<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Whispering.</title>
  
  
  <link href="http://aran.moe/atom.xml" rel="self"/>
  
  <link href="http://aran.moe/"/>
  <updated>2021-12-14T08:20:09.770Z</updated>
  <id>http://aran.moe/</id>
  
  <author>
    <name>Aran W</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>Metasploit Framework on Termux on Android</title>
    <link href="http://aran.moe/archive/msf-on-termux.html"/>
    <id>http://aran.moe/archive/msf-on-termux.html</id>
    <published>2021-12-14T00:11:51.000Z</published>
    <updated>2021-12-14T08:20:09.770Z</updated>
    
    <content type="html"><![CDATA[<p>简单记录一下在<code>Termux</code>上装<code>metaspolit framework</code>的记录</p><p>安装过程参考了<a href="https://github.com/Hax4us/">Hax4us</a>的一键脚本（<a href="https://raw.githubusercontent.com/Hax4us/Metasploit_termux/master/metasploit.sh">link</a>），基本上是手动操作的。</p><h3 id="安装Ruby"><a href="#安装Ruby" class="headerlink" title="安装Ruby"></a>安装Ruby</h3><p>之前看别人的安装记录需要<code>Ruby 2.x</code>系列，可能<code>6.0.x</code>的早期版本需要？看了一下目前最新的<code>6.1.19</code>版本里面写的<code>.ruby-version</code>是需要<code>3.0.2</code>，刚巧Termux官方源自带的Ruby就是3.0.2版本，或许可以不用<code>rbenv</code>或者<code>rvm</code>。</p><p>其实之前尝试过用<code>rvm</code>装<code>3.0.3</code>版本，然后<code>rvm</code>找不到预编译二进制，只能下源码编译，然后总是在一个叫<code>ppoll64</code>之类的函数那里报错，似乎是和Android API 28什么的有关系，不懂于是没仔细看。</p><p>总之先把依赖装好，一般来说用<code>Termux</code>官方源的就没啥问题：</p><blockquote><p><code>apt install -y libiconv zlib autoconf bison clang coreutils curl findutils git apr apr-util libffi libgmp libpcap postgresql readline libsqlite openssl libtool libxml2 libxslt pkg-config wget make ruby libgrpc termux-tools ncurses-utils ncurses unzip</code></p></blockquote><p>和脚本中的区别：这大哥写了两个<code>ncurses</code>，我给去掉了一个；同时他自己维护着一个<a href="https://github.com/Hax4us/TermuxBlack/">TermuxBlack</a>的repo，里面有2.x版本的Ruby，他的脚本用的是这个旧版的。但由于我们安装的是当前（2021-12-14）最新的<code>metasploit framework</code>，所以用Termux自带的Ruby就可以。</p><h3 id="下载MSF源码包"><a href="#下载MSF源码包" class="headerlink" title="下载MSF源码包"></a>下载MSF源码包</h3><p>不知道用<code>git clone</code>会不会有什么区别/问题，我是下载的GitHub release里面的<a href="https://github.com/rapid7/metasploit-framework/archive/refs/tags/6.1.19.tar.gz">6.1.19.tar.gz</a>压缩包。直接<code>tar xf 6.1.19.tar.gz</code>随便解压到哪里都可以（当然得有写入权限），我是放在Termux的家目录了。</p><h3 id="Gems、Bundler、和一些什么配置"><a href="#Gems、Bundler、和一些什么配置" class="headerlink" title="Gems、Bundler、和一些什么配置"></a>Gems、Bundler、和一些什么配置</h3><p>首先进入到我们刚才解压出来的那个目录，以我为例是<code>~/metasploit-framework-6.1.19/</code>：</p><p>参考脚本，更新<code>rubygems</code>（虽然我不知道这是为了更新什么hhhhh）</p><blockquote><p><code>gem install --verbose rubygems-update</code></p></blockquote><blockquote><p><code>update_rubygems</code></p></blockquote><p>然后安装bundler：</p><blockquote><p><code>gem install --verbose bundler</code></p></blockquote><p>可能是为了节约空间？原本脚本里的<code>gem install</code>都加了<code>--no-document</code>的开关，俺觉得无所谓…就把文档也默认装了。</p><p>之前装rb的时候看到说查阅Ruby文档似乎要用到一个叫<code>ri</code>的工具，应该是Ruby自带的，俺还没用过（）</p><p>然后bundle install所有的Gems，记得先配置一下用原生库不然会有问题：</p><blockquote><p><code>bundle config build.nokogiri --use-system-libraries</code></p></blockquote><blockquote><p><code>bundle install -j4</code></p></blockquote><p>这里的Job数似乎也可以根据cpu性能来调，我这边是1个prime、3个gold、4个silver的高通电子垃圾，然后我擅自觉得跑四个job可能效率比较高，于是就<code>-j4</code>了。</p><p>反正也没做过性能对比，差不多就行了（）手机性能也就那样（）</p><h3 id="调整MSF里面DNS解析之类的东西"><a href="#调整MSF里面DNS解析之类的东西" class="headerlink" title="调整MSF里面DNS解析之类的东西"></a>调整MSF里面DNS解析之类的东西</h3><p>因为我们是Termux环境，没有proot，也没有chroot，同时也不遵循<a href="https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard">FHS</a>，所以我们要自己把<code>$msf/lib/net/dns/resolver.rb</code>里面的<code>/etc/resolv.conf</code>替换成<code>$PREFIX/etc/resolv.conf</code>，这里就不提供命令了，自己拿文件编辑器去改就好了。</p><p>下面两个命令根据我粗浅的分析，一个是让Termux可以正确识别msf脚本的shebang，一个是处理ELF文件、去掉不支持的section和动态入口点，避免Android Linker (API 24)报warning（参考<code>termux-elf-cleaner</code>）。</p><blockquote><p><code>find ~/metasploit-framework-6.1.19 -type f -executable -print0 | xargs -0 -r termux-fix-shebang</code></p></blockquote><blockquote><p>（上面的命令记得自己换掉自己的目录）</p></blockquote><blockquote><p><code>find &quot;$PREFIX&quot;/lib/ruby/gems -type f -iname \*.so -print0 | xargs -0 -r termux-elf-cleaner</code></p></blockquote><h3 id="一般来说到这里就装完了"><a href="#一般来说到这里就装完了" class="headerlink" title="一般来说到这里就装完了"></a>一般来说到这里就装完了</h3><p>没报错的话<code>bundle install</code>打印出的最后几行大概类似这样：</p><blockquote><p><code>Using metasploit-framework 6.1.19 from source at `.`</code></p></blockquote><blockquote><p><code>Bundle complete! 15 Gemfile dependencies, 193 gems now installed.</code></p></blockquote><blockquote><p><code>Use `bundle info [gemname]` to see where a bundled gem is installed.</code></p></blockquote><p>然后就可以直接<code>./msfconsole</code>，接下来就是看各种好看的banner（？）</p><p>因为我们也装了<code>postgresql</code>，理论上<code>msfdb</code>也可以用，但…毕竟我连MSF都还没用明白，数据库暂时就先放一放好了。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;简单记录一下在&lt;code&gt;Termux&lt;/code&gt;上装&lt;code&gt;metaspolit framework&lt;/code&gt;的记录&lt;/p&gt;
&lt;p&gt;安装过程参考了&lt;a href=&quot;https://github.com/Hax4us/&quot;&gt;Hax4us&lt;/a&gt;的一键脚本（&lt;a hr</summary>
      
    
    
    
    
    <category term="Termux" scheme="http://aran.moe/tags/Termux/"/>
    
    <category term="Android" scheme="http://aran.moe/tags/Android/"/>
    
  </entry>
  
  <entry>
    <title>近况以及 apt 奇怪地卡在 0% [Working] 的问题</title>
    <link href="http://aran.moe/archive/sth-about-apt.html"/>
    <id>http://aran.moe/archive/sth-about-apt.html</id>
    <published>2019-07-08T00:42:40.000Z</published>
    <updated>2021-12-14T08:10:30.315Z</updated>
    
    <content type="html"><![CDATA[<p>前两天参加 Debian Buster Release Party 的时候把笔记本的硬盘换成了两块新的 Intel DC S4500 480GB ，结果今天发现这东西有个最大的问题——发热量巨大。<br>之前现场装了 Debian 10 RC3 ，选图形界面的时候本以为什么都不选会什么都不装（就是 headless 那种），结果最后装上的是一个 Gnome 3 …。<br>然后不知道因为什么整个 GUI 都卡成一坨屎，根本没法用那种。随便什么输入框按一个键要过好久才有响应，而且会随机出现几个到十几个字符——系统觉得你按住了这个键。令人头大。<br>最后勉勉强强把 Wi-Fi 连上了（说起来 Debian 安装盘是不带 Intel 网卡的二进制驱动的，需要在安装过程中挂载一个或者装完系统之后拿 U 盘装一个），想了想 <code>apt remove</code> 干掉了 Gnome 换成了 Xfce ，结果发现流畅的一逼…。<br>而且我到现在都没搞明白为什么会卡。</p><p>然后在折腾 GUI 的时候不小心把所有的桌面环境都给日没了，命令行连 Wi-Fi 的软件包比如 <code>iw</code> 之类的也不太会用（主要是这东西好像没法连中文 SSID ），索性格盘装回 Windows 好了。毕竟有 WSL 2 ，这东西体验和原生已经很接近了。<br>今天到公司之后下了 Windows 10 Insider Preview 的 ISO ，格盘装系统之类的就不再赘述了。说起来也是今天才知道现在 Insider 已经不是默认正版了，而是要有一个正版授权才能用。<br>装 WSL 2 和 WSL 里的 Debian Distro 都很简单，基本上是一两条命令/一两下鼠标点击的事情。然后看了一下果然商店里带的 Debian 还是 9 的 Stretch 版本。于是开始滚到 10 Buster 。<br>听说滚动更新需要先更老版本的软件包，然后改源的发行版然后 <code>apt full-upgrade</code> 滚到下一个版本。不过我有点偷懒就直接把 <code>/etc/apt/source.list</code> 直接换成了 Buster 的，直接 <code>apt full-upgrade</code> 开始滚。<br>滚的时候就碰到了标题里说的那个问题， 一直卡在 <code>0% [Working]</code> 然后也不动也没有什么错误提示。一开始还以为是网络不行，毕竟今天公司网有点爆炸，就多等了一阵子。然而在带薪拉屎回来之后还卡在 <code>0% [Working]</code>，就开始感觉有点不对了。<br>查了一下似乎是因为我把源都换成了 USTC 的 https 源，然后这个 WSL 的发行版默认还没装 <code>apt-transport-https</code> 这个包， apt 就不支持 https 的源。嗯…奇怪的小问题。<br>解决这个也很简单，先临时把源换回 http 的然后装上这个 https 支持包，再把源改回 https 然后 <code>apt update</code> <code>apt full-upgrade</code> 正常滚就好了。</p><p>好像这两天就发生了这些事情，嗯前两天和朋友讨论了一下手贱删掉系统里的 Shell 的话要怎么修。想了想这东西大概也能水一篇文吧？过两天有空写一下好了。</p><p>Peace.</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;前两天参加 Debian Buster Release Party 的时候把笔记本的硬盘换成了两块新的 Intel DC S4500 480GB ，结果今天发现这东西有个最大的问题——发热量巨大。&lt;br&gt;之前现场装了 Debian 10 RC3 ，选图形界面的时候本以为什么</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>Live Today, Love Tomorrow, Unite Forever.</title>
    <link href="http://aran.moe/archive/live-today-love-tomorrow.html"/>
    <id>http://aran.moe/archive/live-today-love-tomorrow.html</id>
    <published>2019-06-29T00:19:45.000Z</published>
    <updated>2021-12-14T08:11:02.287Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Live-today-Love-tomorrow-Unite-forever"><a href="#Live-today-Love-tomorrow-Unite-forever" class="headerlink" title="Live today, Love tomorrow, Unite forever."></a>Live today, Love tomorrow, Unite forever.</h1><p>最近经常会有…什么都不想做但又不想闲着的时候。<br>结果还是不知道要做什么。</p><p>随手点开 Bear 之后打下了如上文字。</p><p>嗯……</p><p>电视里 Spotify 正在放着 Rewind - 2012 ，果然还是喜欢听那年的流行音乐…<br>所以这是为什么呢。<br>总觉得 2012 年也是很神奇的一年。<br>哈，世界末日都挺过去了的我们。哈。</p><p>六月快过去了呢。</p><p>希望一切安好哦。</p><p>Live today.<br>Love tomorrow.<br>Unite forever.</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Live-today-Love-tomorrow-Unite-forever&quot;&gt;&lt;a href=&quot;#Live-today-Love-tomorrow-Unite-forever&quot; class=&quot;headerlink&quot; title=&quot;Live today, Love</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>Once again.</title>
    <link href="http://aran.moe/archive/onceagain.html"/>
    <id>http://aran.moe/archive/onceagain.html</id>
    <published>2018-09-11T21:21:39.000Z</published>
    <updated>2021-12-14T08:11:14.311Z</updated>
    
    <content type="html"><![CDATA[<p>希望这次可以保留时间久一点吧。<br>记忆啊…</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;希望这次可以保留时间久一点吧。&lt;br&gt;记忆啊…&lt;/p&gt;
</summary>
      
    
    
    
    
    <category term="dairy" scheme="http://aran.moe/tags/dairy/"/>
    
  </entry>
  
</feed>
