<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Atyaf Networks Blog]]></title><description><![CDATA[Thoughts, Computer Technologies and ideas]]></description><link>https://blog.atyafnet.com/</link><image><url>https://blog.atyafnet.com/favicon.png</url><title>Atyaf Networks Blog</title><link>https://blog.atyafnet.com/</link></image><generator>Ghost 4.46</generator><lastBuildDate>Sat, 05 Jul 2025 12:55:15 GMT</lastBuildDate><atom:link href="https://blog.atyafnet.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces]]></title><description><![CDATA[Want to setup a Remote SPAN port but you don't have specialized hardware to do so? This article will walk you through how to do exactly that.]]></description><link>https://blog.atyafnet.com/setup-remote-span-with-openvpn-tap/</link><guid isPermaLink="false">647793c026c4580001404dd3</guid><category><![CDATA[networking]]></category><category><![CDATA[network monitoring]]></category><category><![CDATA[pfsense]]></category><category><![CDATA[Security Onion]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Sun, 15 Oct 2023 20:41:01 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2023/10/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces---Title.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2023/10/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces---Title.jpg" alt="Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces"><p>Want to setup a Remote SPAN port but you don&apos;t have specialized hardware to do so? This article will walk you through how to do exactly that using pfSense and Security Onion 2.4 to analyze the network for intrusion detection and security monitoring.</p><p>Today we will continue our experiments with pfSense and SPAN options just like in the last blog (<a href="https://blog.atyafnet.com/port-mirror/">SPAN and Management on a Single Physical Port</a>), but this time using OpenVPN and bridge interfaces to achieve real remote cross-network traffic mirroring. The motive for this experiment stemmed from a situation I came across in an environment where the underlying network infrastructure does not allow sending or receiving network data frames with manipulated source and/or destination addresses (Virtual VMware environment where Promiscuous mode and MAC changes are restricted). So I figured why not tunnel that traffic through a P2P layer 2 tunneling solution? GRE, L2TP, and OpenVPN were considered. Settled on OpenVPN tap mode as a final solution.</p><h2 id="components-used">Components Used:</h2><p>Virtualized pfSense firewall.</p><p>Virualized <a href="https://github.com/Security-Onion-Solutions/securityonion/blob/2.4/main/DOWNLOAD_AND_VERIFY_ISO.md">Securtiy Onion 2.4</a>.</p><h2 id="objective">Objective:</h2><ul><li>Achieve (E)RSPAN-like feature without any dedicated hardware.</li></ul><p>Let&apos;s first take an overview at our setup:</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-1.png" class="kg-image" alt="Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces" loading="lazy" width="1225" height="713" srcset="https://blog.atyafnet.com/content/images/size/w600/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-1.png 600w, https://blog.atyafnet.com/content/images/size/w1000/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-1.png 1000w, https://blog.atyafnet.com/content/images/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-1.png 1225w" sizes="(min-width: 720px) 720px"></figure><p></p><p>We can achieve this setup using a tunneling solution that supports carrying Ethernet over TCP/UDP (OpenVPN in tap mode in our case), together with software SPAN on pfSense which is handled by ifconfig utility in the backend. We can do traffic mirroring and specify the tunnel interface as the destination. The other end of the tunnel will receive the mirrored traffic as if it is connected directly to a SPAN. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2023/12/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-TunneledTraffic.png" class="kg-image" alt="Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces" loading="lazy" width="1940" height="764" srcset="https://blog.atyafnet.com/content/images/size/w600/2023/12/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-TunneledTraffic.png 600w, https://blog.atyafnet.com/content/images/size/w1000/2023/12/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-TunneledTraffic.png 1000w, https://blog.atyafnet.com/content/images/size/w1600/2023/12/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-TunneledTraffic.png 1600w, https://blog.atyafnet.com/content/images/2023/12/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces-TunneledTraffic.png 1940w" sizes="(min-width: 720px) 720px"><figcaption><em>Tunneled, mirrored Ethernet frame in green</em></figcaption></figure><p>Let&apos;s take a look on the network diagram to understand the network flow;</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces_2.png" class="kg-image" alt="Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces" loading="lazy" width="1420" height="1260" srcset="https://blog.atyafnet.com/content/images/size/w600/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces_2.png 600w, https://blog.atyafnet.com/content/images/size/w1000/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces_2.png 1000w, https://blog.atyafnet.com/content/images/2023/07/Setup-Remote-SPAN-without-Specialized-Hardware-using-OpenVPN-TAP-Interfaces_2.png 1420w" sizes="(min-width: 720px) 720px"></figure><p>All traffic hitting pfSense on the eth1 interface will be mirrored to the OpenVPN tunnel interface, and because we are using tap mode, the other end of the tunnel (at tap5) will be able to see any (RAW) traffic crossing eth1 on pfSense.</p><p></p><p>Now let&apos;s get into the details on how to do it step by step. The first thing would be to setup the tunnel and make sure that it is operable.</p><p>Let&apos;s follow the following steps on pfSense.</p><ul><li>Create a new OpenVPN server with the following configurations;</li></ul><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2023/10/image-5.png" class="kg-image" alt="Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces" loading="lazy" width="1187" height="871" srcset="https://blog.atyafnet.com/content/images/size/w600/2023/10/image-5.png 600w, https://blog.atyafnet.com/content/images/size/w1000/2023/10/image-5.png 1000w, https://blog.atyafnet.com/content/images/2023/10/image-5.png 1187w" sizes="(min-width: 720px) 720px"></figure><p>Server mode: Peer to Peer (SSL/TLS)</p><p>Device mode: tap - Layer 2 Tap Mode</p><p>IPv4 Tunnel Network: a single /32 address (e.g 192.168.224.31/32)</p><p>Custom options:</p><pre><code>tun-mtu 1560;
mssfix 0;
reneg-sec 0;</code></pre><p><em>Make sure to alter the tun-mtu value based on the parent interface max value minus the tunnel overhead.</em></p><p>These are the important settings to note. Complete the other settings as usually done when creating a server endpoint. You might also like to completely disable the tunnel&apos;s data channel encryption to reduce the unnecessary computation.</p><p></p><p>Now let&apos;s set up the client endpoint.</p><p>Obviously the first thing is to install OpenVPN package if it is not installed;</p><pre><code>yum install openvpn
# apt install openvpn
# dnf install openvpn</code></pre><p>Then create a client openvpn config file, below is a sample config for our scenario;</p><pre><code>dev tap4
client
remote REMOTE_ADDRESS PORT
proto udp
tls-client
nobind
cipher none
tun-mtu 1560
auth none
auth-retry nointeract
persist-key
reneg-sec 0
persist-tun
script-security 2

# Script to run after the tunnel is up
up &quot;/usr/share/scripts/ifenslave.sh&quot;
ifconfig 192.168.224.32 255.255.255.255
route-nopull
fragment 0
mssfix 0

&lt;ca&gt;
-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----
&lt;/ca&gt;
&lt;cert&gt;
-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----
&lt;/cert&gt;
&lt;key&gt;
-----BEGIN PRIVATE KEY-----

-----END PRIVATE KEY-----
&lt;/key&gt;
key-direction 1
</code></pre><p>In my use case, I am using Security Onion 2.4 as the client endpoint, and in order to tell the system that the monitor interface will be the tap4 interface, we use the command:</p><pre><code>/sbin/ifenslave bond0 tap4</code></pre><p>And to do that automatically whenever the openvpn tunnel is started, we specify the &apos;up&apos; option in the openvpn config file and point to the script that will run the command;</p><pre><code>&gt; cat /usr/share/scripts/ifenslave.sh
#!/bin/bash

/sbin/ifenslave bond0 tap4
</code></pre><p></p><p>Once the tunnel is up and we verified that it is functioning correctly, we can then proceed and start mirroring packets to the tunnel interface using pfSense bridge interface (ifconfig), but first we need to define the tunnel interface on pfSense;</p><p>Interfaces &#xA0;&gt; Assignment &gt; Interface Assignments</p><p>And add the the OpenVPN server instance as an interface, enable and save.</p><p></p><p>Then we add a new bridge interface in order to create a virtual SPAN port;</p><p> Interfaces &#xA0;&gt; Assignment &gt; Bridges &gt; Add</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2023/10/image-6.png" class="kg-image" alt="Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces" loading="lazy" width="1166" height="472" srcset="https://blog.atyafnet.com/content/images/size/w600/2023/10/image-6.png 600w, https://blog.atyafnet.com/content/images/size/w1000/2023/10/image-6.png 1000w, https://blog.atyafnet.com/content/images/2023/10/image-6.png 1166w" sizes="(min-width: 720px) 720px"></figure><p>We specify only one interface on the member list (the interface to be mirrored), and specify the tunnel interface as the SPAN port.</p><p>After all is done; we should start receiving mirrored traffic on the other end of the tunnel and start analyzing packets.</p><pre><code>&gt; tcpdump -i tap4</code></pre><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2023/10/image-7.png" class="kg-image" alt="Setup Remote SPAN without Specialized Hardware using OpenVPN TAP Interfaces" loading="lazy" width="846" height="579" srcset="https://blog.atyafnet.com/content/images/size/w600/2023/10/image-7.png 600w, https://blog.atyafnet.com/content/images/2023/10/image-7.png 846w" sizes="(min-width: 720px) 720px"></figure><p></p><h2 id="recap">Recap</h2><p>We were able to achieve (E)RSPAN-like feature with only virtualized systems without any need for dedicated hardware.</p>]]></content:encoded></item><item><title><![CDATA[Leverage CVE-2024-3661 TunnelVision to Effectively Disable VPN for iPhone Users]]></title><description><![CDATA[DHCP can add routes to a client’s routing table via the classless static route option 121. This blog  post discuses how to take advantage of that fact to render VPN on iPhones useless.]]></description><link>https://blog.atyafnet.com/cve-2024-3661/</link><guid isPermaLink="false">663d7e2744773c0001f79dea</guid><category><![CDATA[security]]></category><category><![CDATA[iOS]]></category><category><![CDATA[iPhone]]></category><category><![CDATA[VPN]]></category><category><![CDATA[routing]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Mon, 13 May 2024 07:44:45 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2024/05/2024-05-12-00.25.47.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2024/05/2024-05-12-00.25.47.png" alt="Leverage CVE-2024-3661 TunnelVision to Effectively Disable VPN for iPhone Users"><p>This is Based on a research done by the Leviathan Security Group <a href="https://www.leviathansecurity.com/blog/tunnelvision">https://www.leviathansecurity.com/blog/tunnelvision</a></p><p></p><p>For an introduction and details on this security concern, please refer to the linked research above. </p><p>As outlined in the original research, most operating systems, including iOS, are vulnerable to the TunnelVision bug.</p><p>To exploit this flaw, a DHCP server capable of serving <a href="https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml">DHCP option 121 (Classless Static Route Option)</a> is required.</p><p>Upon testing on an iPhone using a DHCP server that serves the routes 0.0.0.0/1 and 128.0.0.0/1, and subsequently connecting the iPhone to a privacy VPN, internet connectivity appears to be lost. </p><p>After numerous attempts, it was discovered that iOS detects any route that starts with 0.0.0.0 and treats it in a special way, resulting in a conflict when a VPN service attempts to add a default route to the iOS routing table.</p><p>Therefore, to render the VPN switch for iPhone users useless (and misleading), it is necessary to avoid using 0.0.0.0 and instead have a DHCP server serve the following routes:</p><ul><li>1.0.0.0/8 VIA ROUTER</li><li>2.0.0.0/7 VIA ROUTER</li><li>4.0.0.0/6 VIA ROUTER</li><li>8.0.0.0/5 VIA ROUTER</li><li>16.0.0.0/4 VIA ROUTER</li><li>32.0.0.0/3 VIA ROUTER</li><li>64.0.0.0/2 VIA ROUTER</li><li>128.0.0.0/1 VIA ROUTER</li></ul><p>In my case, I was using pfSense&apos;s DHCP server, and I needed to pass the routes as a HEX string. This can be achieved using the following HEX:</p><figure class="kg-card kg-code-card"><pre><code>08:01:c0:a8:b4:01:07:02:c0:a8:b4:01:06:04:c0:a8:b4:01:05:08:c0:a8:b4:01:04:10:c0:a8:b4:01:03:20:c0:a8:b4:01:02:40:c0:a8:b4:01:01:80:c0:a8:b4:01</code></pre><figcaption>c0:a8:b4:01 is 192.168.180.1. Replace it with your router.</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2024/05/image.png" class="kg-image" alt="Leverage CVE-2024-3661 TunnelVision to Effectively Disable VPN for iPhone Users" loading="lazy" width="591" height="1280"><figcaption>An iPhone connected to a privacy VPN, but still routing traffic through the local gateway.</figcaption></figure><p></p><h2 id="mitigation">Mitigation</h2><p><em>Switch to Android :)</em></p><p>There is really not much you can do about this flaw other than being cautious when connecting to untrusted WiFi networks and do the following when connecting to a VPN:</p><ul><li>Check routes using <a href="https://apps.apple.com/app/he-net-network-tools/id858241710">HE Tools app</a>.</li><li>Traceroute after connecting to a VPN to check packets path.</li><li>If the goal of the VPN is to change the public IP address, then check IP before and after connceting to the VPN.</li></ul>]]></content:encoded></item><item><title><![CDATA[How to boot Bitlocker Encrypted VHDX beside Ventoy]]></title><description><![CDATA[Ventoy is a great Multi-Boot USB tool, however, booting bitlocker encryptd VHD(x) is not supported. Luckily, there is a workaround..]]></description><link>https://blog.atyafnet.com/bitlocker-encrypted-vhdx-with-ventoy/</link><guid isPermaLink="false">631ef7e501085c0001005ffa</guid><category><![CDATA[windows]]></category><category><![CDATA[bitlocker]]></category><category><![CDATA[ventoy]]></category><category><![CDATA[UEFI]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Mon, 12 Sep 2022 17:19:14 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2022/09/ventoycover.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2022/09/ventoycover.jpg" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy"><p><a href="https://github.com/ventoy/Ventoy">Ventoy</a> is a great and handy bootloader that supports booting multiple file types including VHD(x). </p><p>However, I could not get it to work for Bitlocker encrypted VHDXs, if the disk is encrypted, the windows boot manager complains about not finding winload.exe.</p><p> So the workaround here is to do native VHDX boot from the Windows Boot Manager that is directly booted from UEFI without using Ventoy. In essence, when the UEFI Firmware starts, we have two entries, one to boot into Ventoy, and the other to boot the windows bootloader which can handle encrypted VHDX properly.</p><p>However, the original EFI partition that Ventoy creates is too small to fit the windows EFI files and we can not control its size.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2022/09/image.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="759" height="494" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image.png 600w, https://blog.atyafnet.com/content/images/2022/09/image.png 759w" sizes="(min-width: 720px) 720px"><figcaption>Ventoy EFI partition is only 32MB (hardcoded)</figcaption></figure><p>What we can do instead is redesign the partition layout and create our own EFI system partition. When we first install Ventoy, we can instruct it to preserve some space at the end of the disk.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-1.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="437" height="336"></figure><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-2.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="553" height="344"></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2022/09/image-3.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="751" height="484" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-3.png 600w, https://blog.atyafnet.com/content/images/2022/09/image-3.png 751w" sizes="(min-width: 720px) 720px"><figcaption>Partition layout after preserving space ant the end of the disk</figcaption></figure><p>Then we need to create an EFI System partition which will hold the windows boot files. Right-click on the unallocated disk space &gt; New Simple Volume. We need to format the partition as a FAT32 filesystem.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-4.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="750" height="481" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-4.png 600w, https://blog.atyafnet.com/content/images/2022/09/image-4.png 750w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2022/09/image-6.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="755" height="482" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-6.png 600w, https://blog.atyafnet.com/content/images/2022/09/image-6.png 755w" sizes="(min-width: 720px) 720px"><figcaption>New partition layout</figcaption></figure><p>(<strong>Important</strong>) We now need to mount the VHDx file so we can later tell bcdboot where the windows directory is to copy the files to the EFI partition in the next step.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-7.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="753" height="480" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-7.png 600w, https://blog.atyafnet.com/content/images/2022/09/image-7.png 753w" sizes="(min-width: 720px) 720px"></figure><p>Now in a command prompt:</p><pre><code>bcdboot D:\Windows /s E: /f UEFI</code></pre><p>&quot;D:\Windows&quot; is the windows directory inside the VHDX file. Substitute for the correct drive letter.</p><p>&quot;E:&quot; is the newly created EFI partition that will hold the EFI files. Substitute for the correct drive letter.</p><p>Now all is done. We reboot to check the boot configurations. Because we now have two FAT32 partitions that both have valid boot files, by default, the UEFI firmware will try to boot from the first FAT32 partition, which is the Ventoy partition. We can add a second custom boot option using the second FAT32 partition from the UEFI boot configurations. Every firmware is different on how to do this, but most do have some way of adding a custom UEFI boot option.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-12.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="639" height="498" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-12.png 600w, https://blog.atyafnet.com/content/images/2022/09/image-12.png 639w"></figure><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-13.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="649" height="483" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-13.png 600w, https://blog.atyafnet.com/content/images/2022/09/image-13.png 649w"></figure><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-15.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="1022" height="771" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-15.png 600w, https://blog.atyafnet.com/content/images/size/w1000/2022/09/image-15.png 1000w, https://blog.atyafnet.com/content/images/2022/09/image-15.png 1022w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/09/image-14.png" class="kg-image" alt="How to boot Bitlocker Encrypted VHDX beside Ventoy" loading="lazy" width="660" height="616" srcset="https://blog.atyafnet.com/content/images/size/w600/2022/09/image-14.png 600w, https://blog.atyafnet.com/content/images/2022/09/image-14.png 660w"></figure><p>Success! We can now boot bitlocker encrypted VHDXs and have ventoy installed on a single disk.</p><p></p><h2 id="notes">Notes:</h2><ul><li>The FAT32 partition that will hold the windows boot files has to be a primary partition not a logical partition, otherwise booting windows will fail.</li><li>This should only work on UEFI boot environment, legacy bios has not been tested.</li></ul>]]></content:encoded></item><item><title><![CDATA[Control multi-monitor VMware Workstation VMs and set custom monitor resolution]]></title><description><![CDATA[Let's say you have a high resolution monitor and want to make use of it under VMware Workstation VMs. One way is to add multiple virtual monitors to a VM...]]></description><link>https://blog.atyafnet.com/control-multi-monitor-vms-and-set-custom-monitor/</link><guid isPermaLink="false">61f418053ce21e0001fbb981</guid><category><![CDATA[vmware]]></category><category><![CDATA[workstation]]></category><category><![CDATA[Tutorial]]></category><category><![CDATA[windows]]></category><category><![CDATA[productivity]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Sat, 29 Jan 2022 10:39:30 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2022/01/2022-01-29-14.33.25.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2022/01/2022-01-29-14.33.25.jpg" alt="Control multi-monitor VMware Workstation VMs and set custom monitor resolution"><p></p><p>Let&apos;s say you have a high resolution monitor and want to make use of it under VMware Workstation VMs. One way is to add multiple virtual monitors to a VM and divide the main screen to multiple parts with custom resolution.</p><p>For example, this is how the VM looks before:</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/01/image.png" class="kg-image" alt="Control multi-monitor VMware Workstation VMs and set custom monitor resolution" loading="lazy"></figure><p></p><p>and this is how it looks after:</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/01/image-1.png" class="kg-image" alt="Control multi-monitor VMware Workstation VMs and set custom monitor resolution" loading="lazy"></figure><p>All of this under a Virtual Machine.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/01/20220129_131710.GIF.gif" class="kg-image" alt="Control multi-monitor VMware Workstation VMs and set custom monitor resolution" loading="lazy"></figure><p>So to do this, open a command prompt on the virtual machine and change directory to &quot;%ProgramFiles%\VMware\VMware Tools&quot;</p><pre><code>cd %ProgramFiles%\VMware\VMware Tools</code></pre><p>Then specify the number of virtual monitors and set custom resolution for each one with the following command:</p><pre><code>VMwareResolutionSet.exe 0 3 , 0 0 1650 1931 , 1650 0 1677 966 , 1650 966 1677 965</code></pre><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.atyafnet.com/content/images/2022/01/vmware-set-resolution.jpg" class="kg-image" alt="Control multi-monitor VMware Workstation VMs and set custom monitor resolution" loading="lazy"></figure><p>The detailed syntax can be found on VMware website:</p><p><a href="https://kb.vmware.com/s/article/2058577">https://kb.vmware.com/s/article/2058577</a></p><p>After setting the resolution, you also need to tell vmware workstation to stop auto-fitting the vm window so you don&apos;t lose your resolution settings.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2022/01/image-2.png" class="kg-image" alt="Control multi-monitor VMware Workstation VMs and set custom monitor resolution" loading="lazy"></figure>]]></content:encoded></item><item><title><![CDATA[Port Mirror (SPAN) and management on a single physical port]]></title><description><![CDATA[Want to setup a SPAN port for your network analyzer but you are hardware limited to a single physical port? This will walk you through setting up a software SPAN port on PfSense.]]></description><link>https://blog.atyafnet.com/port-mirror/</link><guid isPermaLink="false">6112bab42730760001434529</guid><category><![CDATA[networking]]></category><category><![CDATA[pfsense]]></category><category><![CDATA[Security Onion]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Wed, 25 Aug 2021 17:49:44 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2021/08/Port-mirroring-and-management-1port_Cover.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2021/08/Port-mirroring-and-management-1port_Cover.jpg" alt="Port Mirror (SPAN) and management on a single physical port"><p></p><h2 id="tl-dr">TL;DR</h2><p>Use software port mirroring if you don&apos;t have an advanced network switch, one example is ifconfig utility in UNIX like systems. PfSense FTW.</p><p></p><h2 id="introduction">Introduction</h2><p>I was trying to setup and evaluate <a href="https://github.com/Security-Onion-Solutions/securityonion">Security Onion v2</a>, I had a spare laptop lying around to test with, but it only has one physical port and a WiFi adapter. Security Onion requires at least 2 Ethernet NICs, one for management and the other for traffic monitoring (RX mode only).</p><p>I tried playing with the Wifi adapter under a Windows VM running alongside SO under an ESXi host, but that looked ugly and too complicated. Instead, I considered the following approach:</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/08/Port-mirroring-and-management-1port.jpg" class="kg-image" alt="Port Mirror (SPAN) and management on a single physical port" loading="lazy"></figure><p>To Achieve this, we need a layer 2 switch that supports port mirroring and can send mirrored traffic to a specific VLAN while still <strong>forwards and receives</strong> frames on the parent physical port. I believe this is only supported on very advanced enterprise gear like some high end Cisco switches (some flavor of RSPAN). Even then, additional features need to be supported by the switch like QinQ in order to mirror sub-interfaces.</p><p>I only had a Unifi switch that barely supports standard physical port mirroring, so the hardware option is not available.</p><h2 id="what-about-a-software-port-mirror">What about a software port mirror?</h2><p>It is possible to do port mirroring in software. In FreeBSD, <a href="https://www.freebsd.org/cgi/man.cgi?ifconfig(8)">ifconfig </a>package provides an option to mirror a bridge port to another interface. I am going to walk through how to do it in Pfsense, since it uses ifconfig in the backend and it will be easier to setup and configure.</p><p>Prerequisite:</p><p> - a PfSense box with at least one unused Ethernet port.</p><p>First, let&apos;s get things clear by looking at our setup:</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/08/Port-mirroring-and-management-1port_2-3.jpg" class="kg-image" alt="Port Mirror (SPAN) and management on a single physical port" loading="lazy"></figure><p>We need to connect our pfsense box directly to the analyzer device, not through a layer 2 switch.</p><p>First, we need to define our VLANs under the physical port eth3, in our case we need two:</p><p>Interface&gt;Assignments&gt;VLANs&gt;Add</p><p>Then we assign an ip address to the management vlan and enable it . For the SPAN vlan, we only need to enable it, without assigning addresses.</p><p>To send mirrored traffic to the SPAN vlan, we first need to create a bridge interface, then add the LAN interface (or the one to be mirrored) to that bridge. The process is as follows:</p><p>Interface&gt;Assignments&gt;Bridge&gt;Add, and choose the LAN interface as a member, then toggle &apos;Display Advanced&apos;, and under Span port option, choose the SPAN VLAN that we created earlier.</p><p>Last step is to assign and enable the bridge interface that we created, without assigning addresses to it.</p><p><em>If more than one interface needs to be mirrored, each mirrored interface has to be on a different bridge, while all can share the same SPAN VLAN.</em></p><p>Now anything enters or leaves the bridge interface is mirrored to the SPAN VLAN. The pfsense part is done, for the analyzer device end, we need to configure its interfaces.</p><p>For my specific setup, I use Security Onion as a VM under ESXi, so all I had to do was configure ESXi management interface and give SO VM two network connections, one management with VID 10, and the other SPAN with VID 20.</p><p></p><h2 id="caveat-when-using-this-approach">Caveat when using this approach</h2><p>Sub-interfaces of the original interface to be mirrored do not get replicated to the SPAN VLAN. For example, in our setup, if the LAN interface had VLAN interfaces under it, they would not be mirrored to the SPAN VLAN.</p><p>To circumvent that, we could use QinQ (802.11ad) which is essentially a second VLAN layer. However, this will require some changes to the existing setup and interface reassignments (reassigning LAN to be under a QinQ interface). In most cases this will only be done in a lab, so if you want to mirror more than one interface, it might be easier to just add multiple bridge interfaces than deal with QinQ complexities.</p>]]></content:encoded></item><item><title><![CDATA[How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch]]></title><description><![CDATA[VMware Workstation does not support handling of VLANS natively. However, there are workarounds that can be used to provide vlan tagged traffic into VMs.]]></description><link>https://blog.atyafnet.com/how-to-passthrough-vlan-tags-to-vmware-workstation-virtual-machines/</link><guid isPermaLink="false">60c1083f23f5dd00018843da</guid><category><![CDATA[Tutorial]]></category><category><![CDATA[vmware]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Thu, 10 Jun 2021 16:14:32 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2021/06/vmware-vlans-cover.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2021/06/vmware-vlans-cover.jpg" alt="How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch"><p></p><h2 id="summary">Summary</h2><p>The idea is to create virtual vlan tagged network interfaces in the host using Hyper-V virtual switch functionality (provided you don&apos;t have Intel or Realtek NIC; see the note at the end of this blog for details), then adding a bridge adapter to the virtual machine with the correspondent vlan interface.</p><h2 id="background">Background</h2><p>One would assume by convention that using virtual machines is sufficient in terms of isolating what&apos;s running inside the VM from the host and the rest of the network, but that&apos;s not always the case. VMware Workstation provides three types of network adapters; Host-only, NAT, and Bridged network. Host-only network adapters provides access to the host machine only, NAT adapters translate the VM source ip to the host ip address, while bridging provides an adapter that acts as if it is physically connected to the host NIC.</p><p>Now, let&apos;s follow what happens when the VM gets compromised in each adapter case. If a Host-only adapter is given to the VM, the host is exposed to the VM directly and nothing else, assuming no host-based protections are in effect, the host could be vulnerable.</p><p>In a case of NAT adapter, all traffic originating from the VM destined outside the VM net, is masqueraded under the host ip address, so in addition to having access to the host, the VM has access to whatever the host machine has in the local network.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2021/06/image-1.png" class="kg-image" alt="How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch" loading="lazy"><figcaption>Untrusted VMs traffic masquerade under the host ip when using NAT adapter</figcaption></figure><p></p><p>Bridging the VM adapter directly to the host NIC can also be problematic, the VM will have direct access and discovery of the local devices in the network.</p><p></p><h2 id="the-better-approach">The Better Approach</h2><p>Since VMware workstation does not provide some sort of vmnet firewall, it is better to offload that function to the physical firewall and have better visibility. This can be done by providing entirely isolated networks using VLANS. VMware Workstation does not support handling of VLANS since they are mostly managed by the host NIC drivers, nevertheless there are workarounds.</p><p>The way it is done is by creating virtual interfaces in the host, each corresponds to specific vlan tag. Then bridging that interface to the VM adapter, effectively passing-through that vlan to the VM.</p><p>Let&apos;s consider the following scenario:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2021/06/image-12.png" class="kg-image" alt="How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch" loading="lazy"><figcaption>VLAN Segregation under VMware Workstation</figcaption></figure><p>Provided that the host NIC supports trunking, creating a virtual interface that is bound to a specific vlan tag in the host and bridging that interface to the VM, allows better control and isolation hence achieves our goal.</p><h2></h2><h2 id="create-vlan-interfaces-with-hyper-v-vswitch">Create VLAN interfaces with Hyper-V VSwitch</h2><p>First you need to enable Hyper-V Services and Hyper-V Module for Windows PowerShell from Windows features, click OK and restart.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/06/image-10.png" class="kg-image" alt="How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch" loading="lazy"></figure><p></p><p>Then open PowerShell with admin privileges and create a new virtual switch</p><figure class="kg-card kg-code-card"><pre><code>New-VMSwitch -Name &quot;External_network&quot; -NetAdapterName &quot;Ethernet&quot;</code></pre><figcaption>&quot;Ethernet&quot; is the available NIC that you want the VSwitch to be based on</figcaption></figure><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/06/image-9.png" class="kg-image" alt="How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch" loading="lazy"></figure><p></p><p>Create virtual adapters for each vlan you want to assign.</p><pre><code>Add-VMNetworkAdapter -ManagementOS -Name VLAN10 -SwitchName External_network</code></pre><p></p><p>Then configure the interface you just created to listen for the vlan tag needed</p><pre><code>Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName VLAN10 -Access -VlanID 10</code></pre><p>Now you have a virtual interface that is configured for a specific vlan. To have access to that vlan inside a virtual machine, simply change the settings from VMware Workstation Virtual Network Editor and have a vmnet that is bridged with the Hyper-V virtual NIC.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.atyafnet.com/content/images/2021/06/image-13.png" class="kg-image" alt="How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch" loading="lazy"><figcaption>File menu &gt; Virtual Network Editor</figcaption></figure><p>If the host machine participation is not needed in a specific vlan interface (maybe for security reasons), you can disable all services and protocols from interface properties except for &apos;VMware Bridge protocol&apos;.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/06/image-14.png" class="kg-image" alt="How to Passthrough VLAN tags to VMware Workstation Virtual Machines using Hyper-V VSwitch" loading="lazy"></figure><p></p><h2 id="caveat-when-using-hyper-v">Caveat when using Hyper-V</h2><p>Once Hyper-V is enabled, your Windows host actually becomes a VM, so your VMware Workstation VMs becomes nested, and their performance greatly decreases.</p><h2 id="note-if-you-have-intel-or-realtek-nic">Note if you have Intel or Realtek NIC</h2><p>Intel and Realtek provide utilities for Windows to add virtual adapters with vlan tag support. You can use them instead of the Hyper-V Virtual Switch method.</p>]]></content:encoded></item><item><title><![CDATA[Fix Windows slmgr Error 0xC004F074 No KMS Server could be contacted]]></title><description><![CDATA[Error 0xC004F074 request time-out when the activation service tries to contact the KMS server]]></description><link>https://blog.atyafnet.com/fix-windows-0xc004f074/</link><guid isPermaLink="false">606ff91123f5dd0001884311</guid><category><![CDATA[windows]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Fri, 09 Apr 2021 08:03:11 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2021/04/2021-04-09-11.49.14.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2021/04/2021-04-09-11.49.14.jpg" alt="Fix Windows slmgr Error 0xC004F074 No KMS Server could be contacted"><p>I was trying to fix a windows machine not being able to activate using a valid KMS server. After setting the KMS server using the command </p><pre><code>slmgr /skms &lt;server-name&gt;</code></pre><p>and initiating the activation</p><pre><code>slmgr /ato</code></pre><p>The request times-out and gives the error code 0xC004F074. After digging through google for a solution, I found none.</p><p>I then decided to look deeper and fired Wireshark to look at the actual request. I found out that the machine tries to activate to a server with the ip 192.168.1.255 even though I had set it manually with slmgr /skms to a different one.</p><p>After spending some time searching through the Registry Editor, I found the rogue key. The SoftwareProtectionPlatform key has the configuration for the Windows activation.</p><pre><code>Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform</code></pre><p>The KeyManagementServiceName string value is the one you set with /skms. However, there were other child keys under SoftwareProtectionPlatform that have these name patterns xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. They also contain a KeyManagementServiceName string value, so deleting them or changing their values to the proper server name solved the issue.</p><p>I believe this was caused by the installation of shady KMS activation crapware by whoever setup this machine before.</p>]]></content:encoded></item><item><title><![CDATA[Setup NtopNG on PfSense the Correct Way]]></title><description><![CDATA[The official ntopng package for pfsense is full of bugs, but there is an alternative way to have a fully operational ntopng integration with pfsense.]]></description><link>https://blog.atyafnet.com/setup-ntopng-on-pfsense-the-correct-way/</link><guid isPermaLink="false">60408854ece513000187e6ac</guid><category><![CDATA[Tutorial]]></category><category><![CDATA[pfsense]]></category><category><![CDATA[ntopng]]></category><category><![CDATA[network monitoring]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Thu, 04 Mar 2021 12:53:49 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2021/03/pfsense-and-ntopng.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2021/03/pfsense-and-ntopng.jpg" alt="Setup NtopNG on PfSense the Correct Way"><p></p><p></p><h2 id="background">Background</h2><p>Ntopng is a great tool for diagnosing and monitoring your network. It is available on pfsense firewall through the builtin package manager. Unfortunately, the pfsense port of &#xA0;ntopng package which is installed through the gui package manger has been broken for a long time . In the latest pfsense 2.5 release, they updated ntopng to 4.2 which is great, but it contains a lot of bugs, sometimes ntopng keeps restarting on itself, other times it seems very slow, and I personally faced an issue that whenever an ntopng service restart occurs, all the package&apos;s config gets wiped out, so any modifications you make, like interface rename or adding alerts endpoints and recipients gets lost on next service restart. Also in the previous version of pfsense, which had ntopng 3.8, geolocation data was not being reported correctly. This all makes it useless to put in production environments.</p><p>Maybe the most optimal way to setup ntopng is to separate it from the firewall and use a dedicated box to record and analyze network traffic by using a port mirror. However, sometimes you are in a circumstance where it is not feasible to have a separate machine, or maybe the firewall box that you are using is powerful enough to add an active network monitoring function to it.</p><h2 id="tested-on-"><em>Tested On:</em></h2><p><em>pfSense 2.5, ntopng 4.2</em></p><p></p><h2 id="tl-dr">TL;DR</h2><p>The better way to integrate ntopng with pfsense is by installing the ntopng package directly from the command line. These are the needed steps in short:</p><p>1- On pfsense 2.5, install ntopng and redis database using the shell</p><pre><code class="language-sh">pkg install ntopng redis</code></pre><p><br>2- Enable ntopng and redis services</p><pre><code class="language-sh">sysrc redis_enable=&quot;YES&quot;
sysrc ntopng_enable=&quot;YES&quot;</code></pre><p><br>3- Install Shellcmd package from pfsense gui package manager</p><p><br>4- Add the below entries to Shellcmd settings and save</p><pre><code class="language-sh">service redis start
service ntopng start</code></pre><p><br>5- Configure ntopng geolocation by downloading the relevant .mmdb files from MaxMind and place them in the folder &quot;/usr/local/share/ntopng/httpdocs/geoip&quot;</p><p><br>6- Edit the startup script of ntopng to add your custom command arguments located in &quot;/usr/local/etc/rc.d/ntopng&quot;</p><p><br>7- Start redis and ntopng services, or simply reboot pfsense</p><pre><code class="language-sh">service start redis
service start ntopng</code></pre><hr><h2 id="details"><br>Details</h2><p>First of all, you need to decide whether you are comfortable using the official but unstable ntopng development build from the original author&apos;s package repository (packages.ntop.org), or otherwise the official stable FreeBSD port maintained by the FreeBSD developer madpilot (pkg.freebsd.org), however, the one in FreeBSD repo sometimes gets too behind in development. Unfortunately the ntop.org does not provide a stable build, only a development snapshot (as the time of this writing). </p><p>If you decide to choose the stable build from (pkg.freebsd.org), then by default, pfsense uses (pkg.freebsd.org) so you do not need to add any additional sources. All you need to do is install ntopng and redis. To do that, connect to your pfsense using ssh or use the console and open the shell prompt.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/03/image.png" class="kg-image" alt="Setup NtopNG on PfSense the Correct Way" loading="lazy"></figure><pre><code class="language-sh">pkg install ntopng redis</code></pre><p>If you decide to install the latest but unstable build, then follow the instructions at (packages.ntop.org/FreeBSD), but use FreeBSD 12 if you are on pfsense 2.5 or later.</p><p>After installing ntopng and redis, you need to make them run automatically on boot. The way we do this by using a package called Shellcmd. It is available on pfsense package manager. Simply head over to system menu, then package manager and install Shellcmd. Once installed, go to services menu, then Shellcmd and add entries to start ntopng and redis on system boot. </p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/03/image-5.png" class="kg-image" alt="Setup NtopNG on PfSense the Correct Way" loading="lazy"></figure><h2 id="geolocation">Geolocation</h2><p>Next, you need to setup geolocation databases if you want ntopng to report geolocation data. Refer to this Github Readme on how and why you need to do this. (<a href="https://github.com/ntop/ntopng/blob/dev/doc/README.geolocation.md">https://github.com/ntop/ntopng/blob/dev/doc/README.geolocation.md</a>).</p><p>Unfortunately, there is no pre-built geoipupdate package for FreeBSD, so you will have to download and update the databases manually, or you could lookup some scripts online that automate the process of downloading the databases from MaxMind for you. &quot;/usr/local/share/ntopng/httpdocs/geoip&quot; is where to put the downloaded database files.</p><p></p><h2 id="startup-command-options">Startup-Command Options</h2><p>Now comes the part where you modify the startup script for ntopng to put whatever argument option you need. Edit the file located on &quot;/usr/local/etc/rc.d/ntopng&quot; using any text editor and go to the line that starts with &quot;command_args=&quot; and add the arguments that you need. You can refer to the official ntop docs here: (<a href="https://www.ntop.org/guides/ntopng/cli_options.html">https://www.ntop.org/guides/ntopng/cli_options.html</a>).</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2021/03/image-6.png" class="kg-image" alt="Setup NtopNG on PfSense the Correct Way" loading="lazy"></figure><p>Ntopng is not designed to be used as an aggregator for network traffic data over long periods of time, instead, it is best used for live traffic monitoring. That is why if you want to keep network traffic for data retention, it is best to send flows to other databases that are more efficient for storing over longer periods.</p><p>For example, you could instruct ntopng to dump flows to an elasticsearch database using the argument:</p><pre><code class="language-sh">--dump-flows &apos;es;flows;index_name%Y.%m.%d;http://ip_of_es:9200/_bulk;&apos;</code></pre><p><br>Another thing to note is, if you want to enable https for the ntopng access portal, after adding the command option --https-port &quot;[port_number]&quot;, ntopng tries to find an ssl certificate but it doesn&apos;t find any. The easiest way correct this is to find and rename the provided dummy certificate to .pem file format. The dummy cert is located on &quot;/usr/local/share/ntopng/httpdocs/ssl/ntopng-cert.pem.dummy&quot;.</p><p></p><p>Finally, once everything is setup correctly, you can start ntopng with</p><pre><code class="language-sh">service redis start
service ntopng start</code></pre><p>or simply rebooting pfsense should bring those services up.</p><p>Now you can head over to http(s)//:ip-of-pfsense:3000 or whatever port you defined in the startup options.</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.atyafnet.com/content/images/2021/03/image-7.png" class="kg-image" alt="Setup NtopNG on PfSense the Correct Way" loading="lazy"></figure>]]></content:encoded></item><item><title><![CDATA[VeraCrypt with Windows built-in system image creator (0x80070001)]]></title><description><![CDATA[<p>I was trying to set up my Windows machine to create a system disk backup image to a VeraCrypt mounted drive. Windows seems not to like the way VeraCrypt mounts drives, it complains about not finding a proper backup device and giving error code 0x80070001.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2020/07/image.png" class="kg-image" alt loading="lazy"></figure><p>A detailed behavior is explained</p>]]></description><link>https://blog.atyafnet.com/veracrypt-0x80070001/</link><guid isPermaLink="false">5f0f49aab2df8d0001703e23</guid><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Wed, 15 Jul 2020 19:23:45 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2020/07/VmgvHT6P-2.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2020/07/VmgvHT6P-2.png" alt="VeraCrypt with Windows built-in system image creator (0x80070001)"><p>I was trying to set up my Windows machine to create a system disk backup image to a VeraCrypt mounted drive. Windows seems not to like the way VeraCrypt mounts drives, it complains about not finding a proper backup device and giving error code 0x80070001.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2020/07/image.png" class="kg-image" alt="VeraCrypt with Windows built-in system image creator (0x80070001)" loading="lazy"></figure><p>A detailed behavior is explained more here: <a href="https://sourceforge.net/p/veracrypt/discussion/technical/thread/fb84dd7b/">https://sourceforge.net/p/veracrypt/discussion/technical/thread/fb84dd7b/</a></p><p>This might be a driver compatibility issue with VeraCrypt drivers and Windows.</p><p>Fortunately, this issue seems to appear only when using the graphical interface of Windows Backup and Restore. When using the backend tool, which is &apos;wbadmin&apos;, the backup process goes smoothly without giving errors.</p><!--kg-card-begin: html--><h3><span style="color: #339966;">So the workaround here is to use the command prompt instead. The equivalent default command when creating a system drive image is:</span></h3><!--kg-card-end: html--><figure class="kg-card kg-code-card"><pre><code>wbadmin start backup -allcritical -backupTarget:X: -quiet</code></pre><figcaption>(admin privileges needed)</figcaption></figure><p>Where &quot;x&quot; is destination drive that will hold the backed-up image.</p><p>You can type &apos;wbadmin /?&apos; to get more info and the syntax.</p><p>Similar situation can be found here:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://superuser.com/questions/1316611/how-to-back-up-to-a-veracrypt-container-using-windows-10-built-in-tools"><div class="kg-bookmark-content"><div class="kg-bookmark-title">How to back up to a VeraCrypt container using Windows 10 built-in tools?</div><div class="kg-bookmark-description">Background: I am running Windows 10 Pro 1709. My C: drive is encrypted with BitLocker. I have an ASUS RT-AC55U with an 8TB HDD attached to its USB 3.0 port. My goal is to use part of that HDD as an</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://cdn.sstatic.net/Sites/superuser/Img/apple-touch-icon.png?v=0ad5b7a83e49" alt="VeraCrypt with Windows built-in system image creator (0x80070001)"><span class="kg-bookmark-author">Super User</span><span class="kg-bookmark-publisher">user746633</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://cdn.sstatic.net/Sites/superuser/Img/apple-touch-icon@2.png?v=e869e4459439" alt="VeraCrypt with Windows built-in system image creator (0x80070001)"></div></a></figure><p>I&apos;ve tested this with both, a local encrypted drive, and a network attached storage using SMB that contains an encrypted file container, and it works fine in both cases.</p><p></p><p>Update: </p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2020/07/image-2.png" class="kg-image" alt="VeraCrypt with Windows built-in system image creator (0x80070001)" loading="lazy"></figure><p>At the end of the backup process, Windows reports that the volumes were successfully backed-up, but gives the error code &quot;0x8004230f&quot;.</p><p>This might prevent the image restoration process since Windows considers the backup process a failure.</p><p>This is fine for me, since all I need is the .vhdx files that are created for each partition when creating a system image, so I won&apos;t be using the Restore Windows Image tool anyway.</p><p>I hope someone finds this helpful.</p><p></p><p>Update 2:</p><p>There is a much better way to do this if the only goal is to create a .vhdx disk image of a running system, use <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/disk2vhd">Sysinternal disk2vhd utility</a>.</p>]]></content:encoded></item><item><title><![CDATA[Deploy PfSense on DigitalOcean with a VPC Network]]></title><description><![CDATA[With the addition of Virtual Private Cloud feature in DigitalOcean, pfsense can be a great gateway and firewall to protect your droplets in a private isolated network.]]></description><link>https://blog.atyafnet.com/deploy-pfsense-on-digitalocean-with-vpc-network/</link><guid isPermaLink="false">5ed8f4adf74536000103ac8c</guid><category><![CDATA[digitalocean]]></category><category><![CDATA[pfsense]]></category><category><![CDATA[VPC]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Tue, 02 Jun 2020 13:20:00 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2020/06/Untitled-2.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2020/06/Untitled-2.jpg" alt="Deploy PfSense on DigitalOcean with a VPC Network"><p>PfSense is a great firewall that can be implemented in different scenarios. With the addition of Virtual Private Cloud (VPC) feature in DigitalOcean, pfsense can be a great gateway and firewall to protect your droplets in a private isolated network.</p><p>Unfortunately, DigitalOcean does not provide (yet) a ready to use image for pfsense. There are ways to deploy pfsense on top of an existing FreeBSD installation, but this is <a href="https://docs.netgate.com/pfsense/en/latest/install/installing-pfsense-over-an-existing-freebsd-installation.html#installing-pfsense-over-an-existing-freebsd-installation">not recommended by Netgate</a>. Alternatively, You can import a custom image to use in DigitalOcean, but the import tool does not support importing iso files, it only support these extensions: <code>gz, bz2, vmdk, vhdx, qcow, qcow2, vdi, raw, img, xz</code>.</p><h3 id="there-is-a-simpler-solution-to-this-but-requires-manual-upload-of-the-image-from-your-local-machine-you-can-simply-download-the-pfsense-iso-image-from-pfsense-org-install-it-as-a-vm-on-a-hypervisor-eg-vmware-virtualbox-hyper-v-once-it-finishes-installing-and-reboots-switch-it-off-then-upload-the-vm-disk-vmdk-vdi-etc-to-digitalocean-now-you-have-a-ready-to-set-up-pfsense-image-">There is a simpler solution to this, but requires manual upload of the image from your local machine. You can simply <a href="https://www.pfsense.org/download/" rel="noreferrer noopener">download the pfsense iso image from pfsense.org</a>, install it as a vm on a hypervisor (eg. VMware, VirtualBox, Hyper-V), once it finishes installing and reboots, switch it off, then upload the vm disk (vmdk, vdi, etc..) to DigitalOcean. Now you have a ready to set up pfsense image.</h3><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2020/06/image-5.png" class="kg-image" alt="Deploy PfSense on DigitalOcean with a VPC Network" loading="lazy"></figure><p>Before you create a disk image using a hypervisor, you should at least give it a 2GB disk for installation (no worries, disk size can be increased once deployed in DigitalOcean), you also don&apos;t want to give it more than 2GB because you don&apos;t want to waste your bandwidth later when you upload.</p><p>Now create a droplet from that image and enable VPC or choose an already created VPC instance. There is also some tweaking needed once you create a droplet. First, you need to access the console and follow pfsense setup, define the WAN network which is the first adapter, then make sure that you do not define a LAN network. This step is important because when you don&apos;t define a LAN, pfsense places an anti-lockout rule on the WAN interface, which is the interface you will be using to connect to pfsense GUI.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2020/06/image-6.png" class="kg-image" alt="Deploy PfSense on DigitalOcean with a VPC Network" loading="lazy"></figure><p>Once you finish the console setup wizard you should be able to access pfsense through the droplet&apos;s public ip address. Once you login make sure that the first step is changing the default admin password (I strongly recommend adding the droplet to a DO Cloud Firewall and denying all access to it except from your public ip address during the whole setup process).</p><p>Now it&apos;s time to define the LAN network, but before you actually do that, you need to add a firewall rule to the WAN interface to allow management, because once you define the LAN, the anti-lockout rule gets removed.</p><figure class="kg-card kg-image-card"><img src="https://blog.atyafnet.com/content/images/2020/06/image-7.png" class="kg-image" alt="Deploy PfSense on DigitalOcean with a VPC Network" loading="lazy"></figure><p>After you add the rule, you can now go to the interfaces tab and assign the new interface which is the VPC. You would want to configure it as a DHCP client because VPCs do not support running static ip addresses without some tweaking and advanced configurations <a href="https://atyafnet.com/2020/05/28/thoughts-and-experiments-with-digitaloceans-new-vpc-network/" rel="noreferrer noopener">as discussed in the previous blog here</a>.</p><p>Another thing you need to watch for is disk space. Running <code><em>gpart show</em></code> in the command prompt, you will notice that pfsense uses only part of the disk space. You need to expand the partition, as well as the file system to reclaim all the unused free space. To do this, you need to follow <a href="https://www.freebsd.org/doc/handbook/disks-growing.html" rel="noreferrer noopener">this guide on FreeBSD.org here</a>.</p><h3></h3><!--kg-card-begin: html--><div style="background-color: #02180c; color: white; padding: 20px;">
<h3 style="text-align: center;"><span style="color: #339966;">Now that your pfsense firewall is ready, you can start tweaking it as your needs.</span></h3>
</div><!--kg-card-end: html--><p></p><p>You can start by installing HAProxy, ACME and Snort packages to use pfsense as reverse proxy, load balancer and a layer 7 cloud firewall.</p><p></p><h2 id="security-concerns-with-unencrypted-traffic-in-vpcs">Security concerns with unencrypted traffic in VPCs</h2><p>For droplets, VPCs are a transparent layer 2 medium. It is true that VPCs are private networks between droplets only you define, it is also true that traffic between nodes in a VPC never leave a data center, but it doesn&apos;t mean all your nodes live in the same rack space.</p><p>Let&apos;s say for example, for easier and simpler configurations, you want to run unencrypted http traffic between web servers and a proxy. This opens up the question of the possibility of someone sniffing traffic at the switching level. Of course I am not implying that someone <strong><em>is</em></strong> violating privacy terms, but it is a security best practices to not let any unencrypted traffic leave a physical link.</p><p>To the rescue, pfsense has a great and easy to use OpenVPN server. You could run it on pfsense and configure clients to send all unencrypted traffic through the VPN tunnel.</p><p>That being said, this goes into a different category, so I will leave it here, or maybe create a dedicated blog in the future.</p>]]></content:encoded></item><item><title><![CDATA[Thoughts and experiments with DigitalOcean's new VPC network]]></title><description><![CDATA[On April 7th, Digital Ocean announced the availability of its new feature called Virtual Private Cloud (VPC). It is essentially a local network between your droplets.]]></description><link>https://blog.atyafnet.com/thoughts-and-experiments-with-digitaloceans-new-vpc-network/</link><guid isPermaLink="false">5ed8e17df74536000103ac4d</guid><category><![CDATA[digitalocean]]></category><category><![CDATA[deepdives]]></category><dc:creator><![CDATA[Yaqoob AL-Hajri]]></dc:creator><pubDate>Thu, 28 May 2020 12:03:00 GMT</pubDate><media:content url="https://blog.atyafnet.com/content/images/2020/06/digital-ocean-wordpress-guide.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.atyafnet.com/content/images/2020/06/digital-ocean-wordpress-guide.jpg" alt="Thoughts and experiments with DigitalOcean&apos;s new VPC network"><p>On April 7th, Digital Ocean announced the availability of its new feature called Virtual Private Cloud <a href="https://www.digitalocean.com/docs/networking/vpc/#7-april-2020" rel="noreferrer noopener">(<strong>VPC</strong>)</a>. It is essentially a local network between your droplets, that let your resources communicate privately in a local network using a different interface without needing to hop to the public internet then back again. Put simply, it&#x2019;s like a LAN between droplets.</p><p></p><p>You can enable VPC in any new droplet you create. If you have not defined a VPC before, the setup will create a default one for you when creating a new droplet if you choose to enable VPC.</p><p>This seems pretty good feature to use and simplifies deployments instead of manually designing custom tunneling solutions between droplets.</p><p>One use case for this feature I can image, is when you want to run all your services behind a proxy. You could easily assign a VPC to to the backend services with the proxy, while exposing only the proxy to the public internet.</p><p>However, there are some limitations, one is that VPCs cannot traverse across data centers. That means if you were to create a VPC on a data center, it would only be available for droplets residing on that particular data center. This is kinda obvious, because to be traversable across data centers it would require Layer 3 tunnels and other expensive complexities.</p><p>Another limitation is that, according to DO docs, <a href="https://www.digitalocean.com/docs/networking/vpc/#limits" rel="noreferrer noopener">VPCs do not support broadcast</a>. That means you cannot run network protocols that rely on broadcast such as DHCP. However, this is <em>almost </em>true, because ARP does actually run fine on the network (or so I thought). To test that, I fired up two droplets, assigned them the same VPC, ran Wireshark and let them communicate.</p><p>I can clearly sea ARP requests and responses as in following screenshot.</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.atyafnet.com/content/images/2020/06/image.png" class="kg-image" alt="Thoughts and experiments with DigitalOcean&apos;s new VPC network" loading="lazy"></figure><p>Seeing the destination as broadcast in the first frame then seeing a reply to that frame felt weird for me. The documentation clearly states that broadcast and multicast <a href="https://www.digitalocean.com/docs/networking/vpc/#limits" rel="noreferrer noopener">are not supported</a>. More on that later.</p><p>This seems all great, but is it actually that seamless?</p><p>Well, I encountered a problem connecting two droplets together in the same VPC and the same subnet. Before that, and as I usually do after I create a new droplet, I immediately lock it down to a single ip that is my public ip address for security and management purposes (I do this using the built-in firewall function in DO in the inbound rules section).</p><p>Back to the problem, the two droplets refused to establish any sort of connection. I could see the the ARP requests and responses and they look just fine, also the ARP tables of each host looks fine too. So it&#x2019;s got to be a unicast issue.</p><p>After spending nearly an hour pulling my hair out, I found out that it is actually a <a href="https://www.digitalocean.com/docs/networking/firewalls/#limits" rel="noreferrer noopener">cloud firewall limitation</a>, in which public and private traffic are both affected by the rules defined in the cloud firewall, not just the public traffic. So if you want to use the firewall, you would have to make sure there are permit rules between the resources you want connect. For example, if your VPC subnet is 10.0.0.0/24, you would want to add a permit rule to the firewall with a destination of 10.0.0.0/24 to allow all resources in that firewall instance to communicate with each other.</p><p>After fixing the above issue, everything went smooth and I could connect droplets directly to each other. Then I further decided to test the reliability of the connection by measuring the bandwidth using iperf3.</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.atyafnet.com/content/images/2020/06/image-1.png" class="kg-image" alt="Thoughts and experiments with DigitalOcean&apos;s new VPC network" loading="lazy"></figure><p>It seems that this droplet is given a shared 10 GBit connection. I noticed that sometimes the bandwidth drops below 200 MBits/s, however this is certainly sufficient for most use cases.</p><p>Getting back to broadcast limitation again, as stated before, VPCs do not support broadcast. However, if that&apos;s the case, then how come ARP frames reach other nodes in the network? Well, it seems that some ARP frames are one exception to the rule. Notice that I say some, because the other some actually get dropped by whatever internal firewall DO are implementing. So let&apos;s generate some ARP traffic:</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.atyafnet.com/content/images/2020/06/image-2.png" class="kg-image" alt="Thoughts and experiments with DigitalOcean&apos;s new VPC network" loading="lazy"></figure><p>Here I use nmap to tell it to scan the the given range and effectively generate ARP request to every scanned ip address.</p><p>Here is how it looks on Wireshark on the machine that generated the requests:</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.atyafnet.com/content/images/2020/06/image-3.png" class="kg-image" alt="Thoughts and experiments with DigitalOcean&apos;s new VPC network" loading="lazy"></figure><p>And here is how it looks on other machines:</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.atyafnet.com/content/images/2020/06/image-4.png" class="kg-image" alt="Thoughts and experiments with DigitalOcean&apos;s new VPC network" loading="lazy"></figure><p>Apparently there is some sort of internal filtering at layer 2 that limits broadcast and multicast.</p><p>From experimenting with the situation, I find that:</p><p><strong>1. Gratuitous ARP are filtered.</strong></p><p><strong>2. Only ARP requests that ask for an ip/mac combination that has already been assigned by the VPC&apos;s DHCP server are permitted.</strong></p><p><strong>3. Only ARP requests that are generated from an assigned address by the VPC&apos;s DHCP server are permitted.</strong></p><p>To sum up point 2 and 3; only DHCP assigned addresses will be able to send and receive broadcast frames.</p><p>Beside not being able to run your own DHCP server, you cannot assign a static ip address to your machines and be able to connect to other machines on the VPC network, unless you add static ARP entries to each of your hosts.</p><p></p><p>I think there is still a lot to be explored in this topic. And I might have miss interpreted something during this analysis.</p><p></p><h2 id="resources-">Resources:</h2><p><a href="https://www.youtube.com/watch?v=nbo5HrmZjXo">https://www.youtube.com/watch?v=nbo5HrmZjXo/</a></p><p><a href="https://www.digitalocean.com/docs/networking/vpc/">https://www.digitalocean.com/docs/networking/vpc/</a></p><p><a href="https://www.digitalocean.com/docs/networking/firewalls/">https://www.digitalocean.com/docs/networking/firewalls/</a></p>]]></content:encoded></item></channel></rss>