<p>What if an adversary tells your electricity provider to temporarily power off your electricity to check if it manages to shut down a particular hidden service ? How do you ensure that your hidden service running at home remains accessible even without the main electrical input ?</p>
<imgsrc="0.png"style="width:250px">
<p>In this tutorial we'll look at the most fundamental part of both Disaster Recovery Planning and Business Continuity for home servers. We'll look at how to deal with power outages. </p>
<imgsrc="1.png"class="imgRz">
<p>For the Electrical Outages, we'll setup a UPS in between our homeserver and the main electrical input, so that in case of a power outage the home server can keep running for a while before finally shutting down. The UPS will then send a message to the Network UPS Tools suite to tell the server to shutdown when the batteries run low. </p>
</div>
</div><!-- /row -->
</div><!-- /container -->
</div><!-- /grey -->
<!-- +++++ Second Post +++++ -->
<divid="anon3">
<divclass="container">
<divclass="row">
<divclass="col-lg-8 col-lg-offset-2">
<h2><b>Electrical Outages - UPS setup </b></h2>
<p>Before buying a UPS, you need to know how much your home server can draw power (in watts), to make it simple just look at your power supply in your Homeserver. Mine is a RM 750x:</p>
<imgsrc="2.png"style="width:250px">
<p>and as explained in the technical specs, it can draw up to 750 Watts of power:</p>
<imgsrc="3.png"class="imgRz">
<p>So you need a UPS that can generate at least 750 Watts of power, such as the APC Back-UPS 1600VA:</p>
<imgsrc="4.png"class="imgRz">
<p>For my usecase, i picked that one because it can power my homeserver with the 900Watts it can output. Perfect for my server that can draw 750Watts.</p>
<p>First make sure your homeserver's plugged onto the UPS which is plugged onto the main electrical source. Then power on the homeserver, and after it booted, connect the serial to usb cable from the UPS to the homeserver, and you'll see it appear like so:</p>
<pre><codeclass="nim">
[ Wonderland ] [ /dev/pts/3 ] [~]
→ lsusb
[...]
Bus 003 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
[...]
</code></pre>
<p>Then, let's install network ups tools (nut) and make it scan for any ups connected via UPS like ours:</p>
<p>Now that the UPS is detected, we can install an interface for the nut service:</p>
<pre><codeclass="nim">
[ Wonderland ] [ /dev/pts/3 ] [~]
→ apt install nut-cgi -y
[ Wonderland ] [ /dev/pts/3 ] [~]
→ vim /etc/nut/hosts.conf
[ Wonderland ] [ /dev/pts/3 ] [~]
→ cat /etc/nut/hosts.conf
MONITOR apc-ups@localhost "APC UPS - 1600VA"
[ Wonderland ] [ /dev/pts/3 ] [~]
→ cat /etc/nut/upsset.conf
I_HAVE_SECURED_MY_CGI_DIRECTORY
[ Wonderland ] [ /dev/pts/3 ] [~]
→ apt install apache2 -y
[ Wonderland ] [ /dev/pts/3 ] [~]
→ a2enmod cgi
Your MPM seems to be threaded. Selecting cgid instead of cgi.
Enabling module cgid.
To activate the new configuration, you need to run:
systemctl restart apache2
[ Wonderland ] [ /dev/pts/3 ] [~]
→ systemctl restart apache2
</code></pre>
<p>And now we can browse it from the web on port 80: the url is: <b>http://192.168.0.100/cgi-bin/nut/upsstats.cgi?host=apc-ups@localhost&treemode</b></p>
<imgsrc="6.png"class="imgRz">
<p>we can see the following graph to know the Battery Charge, Voltage, Input and Load:</p>
<imgsrc="7.png"class="imgRz">
<p>And for more details you can see the data tree:</p>
<imgsrc="8.png"class="imgRz">
<p>Now let's test if it works by unplugging the main electrical source:</p>
<imgsrc="11.png"class="imgRz">
<p>First thing you'll notice is the UPS starting to do a loud beep every 3 seconds, but you can see it in action from the web interface:</p>
<imgsrc="9.png"class="imgRz">
<p>Here as you can see the UPS is working on battery, and slowly the charge is being drained from 100% (now at 97% after 5 minutes) Of course it's being drained slowly due to being on a low load (18% currently), meaning it could last another 20 minutes of electrical outage easily.</p>
</div>
</div><!-- /row -->
</div><!-- /container -->
</div><!-- /white -->
<!-- <div id="anon2">
<divclass="container">
<divclass="row">
<divclass="col-lg-8 col-lg-offset-2">
<h2><b>Internet Outages - Mobile Hotspot setup</b></h2></br></br>
<p>Now to preserve anonymity, just make sure you don't reveal the serial number of your UPS to anyone online otherwise it could get tied to your amazon purchase or similar. </p>