<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/scripts/pretty-feed-v3.xsl" type="text/xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:h="http://www.w3.org/TR/html4/"><channel><title>Hack Your Heart</title><link>https://h4cker.zip/categories/%E5%BC%80%E5%8F%91/</link><description>临渊羡鱼，不如退而结网</description><generator>Hugo 0.168.0</generator><language>en</language><atom:link href="https://h4cker.zip/categories/%E5%BC%80%E5%8F%91/rss.xml" rel="self" type="application/rss+xml"/><lastBuildDate>Wed, 05 Feb 2025 20:49:22 +0800</lastBuildDate><item><title>开发HackYourHeart主题的心路</title><link>https://h4cker.zip/4c2e74/</link><pubDate>Wed, 05 Feb 2025 20:49:22 +0800</pubDate><guid isPermaLink="true">https://h4cker.zip/4c2e74/</guid><description/><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<h1 id="hack-your-heart">Hack Your Heart<a class="anchor" href="#hack-your-heart">#</a></h1>
<p>写这个主题是因为我在Hugo的主题仓库里没有找到喜欢的主题。</p>
<p>因为我是一个<del>黑客</del>脚本小子，我想要更有黑客风格的博客，但是没找到。于是想要自己写一个博客主题。</p>
<p>由于我不会前端，写这个主题十分困难，许多HTML、CSS、JS、F12花哨调试 工具都是我现学的。这个主题也是我边学边写。</p>
<h2 id="特色">特色<a class="anchor" href="#特色">#</a></h2>
<p>没什么特色，都是一些基础功能，你能在其他主题看到相同功能。</p>
<p>许多细节真的非常难搞。搜索功能我很满意，它快速美观。代码块部分结合 Chrome 自定义效果，目录自己写的，各种公式、javascript 其中各种冲突，搞得累死我了。</p>
<p>尤其是代码块的表格显示，行号冲突，锚点冲突，又没有复制按钮。其中魔改了一个js，其中许多搞笑的bug，不过都解决了。</p>
<p>i18n还没搞</p>
<p>虽然页面布局有所借鉴，但都是我自己写的代码，代码非常烂，好在性能还行。我尽量加上了懒加载和Hugo自身的资源引用语法。性能够我自己用了。</p>
<p>首页参考Hack The Box Academy中Dashboard的 <a
  href="https://academy.hackthebox.com/modules" rel="nofollow noopener noreferrer" target="_blank"
  >Modules<span style="user-select:none"> ↗</span></a
>
 页面，色系同HTB：</p>
<p><img
  src="/4c2e74/HTB_Modules.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1187"
/>
</p>
<p>Hugo没有心目中的黑客主题，相近的大概是：<a
  href="https://hackingcapitalism.io/" rel="nofollow noopener noreferrer" target="_blank"
  >https://hackingcapitalism.io/<span style="user-select:none"> ↗</span></a
>
（二开自<a
  href="https://github.com/panr/hugo-theme-hello-friend" rel="nofollow noopener noreferrer" target="_blank"
  >hello-friend<span style="user-select:none"> ↗</span></a
>
 ），新的hello-friend-ng也不太行</p>
<p>其实 <a
  href="https://www.leavesongs.com/" rel="nofollow noopener noreferrer" target="_blank"
  >phithon<span style="user-select:none"> ↗</span></a
>
、<a
  href="https://y4tacker.github.io/" rel="nofollow noopener noreferrer" target="_blank"
  >y4tacker<span style="user-select:none"> ↗</span></a
>
，风格都不错，他们那个暗黑主题不喜欢。白色的推荐 <a
  href="https://www.ol4three.com/" rel="nofollow noopener noreferrer" target="_blank"
  >ol4three<span style="user-select:none"> ↗</span></a
>
 和 <a
  href="https://exp10it.io/" rel="nofollow noopener noreferrer" target="_blank"
  >X1r0z<span style="user-select:none"> ↗</span></a
>
</p>
<p>由于我之前使用的 hexo-theme-aurora 有大量封面图，也舍不得扔掉那么多封面。</p>
<p>其次是 <a
  href="https://3gstudent.github.io/" rel="nofollow noopener noreferrer" target="_blank"
  >3gstudent<span style="user-select:none"> ↗</span></a
>
 的，非常不错，但是感觉差了点什么，类似的最好的就是 <a
  href="https://gitlab.com/gabmus/hugo-ficurinia" rel="nofollow noopener noreferrer" target="_blank"
  >ficurinia<span style="user-select:none"> ↗</span></a
>
，真的漂亮，但我都看那么多了，不如自己搞</p>
<p>主题参考了Fixit、ficurinia等等的实现思路</p>
<p>很早以前我就喜欢HTB风格，漫画图标，酷的配色。黑客浸入感极强。比国内一些CTF、靶场好太多了。国内许多靶场就喜欢搞个普通烂大街的蓝色科技感驾驶舱大屏</p>
<p>现在不是很懂前端，大学学的三剑客貌似没啥用，于是边学边写</p>
<h3 id="主页home">主页/Home：<a class="anchor" href="#主页home">#</a></h3>
<p><img
  src="/4c2e74/hyhhome.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2700" height="1800"
/>
</p>
<h3 id="分类categories">分类/Categories：<a class="anchor" href="#分类categories">#</a></h3>
<p><img
  src="/4c2e74/hyhcategories.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1229"
/>
</p>
<h3 id="标签tags">标签/Tags：<a class="anchor" href="#标签tags">#</a></h3>
<p><img
  src="/4c2e74/hyhtags.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1229"
/>
</p>
<h3 id="存档archives">存档/Archives：<a class="anchor" href="#存档archives">#</a></h3>
<p><img
  src="/4c2e74/hyharchives.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1229"
/>
</p>
<h3 id="朋友friends">朋友/Friends：<a class="anchor" href="#朋友friends">#</a></h3>
<p><img
  src="/4c2e74/hyhfriends.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1229"
/>
</p>
<h3 id="关于about">关于/About：<a class="anchor" href="#关于about">#</a></h3>
<p>这里就是markdown直接写</p>
<p><img
  src="/4c2e74/hyhabout.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1229"
/>
</p>
<h3 id="文章post-page">文章/Post page：<a class="anchor" href="#文章post-page">#</a></h3>
<p><img
  src="/4c2e74/hyhpost.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1229"
/>
</p>
<h3 id="代码块codeblock">代码块/Codeblock：<a class="anchor" href="#代码块codeblock">#</a></h3>
<p><img
  src="/4c2e74/hyhcodeblock.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1537" height="1037"
/>
</p>
<h3 id="数学公式注音emojimathrubyemoji">数学公式、注音、emoji/Math、Ruby、Emoji：<a class="anchor" href="#数学公式注音emojimathrubyemoji">#</a></h3>
<p><img
  src="/4c2e74/hyhmathruby.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1528" height="728"
/>
</p>
<h3 id="图像graph">图像/Graph：<a class="anchor" href="#图像graph">#</a></h3>
<p>goat、UML、Pie、git等等</p>
<p><img
  src="/4c2e74/hyhmermaid.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2544" height="1084"
/>
</p>
<h2 id="installation">Installation<a class="anchor" href="#installation">#</a></h2>
<p>正常安装就行。最好站点配置文件为准</p>
<blockquote>
<p>由于我许多内容都是从本地引用，所以需要额外加入字体等元素，你改成cdn引用就不用引入字体</p>
</blockquote>
<p>注意，如果要显示Katex数学公式字体正确渲染，需要把字体文件放在站点目录下的\static\lib\katex\fonts中</p>
<p>因为Katex的文件默认去所在目录引用fonts,但实际上assets里的fonts不会同步输出到public,但是static里的文件可以同步输出到public,所以你需要将fonts以相同的路径放到static里.</p>
<p>比如assets/a/b/c/katex.min.js,你就要把fonts文件夹位置调整为 static/a/b/c/fonts</p>
<p>物理化学公式需要Katex额外引入一些东西，这里不写了</p>
<p>创建带空格或特殊字符文章，用<code>hugo new &quot;posts/测试 3345.md&quot;</code></p>
<p>我为了让链接更短，使用sulg作为链接。slug生成规则是“标题|时间戳”的md5值取前6位。你嫌重复概率高可以改成8位。可以使用这个脚本为所有文章生成slug：<a
  href="https://github.com/TajangSec/genslug" rel="nofollow noopener noreferrer" target="_blank"
  >https://github.com/TajangSec/genslug<span style="user-select:none"> ↗</span></a
>
</p>
<h2 id="结语">结语<a class="anchor" href="#结语">#</a></h2>
<p>代码真的很烂，也没什么好分享的。这个主题我能一直用下去，毕竟是自己一点一点写出来的，虽然烂但是喜欢。</p>
]]></content:encoded><category>Hugo</category><category>前端</category><category>博客</category></item><item><title>CS二开</title><link>https://h4cker.zip/2a47ff/</link><pubDate>Fri, 24 Feb 2023 16:16:32 +0800</pubDate><guid isPermaLink="true">https://h4cker.zip/2a47ff/</guid><description/><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>不会二开，就改改UI，改改文字、图标之类</p>
<h2 id="二开环境配置">二开环境配置<a class="anchor" href="#二开环境配置">#</a></h2>
<h3 id="反编译">反编译<a class="anchor" href="#反编译">#</a></h3>
<p>IntelliJ IDEA 自带了一个反编译java的工具，有时候我们需要对 cobaltstrike 的整个 jar 包进行反编译，使用这个 IntelliJ IDEA 双击之类的反编译时要是对整个源码层面进行搜索并不是很方便，可使用其自带的反编译工具，可以做到批量的整个反编译。</p>
<p>这里先在 IntelliJ IDEA 安装目录找到 java-decompiler.jar 拷贝到一个准备好的目录，并且新建两个文件，一个 cs_bin 里面放未反编译的 cobaltstrike 再建一个 cs_src 文件，这个是空文件，是为了之后放反编译后的 cobaltstrike</p>
<p><img
  src="/2a47ff/CSek_hjpz_1.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="791" height="213"
/>
</p>
<p>反编译命令</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">java -cp java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dsg<span class="o">=</span><span class="nb">true</span> cobaltstrike_4.5.jar cs_src/cs_4.5</span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">bash</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p>报错：</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">错误: 加载主类 org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler 时出现 LinkageError
</span></span><span class="line"><span class="ln">2</span><span class="cl">        java.lang.UnsupportedClassVersionError: org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler has been compiled by a more recent version of the Java Runtime <span class="o">(</span>class file version 61.0<span class="o">)</span>, this version of the Java Runtime only recognizes class file versions up to 60.0</span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">bash</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p>XXX是由较新版本的java Runtime（类文件版本61.0）编译的，该版本的java运行时只能识别最高达55.0的类文件。</p>
<p>白话就是目标由较新版本的 Java 运行（类文件版本 61.0）编译，当前版本的 Java 运行时仅识别类文件版本 至 60.0</p>
<p>现在是2023/2/24，我Java16版本算低，知道现在还有多少项目用Java8嘛……</p>
<p><strong>Java Class版本对应关系</strong></p>
<table>
	<thead>
			<tr>
					<th>JDK版本号</th>
					<th>Class版本号</th>
					<th>16进制</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>1.1</td>
					<td>45.0</td>
					<td>00 00 00 2D</td>
			</tr>
			<tr>
					<td>1.2</td>
					<td>46.0</td>
					<td>00 00 00 2E</td>
			</tr>
			<tr>
					<td>1.3</td>
					<td>47.0</td>
					<td>00 00 00 2F</td>
			</tr>
			<tr>
					<td>1.4</td>
					<td>48.0</td>
					<td>00 00 00 30</td>
			</tr>
			<tr>
					<td>1.5</td>
					<td>49.0</td>
					<td>00 00 00 31</td>
			</tr>
			<tr>
					<td>1.6</td>
					<td>50.0</td>
					<td>00 00 00 32</td>
			</tr>
			<tr>
					<td>1.7</td>
					<td>51.0</td>
					<td>00 00 00 33</td>
			</tr>
			<tr>
					<td>1.8</td>
					<td>52.0</td>
					<td>00 00 00 34</td>
			</tr>
			<tr>
					<td>9</td>
					<td>53.0</td>
					<td>00 00 00 35</td>
			</tr>
			<tr>
					<td>10</td>
					<td>54.0</td>
					<td>00 00 00 36</td>
			</tr>
			<tr>
					<td>11</td>
					<td>55.0</td>
					<td>00 00 00 37</td>
			</tr>
			<tr>
					<td>12</td>
					<td>56.0</td>
					<td>00 00 00 38</td>
			</tr>
			<tr>
					<td>13</td>
					<td>57.0</td>
					<td>00 00 00 39</td>
			</tr>
			<tr>
					<td>14</td>
					<td>58.0</td>
					<td>00 00 00 3a</td>
			</tr>
			<tr>
					<td>15</td>
					<td>59.0</td>
					<td>00 00 00 3b</td>
			</tr>
			<tr>
					<td>16</td>
					<td>60.0</td>
					<td>00 00 00 3c</td>
			</tr>
			<tr>
					<td>17</td>
					<td>61.0</td>
					<td>00 00 00 3d</td>
			</tr>
			<tr>
					<td>18</td>
					<td>62.0</td>
					<td>00 00 00 3e</td>
			</tr>
	</tbody>
</table>
<p>命令：</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">C:<span class="se">\J</span>ava17<span class="se">\b</span>in<span class="se">\j</span>ava.exe  -cp java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs<span class="o">=</span><span class="nb">true</span> cs_bin/cobaltstrike.jar cs_src</span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">bash</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p>报错：</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">Exception in thread <span class="s2">&#34;main&#34;</span> java.lang.RuntimeException: Zip entry <span class="s1">&#39;META-INF/&#39;</span> tries to escape target directory
</span></span><span class="line"><span class="ln">2</span><span class="cl">        at org.jetbrains.java.decompiler.struct.StructContext.addArchive<span class="o">(</span>StructContext.java:143<span class="o">)</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl">        at org.jetbrains.java.decompiler.struct.StructContext.addSpace<span class="o">(</span>StructContext.java:86<span class="o">)</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">        at org.jetbrains.java.decompiler.struct.StructContext.addSpace<span class="o">(</span>StructContext.java:64<span class="o">)</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">        at org.jetbrains.java.decompiler.main.Fernflower.addSource<span class="o">(</span>Fernflower.java:73<span class="o">)</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl">        at org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler.addSource<span class="o">(</span>ConsoleDecompiler.java:111<span class="o">)</span>
</span></span><span class="line"><span class="ln">7</span><span class="cl">        at org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler.main<span class="o">(</span>ConsoleDecompiler.java:79<span class="o">)</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">bash</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p>意思是zip什么的，要先把当前jar包解压，里面才是真正的客户端和服务端</p>
<p><img
  src="/2a47ff/CSek_hjpz_2.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1089" height="552"
/>
</p>
<p>执行了继续报错，这个原因是<code>java-decompiler.jar</code> 版本不对的原因，换<code>222.4345.14</code>版本即可</p>
<p>编译完成后在IDEA，新建项目</p>
<p><img
  src="/2a47ff/CSek_hjpz_3.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1529" height="1074"
/>
</p>
<p>先建立两个文件夹<code>decompiled_src</code>文件夹，之后再建立一个<code>lib</code>文件夹。将反编译好的CobaltStrike复制到decompiled_src中，然后把它解压出来</p>
<p><img
  src="/2a47ff/CSek_hjpz_4.webp"
  alt="image-20230227095331952"
  class="zoomable"
  loading="lazy"
  decoding="async" width="737" height="755"
/>
</p>
<p>然后把原始的未反编译的CobaltStrike放到刚刚新建的lib中去</p>
<p><img
  src="/2a47ff/CSek_hjpz_5.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="671" height="361"
/>
</p>
<h3 id="项目结构">项目结构<a class="anchor" href="#项目结构">#</a></h3>
<p>点击文件——项目结构</p>
<p><img
  src="/2a47ff/CSek_hjpz_6.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="452" height="469"
/>
</p>
<p>点击模块——依赖</p>
<p><img
  src="/2a47ff/CSek_hjpz_7.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1535" height="1265"
/>
</p>
<p>添加lib里的jar</p>
<p><img
  src="/2a47ff/CSek_hjpz_8.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="948" height="514"
/>
</p>
<p>点击应用</p>
<p>点击工件，添加jar</p>
<p><img
  src="/2a47ff/CSek_hjpz_9.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="950" height="458"
/>
</p>
<p>主类选择aggressor.Aggressor</p>
<p><img
  src="/2a47ff/CSek_hjpz_10.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="775" height="526"
/>
</p>
<p>然后应用，确定</p>
<p>去decompiler_src里右键Aggressor.java，重构，复制文件</p>
<p><img
  src="/2a47ff/CSek_hjpz_11.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1181" height="893"
/>
</p>
<p>复制到src的aggressor(提前建这个文件夹)里</p>
<p><img
  src="/2a47ff/CSek_hjpz_12.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="918" height="293"
/>
</p>
<p>这样就复制到了src里，打开看一看，要没有报红</p>
<p><img
  src="/2a47ff/CSek_hjpz_13.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2456" height="859"
/>
</p>
<p>到这里我们基本的准备工作就完成了，之后我们需要修改哪个文件，就可以在完整的源码中找到那个文件，然后邮件Refactor后然Copy File到这个目录进行修改，修改完成之后就可以选构建–&gt;构建工件–&gt;构建进行编译</p>
<p>编译好的会输出到out文件夹里</p>
<p>运行时，报错</p>
<p><img
  src="/2a47ff/CSek_hjpz_14.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1210" height="191"
/>
</p>
<p>这个时候，重构一下META-INF里的MANIFEST.MF就行</p>
<p>然后补全参数</p>
<p><img
  src="/2a47ff/CSek_hjpz_15.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="1565" height="1121"
/>
</p>
<p>改改resources</p>
<p><img
  src="/2a47ff/CSek_hjpz_16.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="823" height="473"
/>
</p>
]]></content:encoded><h:img src="https://h4cker.zip/2a47ff/CobaltStrike_About.webp"/><enclosure url="https://h4cker.zip/2a47ff/CobaltStrike_About.webp"/><category>CobaltStrike</category><category>二开</category></item></channel></rss>