<?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 Akshat Soni on Medium]]></title>
        <description><![CDATA[Stories by Akshat Soni on Medium]]></description>
        <link>https://medium.com/@akshatsoni64?source=rss-5c35342ccd3f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZL4hZCqmtzTHWgtgEIzbMA.png</url>
            <title>Stories by Akshat Soni on Medium</title>
            <link>https://medium.com/@akshatsoni64?source=rss-5c35342ccd3f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 22:56:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akshatsoni64/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[Extract Numbers from a String — Python]]></title>
            <link>https://akshatsoni64.medium.com/extract-numbers-from-a-string-python-6c851e10aa87?source=rss-5c35342ccd3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c851e10aa87</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[solutions]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Akshat Soni]]></dc:creator>
            <pubDate>Tue, 26 Jan 2021 12:53:37 GMT</pubDate>
            <atom:updated>2021-01-26T14:22:18.041Z</atom:updated>
            <content:encoded><![CDATA[<h3>Extract Numbers from a String — Python</h3><p>Hey Everyone! So I was searching for some random problem-solving questions and came across this interesting problem. After spending some time solving this, I came up with this solution and thought to share it with you guys as I didn’t find any proper solution for this problem.</p><blockquote><strong>Problem Statement:</strong> For a given string, Find the numbers present inside the string and return the count of them. [Sorry don’t remember the exact statement so made this up]</blockquote><p><strong>Sample Test Case:</strong></p><p><strong>Input:</strong></p><pre>string = &quot;Th1s i5 a string with 50m3 numb3r5&quot;</pre><p><strong>Output:</strong></p><pre>Count: 6<br>[1, 5, 50 3, 3, 5]</pre><p><strong>Approach:</strong></p><ol><li>First split up the words from the given string.</li><li>Scan every word and check if that word is a digit itself [Example: 123].</li><li>If not, then scan its characters to determine if there is any number within that word.</li><li>To get the number we will check the ASCII code of the character.</li><li>If the character is a number then we will add it to an integer variable names ‘add’. Else, we will push the number to the array and reset the ‘add’ s value.</li><li>For the last iteration, we will check if there is any number there in ‘add’ to push it to the array.</li><li>For the final output, print the count and the ‘numbers’ array.</li></ol><p><strong>Solution Code:</strong></p><pre># Note: We only have to extract complete numbers, Float numbers will be considered as 2 different complete numbers</pre><pre>string = &quot;I will eat 2 burgers 2345 fries &amp; 1.25 cokes l8r9 aa&quot;<br>numbers = []<br>for val in string.split(&quot; &quot;):<br>    if str.isdigit(val):<br>        numbers.append(val)<br>    else:<br>        # Check for Float Numbers<br>        if &#39;.&#39; in val: <br>            for digit in val.split(&#39;.&#39;):<br>                if str.isdigit(digit):<br>                    numbers.append(digit)<br>        # Non Float Values<br>        else: <br>            add = 0<br>            # Check every character inside string<br>            for i in range(len(val)): <br>                # Consecutive Numbers<br>                if ord(val[i]) in range(48, 58): <br>                    if add &gt; 0:<br>                        add = (add*10) + int(val[i])<br>                    # Numbers mixed with character [a2bc3]<br>                    else: <br>                        add += int(val[i])<br>                    if i == len(val)-1: <br>                        numbers.append(add)<br>                else:<br>                    if add &gt; 0:<br>                        numbers.append(add)<br>                    add = 0</pre><pre>print(len(numbers))<br>print(numbers)</pre><p>Hope you guys like the solution and please do suggest if you have some better solution to this problem. THANK YOU for taking the time to read.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c851e10aa87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authenticate: TryHackMe Room]]></title>
            <link>https://akshatsoni64.medium.com/authenticate-tryhackme-room-9b3ec8d15778?source=rss-5c35342ccd3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b3ec8d15778</guid>
            <category><![CDATA[thm]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[room]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Akshat Soni]]></dc:creator>
            <pubDate>Wed, 05 Aug 2020 11:15:55 GMT</pubDate>
            <atom:updated>2020-08-05T11:15:55.397Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello World! Welcome to the blog…</p><p>You guys can also try amazing room by purchasing a premium subscription of <a href="https://tryhackme.com/">TryHackMe</a>.</p><ul><li>Before starting, Make sure to connect to the TryHackMe server using the VPN configurations file provided.<br>[If you don’t have <a href="https://openvpn.net/download-open-vpn/">OpenVPN</a> installed then: <strong>sudo apt install openvpn</strong>]</li></ul><blockquote><em>Alright! Let&#39;s begin.</em></blockquote><p>Go to <a href="https://tryhackme.com/room/authenticate"><strong>Authenticate </strong>Room</a> inside Your Hacktivities:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z74Rw6ywkznsL31utgKBRQ.png" /><figcaption>Room Overview</figcaption></figure><blockquote><strong><em>Task </em>1</strong> — Deploy the VM:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*X8rNTmp7CLz3HqokzMaPbA.png" /><figcaption>Task 1</figcaption></figure><ul><li>Copy IP address of the VM:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*pWrh3C5yVRk_8a9RV-Hd-Q.png" /><figcaption>Active Machine Information</figcaption></figure><ul><li>Then perform NMAP Scan:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*EJjxdCw74FUFgpnrgeTHdQ.png" /><figcaption>NMAP Scan</figcaption></figure><ul><li>So port 80 is not open! Let’s get the service’s information by applying <strong>-sV</strong> options with NMAP Scan. After the scan, you can see that port <strong>5000</strong>, <strong>7777</strong>, <strong>8888 </strong>are running <strong>httpd </strong>service.<br>Now let’s browse the ports running <strong>httpd </strong>service:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*1wZ6sxKW9olNXHdE9KFzQg.png" /><figcaption>Port 5000</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*t4JJEcoXAq_WsA-b8gI2ew.png" /><figcaption>Port 7777</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Rp22Olj2bK4Wn0HRIll5Q.png" /><figcaption>Port 8888</figcaption></figure><blockquote><strong><em>Task </em>2</strong> — Dictionary Attack:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*QJiMXTb89I1VCg79XFHixw.png" /><figcaption>Task 2</figcaption></figure><ul><li>After going through the description, it is pretty clear that we have to perform a brute-force attack, so lets fire-up Burp-Suite.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*m_4BlmB0IO2Dgr_ayv8X8A.png" /><figcaption>Burp Suite Loading Screen</figcaption></figure><ul><li>Capture the login request and send it to the intruder tab to perform the attack, add the position as given, and add the required payloads for the attack.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAM2gp7BqilCEPqQFswmeA.png" /><figcaption>Brute Force Attack</figcaption></figure><ul><li>We got the password by performing the attack, And after logging in with the password we get the flag:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPHGaivhtPxUi7nC4tZASQ.png" /><figcaption>Flag Page</figcaption></figure><ul><li>Perform the same attack for Mike’s credentials, You will get the rest of the answers as well:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*fTllp0X9m_OG7afh0ELvzg.png" /><figcaption>Quiz Form</figcaption></figure><blockquote><strong><em>Task </em>3 </strong>— Re-registration:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*IWNxmUvxSUNSL-62V2Wfew.png" /><figcaption>Task 3</figcaption></figure><ul><li>Register <strong>Darren </strong>as given in the description.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*IKGsLl-13Q0ZktdpJAjDuw.png" /><figcaption>Registration Form</figcaption></figure><ul><li>Then login with the registered credentials, You will get the flag:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZA34LYFbisfUnpolfxtoSw.png" /><figcaption>Flag Page</figcaption></figure><ul><li>Perform the steps for Arthur&#39;s account, You will get rest of the answers:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*wwxFV0anvEX2ByuOv21sDQ.png" /><figcaption>Quiz Form</figcaption></figure><blockquote><strong><em>Task </em>4</strong> — JSON Web Token:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*9N_ADfwuN1lGPMBCkBo4Iw.png" /><figcaption>Task 4</figcaption></figure><ul><li>Navigate to port number 5000.<br>Perform login as given in the description, and make sure to capture the request:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*FskaGdngY3XvRgDHGtQg5A.png" /><figcaption>Landing Page</figcaption></figure><ul><li>Captured Request for Authentication:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*6ZQBn3_NIZMIhcC75BR7gw.png" /><figcaption>Captured Request</figcaption></figure><ul><li>Captured Request for Login:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jFGZKhTabt4o067XpAzS2g.png" /><figcaption>Captured Request</figcaption></figure><ul><li>Success Alert for Guest User:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*-egZ_eAXsIdHzSv5mlgDtg.png" /><figcaption>Welcome Alert</figcaption></figure><ul><li>Now again login to the system and modify the JWT Token, decode (using <a href="https://gchq.github.io/CyberChef/">CyberChef</a>) the first two part of the token as given in the task description:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOjLMuRV6CIqFjMueYbBtg.png" /><figcaption>Modified Request</figcaption></figure><ul><li>After logging in, You will get the admin flag:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*8FAtfbeVaGqGv9dAGGqbfw.png" /><figcaption>Flag Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*OqyszIfYA9jHIFg5P5P6rA.png" /><figcaption>Quiz Form</figcaption></figure><blockquote><strong><em>Task </em>5 </strong>— No Auth:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*GPJCNUXxmPyxIb37QffUAw.png" /><figcaption>Task 5</figcaption></figure><ul><li>Navigate to the port number 7777, This form will appear:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*65BicY5q5P5k3lQzyT_hBg.png" /><figcaption>Landing Page</figcaption></figure><ul><li>Navigate to <strong>/users/1</strong>:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*a5NzxCfDqOqKUJUqskt1hw.png" /><figcaption>User Data Page</figcaption></figure><ul><li>When navigated to <strong>/users/2</strong>, we got the admin password &amp; some sort of secret data:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*jzIZV4BQoMRoic8DO7Lc3A.png" /><figcaption>Admin Data Page</figcaption></figure><ul><li>Now for this task, let’s try to fuzz the user-id, when passing user-id as 0, we get the superadmin’s data:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*VYeJsL5lGLoUJ8qph-_Hjw.png" /><figcaption>Super Admin Data Page</figcaption></figure><ul><li>Now we got the answers:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*gzAOeEmFo-smXJtseLZulQ.png" /><figcaption>Quiz Form</figcaption></figure><blockquote>And CONGRATULATIONS, You have successfully completed the room!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/0*u0dAsc11gvj8HsvP.png" /></figure><p><em>For any queries, drop me an email akshatsoni64@protonmail.com</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b3ec8d15778" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>