<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Marco Zoratti on Medium]]></title>
        <description><![CDATA[Stories by Marco Zoratti on Medium]]></description>
        <link>https://medium.com/@marco-zora?source=rss-29fab680c81d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h9fiSQqvlkXVyiEmVNBjvA.jpeg</url>
            <title>Stories by Marco Zoratti on Medium</title>
            <link>https://medium.com/@marco-zora?source=rss-29fab680c81d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:00:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marco-zora/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SynapseTab: My first open-source Firefox extension]]></title>
            <link>https://marco-zora.medium.com/synapsetab-my-first-open-source-firefox-extension-98ed30a1929c?source=rss-29fab680c81d------2</link>
            <guid isPermaLink="false">https://medium.com/p/98ed30a1929c</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[firefox]]></category>
            <category><![CDATA[firefox-addons]]></category>
            <category><![CDATA[self-hosted]]></category>
            <dc:creator><![CDATA[Marco Zoratti]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 18:54:58 GMT</pubDate>
            <atom:updated>2026-10-14T18:54:58.885Z</atom:updated>
            <content:encoded><![CDATA[<h3>How my tab chaos turned into a open-source extension</h3><p>I’m a person who’s obsessed with organisation, that’s why I’ve always used <a href="https://addons.mozilla.org/it/firefox/addon/simple-tab-groups/">Drive4ik’s fantastic “Simple Tab Groups”</a> extension to manage my Firefox tabs and workspaces. However, over the last few months I’ve had several problems because, like many developers and IT professionals, I jump between multiple machines every day: a workstation at my desk, a laptop at university, occasionally a Mac Mini, and so on…</p><p>My biggest daily frustration was always the same:</p><blockquote>“Wait, where did that tab go? Oh damn, right, it’s open on my desktop at home”</blockquote><p>Firefox is hands-down my daily driver. But when it came to managing workspaces and synchronizing them across machines without sending my entire browsing history to a third-party cloud service, every existing solution fell short.</p><p>So, I decided to build <a href="https://github.com/marchacio/SynapseTab"><strong>SynapseTab</strong></a><strong> </strong>and to explain to you why i made it 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*CVcVpPxQH0GImi-b8V8OTQ.png" /><figcaption>SynapseTab extension icon</figcaption></figure><h3>My Problem: Tab Sync</h3><p>There are a lot of tab managers out there, including great tools like <em>Simple Tab Groups (STG)</em>. But keeping them in sync across different computers usually meant one of three things:</p><ul><li>Manual JSON exporting/importing (which you forget to do 90% of the time).</li><li>Third-party cloud services requiring proprietary accounts, tracking telemetry, and storing your private browsing context on someone else’s server.</li></ul><p>I wanted something simple that would keep my data safe… after some time, I decided to use my home lab, so my extension had to be:</p><ul><li>Self-hosted &amp; private: A tiny backend running on my own home server via Docker. No accounts, no tracking.</li><li><strong>Ex</strong>tremely efficient, powerful &amp; silent: Workspaces and tabs sync automatically in the background as I work.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uihflyD9Xd8497jM1aD6FQ.png" /><figcaption>A simple pop-up to manage your workspaces</figcaption></figure><p>Obv, the name isn’t random, this extension is meant to be like a synapse connecting two neurons (two computers, in this case) even though there’s a home server in between 😆</p><h3>A few “technical” details about SynapseTab</h3><p>Instead of overcomplicating things, I focused on features that make daily tab management effortless, fast, and safe:</p><ul><li>Lightweight: There is a simple AF backend running in Docker. State is persisted with Redis authenticated via a single private sync token.</li><li>Customization: Support for custom dividers (e.g., <em>“Work”</em>, <em>“Projects”</em>, <em>“To Read”</em>), custom icons, settings and so on and so forth.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRr98-TnXpmg2FxhMrYSog.png" /><figcaption>The more you customise it, the more it becomes yours</figcaption></figure><ul><li>Backup &amp; migration: <br>- One-click imports/exports of your entire workspace tree, tab positions, dividers, and custom badges; <br>- Full support for <em>Simple Tab Groups </em>JSON files;<br>- Last but not least, automated server auto-backups, directly on the backend.</li><li>Tabs spawn: When remote tabs sync to your laptop, they are created in a discarded/suspended state. They show up in your tab bar instantly, but Firefox won’t fetch a single byte of network data or eat memory until you click on them.</li></ul><p>Of course, there are lots of details that I’ve deliberately left out of this Medium story so as not to make it too long, but they can be found on the project’s GitHub page!</p><p>Nowadays (October 2026), SynapseTab is still very much under development, but it has already reached a stable version which I use daily.<br>As it is open source, if you can think of any other features, improvements or ideas, you can contribute directly or let me know by leaving a comment!</p><h3>Try it out!</h3><p>SynapseTab is completely free and open-source:</p><ul><li>Firefox Add-on: Available directly on <a href="https://addons.mozilla.org/en-US/firefox/addon/synapsetab/">Mozilla Add-ons</a> 🦊</li><li>GitHub: <a href="https://github.com/marchacio/SynapseTab">marchacio/SynapseTab</a> for detailed and technical descriptions of how to test and implement everything on your server.</li></ul><p>Thank you so much for reading ❤️<br>If you enjoyed the project and found it a good read, please give me a little round of applause :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98ed30a1929c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I recovered sensitive data from a broken & isolated phone using the Flipper Zero]]></title>
            <link>https://marco-zora.medium.com/how-i-recovered-sensitive-data-from-a-broken-isolated-phone-using-the-flipper-zero-72397ffb320f?source=rss-29fab680c81d------2</link>
            <guid isPermaLink="false">https://medium.com/p/72397ffb320f</guid>
            <category><![CDATA[samsung]]></category>
            <category><![CDATA[flipper-zero]]></category>
            <category><![CDATA[data-recovery]]></category>
            <category><![CDATA[thinking-outside-the-box]]></category>
            <category><![CDATA[problem-solving]]></category>
            <dc:creator><![CDATA[Marco Zoratti]]></dc:creator>
            <pubDate>Fri, 21 Nov 2025 11:50:46 GMT</pubDate>
            <atom:updated>2025-11-21T11:50:46.608Z</atom:updated>
            <content:encoded><![CDATA[<p>👋​ Hello everyone, today’s story will be very conversational and is intended to be an inspiration for anyone who has found themselves in the situation of having to recover data from a completely dead phone.</p><p>I’ll be fairly quick and get straight to the point, with just a few concepts. <em>The important thing is always to think outside the box to solve your problems</em>. Sooo, let’s get started!</p><h3>How it all began</h3><p>One of my best friends writes to me saying that she has broken his phone (a <em>Samsung a53 5g</em>) screen and can no longer see anything, nothing unusual right? The problem is how she broke her phone: she had set an alarm for 5:30 a.m. (very annoying in the mornings that followed, hahah), put her phone in airplane mode and do not disturb mode, and went to sleep. During the night, she dropped her phone and completely broke the screen. Nothing could be seen except for a couple of pixels that lit up green when the screen was turned on. To complicate matters, the touchscreen only worked on the bottom part of the screen, about the last 2 cm.</p><p>At this point, the situation is as follows: the screen displays nothing except for a handful of pixels, only the lower part of the touchscreen works, and the phone is completely isolated, with no data connection and no Bluetooth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*rNGj1dzUa3CGSCBjkItAdg.jpeg" /><figcaption>Can you believe the phone is on? You can tell by the few pixels that are lit up.</figcaption></figure><p>Not the best situation ever :)</p><h3>Planning</h3><p>🎯 The goal was to recover the data saved in the internal storage, but I had several limitations.</p><p>First of all, I had to forget about any solution that required an internet connection (remember, the phone was in airplane mode, and I couldn’t turn it off because the touch screen was partially functional and almost entirely black).</p><p>Well, then the only possible solution is physical and involves the use of a cable. So, just connect the phone to the PC via cable and save the files of interest using the PC, right? No, because in order to view the files from the PC, the phone must be unlocked, otherwise it appears empty. How can we unlock the phone if we can’t see anything and the screen doesn’t respond to touch?</p><p>🧑‍💻 My experience as a programmer advised me to use <em>scrcpy</em>, an exceptional tool for viewing and using a phone screen directly from a PC (check out the <a href="https://github.com/Genymobile/scrcpy">GitHub page</a> because it’s really worth it!). The problem is that to use <em>scrcpy</em>, you have to enable debugging on the phone from the Android developer settings, and of course my friend, knowing nothing about this stuff, had not enabled this option.</p><blockquote>So we’re back to square one.</blockquote><p>The goal is therefore to unlock the phone without using the touchscreen and without seeing what’s happening… Does that remind you of anything?</p><p>🦆If you’re into cybersecurity, you can’t have not thought of a <strong>Rubber Ducky</strong>! Unfortunately, I don’t have a real Rubber Ducky, but luckily I have a <strong>Flipper Zero</strong> with the “unleashed” firmware installed (<a href="https://github.com/DarkFlippers/unleashed-firmware">checkout the project</a>) and therefore with the <em>BadUSB</em> feature pre-installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*D2-qOetwJdDE1wqqxPt8KQ.jpeg" /></figure><p>Basically, the Flipper will behave exactly like a Rubber Ducky USB stick, so I can run scripts that “type keys” as if I had a keyboard connected to the phone (yep, I hadn’t physical one). This way, if I configure the script correctly and run it from the Flipper, I can unlock the phone by simulating the PIN entry!</p><p>Of course, I knew the phone’s PIN (my friend was there with me), and after a couple of attempts, we managed to unlock the phone! Here is the simple script i wrote and used:</p><pre>REM Script to unlock Samsung Blind Mode<br>DELAY 1000<br>REM Press enter to wake the screen up<br>ENTER<br>DELAY 500<br>REM Press enter again to raise the lock screen (swipe up simulation)<br>ENTER<br>DELAY 1000<br>REM Type the PIN<br>STRING 1234<br>DELAY 500<br>REM Confirm the PIN<br>ENTER</pre><blockquote>Remember: “REM” command is the comment for the DuckyScript language. See all possible commands and syntax <a href="https://gist.github.com/methanoliver/efebfe8f4008e167417d4ab96e5e3cac">here</a>.</blockquote><p>To recognize the success of the operation, we relied on the few pixels still alive that lit up only when the screen was on. Specifically, when the phone was still on the lock screen, the screen turned off after 5 seconds, otherwise it stayed on for 5 minutes!</p><p>So once we ran the script from the Flipper Zero, we just had to wait more than 5 seconds to see if everything had gone well or not… and it worked!!! 😁</p><h3>Well, the end of the story?</h3><p>Well, nop.</p><p>The phone was unlocked, I was sure of it. I could also feel the haptic feedback from the phone’s three navigation buttons (recent tabs, home, and back buttons), but despite this, it still didn’t appear on the PC.</p><p>I was quite frustrated because it meant I had to enable/give consent to transfer files from the phone, but I couldn’t see it, and doing it via a rubber ducky script would have been very difficult, if not impossible!</p><p>🔍 So, like any good computer scientist, I set about gathering as much information as possible about how Samsung’s operating system works (yep, i know, it’s Android, but customized).</p><p>I discovered that Samsung enables data transfer by default (thank goodness! Most phones are set to <em>charging only</em> by default), but you have to confirm it by clicking on a pop-up!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*k06UJCPOm2_lGwYXLFgoQg.png" /><figcaption>Confirmation pop-up to access data from the PC</figcaption></figure><p>Finally, luck was on our side because the pop-up was displayed at the bottom of the screen, where our touchscreen still worked even though we couldn’t see anything!!!</p><p>Knowing how the pop-up worked, I clicked somewhere in the lower right corner hoping to press “allow,” and a sound from the computer alerted me that a new device had been connected!<strong> I had done it </strong>🤤</p><p>I finally managed to view the files from my PC, and I was delighted. Obviously, at this point, I started transferring the data to my PC. It took a couple of hours, but I finally recovered the files!</p><h3>🚀 Conclusion</h3><p>The feeling of finally seeing the phone’s contents appear on my PC screen was pure relief and satisfaction. This entire experience, starting from a completely black screen and a partially functional touchscreen, was a perfect example of how limitations can force you to be truly resourceful.</p><p>We couldn’t rely on the easy solutions — no Wi-Fi, no Bluetooth, no screen visibility, and no pre-enabled developer options. It came down to leveraging the Flipper Zero’s BadUSB feature, essentially simulating a keyboard input in the dark, and a bit of luck combined with system knowledge.</p><p>Remember, whether you’re recovering data from a broken device or tackling any technical challenge, the solution often lies not in the most advanced tools, but in understanding the system’s logic and being prepared to <strong>think outside the box</strong>.</p><p><em>The Flipper Zero was just the instrument, the real key was the strategy.</em></p><p>Happy data recovering, and always keep a backup! 😉</p><blockquote>Thanks to Michela for suggesting this fun and educational challenge. She was worried AF while I was laughing and having fun, hahaha. Love, Michi!</blockquote><h3>For the most attentive</h3><p>The more attentive among you may have thought, “What about the alarm clock? Did you disable it somehow? Or is it still ringing every day at 5:30 in the morning?”.</p><p>Thanks to this experience, I retraced the previous steps but with a different problem: the goal was to shutdown the phone without using the touchscreen (yep, I know what you’re thinking, but Samsung only allows a hard-reset by pressing and holding the volume and power buttons, but not a complete shutdown😒).</p><p>So, I looked how the Samsung OS shutdown menu is organized and basically created a rubber ducky script that clicks exactly on the “shutdown” button! 😁</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72397ffb320f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Bachelor Thesis: A Story of Invisible Source Code Attacks]]></title>
            <link>https://marco-zora.medium.com/my-bachelor-thesis-a-story-of-invisible-source-code-attacks-a9f046b4cf61?source=rss-29fab680c81d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9f046b4cf61</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Marco Zoratti]]></dc:creator>
            <pubDate>Fri, 29 Aug 2025 17:52:41 GMT</pubDate>
            <atom:updated>2025-08-30T07:27:31.050Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey everyone! I am happy and proud to say that I graduated with a Bachelor’s degree in Computer Science from the University of Genoa at the end of July 2025. What a journey!🎓</p><p>For my thesis, I explored an area of cybersecurity that I find fascinating, but also a little scary. Now that my academic work is finished, I would like to share my research with the wider tech community, including developers, security experts and anyone who enjoys a good tech story. I’ve simplified the boring and technical language to make the story more accessible and light (around 5 mins read), but if you’re interested in the full thesis you can find it at the end of this page!</p><p>So, grab a coffee and let’s start!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*pTiVgp_aSXQPY77P5PrCsw.jpeg" /><figcaption>The source code may contain malicious code… and you might not even notice it!</figcaption></figure><h3>Part 1: The Unexpected Hiding Attack</h3><p>I was looking for a type of hacker attack to study and explore in depth in my thesis. There are endless ways to carry out an attack, each of which must be tailored to the context and objectives of the attack.<br>I was impressed when I discovered that an attack can also be hidden within the original source code by applying a few tricks to conceal it, so I decided to explore the subject further and opened a Pandora’s box!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0FMslDkLeGe548Ppb9-Rdg.png" /><figcaption>Can you spot the attack?🔍</figcaption></figure><p>I have studied attacks that aim to evade code review, so they hide within healthy source code: the attacker submits a piece of code that looks fine to the human eye through tools such as <em>Github </em>Pull Requests. The project maintainers review it, give it the green light and merge it into the project. <br>The harmful piece of code is now part of the official software source code!</p><p>My thesis focused on two of these enemies: two families of attacks that exploit the limits of human perception.</p><h4>1️⃣Blank Space Trojan (BST):</h4><p>Meet BST, the master of hide-and-seek. <br>This attack is so easy to understand but extremely effective. A cybercriminal writes a piece of malicious code and adds lots of spaces (or tabs) before it. We’re talking thousands of them!</p><p>When a reviewer looks at the code on a platform, they see a normal line of code that simply ends. The harmful part, the <em>payload</em>, has been moved so far to the right that it’s invisible. Who would scroll all the way to the right to check for something hidden there? No one’s gonna look there. <br>This has happened with real-world packages such as <a href="https://checkmarx.com/blog/over-170k-users-affected-by-attack-using-fake-python-infrastructure/">colorama</a> and <a href="https://www.aikido.dev/blog/catching-a-rat-remote-access-trojian-rand-user-agent-supply-chain-compromise">rand-user-agent</a>.</p><p>To illustrate the simplicity and efficiency of this family of attacks that hide payloads, here is simply example:</p><pre>public class HelloWorld {<br>                                                                                                                                                               public void malicious_function() { ...malicious code... }<br>    public static void main(String[] args) {<br><br>        System.out.println(&quot;Hello, World!&quot;);<br>                                                                                                                                                               malicious_function();<br>    }<br><br>}</pre><p><em>Tip: scroll the code to the right :)</em></p><p>The compiler/interpreter ignores blank spaces and executes the code without them, by executing the malicious function!</p><h4>2️⃣Hidden Unicode Trojan (HUT).</h4><blockquote>Note: this type of attack was discovered by Nicholas Boucher and Ross Anderson, who wrote and published a thesis on the subject. I highly recommend visiting their website ( <a href="https://trojansource.codes/">https://trojansource.codes/</a> ) and reading the complete article, extremely interesting and original.</blockquote><blockquote>I have limited my study to the ways in which these vulnerabilities can overcome human perception and how to spot them. I assigned the name “HUT” for ease.</blockquote><p>This family of code manipulation is even more sophisticated. <br>The HUT is a shapeshifter that uses the Unicode standard to trick both humans and machines. It has two favourite ways to work:</p><p><strong><em>The “Homoglyph Doppelgänger”</em></strong>: The Latin letter ‘a’ and the Cyrillic letter ‘а’ appear identical to us, but are distinct characters to a computer.</p><p>An attacker can create, for example, a harmful function called <em>isValid()</em> (using the Cyrillic ‘а’), which looks exactly like the real <em>isValid()</em> function (using the Latin ‘a’), but which is interpreted by the PC as a completely different function.</p><p>When a developer calls what he thinks is the safe function, he’s actually executing the malicious version. Let’s consider the following example:</p><pre>#EXTERNAL DEPENDENCY FILE<br><br>def sendMеssage():<br>  ... malicious code ...</pre><pre># main.py IN YOUR PROJECT<br><br>def sendMessage():<br>  ... safe code ...<br><br><br>if __name__ == &quot;__main__&quot;:<br>  sendMеssage()</pre><p>Can you spot the different char? Yes, this is a very simple and easily identifiable example, but try to put yourself in the shoes of a code reviewer faced with thousands of lines of code… he won’t notice the problem and will think that the function call correctly refers to the safe version.<br>It’s a perfect visual crime!</p><p><strong><em>The ‘Invisible Ink Spell’</em></strong>: the second technique studied uses invisible Unicode control characters, called <em>BiDi chars</em>, that can change the order in which text is displayed. Let me explain this concept with an example.</p><p>The following code is shown to the reviewer during the code review phase. Apparently, there are no noticeable problems: if the user is an admin, the admin function is executed.</p><pre>/* begin admins only */ if(isAdmin)<br>execute_admin_function()</pre><p>The problem is that this type of attack <strong>modifies the graphical representation of the code </strong>through the use of <em>BiDi </em>characters, resulting in the compiled/interpreted code and the displayed code being different.<br>In particular, a clever attacker can play with comments and returns to terminate, bypass, or execute parts of the code at pleasure.</p><p>The following code is what is read by the compiler/interpreter and therefore the code that is actually executed:</p><pre>/* if(isAdmin) begin admins only */<br>execute_admin_function()</pre><p>As you can see, the comment has “incorporated” the if control, bypassing it.</p><blockquote>These attacks transform our greatest strength, human review, into our greatest weakness. So, how can we fight an enemy we can’t even see?</blockquote><h3>Part 2: How to spot these attacks?🔍​</h3><p>My initial idea was to use our standard security tools so I started with <em>Static Application Security Testing </em>(SAST) tools. These are like grammar checkers for code, looking for known security vulnerabilities or errors. <br>The problem? They analyse the logical structure of the code, not what it looks like… strike one -_-</p><p>Next, I tried using generic software metrics, the kind of statistics you use to measure a project’s progress.</p><ul><li>Lines of Code (LOC): Useless. An attack could be hidden in a single modified line. In a 50,000-line project, that’s an indistinguishable 0.002% change.</li><li>File size in bytes: Better, but still easily fooled. Adding a new feature can introduce kilobytes of legitimate code, which can completely mask the few hundred bytes of a malicious payload.</li><li>Cyclomatic complexity: This measures how complex your code’s logic is. However, these attacks are often logically simple and their complexity lies in deception rather than computation.</li><li>Shannon entropy: This is useful for detecting encrypted or compressed code because it is highly random. However, a BST attack does the opposite: it adds a long, repetitive sequence of spaces, which has an entropy close to zero.</li></ul><p>I finally realised I was using the wrong tools, like trying to use a thermometer to measure weight.</p><p>Finally, after some days, my ‘<em>Eureka</em>’ moment!<br>These attacks are introduced at a specific point in time, they are an event, an anomaly in the project’s history. So, rather than analysing a snapshot of the code, why not analyse its entire timeline looking for temporal variations? I decided to treat the release history of a Git repository as a time series, profiling each file at every release to look for sudden, suspicious changes.</p><p>To do this, I had to forge new weapons, new metrics designed specifically for these threats.</p><h4>1️⃣Anti-BST Weapons</h4><ol><li><strong>Max Line Length (MLL)</strong>: The most obvious consequence of a BST attack is an extremely long line of code. Most developers stick to a limit of 80 or 120 characters and a line that suddenly jumps from 80 to over 2,000 characters is a massive red flag.</li><li><strong>Whitespace-to-printable-chars ratio (W/P ratio)</strong>: This became my silver bullet. Every source code file naturally has a balance between the actual code (printable characters) and the spaces used for formatting. A BST attack disrupts this balance by inserting a large amount of whitespace.</li></ol><h4>2️⃣Anti-HUT Weapons</h4><ol><li><strong>Homoglyph character count</strong>: The strategy is very simple, identify the doppelgängers. I created a list of known homoglyphs, such as Cyrillic characters that look like Latin ones, and scanned the code looking for them. While a non-ASCII character might legitimately appear in a comment or string, its presence in a variable or function name is highly suspicious; the sudden appearance of these characters is a clear alarm.</li><li><strong>Invisible Character Count</strong>: The tool scans for specific invisible Unicode characters that are used to reorder text. In 99.9% of programming contexts, there is absolutely no legitimate reason for these characters to appear in your source code so their presence is a critical alert.</li></ol><p>To test these “new weapons”, I created a safety testing environment based on a dataset of 91 popular JavaScript repositories into which I automatically injected backdoors hidden via BST and HUT. <br>It was time to see if the theory held up!</p><h3>Part 3: Results 📊</h3><p>The results were incredibly positive!</p><p>When I ran my tool on the manipulated dataset, the anomalies were evident. <br>The W/P ratio and MLL metrics showed dramatic spikes at the point where the BST attack was injected, even in large projects such as <em>Angular </em>and <em>Vue</em>. <br>For HUT attacks, the metrics acted as a binary sensor: the homoglyph count jumped from zero across thousands of releases to a non-zero number the moment the backdoor was introduced.</p><h3>The end?</h3><p>This journey revealed a shocking truth: the open-source ecosystem is far more fragile than we realise.<strong> Although we place immense trust in our eyes, they can deceive us</strong>. <br>I examined major platforms and discovered that their defences are inadequate, for example, <em>GitHub</em> might wrap text in a Pull Request (mitigating BST), but not when you’re just browsing files in a repository. It only warns against some danger invisible characters, leaving the door wide open for homoglyph attacks. <br>Other platforms, such as <em>npm</em>, offer no visual protection at all for any showed attack.</p><h4>My contribute</h4><p>The best thing about this isn’t just the results but the finding tool itself. <br>I developed a fully functional, open-source Python application called <strong><em>BST_HUT_Analyser</em></strong>, which implements this entire methodology. <br>It’s designed to be scalable and configurable, enabling project maintainers to analyse their own repositories for signs of historical tampering or monitor new contributions.</p><p><a href="https://github.com/marchacio/BST_HUT_analyzer">GitHub - marchacio/BST_HUT_analyzer</a></p><blockquote>Of course, if you want to contribute to the project, you are welcome!</blockquote><h4>The future</h4><p>This is just the beginning! <br>For example, the tool could be integrated directly into CI/CD pipelines to automatically scan every new Pull Request and block it if a suspicious anomaly is detected.<br>In the future, I would like to run my tool on <em>all </em>public repositories on <em>GitHub </em>looking for any hidden and currently functioning payload hided via BST or HUT.</p><p><strong>This thesis involved an in-depth exploration of the trust we place in our own perception and it demonstrated that, although human oversight is crucial, it is not infallible.</strong><br>By combining our intuition with intelligent, specialised tools, we can create a resilient open-source environment for everyone.</p><p><strong>Thank you so much</strong> for reading this far 😁❤️</p><p><em>I would like to thank (once again) my thesis supervisors who accompanied me along this journey, Dr. Giacomo Benedetti and Dr. Luca Caviglione.</em></p><p>I hope my story has been clear, but also entertaining and lighthearted. If you liked it, please give it a clap 👏</p><p>Thanks again, happy coding (&amp; hacking)!</p><h3>For the curious only…</h3><p>If you are interested in the topic and its technical details, you can read my full thesis at the following links:</p><ul><li><strong>Italian version </strong>(original): <a href="https://github.com/marchacio/marchacio.github.io/blob/main/Bachelor%20Thesis/italian_version.pdf">https://github.com/marchacio/marchacio.github.io/blob/main/Bachelor%20Thesis/italian_version.pdf</a></li><li><strong>English version </strong>(translated automatically): <a href="https://github.com/marchacio/marchacio.github.io/blob/main/Bachelor%20Thesis/english_version.pdf">https://github.com/marchacio/marchacio.github.io/blob/main/Bachelor%20Thesis/english_version.pdf</a></li></ul><blockquote>I’m sorry, but for timing reasons the English version has been automatically translated and may contain some errors. If so, please let me know. Thank you very much!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9f046b4cf61" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reverse Engineering: How I hacked vending machines keys with Flipper Zero]]></title>
            <link>https://marco-zora.medium.com/how-i-hacked-nfc-st25tb-keys-with-flipper-zero-d1a3b1833cf2?source=rss-29fab680c81d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1a3b1833cf2</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[flipper-zero]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[nfc]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Marco Zoratti]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 22:10:45 GMT</pubDate>
            <atom:updated>2025-01-09T19:59:46.015Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, I am writing this paper to share all that I have learned from studying, reversing, analyzing and modifying the behavior of vending machines keys through NFC protocol.</p><p>Before I begin, I need to make some clarifications:</p><h3>⛔️ Warnings</h3><blockquote>HACKING, MODIFYING, STEALING, OR CAUSING DAMAGE TO ANY OBJECT NOT OWNED BY YOU IS A CRIME AND AS SUCH IS PUNISHABLE BY LAW.<br>I TAKE NO RESPONSIBILITY FOR HOW THE INFORMATION IN THIS ARTICLE WILL BE USED.</blockquote><p><em>I have had the opportunity to study and test my work in a controlled environment and it must be that way for you who are reading this.</em></p><p><em>The sole purpose of this article is to share the knowledge gained from this adventure, which was certainly educational and interesting. Let’s goooo</em></p><h3>🎯 Introduction</h3><p>My sick mind is always wondering how things work, particularly computer things.<br>In this case, I became curious about the workings of payment machine keys; for those who don’t know, I’m talking about these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*8MSlDhw3ZHVBO3V-GaWquQ.jpeg" /><figcaption>Pic 1: <a href="https://www.coges.eu/wp-content/uploads/2020/02/MyKey-001-500x333.jpg">https://www.coges.eu/wp-content/uploads/2020/02/MyKey-001-500x333.jpg</a></figcaption></figure><p>The operation is very simple: you insert the key, leaving it in you insert coins/bills into the machine and the corresponding credit is “digitally placed” inside the key. The behavior is the same as a payment card, if you don’t have money in your account you can’t use it to buy stuff. Of course every time you buy a snack, coffee or other stuff the cost is subtracted from your bill. Very simple.</p><h3>🔍 Study phase</h3><p>As all good hacking operations, I started by studying the basics and the behavior of the “victims”, our machine and keys.</p><p>By doing a search online, you can find that this type of payments take place via private <a href="https://en.wikipedia.org/wiki/Near-field_communication#Standard_relativi">NFC (Near Field Communication)</a> protocols, so on a frequency of 13.56MHz.</p><p>I do not have an NFC reader that works on those frequencies but I have the <a href="https://flipperzero.one/">Flipper Zero</a>, a very powerful device for hacking and studying radio waves (although it can do much more than that).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*3LTtyphx4cCzg0zxZCmjHw.jpeg" /><figcaption>Pic 2: <a href="https://www.amazon.it/Flipper-FLP-Z-W-R04-Zero/dp/B0BFXKSFNT">https://m.media-amazon.com/images/I/51xPGmiNQGL._AC_UF1000,1000_QL80_.jpg</a></figcaption></figure><p><em>This would be my first chance to get my hands on it so I rolled up my sleeves and started using and programming it in earnest.</em></p><p>Among the pre-installed apps in the official Flipper firmware there is the “NFC” app for studying this protocol. In particular, the key/card reading function was very useful and it gave me a lot of new information to study:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*9qnYShO19Mym09STgtk3yQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*lBg85_268lAWM4Q1O_nEIA.png" /><figcaption>Pic 3–4: Some info read by Flipper Zero (some data are obscured)</figcaption></figure><p>As you can see, Flipper Zero can easily read the data contained in the key such as credit, transactions, serial number etc… but it can’t edit/override them precisely to avoid tampering with the device, even if that is our training objective 😈.</p><p>In addition to reading the data, FZ can save them in the <em>.nfc</em> format where <strong>ALL</strong> informations are shown in the following format:</p><pre>Filetype: Flipper NFC device<br>Version: 4<br># Device type can be ISO14443-3A, ISO14443-3B, ISO14443-4A, ISO14443-4B, ISO15693-3, FeliCa, NTAG/Ultralight, Mifare Classic, Mifare Plus, Mifare DESFire, SLIX, ST25TB<br>Device type: ST25TB<br># UID is common for all formats<br>UID: 00 00 00 00 00 00 00 00 #OBSCURED DATA<br># ST25TB specific data<br>ST25TB Type: 4K<br>Block 0: FF FF FF FF<br>Block 1: FF FF FF FF<br>Block 2: FF FF FF FF<br>Block 3: FF FF FF FF<br>Block 4: FF FF FF FF<br><br>Block 5: FE FF FF FF<br>Block 6: FB FF FF FF<br>...<br>...<br>Block n: XX XX XX XX</pre><p>Here an important step occurs in the case study: as can be read in the file, the NFC key type is <strong>ST25TB</strong>,<strong> </strong>in particular <strong>ST25TB04k</strong>.</p><blockquote>I won’t dwell too much on the other data contained in the file because they are not useful at this moment. They will be explained fully later.</blockquote><h4>👀 <strong>Let’s study ST25TB protocol</strong></h4><p>Being a proprietary data transmission protocol, there is not much information online (as it should be) but only the basic concepts; I’ll save you the searches on the most remote sites on the web and I’ll give you the main information I found about ST25TB type keys:</p><ol><li>ISO14443–2 Type B with Proprietary Protocol;</li><li>512-, 2K-, and 4K-bit EEPROM with write protect;</li><li><strong>Two 32-bit counters with anti-tearing feature;</strong></li><li>OTP bytes with conditional erased features.</li></ol><p>One of the features that most impressed me were the <strong>protected 32-bit counters with mandatory decremental writing</strong>: in simple terms, blocks 5 and 6 (see previous code) are two 32-bit counters initialized to FFFFFFFF (hexadecimal) that can <strong>ONLY</strong> be decreased.<br>So once you get to the FBFFFFFF value, you cannot go back to the FCFFFFFF value for example, as it is a larger number than the previous one. This write is hardware protected by the key so is “impossible” to bypass.</p><p>This concept is very important to understand and it is not difficult to think about what it’s used for: every time we write on the device (therefore we buy food or load money into the key) this value is decreased by one.</p><p>Being a proprietary protocol, it is not specified anywhere what this counter is for but my first idea was that there were <a href="https://en.wikipedia.org/wiki/Checksum">checksums</a> connected to these counters to see if the data was all compliant with the standard or not.</p><blockquote>The question may arise “so does the key have a limited number of operations that can be performed on it?” and the answer is yes, but we are talking about approximately 4,000,000,000 operations (FFFFFFFF hex = 4,294,967,295 decimal). I think they are enough hahaha.</blockquote><h3>🧠 Deduction phase</h3><p>After obtaining the basic information of the protocol and the key, I started looking for information in the dumps of the key: in fact, every time I added/spent money with the key, I read it with Flipper and then saved the file and analyzed it later.</p><p>With about ten .<em>nfc</em> files, I managed to obtain some very important information about the behavior of the key and his blocks:</p><ul><li>The key contains 128 blocks, each of 4 bytes.</li><li>Among these, some blocks are constant because they contain information such as the serial number, the key production date, the vendor and other minor data that do not need (or should not) be changed.</li><li>Other blocks instead change every time the credit increases/decreases.<br>Among these obviously there were the two counter blocks (5 and 6) and many others.<br>The real problem was that I didn’t know exactly what they were for, but I knew that there must be blocks that saved the current credit and the history of transactions since the Flipper app showed this data (see Pic 3–4 above).</li></ul><p>At this point I deduced a lot of information but still not enough to be able to manipulate the data contained in the device as desired.</p><h4>💡 A banal but brilliant idea</h4><p>After a few days of studying the dumps I got an idea that made me take a big step forward in studying the protocol: the Flipper Zero’s firmware is open source, therefore also that of the NFC app and so I can read the code that reads and interprets the ST25TB data!</p><p>So I rushed to the Flipper GitHub page (<a href="https://github.com/flipperdevices/flipperzero-firmware">https://github.com/flipperdevices/flipperzero-firmware</a>) and look at the NFC app code; in particular, I went to study the file <a href="https://github.com/flipperdevices/flipperzero-firmware/blob/dev/applications/main/nfc/plugins/supported_cards/mykey.c">applications/main/nfc/plugins/supported_cards/mykey.c</a> .</p><p>Inside this file I found a lot of useful information including the number of blocks for reading transaction and credit history; here I reported a summary list of the main variable blocks and their functions:</p><ul><li>Blocks 5–6: 32 bit key counters;</li><li>Block 18, 22: counters (?) without writing limits;</li><li><strong>Blocks 33, 35, 37, 39: undefined scope, probably checksum </strong>😬;</li><li>Blocks 52–60: transaction history with a maximum of 8 entities.</li></ul><p>The remaining blocks are constant and contain information that is not very useful to us now.</p><h3>▶️ Create a writing system</h3><p>OK, having clear ideas is essential if you want to edit the encrypted data in the key, but you need the right tools to do and since there are no apps to do this already, I created my own Flipper Zero app that would modify (therefore write) the blocks with the values ​​I wanted.</p><p>In fact, I discovered that (at 09/2024) there are no apps/modules to write data into ST25TB keys so I had to create it myself.</p><blockquote>Small criticism regarding the creation of apps for FZ: I find that there is a lot of confusion online, in fact creating a working app was a struggle due to the lack of documentation and comments in the code.<br>In my opinion, these two elements are needed to expand the community otherwise it will become difficult to carry on the project.<br>Excuse me for this parenthesis, let’s get back to us.</blockquote><p>Here some preview code of the app:</p><pre>//read credit and show it throuth CreditView<br>static void read_credit(DisplayManager* display_manager) {<br>    FURI_LOG_I(TAG, &quot;------READ CREDIT&quot;);<br><br>    Nfc* nfc = alloc_nfc();<br>    St25tbData* data = read_data(nfc);<br>    if(data == NULL) {<br>        //error reading key<br>        view_dispatcher_switch_to_view(display_manager-&gt;view_dispatcher, ErrorViewId);<br>        return;<br>    }<br><br>    display_manager-&gt;credit = MyKeyGetCurrentCredit(data);<br><br>    FURI_LOG_I(TAG, &quot;Credit: %i&quot;, display_manager-&gt;credit);<br>    view_dispatcher_switch_to_view(display_manager-&gt;view_dispatcher, CreditViewId);<br>}<br><br>...<br><br>uint32_t calculateEncryptionKey(St25tbData* data) <br><br>    /*<br>     * Encryption key calculation.<br>     * MK = UID * VENDOR<br>     * SK (Encryption key) = MK * OTP<br>     */<br>    encodeDecodeBlock(&amp;data-&gt;blocks[0x18]);<br>    encodeDecodeBlock(&amp;data-&gt;blocks[0x19]);<br><br>    uint32_t vendor = (data-&gt;blocks[0x18] &lt;&lt; 16 | (data-&gt;blocks[0x19] &amp; 0x0000FFFF)) + 1;<br><br>    encodeDecodeBlock(&amp;data-&gt;blocks[0x18]);<br>    encodeDecodeBlock(&amp;data-&gt;blocks[0x19]);<br><br>    uint32_t key = (getUid(data) * vendor * otp);<br>    return key;<br>}<br><br>...<br><br>//main funtion of the app<br>int32_t writer_st25tb_app(void* p) {<br>    UNUSED(p);<br>  <br>    DisplayManager* instance = display_manager_alloc();<br><br>    int32_t ret = display_manager_run(instance);<br><br>    display_manager_free(instance);<br><br>    return ret;<br>}</pre><h3>1️⃣ First test</h3><p>At this point I naively thought I had found the solution: <strong>modify the last transaction by increasing the credit.</strong></p><p>Once the app has been created and the history of the key has been modified as I wanted, the Flipper Zero read that the credit had increased and I was very happy until I went to test my product on my vending machine: this one read the same credit that was there previously.</p><p>I was sad because I thought I had found a solution but at the same time this fact confirmed one of my hypothesis: the FZ obtains the credit information by reading the last history transiction but in reality the current credit is saved in some other block that I have not yet decoded: the remaining blocks are <strong>33, 35, 37, 39</strong>.</p><h3>️2️⃣ Second test</h3><p>At this point I focused on the overwritten blocks that I still had to decipher and I noticed a constant correlation between them: in each dump, blocks 33 and 37 varied from each other by one/two hexadecimal digit and the same thing happened between blocks 35–39.</p><p>The real problem was understanding how these blocks changed from dump to dump.<br>In fact their values ​​changed profoundly after each writing and I could not understand their correlation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LDsvHiIE3zxVY37dWFySbg.png" /><figcaption>Pic 5: as you can see, there are no obvious correlations between the various dumps (blocks 34, 36 and 38 are obscured)</figcaption></figure><p>After days of study, my bruteforcer soul took over and I decided to try to modify the blocks completely randomly (I know, I’m an idiot 😀 ), hoping to sooner or later catch a code that modified the credit in any way, increase or decrease was the same, I would have been happy anyway.</p><p>Obviously I didn’t gain anything from this attempt (I admit I didn’t really believe it), in fact the key wasn’t even read by the vending machine.</p><p>At this point I had no other solution other than trying random combinations on the unknown blocks.</p><h3>3️⃣ Third test and solution!</h3><p>After a few days of studying, looking and hoping for a solution, I finally got a result!</p><p>In fact, partly by chance and partly by study, I managed to overwrite the data correctly!🥳🥳🥳</p><p>This success is due to the fact that I found the codes to calculate the hexadecimal data to be inserted into blocks 33, 35, 37 and 39 which, as I had expected, are checksums which calculated ​according to various parameters such as 5–6 counters, number of blocks to modify, vendor, OTP…</p><p>After this first success, I focused on optimizing and reusing the code within the app, obviously keeping the credit reading and editing functions working and I finally got to have a definitive version of the Flipper app.</p><p><em>Wow, what a trip!</em></p><h3>🔐 Increase the security of payment systems!</h3><p>After this extremely formative experience, a fairly strong consideration arose spontaneously in my mind:<strong> NFC keys are a payment system that is too easy to be bypassed!</strong></p><p>Unlike credit cards, which are linked to an (online) account with numerous authentication and verification systems, vending machine keys contain <strong>ALL</strong> the data inside them and can be dangerous in the hands of the wrong person.</p><h4>A possible solution?</h4><blockquote>I know that changing a internationally physically implemented payment system can be very difficult and expensive but it can benefit the safety of the machines and sellers.</blockquote><p>Starting from the fact that current checksums are very robust and difficult (but not impossible) to decrypt, I think that they can be improved in at least two ways:</p><ol><li>Periodically change the checksum systems ensuring backward compatibility (otherwise a customer could lose the credit previously entered). An encrypted checksum version control system could be implemented, so that the distributor recognizes the version of the checksums used and adapts to or modifies it.</li><li>Variable parameters that only distributors can know could be added to the checksums.</li><li>If you have some ideas too, share them in the comments!</li></ol><h3>🫶 End… Thanks to…</h3><p>I still have a lot to learn and I apologize if I made any computer science and/or grammatical errors; if so, please let me know with a comment at the bottom of the page.</p><p>I would like to specify that I learned a lot about the ST25TB protocol thanks to @gentilkiwi (<a href="https://github.com/gentilkiwi/st25tb_kiemul">this is the link to his GitHub</a>) whom I thank very much and who put some explanatory slides online 😁.</p><p>❤️ Thanks also to you who read this entire article!</p><p>If you have any questions, comments or objections you can write them freely below! If you liked the article, leave some claps, thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1a3b1833cf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I set up a shared partition between Windows and Linux for my projects.]]></title>
            <link>https://marco-zora.medium.com/how-i-set-up-a-shared-partition-between-windows-and-linux-for-my-projects-c01c8a4b80a0?source=rss-29fab680c81d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c01c8a4b80a0</guid>
            <category><![CDATA[fstab]]></category>
            <category><![CDATA[ntfs]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[partition]]></category>
            <dc:creator><![CDATA[Marco Zoratti]]></dc:creator>
            <pubDate>Thu, 15 Aug 2024 21:30:45 GMT</pubDate>
            <atom:updated>2024-10-16T17:34:30.187Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is NTFS? What is and how to use FSTAB in Linux?</h4><h4>Little sad story :)</h4><p>I recently switched my primary OS from Windows 11 to Fedora 40 but (sadly) i noticed that I still need few Win tools to study and program, so i decided to share projects and important files between the two OSes.</p><p>I’m going to use Linux for the most, but I want to work on the same files on Win if needed.</p><h3>The idea</h3><p>Create a partition that can be read and wrote by both Linux and Win without any problem or incompatibility.</p><p>The best partition type for my case is NTFS which is developed by Microsoft but…</p><blockquote>NTFS read/write support is available on Linux […] using NTFS3. NTFS3 is fully functional NTFS Read-Write driver. (<a href="https://en.wikipedia.org/wiki/NTFS">Wikipedia</a> and <a href="https://docs.kernel.org/filesystems/ntfs3.html">TLKA</a>).</blockquote><p>So, I need to create a new NTFS partition, put in my projects and files, configure it in both OSes and try it out.</p><p>Also, I want to automatically mount the partition within the Fedora home, specifically within the /home/marco/Projects folder.</p><h3>At work</h3><ol><li>I have 1 TB SSD on my pc. Fedora occupies around 300 GB, Windows around 600 GB, so the last 100GB are used by the NTFS partition called “Progetti” (“Projects” in Italian).</li><li>To read/write files from/to the NTFS partition, we need to install NTFS-3G and FUZE drivers on our Linux distro.</li></ol><p>For Fedora (and RPM distros):</p><pre>sudo dnf install ntfs-3g fuse</pre><p>For Ubuntu and derivates:</p><pre>sudo apt-get install ntfs-3g fuse</pre><p>I noticed that this packages are pre-installed in Fedora 40 but always check it, otherwise you can’t R/W the NTFS partition.</p><p>3. I moved all my files and folders into the new partition. For now, the total weight of the partition is about 5 GB and it’s organized very easily:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMY1kV5qVT7SFi-WgOWblw.png" /><figcaption>Some names are obscured due to privacy</figcaption></figure><p>4. I also wanted to automatically mount the new partition in my <em>/home/marco/Progetti </em>folder on boot.</p><p>To do this, I edited the <a href="https://en.wikipedia.org/wiki/Fstab"><em>/etc/fstab</em> file</a> (with <em>sudo</em> permissions obv):</p><blockquote><strong>FSTAB</strong> is a configuration file in Linux systems that defines how partitions and storage devices should be mounted. It’s read during boot and is located at /etc/fstab.</blockquote><p>Each line in the fstab file typically contains six fields:</p><ol><li><strong>Device:</strong> The device name or UUID of the partition.</li><li><strong>Mount point:</strong> The directory where the partition will be mounted.</li><li><strong>File system type:</strong> The type of file system (e.g., ext4, NTFS, FAT32).</li><li><strong>Mount options:</strong> Additional options for the mount (e.g., defaults, noexec, rw).</li><li><strong>Dump:</strong> Used by the dump utility (usually 0 or 1).</li><li><strong>Pass:</strong> Used by the fsck utility (usually 0 or 1).</li></ol><p>Here is my FSTAB (you can read your with the command “<em>cat /etc/fstab” </em>):</p><pre>#<br># /etc/fstab<br># Created by anaconda on Mon Jul 22 23:16:29 2024<br>#<br># Accessible filesystems, by reference, are maintained under &#39;/dev/disk/&#39;.<br>#<br>#...<br>#<br># My root partition: <br>UUID=ef749c64-0a9b-4034-861c-e32a24e9aaf7 / ext4    defaults        1 1<br><br># My efi partition:<br>UUID=8480-F1A9 /boot/efi  vfat    umask=0077,shortname=winnt 0 2<br><br>#---------------------------NEW PARTITION ADDED---------------------------<br><br># My Projects NTFS partition:<br>UUID=1CF44DF1F44DCDA8 /home/marco/Progetti ntfs uid=1000,gid=1000,dmask=022,fmask=033  0 1</pre><p>Notice that in the mount option I added:</p><pre>uid=1000,gid=1000,dmask=022,fmask=033</pre><p>I try to explain what and why:</p><h4>What are UID and GID? What is “1000”?</h4><p>In Linux, UID (User ID) and GID (Group ID) are numerical values that are used to uniquely identify users and groups within the system.</p><p>In my case, my user id and user group id are “1000”. You can check yours running the command <em>id</em>:</p><pre>$id<br>  uid=1000(marco) gid=1000(marco)  [...]</pre><p>This means that the “<em>/home/marco/Progetti</em>” is owned by the user n.1000 and by the group n.1000, that’s my user!</p><p>So <em>Progetti </em>folder is own by me; we can check it typing “<em>ls -lh</em>” in the home directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*Op0CtEmClo57dmbJ2ArlLA.png" /><figcaption>Italian OS…</figcaption></figure><h4>What are dmask and fmask? Why strage values like “022&quot; or “033”?</h4><p>In Linux, dmask (directory mask) and fmask (file mask) are options used to set default permissions for directories and files when mounting a filesystem, especially non-native filesystems like FAT32, NTFS, or exFAT.</p><p>fmask sets the default permission bits for files.</p><p>dmask sets the default permission bits for directories.</p><p>They control which permission bits will be “masked” or turned off when files/dir are created:</p><p>The default permissions for files are usually 666 (read and write for user, group, and others). The fmask value is subtracted from 666 to determine the final permission bits.</p><p><strong>Example:</strong></p><p>If fmask=022, it means:</p><p>666 - 022 = 644 (which translates to rw-r--r--).</p><p>Files will be created with read and write permissions for the owner, and read-only permissions for the group and others.</p><h3>Test it</h3><p>To test it, I rebooted Fedora and everything worked file.</p><p>In fact, my “Progetti” folder was automatically mounted on boot in the home directory and I can work on it.</p><p>I also booted Windows and everything worked fine there, too!</p><p>Now I am able to use, edit and read the same files on both OSes :)</p><h3>Summary of commands and tools used</h3><p>I used only basic commands and tools in this simple guide:</p><ol><li><em>“sudo dnf install [package]” </em>to install packages in your Fedora OS (<a href="https://en.wikipedia.org/wiki/APT_(software)">check out “<em>apt</em>” for Debian-based distros like Ubuntu</a>).</li><li>“<em>cat [file_path]</em>” is a simple but powerful tool to read the content of a file.</li><li>“<em>id</em>” useful command to get some informations about ids on our machine.</li><li>“<em>ls -lh</em>” lists<em> </em>the file in the current directory. “<em>-lh</em>” are optional parameters to show better output.</li></ol><p>I recommend to read the manual of each tool to get more detailed info.</p><p>To do it, just type in your terminal “<em>man [command_name]</em>”.</p><h3>Thank you ❤</h3><p>I apologize for my poor English; I am still learning a lot…</p><p>The content of this post is deliberately simplified so that everyone can learn and know something new.</p><p>If I have made any mistakes, please let me know with a comment. If you liked the story, let me know with some claps!</p><p>See you next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c01c8a4b80a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GUIDE Realme: How to solve fingerprint loss]]></title>
            <link>https://marco-zora.medium.com/guide-realme-how-to-solve-fingerprint-loss-d6052e185f3b?source=rss-29fab680c81d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6052e185f3b</guid>
            <category><![CDATA[realme7pro]]></category>
            <category><![CDATA[fingerprint]]></category>
            <category><![CDATA[fingerprint-sensor]]></category>
            <category><![CDATA[fix]]></category>
            <category><![CDATA[real-me]]></category>
            <dc:creator><![CDATA[Marco Zoratti]]></dc:creator>
            <pubDate>Sun, 20 Aug 2023 19:21:20 GMT</pubDate>
            <atom:updated>2023-08-20T19:37:40.669Z</atom:updated>
            <content:encoded><![CDATA[<h4>Intro</h4><p>Hello, everyone 👋<br>If you have opened this page, it means that you are having problems with your fingerprint sensor;<br>specifically in this guide I want to explain<strong> how to get your fingerprint sensor working again after unlocking the bootloader or after installing a custom rom</strong>.</p><p><strong>I tested it on my Realme 7 Pro</strong>, but I think it could work on any Realme device (if it does, let me know!)</p><h3><strong>Prerequisite and Warning</strong></h3><ol><li><strong>You will need a fingerprint calibrator.<br></strong>I bought one for 7 euros on AliExpress and it arrived in a few days: <a href="https://it.aliexpress.com/item/1005004895894158.html?spm=a2g0o.productlist.main.19.4e9778edmheCuY&amp;algo_pvid=67e11058-390f-4129-a307-4491daa0bdcf&amp;algo_exp_id=67e11058-390f-4129-a307-4491daa0bdcf-9&amp;pdp_npi=4%40dis%21EUR%2113.02%2110.42%21%21%2113.85%21%21%40211b88f116925515735745431e0202%2112000030930318573%21sea%21IT%210%21A&amp;curPageLogUid=4mfBLlKaqnN6">click here for the link</a>.<br>In case the above link doesn’t work, just search on AliExpress for ‘fingerprint calibration tool’ and choose something similar to this:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*lEDm4EbH36OrEq4TYYyAKA.png" /><figcaption>One among them, I bought the second one</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*wodD7FdKf8ayedGfhzPPCA.jpeg" /><figcaption>This is</figcaption></figure><p>2. The following guide plans to install the Realme UI rom, so if at this moment you have a custom rom installed (such as “PixelExperience” or “DerpFest” or others) this guide requires you to <strong>DELETE ALL YOUR DATA</strong> and install the Realme UI .<br>⚠️If you are aware of this and want to continue, I recommend you make a backup before following the next steps.</p><blockquote>I am not responsible for any damage to your device and/or your data. Thanks for understanding ❤</blockquote><h4>My problem</h4><p><em>If you want, you can skip this part of the text as it is only to set the context and the causes of my problem well.</em><br> <br>It all started when I decided to change rom to my Realme 7 Pro, so I unlocked the bootloader and then installed a custom rom (to find the best custom roms for Realme 7 pro I invite you to subscribe to the Telegram channel “<em>Realme 7 Pro | Discussion</em>”: <a href="http://t.me/realme7ProOfficial">t.me/realme7ProOfficial</a>).<br>Unfortunately for some reason my fingerprint sensor no longer worked and I was without it for over two years.<br>After this long period I decided to delete everything and reinstall the stock Realme UI 3 and thanks to this decision I was able to restore the fingerprint sensor.<br>Now I’ll explain how to do it in detail:</p><h3>Step 1</h3><h4>Install stock Realme UI</h4><p>To get started, the stock version of the realme ui must be installed.</p><p>You can find many guides explaining how to install it, in particular I followed this video: <a href="https://www.youtube.com/watch?v=UXGXiF7R8Xk">How to Revert back to Realme UI from Custom Roms on Realme 7 pro — YouTube</a></p><p>Specifically, I installed via the OrangeFox recovery (ver. 11.1_3_A12+) the F24 version of Realme UI 3, the links are below:</p><blockquote>Realme UI 3 ver. F24: <a href="https://drive.google.com/file/d/1t-5sZ6N5KrO-wJGrLiwgtM1VM7UqUYKL/view">RMX2170_11_F.24_3240_202212131615.zip — Google Drive</a></blockquote><blockquote>OrangeFox Recovery: <a href="https://t.me/realme7ProUpdates/284">https://t.me/realme7ProUpdates/284</a></blockquote><p><em>(Many thanks to the telegram group “Realme 7 Pro | Discussion” because thanks to them I was able to obtain these links </em>😁<em>)</em></p><blockquote>NOTE: I don’t know if this guide works the same way with previous or future versions of Realme UI, if so let me know with a comment! Thanksss</blockquote><h3>Step 2</h3><h4>Open dialer and engineer mode</h4><p>Now open the dialer and type in the secret code <strong>without pressing the call key</strong>: *#899# . <em>If nothing happens, it means that there is some error in your installation of the Realme UI and therefore you have to reinstall the system</em>.<br>Doing so will open a special screen called ‘engineer mode’ from which we have to press the ‘manual test’ button as shown in the picture:</p><figure><img alt="Click the ‘manual test’ button" src="https://cdn-images-1.medium.com/max/576/1*jlbHVKhmQwWzKgqoZ_2-Jg.jpeg" /><figcaption>Click the ‘manual test’ button</figcaption></figure><h3>Step 3</h3><h4>Work!</h4><p>At this point we need to scroll to the “<strong>device debugging</strong>” page and click “<strong>finger print test</strong>” and then “<strong>finger print optical calibration</strong>”:</p><figure><img alt="Click “Device Debugging” or slide right" src="https://cdn-images-1.medium.com/max/576/1*vvzgd2oEfTzo09NqAXRfng.jpeg" /><figcaption>Click “Device Debugging” or slide right</figcaption></figure><figure><img alt="Click “finger print test”" src="https://cdn-images-1.medium.com/max/576/1*4Uz3FBE9Zhr6pYPJUFd3Ww.jpeg" /><figcaption>Click “finger print test”</figcaption></figure><figure><img alt="Click “finger print optical calibration”" src="https://cdn-images-1.medium.com/max/576/1*emFWFhZcL-WQLRqQp2Tg4w.jpeg" /><figcaption>Click “finger print optical calibration”</figcaption></figure><p>At this point, a <em>pop-up</em> requesting a code will <em>pop up:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*OcnlRFC98Dz2Plth4Uk3IQ.jpeg" /></figure><p>Enter code <strong>6776 </strong>and than click ‘ok’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*p40ciENihnbAoynMz6Y1wA.jpeg" /></figure><p>We are now on the page that allows us to ‘adjust’ the fingerprint reader.</p><h3>Step 4</h3><h4>Calibration</h4><p>Click the “start” button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*X5M93vLCQk385UypCi0fQg.jpeg" /></figure><p>After clicking the ‘start’ button, we will be asked to put down on the fingerprint sensor the <strong><em>yellow </em></strong>rubber piece and click ‘next’, then the <strong><em>black </em></strong>one and click ‘next’, then the <strong><em>blue </em></strong>one.<br>⚠️ <strong>Attention: the screen will probably tell you to place the rubber pieces in a different order; you have to give a fuck and follow the order I wrote above.<br>I don’t know why this happens, but only in the order written above I was able to calibrate the sensor… </strong>⚠️</p><p>So the order must be as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*lgZhFtRiP-vs2Rs4-HI2RQ.jpeg" /><figcaption>Sorry about the graphics 🙇🏾‍♂️</figcaption></figure><p>You can detach the rubber pieces or keep them attached to the plastic body, as you prefer.<br>I personally have always detached them and applied them one by one.</p><p>If all went well, we should end up with this screen and restart the phone:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*DRnA4QKncYILfcHNEu28UA.png" /><figcaption>YESSSSSS</figcaption></figure><p>At this point we finished! 😃</p><p>If all went well, after restarting the phone you can go to the system settings and set your finger in the security settings!</p><p>⚠️<strong>If the process you have just executed has errors, don’t worry it can happen</strong>! ⚠️<br>Try again 1, 2, 3, 4 times then if it doesn’t work try dimming the light in the room.<br>If it also doesn’t work at this point, try changing the order of the tyres but I can’t guarantee anything, sorry.</p><h3>Finish 🥳</h3><p>I sincerely hope I have helped you in some way, if so leave a like to make me understand, TY 💌.</p><p>If you have encountered some errors you have two possibilities:<br>1) write your problem in the comments, I’ll try to answer you as soon as possible and help you.</p><p>2) join the Telegram group “Realme 7 Pro | Discussion” where a lot of people will be able to help you!</p><p>Thank you so much and see you next time!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6052e185f3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Bypass SafetyNet test afeter rooting]]></title>
            <link>https://marco-zora.medium.com/how-to-bypass-safetynet-test-afeter-rooting-9424366dbc46?source=rss-29fab680c81d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9424366dbc46</guid>
            <category><![CDATA[safety-net]]></category>
            <category><![CDATA[root-android-device]]></category>
            <category><![CDATA[fix]]></category>
            <category><![CDATA[andorid]]></category>
            <category><![CDATA[android-root-guide]]></category>
            <dc:creator><![CDATA[Marco Zoratti]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 19:39:57 GMT</pubDate>
            <atom:updated>2023-12-15T09:02:27.412Z</atom:updated>
            <content:encoded><![CDATA[<p>ITA:</p><blockquote>Premesse: testato su <a href="https://www.google.com/search?q=realme+7+pro&amp;oq=realme+7+pro&amp;aqs=edge.0.0i433i512j0i512l7.1875j0j1&amp;sourceid=chrome&amp;ie=UTF-8">Realme 7 pro</a>, con a bordo <a href="https://derpfest.org/">Derpfest </a>(android 13) e root <a href="https://magiskmanager.com/">Magisk</a> già installato.</blockquote><p>Ecco una guida veloce veloce su come bypassare il SafetyNet Test al fine di fixare i problemi di Google Wallet:</p><h3>Passo 1, attivare Zygisk e la lista di blocco</h3><p>La prima cosa da fare è andare nelle impostazioni e attivare Zygisk e la lista di blocco:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*VS-VPedlxY1ad9pf.jpg" /></figure><p>Riavvia il telefono.</p><h3>Passo 2, configura la lista di blocco</h3><p>Configura la lista di blocco aggiungendo come prima cosa Google Wallet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*XRev69sLhuOtyYo2lqUrWw.png" /></figure><p>Successivamente clicca i tre puntini in alto e clicca su “mostra app di sistema”.</p><p>In questo modo verranno mostrate alcune app e servizi da includere nella lista:</p><ul><li>Google Play Services</li><li>Google Play Store</li><li>Android Services Library</li><li>Carrier Services</li><li>Google Services Framework</li></ul><p>La lista risulta quindi cosi:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*h_HRE5IVam2ZWtTwaHC1ug.png" /></figure><p>Se serve, aggiungi altre app che non devono vedere il root.</p><p>A questo punto riavvia il telefono.</p><h3>Passo 3, installa i pacchetti</h3><p>Per superare con successo il Safetynet Test devi installare almeno il pacchetto <a href="https://github.com/kdrag0n/safetynet-fix/releases">Universal SafetyNet Fix</a> (di “kdrag0n” moddato da “Displax”: https://github.com/Displax/safetynet-fix/releases).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5ln8b9JDBbKf7JbQZUdKg.png" /></figure><h3>Passo 4, test</h3><p>A questo punto dovrebbe funzionare tutto.</p><p>Per testarlo, ci sono diverse app sul Playstore che fanno questo check.</p><p>Riavvia un’ultima volta il telefono e il SafetyNet Test dovrebbe essere passato. In caso contrario, aggiorna questa nota o scrivi un commento qua sotto con il probabile problema ed una possibile soluzione.</p><h3>Ancora non funziona?</h3><p>Con gli ultimi aggiornamenti di Google potresti avere ancora qualche problema.</p><p>Prova installando questo modulo magisk: https://xdaforums.com/t/module-play-integrity-fix-safetynet-fix.4607985/</p><p>Grazie, alla prossima!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9424366dbc46" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>