<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Balzabu | Blog</title>
    <link>https://blog.balzabu.io/tags/sysadmins/</link>
    <description>Recent content on Balzabu | Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 16 Jan 2025 20:57:50 +0100</lastBuildDate>
    <atom:link href="https://blog.balzabu.io/tags/sysadmins/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Bypassing ISP Content Blocking with DoH</title>
      <link>https://blog.balzabu.io/posts/bypassing_isp_dns_with_doh/</link>
      <pubDate>Thu, 16 Jan 2025 20:57:50 +0100</pubDate>
      <guid>https://blog.balzabu.io/posts/bypassing_isp_dns_with_doh/</guid>
      <description>&lt;p&gt;Hello!
It&amp;rsquo;s been a while since I last wrote on the blog, but unfortunately, my life has been quite hectic lately, leaving me with little time to focus on writing posts.&lt;/p&gt;
&lt;p&gt;Nonetheless, I have never stopped tackling all sorts of problems! :D
&lt;br&gt;
In fact, I recently dealt with a rather tricky issue that friends and family pointed out to me, and I decided to explore it further.&lt;/p&gt;
&lt;h3 id=&#34;the-problem&#34;&gt;The Problem&lt;/h3&gt;
&lt;p&gt;Recently, some of the largest Italian ISPs have begun enforcing DNS traffic rules.
&lt;br&gt;
This is most likely related to the crackdown on illegal content streaming, but it also opens up an interesting discussion about &lt;strong&gt;user security&lt;/strong&gt;.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Hello!
It&rsquo;s been a while since I last wrote on the blog, but unfortunately, my life has been quite hectic lately, leaving me with little time to focus on writing posts.</p>
<p>Nonetheless, I have never stopped tackling all sorts of problems! :D
<br>
In fact, I recently dealt with a rather tricky issue that friends and family pointed out to me, and I decided to explore it further.</p>
<h3 id="the-problem">The Problem</h3>
<p>Recently, some of the largest Italian ISPs have begun enforcing DNS traffic rules.
<br>
This is most likely related to the crackdown on illegal content streaming, but it also opens up an interesting discussion about <strong>user security</strong>.</p>
<p>The main risk is that by forcing users to use their DNS servers, ISPs can monitor and log all DNS requests. This means they can track which websites are visited, creating a detailed profile of users&rsquo; browsing habits.</p>
<p>Additionally, this practice could expose users to potential DNS traffic manipulations, such as redirection to malicious sites or selective blocking of certain online resources not hosting malicious contents.
<br>
Another critical aspect is that ISPs could use this information for commercial purposes or share it with third parties, further compromising user privacy.</p>
<p><img src="../../images/dns_over_https/dns_censor.png" alt="DNS Censor"></p>
<h3 id="technical-dive-in">Technical Dive-In</h3>
<p>With patience, I decided to conduct a series of in-depth tests to verify this claim. I configured various public DNS services (including Google DNS, Cloudflare, and OpenDNS) on two routers from different ISPs and monitored the DNS traffic.
The results were unequivocal: despite the DNS settings configured on the router, all DNS requests were systematically redirected to the ISP&rsquo;s DNS servers.</p>
<p>I conducted further tests on a ZTE router provided by a major Italian ISP. Even though the official manual clearly indicated an &ldquo;ISP DNS&rdquo; option that could be disabled to use custom DNS, after disabling this option, the router continued to ignore the custom DNS settings.</p>
<p><img src="../../images/dns_over_https/hardcoded-dns-settings.jpg" alt="ZTE Router Configuration Panel"></p>
<h3 id="the-solution-dns-over-https-doh">The Solution: DNS-over-HTTPS (DoH)</h3>
<p>After various attempts, the solution turned out to be the use of DNS-over-HTTPS (DoH). This technology represents a significant evolution over traditional DNS as it encapsulates DNS requests within the HTTPS protocol.</p>
<p>The working principle is simple but effective: instead of sending DNS requests in plain text over port 53 (which can be easily intercepted and modified by the ISP), DoH uses the HTTPS protocol on port 443. Since HTTPS traffic is encrypted, the ISP cannot read or modify DNS requests, making forced redirection to their servers impossible.</p>
<p>In practice, when a browser or application configured to use DoH needs to resolve a domain name, it sends an HTTPS request to a DoH server (such as those from Cloudflare or Google). The server responds with the requested IP address, all through a secure and encrypted connection.</p>
<p><img src="../../images/dns_over_https/dns_over_https.png" alt="DNS-over-HTTPS Diagram"></p>
<p>This method is particularly effective because, although the ISP can see that we are communicating with an HTTPS server, it cannot determine which DNS requests we are making or alter them.</p>
<h3 id="comparison-with-traditional-dns">Comparison with Traditional DNS</h3>
<p>To better understand the difference, let&rsquo;s look at how traditional DNS works compared to DoH. In traditional DNS, requests are sent in plain text, which means anyone on the network path, including ISPs, can see and potentially manipulate them.</p>
<p><img src="../../images/dns_over_https/traditional_dns.png" alt="Traditional DNS Diagram"></p>
<p>In contrast, DoH encrypts the requests, ensuring that only the intended DoH server can decode them. This encryption prevents ISPs and other intermediaries from viewing or altering the DNS traffic.</p>
<p><img src="../../images/dns_over_https/dns-vs-doh.png" alt="Comparison"></p>
<p>By adopting DoH, users can significantly enhance their privacy and security, bypassing ISP content blocking and preventing potential DNS manipulations.</p>
<h3 id="contacts">Contacts</h3>
<p>For questions or suggestions, contact: <a href="mailto:noc@balzabu.io">noc@balzabu.io</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Automating cloud-init Disabling on Ubuntu Servers</title>
      <link>https://blog.balzabu.io/posts/disable-cloud-init/</link>
      <pubDate>Fri, 29 Dec 2023 13:39:50 +0100</pubDate>
      <guid>https://blog.balzabu.io/posts/disable-cloud-init/</guid>
      <description>&lt;hr&gt;
&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Managing cloud infrastructure often involves dealing with various initialization and configuration tasks. For Ubuntu servers, the &lt;code&gt;cloud-init&lt;/code&gt; package plays a crucial role in handling these tasks during the instance boot process. However, there may be scenarios where you want to disable &lt;code&gt;cloud-init&lt;/code&gt; for specific use cases or configurations.&lt;/p&gt;
&lt;p&gt;To simplify this process, I&amp;rsquo;ve created a Bash script called &lt;code&gt;disable-cloud-init&lt;/code&gt;. This script automates the task of disabling &lt;code&gt;cloud-init&lt;/code&gt; on Ubuntu servers in a non-interactive manner, streamlining the configuration process.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<hr>
<h2 id="introduction">Introduction</h2>
<p>Managing cloud infrastructure often involves dealing with various initialization and configuration tasks. For Ubuntu servers, the <code>cloud-init</code> package plays a crucial role in handling these tasks during the instance boot process. However, there may be scenarios where you want to disable <code>cloud-init</code> for specific use cases or configurations.</p>
<p>To simplify this process, I&rsquo;ve created a Bash script called <code>disable-cloud-init</code>. This script automates the task of disabling <code>cloud-init</code> on Ubuntu servers in a non-interactive manner, streamlining the configuration process.</p>
<h2 id="features">Features</h2>
<ul>
<li><strong>Automation</strong>: The script automates the process of disabling <code>cloud-init</code>, saving time and effort.</li>
<li><strong>Non-Interactive</strong>: Designed to be run in a non-interactive environment, so you won&rsquo;t have to specify or do anything.</li>
<li><strong>Based on Gist</strong>: The script is based on <a href="https://gist.github.com/zoilomora/f862f76335f5f53644a1b8e55fe98320">this Gist</a>, providing a reliable foundation.</li>
</ul>
<h2 id="usage">Usage</h2>
<h3 id="prerequisites">Prerequisites</h3>
<p>Before using the script, ensure:</p>
<ul>
<li>You are using an Ubuntu server.</li>
<li>You have the necessary privileges (root access) to execute the script.</li>
</ul>
<h3 id="running-the-script">Running the Script</h3>
<p>Execute the following one-liner in your terminal to run the script:</p>






<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>bash -c <span style="color:#e6db74">&#34;</span><span style="color:#66d9ef">$(</span>curl -fsSL https://raw.githubusercontent.com/balzabu/disable-cloud-init/main/disable-cloud-init.sh<span style="color:#66d9ef">)</span><span style="color:#e6db74">&#34;</span></span></span></code></pre></div>
<blockquote>
<p>Note: after running the script, consider performing a manual reboot to ensure that the changes take effect.</p>
</blockquote>
<h2 id="conclusion">Conclusion</h2>
<p>Feel free to <a href="https://github.com/balzabu/disable-cloud-init">check out the project on GitHub</a> and give it a try on your Ubuntu servers. Your feedback and contributions are highly appreciated!</p>
<p>Happy scripting!</p>
<h2 id="contacts">Contacts</h2>
<p>For questions or suggestions, contact: <a href="mailto:noc@balzabu.io">noc@balzabu.io</a>.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
