<?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: Ghit</title>
    <description>The latest articles on DEV Community by Ghit (@ghat).</description>
    <link>https://dev.to/ghat</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4035210%2Ffd0d42a5-5d2d-42f6-9d2c-1739062cb51a.png</url>
      <title>DEV Community: Ghit</title>
      <link>https://dev.to/ghat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ghat"/>
    <language>en</language>
    <item>
      <title>How I Turned OWASP Juice Shop Into a Live Attack-Detection Lab Using SecureNow</title>
      <dc:creator>Ghit</dc:creator>
      <pubDate>Sat, 18 Jul 2026 12:01:56 +0000</pubDate>
      <link>https://dev.to/ghat/how-i-turned-owasp-juice-shop-into-a-live-attack-detection-lab-using-securenow-46na</link>
      <guid>https://dev.to/ghat/how-i-turned-owasp-juice-shop-into-a-live-attack-detection-lab-using-securenow-46na</guid>
      <description>&lt;p&gt;Ever wanted to see an attack get caught the moment it happens, instead of just reading about it after the fact? That's what this walkthrough is about.&lt;/p&gt;

&lt;p&gt;OWASP Juice Shop is intentionally broken — SQL injection, XSS, broken access control, and a dozen other flaws are baked into its code on purpose, making it one of the best sandboxes for learning how real attacks actually work. But knowing an app is vulnerable is only half the story: the real skill is watching an attack happen and catching it as it unfolds. That's where SecureNow comes in.&lt;/p&gt;

&lt;p&gt;In this walkthrough, I set up Juice Shop from scratch, then instrumented it with SecureNow's SDK, CLI, and cloud dashboard to monitor traffic in real time and flag malicious behavior — SQL injection attempts, brute-force logins, account enumeration — the moment it happens. Here's exactly how I did it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Is OWASP Juice Shop?
&lt;/h2&gt;

&lt;p&gt;OWASP Juice Shop is a deliberately vulnerable web application, developed and maintained by OWASP, used worldwide for learning cybersecurity. It simulates an e-commerce site that sells fruit juices — complete with account creation, product search, reviews, and a chatbot.&lt;/p&gt;

&lt;p&gt;Under the hood, it packs in a dozen security flaws on purpose. Each one maps to a "challenge" you solve by exploiting it: SQL injection, Cross-Site Scripting (XSS), authentication bypass, broken access control, sensitive data exposure, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech stack:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js and Express.js on the server side&lt;/li&gt;
&lt;li&gt;Angular for the frontend&lt;/li&gt;
&lt;li&gt;TypeScript across the entire codebase&lt;/li&gt;
&lt;li&gt;Sequelize as the ORM for data persistence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because nearly every category of the OWASP Top 10 is represented in the app, it's an ideal training ground for understanding — under real conditions — how a web attack works, and therefore how to detect it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Installing OWASP Juice Shop
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 Getting the Source Code
&lt;/h3&gt;

&lt;p&gt;Clone the project's repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/juice-shop/juice-shop.git
&lt;span class="nb"&gt;cd &lt;/span&gt;juice-shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A quick look at the project structure reveals several key folders worth exploring before moving on.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Installing Dependencies
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;This may print a wave of &lt;code&gt;npm warn deprecated&lt;/code&gt; messages, tied to older internal dependencies (outdated versions of &lt;code&gt;glob&lt;/code&gt;, &lt;code&gt;rimraf&lt;/code&gt;, &lt;code&gt;uuid&lt;/code&gt;, etc.). These are harmless — they just flag transitive packages that are no longer maintained, and don't affect installation or app functionality.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.3 Building the Project
&lt;/h3&gt;

&lt;p&gt;Since Juice Shop is written in TypeScript, it needs a build step before the server can start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This compiles the TypeScript into JavaScript (into a &lt;code&gt;build/&lt;/code&gt; folder) and prepares the Angular frontend assets.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.4 Starting the Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once running, the app is available at &lt;code&gt;http://localhost:3000&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Exploring the Application's Functionality
&lt;/h2&gt;

&lt;p&gt;Before diving into the security side, it's worth browsing the app like an ordinary user would: create an account, log in, search for products, add items to the cart. This builds a mental map of the exposed functionality — an essential foundation for identifying attack surfaces later.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Introducing SecureNow
&lt;/h2&gt;

&lt;p&gt;SecureNow is an application security solution that monitors an app's traffic in real time and automatically detects behavior matching known attacks — SQL injection, XSS, brute-force, account enumeration, and more.&lt;/p&gt;

&lt;p&gt;It's built around three components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;SDK&lt;/strong&gt; installed in the project, which hooks into the HTTP request lifecycle&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;CLI&lt;/strong&gt; for configuring, initializing, and verifying the integration from the command line&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;cloud dashboard&lt;/strong&gt; that centralizes reported events and lets you configure detection rules&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Creating the Application on SecureNow
&lt;/h2&gt;

&lt;p&gt;The first step on the SecureNow side is registering the app to be protected, via the &lt;strong&gt;Create New Application&lt;/strong&gt; form on the dashboard:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Application Name&lt;/td&gt;
&lt;td&gt;A name identifying the project&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hosts&lt;/td&gt;
&lt;td&gt;Domains associated with the app (left empty or set to &lt;code&gt;localhost&lt;/code&gt; for local dev)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discover &amp;amp; monitor all subdomains&lt;/td&gt;
&lt;td&gt;Useful for a real public domain; unchecked for a purely local app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SecureNow Instance&lt;/td&gt;
&lt;td&gt;The cloud instance receiving traces and logs (Free Trial tier is enough for testing)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Creating the application automatically generates a unique &lt;code&gt;APPID&lt;/code&gt;, which the SDK uses internally to associate reported events with the correct application on the dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Installing and Authenticating the SDK
&lt;/h2&gt;

&lt;h3&gt;
  
  
  6.1 Installing the Package
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;h3&gt;
  
  
  6.2 Authentication
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx securenow login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This opens the browser for OAuth authentication, linking your local dev environment to your SecureNow account.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 Initializing the Local Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx securenow init
npx securenow &lt;span class="nb"&gt;env&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command creates a local config file (&lt;code&gt;.securenow/credentials.json&lt;/code&gt;) with the integration settings. The second checks that the essential options are properly enabled:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;loggingEnabled&lt;/code&gt; — enables event logging&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;captureBody&lt;/code&gt; — captures the body of HTTP requests&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;captureMultipart&lt;/code&gt; — captures multipart requests (file uploads)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;firewallEnabled&lt;/code&gt; — enables the real-time application firewall&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. Instrumenting the Code
&lt;/h2&gt;

&lt;p&gt;Instrumentation means making sure the SecureNow SDK runs before the application code, so it can observe all traffic from the moment the server starts.&lt;/p&gt;

&lt;p&gt;Node.js natively supports this via the &lt;code&gt;-r&lt;/code&gt; (&lt;code&gt;--require&lt;/code&gt;) flag, which loads a module before the script's main entry point. Juice Shop's original startup script in &lt;code&gt;package.json&lt;/code&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node build/app"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It gets modified to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node -r securenow/register build/app"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach has a key advantage: it requires no changes to the application's own source code. The &lt;code&gt;securenow/register&lt;/code&gt; module inserts itself transparently into the Node.js process, intercepts HTTP requests at a low level (typically via instrumentation of the native &lt;code&gt;http&lt;/code&gt;/&lt;code&gt;https&lt;/code&gt; modules or the Express framework), and forwards the relevant events to the SDK.&lt;/p&gt;

&lt;p&gt;After this change, rebuild and restart to apply it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run build
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Verifying the Integration
&lt;/h2&gt;

&lt;p&gt;The SecureNow CLI offers several diagnostic commands to validate each part of the integration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx securenow status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirms the agent is active and properly connected to the configured SecureNow instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx securenow firewall apps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists applications currently protected by the SecureNow firewall — your app should appear here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx securenow firewall status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirms whether the application firewall is active or inactive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx securenow test-span &lt;span class="nt"&gt;--env&lt;/span&gt; &lt;span class="nb"&gt;local&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sends a test event ("span") to the SecureNow instance, providing an end-to-end check that the telemetry chain works — from the SDK all the way to the cloud dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Validating with Real Application Traffic
&lt;/h2&gt;

&lt;p&gt;A test span confirms connectivity, but it doesn't guarantee the SDK is correctly capturing real traffic generated by the application. To validate that, I:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Manually browsed the app — logging in, searching for products, adding items to the cart, and attempting a failed login with a wrong password&lt;/li&gt;
&lt;li&gt;Watched the SecureNow dashboard to confirm each action produced a corresponding event, visible in near real time&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every action showed up on the dashboard as it happened — proof that the instrumentation was capturing genuine traffic, not just synthetic test pings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Setting up OWASP Juice Shop gives you a realistic, safe environment to practice exploiting the OWASP Top 10. But pairing it with SecureNow turns that exercise into something more valuable: a live demonstration of what real-time detection actually looks like from the defender's side. Instead of just reading about SQL injection or brute-force attacks in theory, you can watch them get flagged on a dashboard the instant they happen — which is a much sharper way to understand both the attack and the defense.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
