<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sidharth Sunil Menon on Medium]]></title>
        <description><![CDATA[Stories by Sidharth Sunil Menon on Medium]]></description>
        <link>https://medium.com/@sidharthsmenon?source=rss-b89f41dd1f14------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sGw3ErsETnG5h9Obk200PQ.png</url>
            <title>Stories by Sidharth Sunil Menon on Medium</title>
            <link>https://medium.com/@sidharthsmenon?source=rss-b89f41dd1f14------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:45:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sidharthsmenon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Honeypot to Honeynet: Building a Multi-Source Azure Sentinel Lab]]></title>
            <link>https://sidharthsmenon.medium.com/from-honeypot-to-honeynet-building-a-multi-source-azure-sentinel-lab-d20750350eff?source=rss-b89f41dd1f14------2</link>
            <guid isPermaLink="false">https://medium.com/p/d20750350eff</guid>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Sidharth Sunil Menon]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 18:17:39 GMT</pubDate>
            <atom:updated>2025-11-30T22:31:17.552Z</atom:updated>
            <content:encoded><![CDATA[<p>My first Azure Sentinel project was a simple honeypot, which consisted of one vulnerable Windows VM exposed to the internet, with failed RDP attempts flowing into a Log Analytics workspace and visualized in a Sentinel workbook as a world map of attacker activity. [If you’re curious, here is the <a href="https://sidharthsmenon.medium.com/azure-sentinel-honeypot-threat-analysis-d92ad9263f8a">project link</a>].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*sk3A8TsJz4Lw5fVR0K-weg.png" /><figcaption>Note: This diagram was created using Lucidchart (lucid.app)</figcaption></figure><p>This time, I’m leveling it up from a honeypot to a honeynet by using 3 VMs instead of one, including a dedicated attacker VM to simulate repeatable attacks on demand. Alongside host attacks, I’m also ingesting Azure AD, Storage, Key Vault, and subscription activity logs into the same workspace, further widening the threat analysis scope.</p><p>We start by configuring the first Windows VM with the Windows 10 Enterprise image. The resource group for our honeynet setup [Honeynet-RG] is also created and associated with the VM in this step.</p><pre>Note: It is recommended to set the VM&#39;s size to a minimum of 2 vcpus to<br>avoid performance issues.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*09_d3qrk2KPbnZwkHp_CWA.png" /></figure><p>In the ‘Networking’ pane, configure the virtual network for our setup [honeynet-vnet in this case] and keep the settings as per the screenshot below. Post this step, the VM can be created without making any changes.</p><pre>The warning below the inbound ports dropdown indicates that all external<br>IP addresses are allowed to hit the RDP port of the VM by default. In an<br>ideal scenario, this must be restricted to &#39;My IP&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*RGOg6rgR6dJoLdQk5KMt0Q.png" /></figure><p>Similarly, create the Linux VM with the Ubuntu image as shown below. Make sure that the VM is associated with the same resource group as the Windows VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*inm5JI1ovcUj6Qd7AqxRqQ.png" /></figure><p>In the networking pane, select the same VNet as that of the Windows machine and proceed to create the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*p5g12uOZFu_YfMA05wtZfQ.png" /></figure><p>Now that our two ‘victim’ VMs are created, navigate to the Network Security Group configuration screen for the Windows VM and delete the existing RDP inbound rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*j39wTfCJDM5y4kkDMkGtfg.png" /></figure><p>In its place, create a new inbound rule that allows any source to hit destination, as shown below:</p><pre>Note: This rule allows any external entity to access any port within the VM.<br>This must not be replicated in any non-test environment.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*CVZRkyOzreFTlD62C7RJZA.png" /></figure><p>Similarly, replicate the same steps for Linux VM NSG, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*2xh1GTPgrQrYjAWDxVX4HA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*2ljoIbAoQsY4Tn2RgBx3Hw.png" /></figure><p>When attempting to ping the windows VM with its public IP, it is observed that the request is timing out. This indicates that the firewall within the Windows VM is still active and preventing external connections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*N8NiSJBf1XwJSr9i8Cj-1w.png" /></figure><p>To investigate further, RDP into the Windows VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*9pRAPxyJ0fY32HRv1IpT4g.png" /></figure><p>Set up the Windows VM as desired. I’d recommend turning off all the settings as shown below to improve the VM’s performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kj-QCFB-2Tr4XhXBWFlPbw.png" /></figure><p>Once set up, open the Windows Firewall</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*V_Mmd2JlWb9BbHry5rwg5A.png" /></figure><p>Open the Windows Defender Firewall Properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzO0L0Ehavk93YSXhzgo9A.png" /></figure><p>Here, set the firewall state to ‘off’ for the domain, private as well as public profiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*O54jGPNQOj1NGUOmywvq6g.png" /></figure><p>Once this is done, proceed to download MS SQL Server from Microsoft’s website and follow the installation steps as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOvuqbaYY9f8TFVdvbRU4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*3ZbEJYeB1c4_H4wxKwLPag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*1hjJUTO0yfQkVdbFJGBJMg.png" /></figure><p>Once installed, click on ‘Open Folder’, mount the ISO file and perform the setup process as per the screenshots below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*AYG3s7-Merz4DPK-X0_M9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*gWp_MNc5pWo1xxoTghiUog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*-9XMzcgBPx8mJQGCfVFeOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*3PUsKKmXslCUyk43OVWXyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*ibS9F5-MBJxl2xFAmIo5eg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*MEyZLcE_YHuNvwveZgxCeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*X7xclNzMa8hRgQ0KQdDRnw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*Pm6vjEjpSuBUFbaRRWvLHQ.png" /></figure><p>Set the credentials for the ‘sa’ admin account and add the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*j-rGGZOqgI8yV34tWRlENA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*iFLphSjEXRL0D1NoCNFYjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*Vc8cWgczGevEHafsgw8sLw.png" /></figure><p>Once this is done, proceed to install the SQL Server Management Studio, which we will use to connect and interact with the SQL server instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITMFhTwYpnfnwRi7CIk4Uw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*kZPLZNrLWdiEDwNolz7MOQ.png" /></figure><p>Now, open Event Viewer and navigate to the Security Tab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*OIgOh0064PRuMvux8aXk-Q.png" /></figure><pre>As you can see below, failed login attempts have already started to <br>rack up due to the vulnerable configuration of the Windows firewall <br>as well as the NSGs.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*If-Pe9bitmzGDiGnDbA2gA.png" /></figure><p>However, in addition to this, we would also want the MS SQL authentication logs to be captured in Event Viewer. To achieve this, we can follow the below article from Microsoft:</p><p><a href="https://learn.microsoft.com/en-us/sql/relational-databases/security/auditing/write-sql-server-audit-events-to-the-security-log?view=sql-server-ver16">Write SQL Server Audit events to the Security log - SQL Server</a></p><p>Open Registry Editor, navigate to the below path, and make the necessary changes as per the screenshots below:</p><pre>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*ocxEnn3zmOla5DxKevp1TQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*AOBI-vJKzvZm4902ZjTBzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*BIBf7a9AbzpEPhpoxSMggg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*ugdwhA831tLMrcne4Sm8nA.png" /></figure><p>Additionally, execute the below command on CMD to configure the audit object access</p><pre>auditpol /set /subcategory:&quot;application generated&quot; /success:enable /failure:enable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*DzBEeWurUfxZ6wZi-fhRQg.png" /></figure><p>Then, launch the SQL Server Management Studio and connect to the SQL server using the configured credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*OJ_H9KlAdFdnBuwebtJyxA.png" /></figure><p>Once connected, navigate to Properties -&gt; Security and ensure that login auditing is set to both failed and successful logins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*rnnjLR84r8mxZ6wZXT5nTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*7vISit03GrNSiy-UVJAiMQ.png" /></figure><p>After this, to generate some security events, disconnect from the database and re-connect using incorrect credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*AbMD1wSbJtbXuiGJDXAbPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*3eSQ7T87tMzr2XUpbVO-FQ.png" /></figure><p>As you can see below, logs pertaining to the SQL server have now started to populate within the Windows Event Viewer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDfgB89Yp8-XvYjKP-bZ2g.png" /></figure><p>Now, let’s proceed to create the Attacker VM. A new resource group is created for this VM and it is placed in a separate region to solidify its status as an external entity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*96uBTtzO12KGiVw_kDIIYA.png" /></figure><p>The attacker VM is also placed in a separate VNet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*r4wQ_Ci5Iq8QWD9DivBZqA.png" /></figure><p>RDP into the attacker machine and set it up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*7FR-z_qZfKWDCxnJ41S4pQ.png" /></figure><p>Now, attempt to RDP into the ‘victim’ windows machine using incorrect credentials to rack up security events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*szrraLphBfiHHWwfCNBY7g.png" /></figure><p>Similarly, perform the same for the victim PC’s SQL server instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*bNJHissbZvNKNiz2HYApZQ.png" /></figure><p>Additionally, authentication with improper credentials via SSH is attempted for the Linux VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*np3t95guwnp-JcViyNbulA.png" /></figure><p>Revisiting the Event Viewer on the vulnerable VM, it can be observed that multiple login attempts are being made within a span of seconds!</p><pre>I ideally wanted to showcase our deliberate failed authentication attempts<br>here, but the external events were so many that it was impossible to dig them<br>out.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*ji28UkqFJUn5KF_vGc0Ipg.png" /></figure><p>Connect to the Linux VM and navigate to /var/log. Return the content of the file titled ‘auth.log’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*L3sjOoP_WkBvRLForlhb2Q.png" /></figure><p>As you can see, there are multiple entries within this file already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*jMmeZqgo9p_TW_Er_5N3ww.png" /></figure><p>Failed login attempts can be segregated from the rest by filtering out the ‘password’ keyword. It was observed that majority of the attempts were made with usernames such as ‘admin’ and ‘root’, as they are usually associated higher privileged accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*iEEau5QpdOXgIYRGUdJZHQ.png" /></figure><p>The keyword ‘deliberate’ was used to filter out our intentional failed login attempts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*Ws6K8NJ0nVhNpysSoxb2PA.png" /></figure><p>Our goal is to consolidate the logs received from all sources into the Azure Log Analytics Workspace, which will then thread it through to Sentinel</p><p>To achieve this, create a Log Analytics Workspace and map it to our resource group, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*fM2plGs3YxqADoE80v36iQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*ZeRP1FyqZHNuGLJONC3HTQ.png" /></figure><p>Next, go into Sentinel, select the workspace and create a new watchlist as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*dZJSnwiwq8mQJ0AzLbX3NQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*9mHudfdaQDI8GWh8ljnyqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*DvFyaTWFu2vXxIc0_HVEJQ.png" /></figure><p>Ensure that the watchlist is titled ‘geoip’, as the file that we would be uploading in the next step has a dependency on this keywork.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*UOVnvjFXoKUicM4NN_hUHg.png" /></figure><p>In the ‘Source’ page, upload the CSV file which can be downloaded from <a href="https://github.com/sidsmenon/azure-sentinel-multi-source-honeynet/blob/main/geoip-summarized.csv">here</a>, and set all the other fields as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d5xl5P5FYsehlcAZFJ4Ltg.png" /></figure><p>Once created, the watchlist will take around 20–30 minutes to populate all of the content</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*CR6NUmFFxQRx4Mp6TxqbOg.png" /></figure><p>Meanwhile, navigate to the Log Analytics Workspace -&gt; Logs and attempt to query the watchlist logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*sVhqFZ4uyU0ZOreCowRT_w.png" /></figure><p>As you can see below, upon entering the ‘_GetWatchlist(“geoip”)’ query, the associated entries were returned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*pJ9VwDH-jN89iXCq5LJC_g.png" /></figure><p>Now, to facilitate the collection of logs, navigate to Microsoft Defender for Cloud, click on the subscription and configure the respective settings as per the screenshots below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sh8l28yseR5GCsv0dM68ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NjbLpXdMPCkHRFCxx_m_Yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8kntij8TfEitNLYUryYDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20_KQO03yIYfUvDcfR-gog.png" /></figure><p>Then, navigate back to Environment Settings, click on the Log Analytics Workspace, and make the necessary changes as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YTyrj1NX1NxsVim7oJAu2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lROR1LZS1685YZylv3gG5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*P924r6jkRzzs9SVBaH-DBw.png" /></figure><p>To enable the capture of Windows Security Event logs within Azure, we must install a plugin from the Content Hub within the Defender portal. This can be performed as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JFAWigoKB339d-rtUAJd7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*tR1cbTJwE9GzVF-D9PJAuw.png" /></figure><p>Once installed, navigate to Microsoft Sentinel -&gt; Data Connectors -&gt; Windows Security Events via AMA -&gt; Open connector page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rg4vShmzYdtYWZHRBKu45A.png" /></figure><p>From this screen, create a data collection rule that will allow us to collect all security events from the Windows VM as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*VaZiRcRc_OQaMb7g-wJKmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2YZZcdamFx19sc8xfV5nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7QeiqqEWEdVQfSG7hgD1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*WI3AKNqsYLUCPEfsl9cGQQ.png" /></figure><p>Once this is done, navigate back to Environment settings, click on the Azure subscription.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*DQN7FFKu_ZyvakNOPt1Ucw.png" /></figure><p>Configure the continuos export setting as per the screenshot below, and click on Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*zCEF7LpENhzbFVMBrCVDXA.png" /></figure><p>To further bolster ourarray of logged services, navigate to the Storage Centre and create a new storage account as per the screenshots below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*3Wsbk3OHpBhJNI5Hft-A-A.png" /></figure><p>Ensure that the storage account name is unique.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*zYCUn6lGDE5ETPPcznY4vg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*_4C8BimyL9aFFiVHUd06mQ.png" /></figure><p>Our next goal is to configure NSG flow logs, wherein Sentinel will analyze the traffic flowing through the VMs’ NSGs and highlight suspicious traffic.</p><p>To do so, navigate to network security groups -&gt; &lt;The windows VM NSG&gt; -&gt; NSG flow logs and click on Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A7pEdiV5cO_EJAPaeY6I7A.png" /></figure><p>Proceed to create the flow logs as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*nojZOEerqFRprbmKba2u9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*PPCh5DHi_vJKmaMbd4xtCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*ghMA3ojfF5EzKluxYpFAhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*N1gQpnWwQmG2-x3S67V8QA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*5ViWGbTTpVhdSVGp8BDR8g.png" /></figure><p>Now that that is done, we must create a data collection rule within the Log Analytics Workspace which will allow us to pull the necessary logs from both VMs for further analysis.</p><p>To do so, navigate to the Log Analytics Workspace -&gt; Agents and proceed to configure and create the respective source and destination for the data collection rule as per the screenshots below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*xIw2IVsFnZorhe4hbaBk8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*axM_GEkXEKr8Q7lOAkwMzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*bsl38Y7dLiNrc17IV-rRoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zy9r2VjNN-fkkf7AFKySA.png" /></figure><p>From the Linux Syslog source, we just require the authentication logs for the purpose of this lab. All other log types can be set to none as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R_GQXaRPpFs8DL5AvO1tFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SB-PzWo44_QACYpjsmtKjw.png" /></figure><p>Similar to Linux Syslog, configure the Windows Event Logs data source as per the screenshots below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*nLoe2VGtHAoa-nOHC1uNDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hVRy9RWBQDZNS8r7b4ZnZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*2wF9gNYwfjVuaNoUxrxsBA.png" /></figure><p>To incorporate some additional events into our logging repertoire, navigate back to the data collection rules page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*yN7-6_71Li3WSUQlfU26rQ.png" /></figure><p>From here, navigate to Data sources -&gt; Windows Event Logs, and add the below XPath query as per the screenshot below:</p><p>This XPath query is used to enable Windows Defender malware detection</p><pre>Microsoft-Windows-Windows Defender/Operational!*[System[(EventID=1116 or EventID=1117)]]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xCgTLf-1PXHMNH7nzY5IOw.png" /></figure><p>Similarly, add the below additional query and click on ‘Save’.</p><p>This XPath query is used to configure Windows Firewall tampering detection.</p><pre>Microsoft-Windows-Windows Firewall With Advanced Security/Firewall!*[System[(EventID=2003)]]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EcG1TsuKVGxb_QuJGt6m-Q.png" /></figure><p>Now that the ‘Windows Event Logs’ data collection rule has been configured, we are able to successfully query them in the Log Analytics Workspace using the ‘SecurityEvent’ query, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x91MkB1fNcwZKVmPiCRpGA.png" /></figure><p>Our next step is to add Active Directory to our collection of services that will be logged.</p><p>To do so, navigate to Entra ID -&gt; Diagnostic settings and add the diagnostic setting as per the screenshots below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*nW64n8_w169Sq-CAMPYYwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*97fRzAK-XyiNG-CG9sxf-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*SIjzcNzxLyQvtMt46ri2xg.png" /></figure><p>This enabled us to query AD related activity such as Sign-ins using the ‘SigninLogs’ query.</p><pre>Note: The below screenshot shows no results as the diagnostic setting has<br>just been created and we are yet to perform any AD specific activity. </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OjAmYfxlPZMX5_0uCumPWQ.png" /></figure><p>To populate some AD-specific logs, Navigate to Entra ID and create a user as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJ0dKRLws-1KJhE-s7Y8Gw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XccX-kOpjp7kqaLKYtcarA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ICTmxR1FaQXKGrzbmIMV6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JsqRBebDqv302NfEYTVO0g.png" /></figure><p>Once created, assign global administrator user privileges to this user as per the screenshot below (only to showcase that it will be logged).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0VVSb12ca-9WAcmz4mzS6w.png" /></figure><p>Now, to generate some authentication events, deliberately attempt to authenticate into our newly created user with the incorrect credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vm9EOIix1jZ-L2ecjUFO7Q.png" /></figure><p>After a few incorrect attempts, authenticate using the right credentials</p><pre>Note: We are being asked to set a new password as this is our first<br>login.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gr9HeY-Q_i1vhVwJ-HmwOg.png" /></figure><p>Now, when we query ‘SigninLogs’ again, it is observed that the logs pertaining to the above steps have now been populated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ze2VkU9zJKCM60idbOwrOw.png" /></figure><p>Expanding on these logs will reveal parameters such as the event type and the affected user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SRBnnvLrSibFagbMeeuj5Q.png" /></figure><p>Similarly, ‘AuditLogs’ can be queried to retrieve events such as the creation / deletion of users as well as the assignment of privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwIgvCte3ETSovLD-jxaFA.png" /></figure><p>I would highly recommend to go through each entry of these logs in order to obtain a deeper understanding about the various parameters that are captured for each event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fBhpsmDAbE8L3Qwc0eftEA.png" /></figure><p>Furthering our quest to capture more logs, navigate to Azure Monitor -&gt; Activity Log -&gt; Export Activity Logs</p><p>Azure Monitor logs include subscription level changes such as the creation / deletion of resource groups, so it is a neat addition to have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-ip6ZCdSiWrg9sbK16c8w.png" /></figure><p>From here, create a diagnostic setting as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZ5UCGt7bwtOH9j-qjqZdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RlEMW96SaUEZBgO2IfT_7w.png" /></figure><p>Logs pertaining to Azure Monitor can be queried using the ‘AzureActivity’ query.</p><pre>Note: The logs are yet to populate as no subscription level change has been<br>performed yet.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-FSt-UwPvsYXMGQRa6oQw.png" /></figure><p>To populate Azure Monitor logs, proceed to create and remove a resource group as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGoatBjR8SowFhp_Ad6mNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXDKPEXa5MVzRLqKkYAI2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mH1rSvFAITd1ddNtZCezA.png" /></figure><p>When we re-run the query, we can see that the above performed events have been populated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cSpGoAlXDWUU9ngXqdWxw.png" /></figure><p>Our next step is to create a diagnostic setting for the storage account that we had previously created. This can be performed using the blob storage resource as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fcZffUOBUiaHy8OvGHqoVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hl0xh-RPyXubV3FswDPnw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BdrbnaMrgfGh3GCfNOPyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_sVbcGBwqIUSxFKiFjkUAg.png" /></figure><p>Now that the diagnostic setting has been created, follow the below step to create a test container so as to generate blob logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-1fUIxO5iqbm1cg2Y3Cwjg.png" /></figure><p>As shown below, we are now able to query the blob logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*-UqqnRp1uoniA0k64goQew.png" /></figure><p>Activities pertaining to the management of authentication keys and secrets are considered to be extremely sensitive. This makes it essential to configure the logging of such activities.</p><p>To achieve this, create an Azure Key Vault as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZyDACQgEINEzc2MBduVTzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zX-GVgee45B3ddITOdtEzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unMqWQNm5NbSnIUFBTtO6w.png" /></figure><p>Once created, create a Secret within the key vault as per the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nUsQSL99RQjapWSTmK_6Dg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJqINs0CPAixCRWVZxMXfg.png" /></figure><p>Even the act of showing the secret value will be captured in the respective logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjNAiUXX-tPLTst2mlHOvA.png" /></figure><p>In some cases, the logs may take a while to populate, as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a6ZCkH8OsGhl2DB01rWCzA.png" /></figure><p>Now, our final task is to configure our Microsoft Defender workbooks so as to visualize all of our attacks in a single pane of glass.</p><p>To do so, navigate to Sentinel -&gt; &lt;The honeynet log analytics workspace&gt; and access the Defender portal.</p><pre>In the previous iteration of this project, Sentinel workbooks could be<br>configured within the Azure portal itself. Now, Microsoft has shifted<br>this functionality to a standalone Defender portal. This highlights the<br>importance of staying up-to-date with the changes that are made to a<br>product in order to prevent any disruptions in the business workflow.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMOKlbfhexn6HG3Ck3XanQ.png" /></figure><p>Within the Defender Portal, click on ‘Add Workbook’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJhgBMG08PdRjK60S-GHqw.png" /></figure><p>Remove the existing workbook entry as it is not required for this demonstration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqDTlY4U95zzRwm4_R4-FA.png" /></figure><p>Then, click on Add and then ‘Add data source + visualization’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nm8OwiRi8ULTncUtDEKEOg.png" /></figure><p>Let’s start by configuring the workbook for our Windows failed RDP logins.</p><p>Click on ‘Advanced Editor’, copy the contents of <a href="https://github.com/sidsmenon/azure-sentinel-multi-source-honeynet/blob/main/windows-failed-rdp.json">this JSON file</a>, and click ‘Apply’ and then ‘Done Editing’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqkmRVHm_cHyfMh8blz8FQ.png" /></figure><p>As shown below, the query has executed successfully and we are now able to see origin and count of the failed Windows RDP attempts.</p><p>In order to obtain a birds-eye view of this, click on ‘Open in Azure’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CbR5ejmu6Ta2gY3CdY4znw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ymM1DAkstHniI-8KxBU6Q.png" /></figure><p>Now, replicate the same steps to add the below three additional workbooks:</p><ol><li>NSG Malicious Flow Logs: <a href="https://github.com/sidsmenon/azure-sentinel-multi-source-honeynet/blob/main/nsg-malicious-flow-logs.json">Link to the JSON file</a></li><li>Microsoft SQL Authentication Failures: <a href="https://github.com/sidsmenon/azure-sentinel-multi-source-honeynet/blob/main/ms-sql-authentication-failure.json">Link to the JSON File</a></li><li>Linux VM SSH Authentication Failures: <a href="https://github.com/sidsmenon/azure-sentinel-multi-source-honeynet/blob/main/linux-ssh-auth-fail.json">Link to the JSON File</a></li></ol><h3>Results:</h3><p>After performing the documented steps, the below 4 workbooks are obtained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P0nuDFMb1ecFLNXyUw7Q5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oa6iXKSZ5O1ZUVKYjsORoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Of65EfUq15tzsOEPbL00g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hwk7z31WywRy10agvF1hmQ.png" /></figure><h3>Takeaways:</h3><p>In conclusion, this project was a natural progression from my first Azure Sentinel honeypot lab in terms of scale, depth and the variety of information that could be captured and analyzed. While the earlier version relied on a single vulnerable Windows VM and one workbook focused on failed RDP attempts, this edition evolved into a small honeynet with multiple machines, simulated attacks for repeatable signal generation, and four dedicated Sentinel workbooks instead of one.</p><p>In doing so, I was also able to address a key limitation of the earlier approach by avoiding dependence on external APIs for geolocation and instead leveraging native sources within the Azure logging ecosystem wherever applicable. More importantly, this experiment went beyond workbook creation, as it provided a practical understanding of the different sources from which logs can be collected (host, network, and Azure services), how these sources can be configured to stream into a Log Analytics workspace, and how the resulting data can be queried and visualized in Sentinel, ultimately building a more holistic view of the parameters that can be monitored within a cloud environment.</p><h3>Mitigation:</h3><p>In a real world environment, the following mitigations should be implemented to reduce exposure while still maintaining strong detection coverage:</p><ol><li>Remove “open to all” NSG rules for RDP/SSH/MSSQL and allow access only from trusted IP ranges.</li><li>Use Azure Bastion or a VPN/jump host approach to avoid public RDP/SSH entirely.</li><li>Enforce <strong>MFA</strong> for all privileged accounts and block legacy authentication where applicable.</li><li>Apply <strong>least privilege RBAC</strong> and avoid using subscription Owner rights for routine operations.</li><li>Disable or limit password-based logins (especially for SSH) and enforce SSH keys where possible.</li><li>For MSSQL, disable unnecessary authentication methods, enforce strong passwords, and restrict SQL access to private networks only.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d20750350eff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Sentinel — Honeypot Threat Analysis]]></title>
            <link>https://sidharthsmenon.medium.com/azure-sentinel-honeypot-threat-analysis-d92ad9263f8a?source=rss-b89f41dd1f14------2</link>
            <guid isPermaLink="false">https://medium.com/p/d92ad9263f8a</guid>
            <category><![CDATA[azure-sentinel]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[honeypot]]></category>
            <dc:creator><![CDATA[Sidharth Sunil Menon]]></dc:creator>
            <pubDate>Thu, 19 Sep 2024 15:37:34 GMT</pubDate>
            <atom:updated>2024-09-19T15:39:59.510Z</atom:updated>
            <content:encoded><![CDATA[<h3>Azure Sentinel — Honeypot Threat Analysis</h3><p>In this project, we will be utilizing the Azure Sentinel SIEM to analyze the security events, particularly the failed RDP login attempts, that occur on a vulnerable Windows virtual machine which is exposed over the internet. These security events will be pulled from the Windows Event Manager of the vulnerable VM and sent over to Azure Sentinel via the Azure Log Analytics Workplace. The public IP of the attacker(s) will be pulled from the logs and sent to a third-party API (ipgeolocation.io) to obtain the respective latitude and longitude details of the attacker. This data will be plotted on a world map within an Azure Sentinel workbook to obtain a birds-eye view of the origin and frequency of these attacks.</p><p>[Note: This project can be comfortably re-created using the credits that are bundled with the Azure free-trial subscription].</p><h3><strong>Process Flow Diagram:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVA2KoqNEz2dqHd7I5K_dA.png" /><figcaption>Note: The above diagram was created using lucid.app</figcaption></figure><h4>Step 1: <strong>Log into the Azure portal and create a Windows VM</strong></h4><p>Configure the basic settings of the virtual machine as per the screenshot below. Create a new resource group and set it’s name as well as the VM’s name as per your preference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TZmy1aoYNJx9hVu4AqYCA.png" /></figure><p>Keep the default option for the disk size and set up the username and password details for the VM’s admin account.</p><pre>Note: If you receive a &quot;storage not available&quot; error, try changing the <br>region of your VM. This often occurs due to availability issues that arise <br>from very high demand in that particular region.</pre><p>Additionally, select all available options in the “select inbound ports” drop down menu. These include: HTTP (80), HTTPS (443), SSH (22) and RDP (3389).</p><pre>Note: We have chosen to allow all these ports as our intention is to make<br>this VM as vulnerable as possible. In an ideal scenario, we must restrict<br>this selection to only include the required ports such as RDP(3389).</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UEvOvy6CcdS5XYr4d4JevA.png" /></figure><p>Moving on, click on “Next : Disks &gt;”, leave the options as is, and then click on “Next : Networking &gt;”. A new virtual network will be created for your VM by default.</p><p>Leave all settings in their default state, excluding the “NIC network security group”, which is to be set to “Advanced”. Upon doing so, a new “Configure network security group” drop down menu will appear with the pre-configured name of your network security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XOdbDrJUu0z4LY95ZQWTPg.png" /></figure><p>Click the “create new” link that is present beneath the network security group name and delete the existing inbound rule by clicking the trash bin icon in the far right, as highlighted in the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yTso2WOgVa8VZQ2v3cpDCw.png" /></figure><p>Then, click on “+ Add an inbound rule”, configure the rule as per the below screenshot and then click on “Add” and then “OK”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ok3NAh4DqSuzbE8nDidjqA.png" /></figure><p>After doing so, click on “Review + create” -&gt; “Create” and then wait for a few minutes for the windows VM to provision itself.</p><h4>Step 2: Create the Azure Log Analytics Workspace Instance</h4><p>In the home page of the Azure portal, click on “Create a resource” and then search for “log analytics workspace”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaWOFy8-w-TExaeC_2mZLw.png" /></figure><p>After clicking on “Create”, select the resource group that you’d created while configuring your VM from the dropdown menu, set a name for the log analytics workspace, and then click on “Review + create”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_wSqVeN3zJFYMijii20JA.png" /></figure><h4>Step 3: Configure Microsoft Defender for Cloud</h4><p>After this has been created, go back to the home page -&gt; click on the search bar at the top -&gt; Search for “Microsoft Defender for Cloud” -&gt; Click on the “Environment settings” tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYaGa_ljmqA6fZw3Itk8dw.png" /></figure><p>Within “Environment settings”, click on the Azure subscription dropdown menu and select the log analytics workspace that we had created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pePE71OygK6Tnj6ryerKSA.png" /></figure><p>Within “Defender plans”, set the configuration as per the below screenshot and click on “Save”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2DYX9ap_BrOKKelBmKH-w.png" /></figure><p>Within the “Data collection” tab, configure it to log all events. Then click on “Save” again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6aCXB6uWA0OpV05I4mjIw.png" /></figure><h4>Step 4: Link the Log Analytics Workspace instance with our vulnerable VM</h4><p>Navigate back to the home page. From there, click on the log analytics workspace instance -&gt; Click on the “Classic” drop down menu on the left -&gt; Click on “Virtual machines (deprecated)”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdKVnfNOBbJSOUoLajijqA.png" /></figure><p>From the list, click on the VM that we had previously created and then click on “Connect”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8EuLuF7l9CK4B9tEnNm1fg.png" /></figure><p>This is done so that the log analytics workspace can pull event logs from the vulnerable VM for our analysis.</p><h4><strong>Step 5: Configure Microsoft Sentinel to retrieve logs from the log analytics workspace.</strong></h4><p>In the search bar at the top, Search “Microsoft Sentinel” and click on the first result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_UrPnDrrrobbZ7z04yAs_Q.png" /></figure><p>Click on “Create” (Kindly ignore the existing entry, yours will probably be blank)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gd1DQ4Vgjqk6A-vfvkCDnA.png" /></figure><p>Click on the Log Analytics Workspace instance that we had created and then click on “Add”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4o3aO45C6d-iq3oVmAL89w.png" /></figure><h4>Step 6: Connect to the VM and Configure it to be Vulnerable</h4><p>Navigate to your VM instance, copy the public IP address, and enter the same in an RDP window and click on “Connect” to connect into the VM remotely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYblkDxhYNF4sfDp0L1Rzg.png" /></figure><p>In the credentials screen, click on “more choices” -&gt; “use a different account” -&gt; enter the credentials that we had set up while creating the VM -&gt; Click on “Ok”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TB7IJbCrBmOhgeNVfi9Ecg.png" /></figure><p>[Click “Yes” when prompted whether to connect to the machine]</p><p>Once connected, set up the machine as per the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IojC4AB-_-XAdJf6kIZncA.png" /></figure><p>Once the VM is set up, open the Windows Event Viewer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pu9KJ8XkgxryciHqhlvkug.png" /></figure><p>Within the Event Viewer, navigate to Windows logs -&gt; Security</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLgPZWUhDYe9bfaD_OBKDg.png" /></figure><p>Identify the logs with the Event ID: 4625. These logs pertain to the Failed RDP logins, which we are aiming to extract to our Azure Log Analytics Workspace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HkJMwicaS4Nt9EYX8yKfXw.png" /></figure><p>[Note: you may not see as many events on your Windows Event Viewer instance, and that’s okay. If you leave the VM running for a few hours, it will ultimately accumulate multiple failed logins from external entities owing to our insecure Network Security Group setup. You can also contribute to this data by deliberately causing failed RDP attempts].</p><p>Once the required event ID has been noted, access the windows firewall settings by searching “wf.msc”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lz3318Abcq-BK701xdICuQ.png" /></figure><p>Click on “Windows Defender Firewall Properties”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUYYi6Kui0PRNImma8NvGQ.png" /></figure><p>Set the Firewall state to “Off” for the Domain, Private and Public profiles</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4SuDX_sYCm-VBpGxw2yhA.png" /></figure><p>[Note: I know that this has been repetitively mentioned in this article, but to re-iterate, these changes are being made with the sole purpose of making the VM as vulnerable as possible. DO NOT replicate these settings on your own systems]</p><h4>Step 7: Setup the Third-Party API to Retrieve the Location Details</h4><p>As mentioned in the introduction of this project, our aim is to determine the attackers’ country of origin so as to plot and view this data on a map. For this purpose, we will be using the “ipgeolocation” API, which accepts a public IP as input, and returns the respective location details pertaining to that IP.</p><p>Navigate to the API website (<a href="https://ipgeolocation.io/">https://ipgeolocation.io/</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6sF1QJGSJsQ6tOiNBHZASQ.png" /></figure><p>Upon visiting, the website showcases the types of data that it can return upon receiving a public IP address.</p><p>To gain access to the API key, create an account using the “Sign Up” menu.</p><p>Once you’ve logged in with your credentials, your API key will be visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0qpG9iclNm6tJEMAQAGaGA.png" /></figure><h4>Step 8: Exfiltrate and Collate the Failed RDP Logs from Event Viewer</h4><p>To achieve this, we will be utilizing the below PowerShell script</p><p>Script Link: <a href="https://github.com/sidsmenon/sentinel-honeypot/blob/main/log_export_script.ps1">https://github.com/sidsmenon/sentinel-honeypot/blob/main/log_export_script.ps1</a></p><p>To run the script, open “PowerShell ISE” in the Windows Machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOO7pxCL1ZtYeaoUSmXTmw.png" /></figure><p>Once opened, click on the highlighted icon, paste the script, and change the existing API ID to include the one that you had created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQbfSzoke8PDc78oISuAMA.png" /></figure><p>Next, click on the highlighted icon to execute the script, and keep it running so that failed login attempts started to appear in the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2twmIf5VAtrh3LLPp5DxFA.png" /></figure><p>Soon, you will start to see multiple entries popping up, highlighting the multiple attempts that are being made by attackers from all over the world to take over your machine. When you dive deeper into the output, you will notice some interesting parameters such as the username that was entered while attempting to login, and the origin country of such attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYkY1RlhH-TiNTTH72Zwbw.png" /></figure><p>Once you have received a significant amount of attack data, stop the execution of the script and visit the path that is highlighted in the above screenshot to access our log file.</p><pre>Note: In an ideal scenario, the script must be kept running, so that the<br>latest attacks keep getting appended onto the failed RDP log file. For the<br>purpose of this demonstration, we are minimizing the dataset.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJ337-CeGjMrdN_apiNWmw.png" /></figure><p>As shown below, the attacker data which was outputted by the PowerShell script has been appended to the log file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mac7nZXLYHknBfWUgpLgLA.png" /></figure><p><strong>Step 9: Ingest the Log File to the Azure Log Analytics Workspace for Further Analysis</strong></p><p>Moving back to the Azure portal, navigate to our Log Analytics Workspace instance and click on “Tables”, which is present in the “Settings” dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCMyYKDDkvASlyCzJMEopw.png" /></figure><p>Then, click on the dropdown button that is next to “Create” and choose “New custom log (MMA Based)”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYGGupzRAlosztPeHzIShA.png" /></figure><p>In the next page, copy over our log file from the Windows VM to our local machine, select it, and then click on “Next”. This log file will be used as a reference by the log analytics workspace to extract further such logs with the same structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A5yXA6jZyh__69MWg3spTg.png" /></figure><p>Keep the delimiter as “New line” and click on “Next” again</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-tiMC8NWhORDU_AD586Sw.png" /></figure><p>Then, select the path type as “Windows” and copy the path to the “failed_rdp.log” file in the “Path” field. Here, we are defining where the log analytics workspace must look for within our Windows VM to automatically capture all future logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPpiBB_VCkEfeNwl8g0X0A.png" /></figure><p>Provide a custom, easily identifiable name for the log file and then click on “Next”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zbwg-2AkG28paF_MYfy4ug.png" /></figure><p>Review the details on the next screen, and click on “Create”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBCubBXZ7spk4F9SHLuR6g.png" /></figure><p>Then, click on the “Logs” section of the analytics workspace, add the name of your table in the text area, and click on the highlighted run button to check if the log analytics workspace is able to retrieve the logs from the VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-dbit4VBq2Mm3RV1D4TQsA.png" /></figure><pre>Note 1: While creating the table, Azure will automatically add an &#39;_CL&#39;<br>to the end of the table name. Please enter the table name accordingly.<br><br>Note 2: If you initially receive the &quot;No results found from the last 24 hours&quot;<br>error, DO NOT PANIC. It takes time for the log analytics workspace to reach<br>the specified collection path and to retrieve the logs. You can keep retrying<br>for a few minutes until the logs finally appear in the output.</pre><p>After a while, when we click on ‘Run’, the logs will finally start to appear in the output, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0X4y1j0nmTevsUdgcI5lA.png" /></figure><p>Now, our goal is to extract and represent the data that is associated with each parameter in such a way that the Azure Sentinel instance will be able to comprehend, analyze and ultimately plot them onto the world map. To achieve this, we will be running the below log query:</p><pre>FAILED_RDP_LOGS_CL<br>|extend username = extract(@&quot;username:([^,]+)&quot;, 1, RawData),<br>         timestamp = extract(@&quot;timestamp:([^,]+)&quot;, 1, RawData),<br>         latitude = extract(@&quot;latitude:([^,]+)&quot;, 1, RawData),<br>         longitude = extract(@&quot;longitude:([^,]+)&quot;, 1, RawData),<br>         sourcehost = extract(@&quot;sourcehost:([^,]+)&quot;, 1, RawData),<br>         state = extract(@&quot;state:([^,]+)&quot;, 1, RawData),<br>         label = extract(@&quot;label:([^,]+)&quot;, 1, RawData),<br>         destination = extract(@&quot;destinationhost:([^,]+)&quot;, 1, RawData),<br>         country = extract(@&quot;country:([^,]+)&quot;, 1, RawData)<br> |where destination != &quot;samplehost&quot;<br> |where sourcehost != &quot;&quot;<br> |summarize event_count=count() by timestamp, label, country, state, sourcehost, username, destination, longitude, latitude</pre><p>After running the query, we’ll get the below output wherein the data associated with each parameter has been neatly segregated. This query can now be used to create our Azure Sentinel Workbook</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7wLBLv6daeJVdABsiQM1Q.png" /></figure><p><strong>Step 10: Configure the Azure Sentinel Workbook to Plot the Data as Required:</strong></p><p>From the home page, navigate to Azure Sentinel, choose our Log Analytics Instance, and then click on “Workbooks” within the “Threat management” dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdE5pLku5bJIij1J-be_lA.png" /></figure><p>In the next page, click on “Add Workbook”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MS7smG5AB7Awyc5rx35hw.png" /></figure><p>Then, click on “Edit”, and remove the pre-populated data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKqa5KFjuVaMJ1HkwYqs_w.png" /></figure><p>Once the items have been removed, click on the “Add” button and choose “Add query”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9g6IZ_i8Z-VCZwKczMIZ8w.png" /></figure><p>Paste the query which we had previously utilized in the Log Analytics Workspace, choose “Map” from the visualization drop down menu, and click on “Run Query”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHcYvsAllLOEIKbjiLeqQA.png" /></figure><p>Upon running the query, we receive the below output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbxyQxQizshnM60upljOdw.png" /></figure><p>Set the metric label option to ‘label’, click on apply, and then click on “Done Editing” at the top left.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wmzrvs8-7gKE7KzU4NQmQ.png" /></figure><p>After doing so, we receive the below final output which clearly highlights the origin, frequency and the IP details of the attackers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvLe1CikuC3LkiyZG7RMpw.png" /></figure><p><strong>Bonus Step: Cleanup (Important):</strong></p><p>Once you are done recreating this project, remember to de-provision the different services that we have utilized, especially the vulnerable Windows VM, so as to avoid any additional unintended costs.</p><p><strong>Project Limitations:</strong></p><ol><li>This project focuses solely on tracking just a single log type, namely the failed RDP logs.</li><li>In this project, we have just implemented a simple, small scale setup for our analysis, including a standalone Windows VM.</li><li>We are solely reliant on external threats to generate the respective security logs. No attack simulation was performed.</li><li>To obtain the attacker coordinate details, we have a dependency on the ‘ipgeolocation’ third-party API. In its free tier, the API only allows for up to 1000 calls, resulting in a lapse in the tracking of further attack attempts.</li><li>No mitigation steps were covered in this demonstration.</li></ol><p>I will be working on addressing these limitations in the next iteration of this project. Stay tuned!</p><p>Until then, I hope you found this walkthrough to be useful and were able to follow along with it. Please let me know your thoughts in the comments.</p><p>Thank You!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d92ad9263f8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>