<?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>Forem: Suprim Devkota</title>
    <description>The latest articles on Forem by Suprim Devkota (@suprimdevkota).</description>
    <link>https://forem.com/suprimdevkota</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%2F1217728%2Fe65819ad-1a72-4630-8897-9929070cef42.png</url>
      <title>Forem: Suprim Devkota</title>
      <link>https://forem.com/suprimdevkota</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/suprimdevkota"/>
    <language>en</language>
    <item>
      <title>Setting Up a Windows VM for Log Collection Using the ELK Stack - A Step-by-Step Guide</title>
      <dc:creator>Suprim Devkota</dc:creator>
      <pubDate>Mon, 10 Mar 2025 09:48:36 +0000</pubDate>
      <link>https://forem.com/suprimdevkota/setting-up-a-windows-vm-for-log-collection-using-the-elk-stack-a-step-by-step-guide-4hod</link>
      <guid>https://forem.com/suprimdevkota/setting-up-a-windows-vm-for-log-collection-using-the-elk-stack-a-step-by-step-guide-4hod</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Log collection&lt;/strong&gt; is vital for cybersecurity as it provides visibility into system activities, allowing organizations to monitor and track events happening within their infrastructure. They capture detailed information about user actions, network connections, application errors, and system performance, helping to detect suspicious activity such as unauthorized logins, privilege escalation, or malware execution. In the event of a cyberattack, logs become essential for forensic investigation, enabling cybersecurity professionals to trace the attacker's movements, understand the methods used, and identify the vulnerabilities exploited, leading to faster resolution and containment.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;ELK Stack&lt;/strong&gt; (now often called the Elastic Stack) is a powerful, open-source suite of tools used for log management, data analysis, and visualization, comprising Elasticsearch, Logstash, and Kibana. Let us understand each tool in detail.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Elasticsearch&lt;/strong&gt;: It is a distributed JSON-based search and analytics engine that stores and indexes data. &lt;br&gt;
&lt;em&gt;Think of it like a giant library where books (data) are stored in an organized way. When you need to find a specific piece of information (search for data), Elasticsearch helps you find it quickly by searching through the library's catalog (indexes).&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Logstash&lt;/strong&gt;: A server-side data processing pipeline that ingests, transforms and sends data to a desired destination. &lt;em&gt;Think of it like a conveyor belt that takes raw materials (data from different sources), processes them (filters and formats the data) and moves them to an appropriate destination (Elasticsearch).&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kibana&lt;/strong&gt;: A visualization layer that works on top of Elasticsearch, providing search and data visualization capabilities for data indexed in Elasticsearch. &lt;em&gt;Think of it like the control panel in a car, providing you with graphs and information that give you insight to the performance and status of your system. Instead of just showing you the raw data, it helps you visualize and make sense of all the data you have.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to these, Logs are typically collected using &lt;strong&gt;Beats&lt;/strong&gt;. Beats are a collection of lightweight, open-source data shippers that collect and forward data (like logs, metrics and events) from various sources to Elasticsearch or Logstash for processing and analysis.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this project, I'll be using &lt;strong&gt;Winlogbeat&lt;/strong&gt; which focuses exclusively on Windows Event Logs. &lt;em&gt;Think of Winlogbeat as a specialized messenger who only delivers important notes or messages (event logs) from your Windows system to a destination like Elasticsearch or Logstash.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So to wrap it all up, &lt;strong&gt;Winlogbeat&lt;/strong&gt; collects logs from the system we want to monitor and sends it to &lt;strong&gt;Logstash&lt;/strong&gt;. Logstash filters and formats the raw data and sends it to &lt;strong&gt;Elasticsearch&lt;/strong&gt; which indexes the data for faster searching. Finally &lt;strong&gt;Kibana&lt;/strong&gt;, lets you explore and interact with the indexed data in Elasticsearch in a user-friendly way.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpd5hgdg0tp4iwn55ovh1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpd5hgdg0tp4iwn55ovh1.png" alt="High-level-view of the project" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this guide, I'll walk you through setting up a Windows Virtual Machine (VM) on a host Windows system, installing the Windows OS, and configuring log collection from the VM to the host machine using the ELK Stack (&lt;strong&gt;Elasticsearch, Logstash, and Kibana&lt;/strong&gt;).  &lt;/p&gt;

&lt;p&gt;By the end of this tutorial, you'll have a working ELK stack capturing Windows event logs from your VM and displaying them in Kibana for analysis.  &lt;/p&gt;




&lt;h2&gt;
  
  
  Setting up the Windows Virtual Machine
&lt;/h2&gt;

&lt;p&gt;Using &lt;strong&gt;VMware Workstation&lt;/strong&gt; or &lt;strong&gt;VirtualBox&lt;/strong&gt; on the host machine, attach the Windows ISO file and install the Operating system. Allocate at least &lt;code&gt;2 CPUs&lt;/code&gt;, &lt;code&gt;4 GB RAM&lt;/code&gt; and &lt;code&gt;32 GB&lt;/code&gt; disk space for the Virtual Machine that will be used to collect logs. To ensure network connectivity configure the network settings to &lt;strong&gt;Bridged Adapter&lt;/strong&gt; or &lt;strong&gt;NAT&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxn1cd4h67lmgrns8w1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxn1cd4h67lmgrns8w1w.png" alt="Virtual Machine settings" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting Up Winlogbeat on the Virtual Machine
&lt;/h2&gt;

&lt;p&gt;Once the Virtual Machine has been setup, the following things must be done to ensure that logs are properly collected and sent to the Logstash server running on the host.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Verify important logs are enabled in Event Viewer&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open &lt;strong&gt;Event Viewer&lt;/strong&gt; (&lt;code&gt;eventvwr.msc&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expand &lt;strong&gt;Windows Logs&lt;/strong&gt; &amp;gt; &lt;strong&gt;Security, System, Application&lt;/strong&gt;.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Right-click each log category &amp;gt; &lt;strong&gt;Properties&lt;/strong&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure &lt;strong&gt;Enable Logging&lt;/strong&gt; is checked.
&lt;/li&gt;
&lt;li&gt;Set log size to &lt;strong&gt;at least 10 MB&lt;/strong&gt;. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Enable Audit Policies&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open &lt;strong&gt;Local Group Policy Editor&lt;/strong&gt; (&lt;code&gt;gpedit.msc&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to:  &lt;code&gt;Computer Configuration &amp;gt; Windows Settings &amp;gt; Security Settings &amp;gt; Advanced Audit Policy Configuration&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable relevant audit policies (e.g., Logon Events, Account Management, Object Access).  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;In this project I enabled auditing the following policies: Audit Security Group Management, Audit Audit Policy Change, Audit Process Creation, Audit Process Termination, Audit Sensitive Privilege Use, Audit File System, Audit Registry, Audit Handle Manipulation, Audit User Account Management, Audit Logon, Audit Logoff, Audit Special Logon and Audit Security State Change.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Install &amp;amp; Configure Winlogbeat&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To ensure that firewall rules don't interfere with Winlogbeat we can run the following command to add an outbound rule to Windows Firewall.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;New-NetFirewallRule&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-DisplayName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow Winlogbeat to Logstash"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Direction&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Outbound&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-RemotePort&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;5044&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Protocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;TCP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Action&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Allow&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download &lt;code&gt;Winlogbeat&lt;/code&gt; from &lt;a href="https://www.elastic.co/downloads/beats/winlogbeat" rel="noopener noreferrer"&gt;Winlogbeat downloads page&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract to &lt;code&gt;C:\Program Files\Winlogbeat&lt;/code&gt;. (&lt;em&gt;You might need to rename the downloaded directory to just Winlogbeat in order to avoid PATH TOO LONG errors.&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure &lt;code&gt;winlogbeat.yml&lt;/code&gt; by uncommenting the following lines and adding your Host machine's IP as:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;output.logstash&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;HOST_MACHINE_IP&amp;gt;:5044"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;winlogbeat.event.logs&lt;/code&gt; field specifies what feed to send to the &lt;strong&gt;Logstash&lt;/strong&gt; server. The default configuration covers a large variety of relevant logs so I left that unchanged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbfkbqh2nascedve5z6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbfkbqh2nascedve5z6i.png" alt="Winlogbeat configuration file" width="698" height="595"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install and Start Winlogbeat by running &lt;code&gt;PowerShell&lt;/code&gt; as Administrator and entering the following commands:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"C:\Program Files\Winlogbeat"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;Set-Execution-Policy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Unrestricted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;CurrentUser&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\install-service-winlogbeat.ps1&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nx"&gt;Start-Service&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;winlogbeat&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;Set-Execution-Policy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Restricted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;CurrentUser&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Ensure that the winlogbeat service is running by executing the following command in Powershell: &lt;code&gt;Get-Service winlogbeat&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34ia16i6hywstoti0cvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34ia16i6hywstoti0cvu.png" alt="Winlogbeat service running" width="347" height="170"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting Up ELK Stack on the Host Machine
&lt;/h2&gt;

&lt;p&gt;Now that logs are sent from the virtual machine to the host machine, we have to make sure that ElasticSearch, Logstash and Kibana are installed and configured to receive, index and display the logs in the host machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install Java JDK
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Download Java JDK and install it in the host computer.&lt;/li&gt;
&lt;li&gt;Set the JAVA_HOME environment variable to point to the &lt;code&gt;jdk&lt;/code&gt; directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Download &amp;amp; Install Elasticsearch
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download Elasticsearch from &lt;a href="https://www.elastic.co/downloads/elasticsearch" rel="noopener noreferrer"&gt;Elasticsearch downloads page&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract to &lt;code&gt;C:\Program Files\Elasticsearch&lt;/code&gt; (&lt;em&gt;You might need to rename the downloaded directory to just Elasticsearch in order to avoid PATH TOO LONG errors.&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure &lt;code&gt;elasticsearch.yml&lt;/code&gt; as:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;network.host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;0.0.0.0&lt;/span&gt;
  &lt;span class="na"&gt;http.port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;9200&lt;/span&gt;
  &lt;span class="na"&gt;discovery.type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;single-node&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Make sure to set security features to &lt;code&gt;false&lt;/code&gt; in order to use http instead of https which requires an SSL certificate.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start Elasticsearch as:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;C:\ELK\elasticsearch\bin&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\elasticsearch.bat&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Verify that &lt;code&gt;Elasticsearch&lt;/code&gt; has started by browsing to: &lt;code&gt;http://localhost:9200&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpu8s52n29t2y0ip946y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpu8s52n29t2y0ip946y.png" alt="Elasticsearch Default page" width="565" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If asked to signin, run the following command in &lt;code&gt;Powershell&lt;/code&gt; to generate a new password from the &lt;code&gt;/bin&lt;/code&gt; directory: &lt;code&gt;elasticsearch-reset-password -u elastic&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Download &amp;amp; Install Logstash (&lt;em&gt;Only Required when logs are to be parsed before being sent to Elasticsearch&lt;/em&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To ensure that firewall rules don't interfere with Logstash we can run the following command to add an inbound rule to Windows Firewall.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;New-NetFirewallRule&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-DisplayName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow Logstash"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Direction&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Inbound&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-LocalPort&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;5044&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Protocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;TCP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Action&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Allow&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download Logstash from &lt;a href="https://www.elastic.co/downloads/logstash" rel="noopener noreferrer"&gt;Logstash downloads page&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract to &lt;code&gt;C:\Program Files\Logstash&lt;/code&gt; (&lt;em&gt;You might need to rename the downloaded directory to just Logstash in order to avoid PATH TOO LONG errors.&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure &lt;code&gt;C:\Program Files\Logstash\config\logstash.conf&lt;/code&gt; as:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;  &lt;span class="n"&gt;input&lt;/span&gt; {
    &lt;span class="n"&gt;beats&lt;/span&gt; {
      &lt;span class="n"&gt;port&lt;/span&gt; =&amp;gt; &lt;span class="m"&gt;5044&lt;/span&gt;
      &lt;span class="n"&gt;ssl&lt;/span&gt; =&amp;gt; &lt;span class="n"&gt;false&lt;/span&gt;
    }
  }
  &lt;span class="n"&gt;output&lt;/span&gt; {
    &lt;span class="n"&gt;elasticsearch&lt;/span&gt; {
      &lt;span class="n"&gt;hosts&lt;/span&gt; =&amp;gt; [&lt;span class="s2"&gt;"http://localhost:9200"&lt;/span&gt;]
      &lt;span class="n"&gt;index&lt;/span&gt; =&amp;gt; &lt;span class="s2"&gt;"%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"&lt;/span&gt; 
      &lt;span class="n"&gt;user&lt;/span&gt; =&amp;gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;
      &lt;span class="n"&gt;password&lt;/span&gt; =&amp;gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start Logstash as: &lt;code&gt;C:\ELK\logstash\bin\logstash.bat -f C:\ELK\logstash\config\logstash.conf&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Download &amp;amp; Install Kibana
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download Kibana from &lt;a href="https://www.elastic.co/downloads/kibana" rel="noopener noreferrer"&gt;Kibana downloads page&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract to &lt;code&gt;C:\Program Files\Kibana&lt;/code&gt; (&lt;em&gt;You might need to rename the downloaded directory to just Kibana in order to avoid PATH TOO LONG errors.&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure &lt;code&gt;kibana.yml&lt;/code&gt; as:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;server.port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5601&lt;/span&gt;
  &lt;span class="na"&gt;elasticsearch.hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:9200"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Start Kibana as: &lt;code&gt;C:\ELK\kibana\bin\kibana.bat&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify that &lt;code&gt;Kibana&lt;/code&gt; has started by browsing to: &lt;code&gt;http://localhost:5601&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Create Index Pattern and validate logs in Kibana
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open Kibana at: &lt;code&gt;http://localhost:5601&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to &lt;code&gt;Management &amp;gt; Stack Management &amp;gt; Kibana &amp;gt; Data views&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create an data view: Enter a name ,&lt;code&gt;winlogbeat-*&lt;/code&gt; as the index pattern and select &lt;code&gt;@timestamp&lt;/code&gt; as the time filter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to Discover and select the name of the data view to view logs from the index pattern.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8xxaaumkq5f6z9sy7jf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8xxaaumkq5f6z9sy7jf.png" alt="Creating Data view in Kibana" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this guide, we have covered the essential steps to set up a Windows VM for log collection using the ELK Stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Successfully created and configured a Windows Virtual Machine.&lt;/li&gt;
&lt;li&gt;Enabled Windows Event Logging and configured auditing policies.&lt;/li&gt;
&lt;li&gt;Installed and configured Winlogbeat to forward logs to Logstash.&lt;/li&gt;
&lt;li&gt;Installed and set up the ELK Stack (Elasticsearch, Logstash, and Kibana) on the host machine.&lt;/li&gt;
&lt;li&gt;Verified and analyzed logs in Kibana.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next Steps and Enhancements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Implement alerting&lt;/strong&gt;: Use Kibana’s Watcher feature to create real-time alerts based on specific log patterns or anomalies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strengthen security&lt;/strong&gt;: Secure your ELK stack using TLS encryption and authentication to protect sensitive log data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create custom dashboards&lt;/strong&gt;: Develop tailored visualizations and dashboards in Kibana to monitor key performance indicators and security events.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expand log collection&lt;/strong&gt;: Integrate additional log sources such as Sysmon, PowerShell, and network traffic for comprehensive visibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqqxqdz4lix6r8smd1hb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqqxqdz4lix6r8smd1hb.png" alt="Final Project" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>elk</category>
      <category>cybersecurity</category>
      <category>learning</category>
      <category>security</category>
    </item>
    <item>
      <title>Cyber-Sentry: Building a Secure Honeypot Fortress with Azure Sentinel and Log Analytics Workspace</title>
      <dc:creator>Suprim Devkota</dc:creator>
      <pubDate>Tue, 02 Jan 2024 14:32:39 +0000</pubDate>
      <link>https://forem.com/suprimdevkota/cyber-sentry-building-a-secure-honeypot-fortress-with-azure-sentinel-and-log-analytics-workspace-47md</link>
      <guid>https://forem.com/suprimdevkota/cyber-sentry-building-a-secure-honeypot-fortress-with-azure-sentinel-and-log-analytics-workspace-47md</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Honeypots&lt;/strong&gt;, in the context of cybersecurity, are &lt;em&gt;decoys&lt;/em&gt; or sacrificial computers intended to lure in attackers. It mimics a potential target system and in doing so &lt;strong&gt;gains useful insights from the intrusion attempts of the hackers&lt;/strong&gt;. It may also be used to gain information about the mode of operation of the hackers or to distract them from real systems and make them focus their efforts on the decoy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ju8o7hdryp9adns5ph1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ju8o7hdryp9adns5ph1.jpg" alt="honeypot" width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
In this guide, we'll walk through the process of creating a honeypot using &lt;code&gt;Microsoft Azure&lt;/code&gt;. This involves setting up a virtual machine, configuring security measures, and leveraging &lt;code&gt;Azure Sentinel&lt;/code&gt; for visualizing geodata related to potential attacks. We'll also be exposed to the &lt;code&gt;Log Analytics Workspace&lt;/code&gt; in Azure and &lt;code&gt;Kusto Query Language (KQL)&lt;/code&gt; which will be used to query logs in the project.&lt;/p&gt;
&lt;h3&gt;
  
  
  Azure Account Setup
&lt;/h3&gt;

&lt;p&gt;To begin, create an Azure account using your college email (one ending in &lt;em&gt;&lt;code&gt;.edu&lt;/code&gt;&lt;/em&gt;), which provides $100 in free credits valid for a year.&lt;/p&gt;
&lt;h3&gt;
  
  
  Creating an Azure Virtual Machine
&lt;/h3&gt;

&lt;p&gt;Create an Azure Virtual Machine. For this project I used the Windows 10 x64 Pro image, equipped with 2 vCPUs, 8 GB memory. I also created an admin account. (Be sure to remember the password as it will be used later to log in to the VM remotely.)&lt;/p&gt;
&lt;h3&gt;
  
  
  Resource Group and Network Security Group
&lt;/h3&gt;

&lt;p&gt;In Azure, resources such as &lt;code&gt;VMs&lt;/code&gt; and &lt;code&gt;Log Analytics Workspaces&lt;/code&gt; can be group into a logical group which usually shares the same lifespan. This grouping of resources is called a &lt;strong&gt;&lt;code&gt;Resource Group&lt;/code&gt;&lt;/strong&gt;. Azure also allows us to establish and configure a &lt;code&gt;Network Security Group (NSG)&lt;/code&gt;, which serves as a virtual firewall. We will be allowing all traffic to the VM by setting source and destination as &lt;code&gt;*&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caution&lt;/strong&gt;: Setting &lt;code&gt;NSG&lt;/code&gt; configuration to allow all traffic is typically avoided for any resource you have on the cloud that is to be protected, but for the intent of our Honey Pot, this is ideal.&lt;/p&gt;
&lt;h3&gt;
  
  
  Log Analytics Workspace (LAW) and Microsoft Sentinel
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Log Analytics Workspace (LAW)&lt;/code&gt; provides a centralized for collecting and analyzing data in Azure. We will set it up to ingest logs, including Windows event logs and custom logs for geographic location. &lt;code&gt;Microsoft Sentinel&lt;/code&gt; will then connect to LAW to display geodata on a map. Set the &lt;code&gt;Microsoft Defender for Cloud&lt;/code&gt; to collect all events and connect &lt;code&gt;LAW&lt;/code&gt; to the &lt;code&gt;VM&lt;/code&gt; for data collection.&lt;/p&gt;
&lt;h2&gt;
  
  
  Visualizing Geodata with Microsoft Sentinel
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Remote Desktop Connection
&lt;/h3&gt;

&lt;p&gt;Obtain the public IP address of the VM and connect via &lt;code&gt;Remote Desktop Connection&lt;/code&gt; app in your system using the admin account credentials you created while setting up the VM. Inside the VM, turn off the firewall and verify by pinging its public IP from your machine.&lt;/p&gt;
&lt;h3&gt;
  
  
  Analyzing Event Logs
&lt;/h3&gt;

&lt;p&gt;You can then explore the Event Viewer to identify failed login attempts (Event ID: 4625). This event id will be helpful when filtering records using &lt;code&gt;KQL&lt;/code&gt; later.&lt;/p&gt;
&lt;h3&gt;
  
  
  Geolocating IP Addresses
&lt;/h3&gt;

&lt;p&gt;If you look closer at the event log, you'll see that it only contains the source IP address for the failed login attempt. Since we eventaully need to plot the IP address, we'll need some way to convert this IP address into geological data. For this we'll use &lt;code&gt;ipgeolocation.io&lt;/code&gt;'s API to obtain geographical information for the IP addresses. This API is useful as it gives us Lattitude, Longitude, Country and similar information.&lt;/p&gt;

&lt;p&gt;We'll use a powershell script for extracting the data from the &lt;code&gt;Windows Event Logs&lt;/code&gt; and using the API key we'll convert the IP address to geological data. &lt;/p&gt;
&lt;h3&gt;
  
  
  Creating Custom Log in LAW
&lt;/h3&gt;

&lt;p&gt;Fortunately for us, we can simply copy the custom log powershell script from &lt;a href="https://github.com/joshmadakor1/Sentinel-Lab/blob/main/Custom_Security_Log_Exporter.ps1" rel="noopener noreferrer"&gt;https://github.com/joshmadakor1/Sentinel-Lab/blob/main/Custom_Security_Log_Exporter.ps1&lt;/a&gt;. This script basically continuously monitors and export failed login attempts to &lt;code&gt;failed_rdp.log&lt;/code&gt;. Take care to replace the API key with a new key from &lt;code&gt;ipgeolocation.io&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In Azure, create a custom log in LAW by uploading the &lt;code&gt;failed_rdp.log&lt;/code&gt; file. This will take some time to fully upload however it will train the &lt;code&gt;LAW&lt;/code&gt; to parse our custom log.&lt;/p&gt;
&lt;h3&gt;
  
  
  Extracting Fields using KQL
&lt;/h3&gt;

&lt;p&gt;To visualize the data collected in &lt;code&gt;LAW&lt;/code&gt;, we'll use a new workbook in &lt;code&gt;Microsoft Sentinel&lt;/code&gt;. Further, we'll employ &lt;code&gt;Kusto Query Language (KQL)&lt;/code&gt; to extract relevant fields from the raw custom log data which will be used by Azure Sentinel to plot the intrusion attempts. For this use the query below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FAILED_RDP_WITH_GEO_CL
 |extend username = extract(@"username:([^,]+)", 1, RawData),
         timestamp = extract(@"timestamp:([^,]+)", 1, RawData),
         latitude = extract(@"latitude:([^,]+)", 1, RawData),
         longitude = extract(@"longitude:([^,]+)", 1, RawData),
         sourcehost = extract(@"sourcehost:([^,]+)", 1, RawData),
         state = extract(@"state:([^,]+)", 1, RawData),
         label = extract(@"label:([^,]+)", 1, RawData),
         destination = extract(@"destinationhost:([^,]+)", 1, RawData),
         country = extract(@"country:([^,]+)", 1, RawData)
 |where destination != "samplehost"
 |where sourcehost != ""
 |summarize event_count=count() by timestamp, label, country, state, sourcehost, username, destination, longitude, latitude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query basically extracts username, timestamp, latitude, longitude, sourcehost, state, label, destination and country from the raw log data and filters it to exclude the initial training data. It also summarizes event count by the extracted fields.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following these steps, we've successfully set up a honeypot in Microsoft Azure, configured logging, and visualized geodata using Azure Sentinel. This comprehensive approach allows you to monitor and analyze potential security threats effectively. The intrusion map I obtained after letting the VM run for a couple of days is shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnxx7q1vsbtn0ct1x0k9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnxx7q1vsbtn0ct1x0k9q.png" alt="Failed RDP World Map" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>azure</category>
      <category>kql</category>
    </item>
    <item>
      <title>Web Vulnerabilities: SQL Injections</title>
      <dc:creator>Suprim Devkota</dc:creator>
      <pubDate>Mon, 11 Dec 2023 10:56:58 +0000</pubDate>
      <link>https://forem.com/suprimdevkota/sql-injections-k3h</link>
      <guid>https://forem.com/suprimdevkota/sql-injections-k3h</guid>
      <description>&lt;p&gt;&lt;em&gt;SQL injection (SQLi) is a web security vulnerability that allows an attacker to interfere with the queries that an application makes to its database.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Impacts&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unauthorized access to sensitive data such as passwords, credit card details and personal user information.&lt;/li&gt;
&lt;li&gt;Reputational damage and regulatory fines.&lt;/li&gt;
&lt;li&gt;Possibility of attacker gaining a persistent backdoor into an organization’s systems.&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;&lt;strong&gt;What parts of a &lt;code&gt;SQL query&lt;/code&gt; can be injected?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Common in &lt;code&gt;WHERE&lt;/code&gt; clause of &lt;code&gt;SELECT&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;UPDATE&lt;/code&gt; statements, within the updated values or the &lt;code&gt;WHERE&lt;/code&gt; clause.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;INSERT&lt;/code&gt; statements, within the inserted values.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;SELECT&lt;/code&gt; statements, within the table or column name.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;SELECT&lt;/code&gt; statements, within the &lt;code&gt;ORDER BY&lt;/code&gt; clause&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;&lt;strong&gt;Detection mechanisms&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Submit a single quote character &lt;code&gt;'&lt;/code&gt; and look for errors and other anomalies.&lt;/li&gt;
&lt;li&gt;Boolean conditions such as &lt;code&gt;OR 1=1&lt;/code&gt; or &lt;code&gt;OR 1=2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Payloads designed to trigger time delays such as &lt;code&gt;' OR '1'='1' AND SLEEP(5) --&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Comments with &lt;code&gt;--&lt;/code&gt; at the end of an injection.&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Retrieving hidden data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine a shopping application that displays products in different categories. When the user clicks on the &lt;strong&gt;Gifts&lt;/strong&gt; category, their browser requests the URL: &lt;code&gt;https://insecure-website.com/products?category=Gifts&lt;/code&gt; and causes the application to make a SQL query to retrieve details of relevant products from the data base as:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Gifts'&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;released&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This is vulnerable to SQL injection as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Payload = Gifts'-- shows gifts released or not&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Gifts'&lt;/span&gt;&lt;span class="c1"&gt;--' AND released = 1&lt;/span&gt;

&lt;span class="c1"&gt;--Payload = Gifts' OR 1=1-- shows all items released or not&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Gifts'&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;--' AND released = 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;em&gt;&lt;code&gt;CAUTION&lt;/code&gt;: When injecting the condition &lt;code&gt;OR 1=1&lt;/code&gt; it’s common for applications to use data from a single request in multiple different queries. So if the condition reaches an &lt;code&gt;UPDATE&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt; statement, it can result in accidental data loss.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subverting application logic&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine an application that lets users login with a username and password. The application checks the credentials by performing an SQL query as follows and if the query returns details of the user, login is successful else it is rejected.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'wiener'&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'bluecheese'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This is vulnerable to injection as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="cm"&gt;/*payload = administrator'-- allows the attacker to log in as any user
without need for password*/&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'administrator'&lt;/span&gt;&lt;span class="c1"&gt;--' AND password = ''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This query returns user whose &lt;code&gt;username&lt;/code&gt; is &lt;code&gt;administrator&lt;/code&gt; without the need for a password.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;UNION attacks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine an application executes the following query containing the user input &lt;code&gt;Gifts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Gifts'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This is vulnerable to injection as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UNION&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="c1"&gt;--&lt;/span&gt;

&lt;span class="c1"&gt;--The malicious SQL query would then be:&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; 
&lt;span class="k"&gt;UNION&lt;/span&gt; 
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="c1"&gt;--&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This causes the application to return all usernames and passwords along with the names and descriptions of the products. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Blind &lt;code&gt;SQL&lt;/code&gt; injection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most &lt;code&gt;SQLi&lt;/code&gt; are blind in nature but can still be exploited to gain unauthorized data. Some techniques are:&lt;/p&gt;

&lt;p&gt;a.  &lt;em&gt;Divide by zero&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; 
    &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="c1"&gt;--'&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;b. &lt;em&gt;Triggering time delays with &lt;code&gt;SLEEP()&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


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

&lt;p&gt;&lt;strong&gt;Prevention against SQL Injection using Prepared Statements or Parameterized Queries&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They make SQL injections virtually impossible.&lt;/li&gt;
&lt;li&gt;Prepared statements separate code from data by ensuring that user-supplied input does not alter your program’s logic.&lt;/li&gt;
&lt;li&gt;Prepared statements are compiled by the SQL server before adding user input.&lt;/li&gt;
&lt;li&gt;Anything that is not part of the prepared statements is treated as string data and not as an executable SQL query.
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Create MySQL server and store username and password in variables.&lt;/span&gt;
&lt;span class="nv"&gt;$mysqli&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;mysqli&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mysql_host"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mysql_username"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mysql_password"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"database_name"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$_POST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nv"&gt;$password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$_POST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"password"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// Vulnerable SQL statement&lt;/span&gt;
&lt;span class="nv"&gt;$vuln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"SELECT Id FROM Users WHERE Username='&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;' AND Password='&lt;/span&gt;&lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="s2"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$mysqli&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vuln&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Safe prepared statement&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$mysqli&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT Id FROM Users WHERE Username =? AND Password =?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;bind_param&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ss"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Unsafe prepared statement&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$mysqli&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT Id FROM Users WHERE Username='&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;' AND Password=password'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




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

</description>
      <category>cybersecurity</category>
      <category>learning</category>
      <category>sql</category>
      <category>exploit</category>
    </item>
    <item>
      <title>Exploit Development: Buffer Overflows</title>
      <dc:creator>Suprim Devkota</dc:creator>
      <pubDate>Fri, 24 Nov 2023 06:13:32 +0000</pubDate>
      <link>https://forem.com/suprimdevkota/exploit-development-buffer-overflows-2ika</link>
      <guid>https://forem.com/suprimdevkota/exploit-development-buffer-overflows-2ika</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Let’s say you have a candy jar with a capacity for 10 candies. Each candy represents a piece of data. Now, let’s say you have a friend who loves to share candies with you.&lt;/p&gt;

&lt;p&gt;In a world without proper checks, your friend might get excited and decide to share 15 candies with you, not realizing the jar can only hold 10. As a result, candies spill out of the jar, making a mess. In the realm of computer security, this overflow of candies is similar to a buffer overflow, where data spills beyond the allocated space, potentially causing chaos and security vulnerabilities.&lt;/p&gt;

&lt;p&gt;To understand buffer overflows we have to first look at the anatomy of memory in the computer and the organization of stack in said memory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwu4mr6yi4vigbqayiui.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwu4mr6yi4vigbqayiui.jpg" alt="Anatomy of Memory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A buffer overflow attack is exploited when the data sent to the buffer overflows the Buffer Space into the &lt;code&gt;Extended Instruction Pointer (EIP)&lt;/code&gt; which contains the address of the next instruction to be executed. Changing the value in this &lt;code&gt;EIP&lt;/code&gt; register to point to malicious code is the crux of the whole exploit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps involved in a buffer overflow attack
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Finding the vulnerable service by spiking&lt;/strong&gt;: &lt;em&gt;Spiking&lt;/em&gt; involves sending various input values to the target service to identify potential vulnerabilities. This helps in understanding how the service behaves under different conditions and if it reacts unexpectedly to certain inputs. Identifying a service that exhibits abnormal behavior or crashes in response to specific inputs might indicate a potential buffer overflow vulnerability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fuzz the service&lt;/strong&gt;: &lt;em&gt;Fuzzing&lt;/em&gt; is the process of sending a large number of random or specially crafted inputs to the target service to observe its response. This helps in discovering points of failure or unexpected behavior. Fuzzing aims to trigger any unexpected responses or crashes that may indicate the presence of a buffer overflow vulnerability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Obtain the offset address of the &lt;code&gt;EIP&lt;/code&gt;&lt;/strong&gt;: Once a buffer overflow is identified, the next step is to determine the offset at which the &lt;code&gt;Extended Instruction Pointer (EIP)&lt;/code&gt; is overwritten. This involves sending input with a pattern and analyzing the crash to find the distance from the start of the buffer to the overwritten &lt;code&gt;EIP&lt;/code&gt;.Purpose: Knowing the offset is crucial for crafting the payload to precisely overwrite the &lt;code&gt;EIP&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Overwrite the &lt;code&gt;EIP&lt;/code&gt;&lt;/strong&gt;: Craft a payload to overwrite the EIP with a controlled value, typically pointing to the location of the attacker’s shellcode. By controlling the &lt;code&gt;EIP&lt;/code&gt;, the attacker can redirect the program’s execution to the injected malicious code instead of following the normal flow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Find bad characters&lt;/strong&gt;: Identify characters that may interfere with the proper execution of the payload, such as null bytes &lt;code&gt;(/x00)&lt;/code&gt; or other characters that might be altered during transmission. This ensures that the payload doesn’t contain characters that could disrupt the execution of the exploit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Find the right module&lt;/strong&gt;: Identify the module or library in the target process that can be used to execute the payload. This often involves locating a module with a memory address that remains consistent across different executions of the program. Determining a reliable module helps in crafting the exploit to ensure stability and effectiveness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generate Shellcode&lt;/strong&gt;: Create a payload, often in the form of shellcode, which is a small piece of code that performs a specific action, such as spawning a shell or providing remote access. The shellcode is the actual payload that the attacker wants to execute on the target system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gain Root!&lt;/strong&gt;: Execute the crafted exploit to take control of the target system, typically by escalating privileges to gain root access or the highest level of control. This is the ultimate objective, allowing the attacker to manipulate the system as desired.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Buffer Overflow Safeguards and Prevention
&lt;/h3&gt;

&lt;p&gt;Runtime bounds checking makes it theoretically impossible for a buffer overflow to happen by checking whether the space in a buffer is enough to accomodate the incoming data. This is the reason why languages such as &lt;code&gt;Python&lt;/code&gt; and &lt;code&gt;Java&lt;/code&gt; implement it.&lt;/p&gt;

&lt;p&gt;However there are also performance costs associated with this method as extra computation has to be done every time an element is to be inserted. This is the reason why languages such as &lt;code&gt;C&lt;/code&gt; and &lt;code&gt;C++&lt;/code&gt; do not implement it and hence why programs written in these languages are vulnerable to overflows.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>learning</category>
      <category>security</category>
    </item>
  </channel>
</rss>
