<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Homebrew &#8211; Digitaldocblog</title>
	<atom:link href="https://digitaldocblog.com/tag/homebrew/feed/" rel="self" type="application/rss+xml" />
	<link>https://digitaldocblog.com</link>
	<description>Various digital documentation</description>
	<lastBuildDate>Wed, 12 Apr 2023 05:36:31 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://digitaldocblog.com/wp-content/uploads/2022/08/cropped-website-icon-star-500-x-452-transparent-32x32.png</url>
	<title>Homebrew &#8211; Digitaldocblog</title>
	<link>https://digitaldocblog.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Create a virtual Hacking Lab on Apple Silicon Mac</title>
		<link>https://digitaldocblog.com/mac/create-a-virtual-hacking-lab-on-apple-silicon-mac/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 12 Apr 2023 05:36:31 +0000</pubDate>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Homebrew]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://digitaldocblog.com/?p=214</guid>

					<description><![CDATA[When you are a cyber security consultant, a pen tester or even a system operator with technical interest then you want to perform attacks on systems to understand exactly how&#8230;]]></description>
										<content:encoded><![CDATA[
<p>When you are a cyber security consultant, a pen tester or even a system operator with technical interest then you want to perform attacks on systems to understand exactly how hackers work in real life and which vulnerabilities are exploited in order to take control of the system. If you know how hackers attack your system, you can protect it better. </p>



<p>Under no circumstances should you start attacks on systems located on the internet, even if the systems belong to you, because from a legal point of view it is always a risk and you can get into trouble. You should build a game environment in your local network in which you install attacker and victim system. It is important that you only use private IP addresses and that the game environment does not route any data traffic to and from the Internet. This gaming environment is then your <strong>Hacking Lab</strong> in which you can try out different attack scenarios safely and securely.</p>



<p>The idea is to install a virtualization software on the operating system of the host computer which is in my case an M2 Apple Mac with Ventura 13.3. The virtualization software I use is <a href="https://mac.getutm.app" title="UTM for Mac">UTM</a>. UTM create the virtual guest machines in a virtual Lan (Vlan) isolated from the host operating system and the local network. The virtual guest machines can talk to each other but can not access the local network or the internet via the host. The host can talk to the virtual guest machines. This network mode is defined as <strong>host only</strong> mode.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img fetchpriority="high" decoding="async" width="3950" height="1141" src="https://digitaldocblog.com/wp-content/uploads/2023/04/01-network.png" alt="Network setup for the Hacking Lab" class="wp-image-211" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/01-network.png 3950w, https://digitaldocblog.com/wp-content/uploads/2023/04/01-network-300x87.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/01-network-1024x296.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/01-network-768x222.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/01-network-1536x444.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/01-network-2048x592.png 2048w" sizes="(max-width: 3950px) 100vw, 3950px" /><figcaption class="wp-element-caption">Network setup for the Hacking Lab</figcaption></figure>
</div>


<p><em>Note: UTM provide various network operating modes. Details can be read in the <a href="https://docs.getutm.app/settings-qemu/devices/network/network/" title="UTM network modes">UTM documentation</a>.</em></p>



<p>The installation of UTM can be done in two ways:</p>



<ol class="wp-block-list">
<li>Payed version in the Apple <a href="https://apps.apple.com/de/app/utm-virtual-machines/id1538878817?mt=12" title="UTM in the App Store">App Store</a></li>



<li>Free download from the <a href="https://mac.getutm.app" title="Download UTM">UTM site</a></li>
</ol>



<p>I recommend to install the payed version from the App Store. You will get all updates whenever there are updates available and you support the development of this fantastic tool. At the time of writing this article the costs for the payed version of UTM were 11.99 Euro.</p>



<p>Once UTM has been installed we need to create the attacker and the victim as virtual guest machines in UTM. The attacker is a <a href="https://www.kali.org/get-kali/#kali-installer-images" title="Get Kali Linux Images">Kali Linux Image</a> the victim will be a host prepared with vulnarabilities from <a href="https://www.vulnhub.com" title="Vulnerable Hub. Hosts to be attacked">vulnerable hub</a>. </p>



<p>On vulnerable hub you find vulnerable virtual machines. These machines are prepared from cyber security enthusiasts for other security enthusiasts. These machines are available with vulnerabilities and created specifically for the purpose of hacking them. </p>



<h3 class="wp-block-heading">Create a vulnerable virtual machine in UTM</h3>



<p>To create a victim in UTM you search for a machine which best suits your needs and download the virtual machine from vulnerable hub which is available there in the <a href="https://docs.fileformat.com/disc-and-media/ova/" title="OVA File format explained">.ova format</a>. OVA is basically a tar based archive that contains among other things, an <a href="https://docs.fileformat.com/disc-and-media/ovf/" title=".ovf File format">.ovf file</a> with the specification of the virtual machine and in most cases disk image files in the format .vdi and .vmdk. Other files contained in the .ova file we don&#8217;t consider.</p>



<p>On vulnerable hub we <a href="https://www.vulnhub.com/?q=Robot" title="search for Robot">search for Robot</a> and find 3 search results. We look for <a href="https://www.vulnhub.com/entry/mr-robot-1,151/" title="Mr-Robot: 1 vulnerable machine">Mr-Robot: 1</a>, click on it and find the download link to download the .ova file for the vulnerable virtual machine.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/02-Vulnerable-Hub-Search-Robot-1.jpeg" alt="Find Mr-Robot: 1 an volnerable hub" class="wp-image-201" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/02-Vulnerable-Hub-Search-Robot-1.jpeg 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/02-Vulnerable-Hub-Search-Robot-1-300x195.jpeg 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/02-Vulnerable-Hub-Search-Robot-1-1024x666.jpeg 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/02-Vulnerable-Hub-Search-Robot-1-768x499.jpeg 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/02-Vulnerable-Hub-Search-Robot-1-1536x999.jpeg 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/02-Vulnerable-Hub-Search-Robot-1-2048x1332.jpeg 2048w" sizes="(max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Find Mr-Robot: 1 an volnerable hub</figcaption></figure>
</div>


<p>   To install Mr-Robot: 1 as virtual machine in UTM we first must unpack the .ova file. </p>



<pre class="wp-block-code"><code>patrick % ls
total 2884016
mrRobot.ova

patrick % tar -xvf mrRobot.ova 
x mrRobot.ovf
x mrRobot.mf
x mrRobot-disk1.vmdk

patrick % ls
total 2884016
mrRobot-disk1.vmdk mrRobot.mf mrRobot.ova mrRobot.ovf

</code></pre>



<p>Then we convert the disk image file mrRobot-disk1.vmdk into the .qcow2 format which is the supported format by UTM. If you need some more detailed information there is a very good explanation on <a href="https://www.xmodulo.com/convert-ova-to-qcow2-linux.html" title="How to convert ova to qcow2">Xmodulo</a>. </p>



<p>To convert the disk image from into .qcow2 we need the utility qemu-img. I install the complete <a href="https://formulae.brew.sh/formula/qemu#default" title="Qemu Emulator on homebrew">qemu emulator</a> from <a href="https://formulae.brew.sh" title="Homebrew">homebrew</a> as the qemu utilities are not available as single option. If you don&#8217;t know homebrew or in case homebrew is not installed on your Mac just go to my blog site <a href="https://digitaldocblog.com" title="Digitaldocblog">digitaldocblog</a> and read <a href="https://digitaldocblog.com/mac/how-to-setup-homebrew-on-mac-os/" title="How to setup homebrew on a Mac">the article</a> how to intstall and use homebrew on your Mac.</p>



<pre class="wp-block-code"><code>patrick %  brew install qemu

patrick % ls
total 2884016
mrRobot-disk1.vmdk mrRobot.mf mrRobot.ova mrRobot.ovf

patrick % qemu-img convert -O \
qcow2 mrRobot-disk1.vmdk mrRobot.qcow2

patrick % ls
total 2884016
mrRobot-disk1.vmdk mrRobot.mf mrRobot.ova mrRobot.ovf
mrRobot.qcow2

</code></pre>



<p>Then you start UTM from the main menue and click create new virtual machine. </p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/03-UTM-Create-Virt-Machine.jpeg" alt="UTM main menue" class="wp-image-209" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/03-UTM-Create-Virt-Machine.jpeg 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/03-UTM-Create-Virt-Machine-300x195.jpeg 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/03-UTM-Create-Virt-Machine-1024x666.jpeg 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/03-UTM-Create-Virt-Machine-768x499.jpeg 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/03-UTM-Create-Virt-Machine-1536x999.jpeg 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/03-UTM-Create-Virt-Machine-2048x1332.jpeg 2048w" sizes="(max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">UTM main menue</figcaption></figure>
</div>


<p>Then you click on <strong>Emulate</strong>. You click on Emulate because the virtual machine you are going to install is compiled for the x86 64 Intel CPU Architechture. This Intel CPU must be emulated by UTM to provide the basis that your host can run as guest on your Apple ARM Silicon Mac (M1 and M2). In the next chapter when we install the attacker Linux we choose a virtual machine that is compiled for the Apple ARM 64 Silicon architechture. Then we click Virtualize because this guest machine is compiled for your host architecture (M1 or M2).</p>



<p>After Emulate you click on <strong>Custom</strong>. Then you <strong>skip ISO boot</strong>, accept in the following all default values ​​and assign a name fitting your needs for your new virtual host. At the end, the configuration is completed with safe.</p>



<p>In the left panel you see the virtual machine you just created. Mark it and click on the <strong>settings menue</strong> at the top right side.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/04-UTM-virtual-machine-settings-2.png" alt="Virtual Machine Settings" class="wp-image-199" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/04-UTM-virtual-machine-settings-2.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/04-UTM-virtual-machine-settings-2-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/04-UTM-virtual-machine-settings-2-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/04-UTM-virtual-machine-settings-2-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/04-UTM-virtual-machine-settings-2-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/04-UTM-virtual-machine-settings-2-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Virtual Machine Settings</figcaption></figure>
</div>


<p>In the left panel of the settings go to the <strong>Drives section</strong> and delete the IDE drive. Stay in the Drives section and create a new drive. Here you click on Import and select the .qcow2 file on your hard disk (the one you created as you converted the .vmdk file). After this step go to the <strong>QEMU section</strong> where you unselect UEFI Boot. To set the correct network settings go to <strong>Network section</strong> and select Host only. Finally you click on safe and end the configuration.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/07-UTM-network-1.png" alt="Virtual machine network settings" class="wp-image-203" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/07-UTM-network-1.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/07-UTM-network-1-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/07-UTM-network-1-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/07-UTM-network-1-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/07-UTM-network-1-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/07-UTM-network-1-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Virtual machine network settings</figcaption></figure>
</div>


<h3 class="wp-block-heading">Create the attacker virtual machine in UTM</h3>



<p>To launch attacks against a vulnerable virtual host I recommend installing a standard Kali Linux machine in UTM. Most tools are already pre-installed here and you can start immediately. </p>



<p>We go on the Kali.org website an there into the section <a href="https://www.kali.org/get-kali/" title="Get Kali on Kali.org">get Kali</a>. I choose installer images and then we select the ARM Silicon (ARM64) for download the Kali especially compiled for our Apple ARM Silicon M2 architecture (if you have a M1 this is also working fine). Click on the recommended installer and download the iso image to your hard drive.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/08-Kali-Installer-Image-1.png" alt="Kali Linux Installer for ARM64" class="wp-image-204" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/08-Kali-Installer-Image-1.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/08-Kali-Installer-Image-1-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/08-Kali-Installer-Image-1-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/08-Kali-Installer-Image-1-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/08-Kali-Installer-Image-1-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/08-Kali-Installer-Image-1-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Kali Linux Installer for ARM64</figcaption></figure>
</div>


<p>After you have downloaded the iso image the installation will be performed in 2 steps. First you create a new virtual machine in virtualization mode and then in step 2 you install the Kali Linux on it.</p>



<p>Click on the + sign in the top menue and then select Virtualize.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/09-Install-Virtual-Machine-Virtualization-Mode-1.png" alt="Install virtual machine in virtualization mode" class="wp-image-206" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/09-Install-Virtual-Machine-Virtualization-Mode-1.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/09-Install-Virtual-Machine-Virtualization-Mode-1-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/09-Install-Virtual-Machine-Virtualization-Mode-1-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/09-Install-Virtual-Machine-Virtualization-Mode-1-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/09-Install-Virtual-Machine-Virtualization-Mode-1-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/09-Install-Virtual-Machine-Virtualization-Mode-1-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Install virtual machine in virtualization mode</figcaption></figure>
</div>


<p>After that you can select the OS you want to install. Here you click on Linux and  here you select the iso image you downloaded from Kali in the Boot-Iso-Image section.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/10-Select-ISO-Image-5.png" alt="Select the iso image in the Boot-Iso-Image section" class="wp-image-196" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/10-Select-ISO-Image-5.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/10-Select-ISO-Image-5-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/10-Select-ISO-Image-5-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/10-Select-ISO-Image-5-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/10-Select-ISO-Image-5-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/10-Select-ISO-Image-5-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Select the iso image in the Boot-Iso-Image section</figcaption></figure>
</div>


<p>Then you click continue and keep the default value for the RAM but set the CPU cores to 4.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/11-CPU-Cores-To-4-3.png" alt="Set CPU Cores to 4" class="wp-image-198" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/11-CPU-Cores-To-4-3.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/11-CPU-Cores-To-4-3-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/11-CPU-Cores-To-4-3-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/11-CPU-Cores-To-4-3-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/11-CPU-Cores-To-4-3-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/11-CPU-Cores-To-4-3-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Set CPU Cores to 4</figcaption></figure>
</div>


<p>In the following you can keep all default values i.e. for storage and always click on continue until you come to the Summary section. Here you can give you new virtual machine a name according to your needs. Finally you click on safe.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/12-Summary-Virtual-Host-1.png" alt="Give your virtual machine a name" class="wp-image-208" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/12-Summary-Virtual-Host-1.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/12-Summary-Virtual-Host-1-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/12-Summary-Virtual-Host-1-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/12-Summary-Virtual-Host-1-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/12-Summary-Virtual-Host-1-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/12-Summary-Virtual-Host-1-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">Give your virtual machine a name</figcaption></figure>
</div>


<p>Then click on the settings to open the settings menue. Go to the Devices section and click on new and add a new serial device emulation. This is very important for the installation of Kali Linux on your virtual machine otherwise the installer will not start. </p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2208" height="1436" src="https://digitaldocblog.com/wp-content/uploads/2023/04/13-New-Serial-Device-Emulation-5.png" alt="New Serial Device Emulation" class="wp-image-197" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/13-New-Serial-Device-Emulation-5.png 2208w, https://digitaldocblog.com/wp-content/uploads/2023/04/13-New-Serial-Device-Emulation-5-300x195.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/13-New-Serial-Device-Emulation-5-1024x666.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/13-New-Serial-Device-Emulation-5-768x499.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/13-New-Serial-Device-Emulation-5-1536x999.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/13-New-Serial-Device-Emulation-5-2048x1332.png 2048w" sizes="auto, (max-width: 2208px) 100vw, 2208px" /><figcaption class="wp-element-caption">New Serial Device Emulation</figcaption></figure>
</div>


<p> Run the virtual machine to start the installation. Here you see that 2 windows will be opened. Choose the window that says terminal one and start the installation. Don’t choose Graphical installation. Then follow the installation steps. You can see a very good <a href="https://www.youtube.com/watch?v=9zdjQ9w_v_4" title="How To Install Kali Linux 2022 On M1 / M2 Mac Using UTM">video on YouTube</a> that guide you through the standard installation.</p>



<p>Once you see the finish installation screen then use the navigation bar of this window terminal 1 and shut down the virtual machine. Close the second window that has been opened when you started with the installation.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1288" height="924" src="https://digitaldocblog.com/wp-content/uploads/2023/04/14-Installation-Completed-1.png" alt="Installation Completed. Shut down." class="wp-image-205" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/14-Installation-Completed-1.png 1288w, https://digitaldocblog.com/wp-content/uploads/2023/04/14-Installation-Completed-1-300x215.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/14-Installation-Completed-1-1024x735.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/14-Installation-Completed-1-768x551.png 768w" sizes="auto, (max-width: 1288px) 100vw, 1288px" /><figcaption class="wp-element-caption">Installation Completed. Shut down.</figcaption></figure>
</div>


<p>Then you go to the main window, select the virtual machine you just installed, go to the main window and unmount the iso at the bottom of the page.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2006" height="1480" src="https://digitaldocblog.com/wp-content/uploads/2023/04/15-Unmount-iso-1.png" alt="Unmount the iso" class="wp-image-200" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/15-Unmount-iso-1.png 2006w, https://digitaldocblog.com/wp-content/uploads/2023/04/15-Unmount-iso-1-300x221.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/15-Unmount-iso-1-1024x755.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/15-Unmount-iso-1-768x567.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/15-Unmount-iso-1-1536x1133.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/15-Unmount-iso-1-120x90.png 120w" sizes="auto, (max-width: 2006px) 100vw, 2006px" /><figcaption class="wp-element-caption">Unmount the iso</figcaption></figure>
</div>


<p>Open the settings and go to the device sections and remove the serial device you created before. To set the correct network settings go to <strong>Network section</strong> and select Host only. Finally you click on safe and end the configuration.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2006" height="1440" src="https://digitaldocblog.com/wp-content/uploads/2023/04/16-remove-serial-device-1.png" alt="Remove serial device" class="wp-image-202" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/16-remove-serial-device-1.png 2006w, https://digitaldocblog.com/wp-content/uploads/2023/04/16-remove-serial-device-1-300x215.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/16-remove-serial-device-1-1024x735.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/16-remove-serial-device-1-768x551.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/16-remove-serial-device-1-1536x1103.png 1536w" sizes="auto, (max-width: 2006px) 100vw, 2006px" /><figcaption class="wp-element-caption">Remove serial device</figcaption></figure>
</div>


<h3 class="wp-block-heading">Check the network configuration</h3>



<p>Run both virtual machines in UTM, Robot1VulnerableHost and the Attacker machine KaliLinux. When you run Robot1VulnerableHost you see the logon screen after the machine has beefed. Of course you don’t have login credentials because you want to hack into it instead of logging in. This is different on your KaliLinux. Here you created an account during the installation. </p>



<p>Log into KaliLinux and open a Terminal. Check the ip address from KaliLinux. The ip address is <strong>192.168.128.5</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2558" height="1440" src="https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali.png" alt="Check the IP Addess of KaliLinux" class="wp-image-210" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali.png 2558w, https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali-300x169.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali-1024x576.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali-768x432.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali-1536x865.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali-2048x1153.png 2048w, https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali-1140x641.png 1140w, https://digitaldocblog.com/wp-content/uploads/2023/04/17-check-IP-Kali-540x304.png 540w" sizes="auto, (max-width: 2558px) 100vw, 2558px" /><figcaption class="wp-element-caption">Check the IP Addess of KaliLinux</figcaption></figure>
</div>


<p>Then discover the network 192.168.128.0/24 to find other hosts in the same subnet. Type the following command.</p>



<pre class="wp-block-code"><code>
kaliLinux % netdiscover -r 192.168.128.0/24

</code></pre>



<p>You see 2 hosts in your subnet <strong>192.168.128.1</strong> which is the bridge between your local host network and your vlan and you see <strong>192.168.128.6</strong> which is Robot1VulnerableHost on the same subnet.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2558" height="1440" src="https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan.png" alt="Discover the virtual network" class="wp-image-212" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan.png 2558w, https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan-300x169.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan-1024x576.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan-768x432.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan-1536x865.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan-2048x1153.png 2048w, https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan-1140x641.png 1140w, https://digitaldocblog.com/wp-content/uploads/2023/04/18-netdiscover-vlan-540x304.png 540w" sizes="auto, (max-width: 2558px) 100vw, 2558px" /><figcaption class="wp-element-caption">Discover the virtual network</figcaption></figure>
</div>


<p>You can ping Robot1VulnerableHost but you cannot ping the host computer which is my Mac on subnet 192.168.0.0/24 with the ip address 192.168.0.38. So the bridge does not route traffic from your vlan into the local network which is what we need. The guests can talk to each other but they can not talk to the outside world. </p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2558" height="1440" src="https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1.png" alt="Guests can talk with each other but not with the host" class="wp-image-207" srcset="https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1.png 2558w, https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1-300x169.png 300w, https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1-1024x576.png 1024w, https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1-768x432.png 768w, https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1-1536x865.png 1536w, https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1-2048x1153.png 2048w, https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1-1140x641.png 1140w, https://digitaldocblog.com/wp-content/uploads/2023/04/19-ping-1-540x304.png 540w" sizes="auto, (max-width: 2558px) 100vw, 2558px" /><figcaption class="wp-element-caption">Guests can talk with each other but not with the host</figcaption></figure>
</div>


<p>Then I ping the virtual guests from my Mac. Here you see the host can talk to them. So the network setup of the Hacking Lab is correct.  </p>



<pre class="wp-block-code"><code>patrick % ping 192.168.128.5
PING 192.168.128.5 (192.168.128.5): 56 data bytes
64 bytes from 192.168.128.5: icmp_seq=0 ttl=64 time=0.979 ms
64 bytes from 192.168.128.5: icmp_seq=1 ttl=64 time=0.568 ms
64 bytes from 192.168.128.5: icmp_seq=2 ttl=64 time=0.811 ms
64 bytes from 192.168.128.5: icmp_seq=3 ttl=64 time=0.718 ms
^C

patrick % ping 192.168.128.6
PING 192.168.128.6 (192.168.128.6): 56 data bytes
64 bytes from 192.168.128.6: icmp_seq=0 ttl=64 time=2.663 ms
64 bytes from 192.168.128.6: icmp_seq=1 ttl=64 time=2.298 ms
64 bytes from 192.168.128.6: icmp_seq=2 ttl=64 time=2.330 ms
64 bytes from 192.168.128.6: icmp_seq=3 ttl=64 time=2.310 ms
64 bytes from 192.168.128.6: icmp_seq=4 ttl=64 time=2.318 ms
^C

patrick %

</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to setup Homebrew on Mac OS</title>
		<link>https://digitaldocblog.com/mac/how-to-setup-homebrew-on-mac-os/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 16 Mar 2021 12:00:00 +0000</pubDate>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Homebrew]]></category>
		<guid isPermaLink="false">https://digitaldocblog.com/?p=130</guid>

					<description><![CDATA[Most of the Mac OS users install software via the Apple App store or download a .dmg file from the Internet and and copy the app into the Applications directory&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Most of the Mac OS users install software via the Apple App store or download a .dmg file from the Internet and and copy the app into the Applications directory or run an installation script to install the software on the Mac. Another way to install software on your Mac is using a package manager like <a href="https://brew.sh">Homebrew</a>. Homebrew is very easy to use and you have access to a large number of free software packages from developers around the world. </p>



<h2 class="wp-block-heading">Homebrew Installation and Uninstallation</h2>



<p>First check if Homebrew is (already) installed.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ brew --version
Homebrew 3.0.5
Homebrew/homebrew-core (git revision 4324a52c3e; last commit 2021-03-14)
Homebrew/homebrew-cask (git revision 16c4718ac7; last commit 2021-03-14)
Macbook Pro:~ user$
</code></pre>



<p>The above output show Homebrew 3.0.5.<br></p>



<p>In case Homebrew is not installed first check the requirements for Mac OS on the <a href="https://docs.brew.sh/Installation">Homebrew Installation site</a>.  Here you find that Homebrew requires Command Line Tools (CLT) for Xcode. Therefore I first check if Command Line Tools are installed on my Mac.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ xcode-select -p
/Library/Developer/CommandLineTools
Macbook Pro:~ patrick$
</code></pre>



<p>The above command return that Command Line Tools for xcode (CLT) are installed on my Mac and show the path where the Command Line Tools are installed.</p>



<p>In case Command Line Tools for xcode are not installed run the following command before you start with the Homebrew installation.</p>



<pre class="wp-block-code"><code>:$ xcode-select --install
</code></pre>



<p>Then go to the <a href="https://brew.sh/">Homebrew Website</a> and check the actual installation instructions. At the time of writing this document you run the following script to install Homebrew.</p>



<pre class="wp-block-code"><code>:$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
</code></pre>



<p>After the installation I check the Homebrew version and run <code>brew doctor</code>.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ brew --version
Homebrew 3.0.5
Homebrew/homebrew-core (git revision 4324a52c3e; last commit 2021-03-14)
Homebrew/homebrew-cask (git revision 16c4718ac7; last commit 2021-03-14)

Macbook Pro:~ user$ brew doctor
Your system is ready to brew.
Macbook Pro:~ user$
</code></pre>



<p>The shell output show that Homebrew version 3.0.5 is installed on the system and that I am ready to brew which means that I am now ready to install software with Homebrew.</p>



<p>To uninstall Homebrew you run the following script.</p>



<pre class="wp-block-code"><code>:$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
</code></pre>



<h2 class="wp-block-heading">Update Command Line Tools for xcode</h2>



<p>Homebrew need Command Line Tools for xcode but sometimes Command Line Tools can be outdated. When you run <code>brew doctor</code> and see the following message that Command Line Tools are outdated you must ensure that the latest version of Command Line Tools is installed on your Mac.</p>



<pre class="wp-block-code"><code>Patricks-Macbook Pro:~ patrick$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https:&#47;&#47;developer.apple.com/download/more/.

Patricks-Macbook Pro:~ patrick$ ls -l /Library/Developer
total 0
drwxr-xr-x  5 root  admin  160 15 Sep 07:18 CommandLineTools
drwxr-xr-x  4 root  admin  128  9 Okt  2019 PrivateFrameworks

Patricks-Macbook Pro:~ patrick$ 
</code></pre>



<p>To update Command Line Tools for xcode they must first be uninstalled and then re- installed on the system. Pls. find additional information <a href="https://www.openguru.com/2020/07/how-to-uninstall-mac-os-xcode-command.html">how to uninstall</a> Command Line Tools for xcode and check the related <a href="https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-HOW_CAN_I_UNINSTALL_THE_COMMAND_LINE_TOOLS_">Apple Developer Docs</a>.</p>



<pre class="wp-block-code"><code>Patricks-Macbook Pro:~ patrick$ sudo rm -rf /Library/Developer/CommandLineTools

Patricks-Macbook Pro:~ patrick$ ls -l /Library/Developer
total 0
drwxr-xr-x  4 root  admin  128  9 Okt  2019 PrivateFrameworks

Patricks-Macbook Pro:~ patrick$ sudo xcode-select --install
xcode-select: note: install requested for command line developer tools

Patricks-Macbook Pro:~ patrick$ ls -l /Library/Developer
total 0
drwxr-xr-x  5 root  wheel  160 28 Feb 06:35 CommandLineTools
drwxr-xr-x  4 root  admin  128  9 Okt  2019 PrivateFrameworks

Patricks-Macbook Pro:~ patrick$ xcode-select -p
/Library/Developer/CommandLineTools

Patricks-Macbook Pro:~ patrick$
</code></pre>



<h2 class="wp-block-heading">Homebrew Software Repositories and Tap(s)</h2>



<p>With Homebrew package manager you have access to a wide range of software that can be installed on your system. After Homebrew has been installed on your system you find Homebrew under <code>/usr/local/Homebrew</code> on your system.</p>



<p>Homebrew differentiates between Core Software Packages and Cask Software or so-called Casks. All Software Packages are available in GitHub Repositories.</p>



<p><a href="https://github.com/Homebrew/homebrew-core">Homebrew Core Software Packages</a> are free software developed from developers around the world to be installed on Mac OS platforms using Homebrew. Core software will be installed based on so called formulae. A formula contain the required information for the installation such as i.e. from where the installation files should be loaded, which dependencies exist and how the installation should be performed on the different Mac platforms. All formulae for Core Software Packages have been loaded from Homebrew&#8217;s <strong>GitHub Core-Repository</strong> <a href="https://github.com/Homebrew/homebrew-core">Homebrew/homebrew-core</a> into the <strong>core Tap</strong> on your machine. This Tap can be found on you machine in <code>/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core</code></p>



<p><a href="https://github.com/Homebrew/homebrew-cask">Homebrew Cask Software Packages</a> are native Mac OS Apps like Google Chrome, Firefox or other Mac OS Apps that can be installed using the <a href="https://github.com/Homebrew/homebrew-cask">Homebrew Cask</a> extension of the Homebrew Package Manager instead of installing the software via the Apple App Store or drag and drop a dmg file into the Application folder. How to use Homebrew Cask can be read on the <a href="https://github.com/Homebrew/homebrew-cask/blob/master/USAGE.md">Homebrew Cask GitHub site</a>. Casks will be loaded from the Homebrew&#8217;s <strong>GitHub Cask-Repository</strong> <a href="https://github.com/Homebrew/homebrew-cask">Homebrew/homebrew-cask</a> into the <strong>cask Tap</strong> on your machine. This Tap can be found on you machine in <code>/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask</code>.</p>



<p>It is also possible to install Software that is not available on Homebrew&#8217;s GitHub Core-Repository or Homebrew&#8217;s GitHub Cask-Repository. In this case you must first <code>tap</code> the GitHub Repository to let Homebrew know, from where it should load the formula or cask to install the software package.</p>



<p>For example the formula for <strong>MongoDB</strong> has been removed from the GitHub Core-Repository. But fortunately the MongoDB Team is maintaining a custom GitHub-Repository <a href="https://github.com/mongodb/homebrew-brew">mongodb/homebrew-brew</a> from where you can tap the formulae on your local machine. </p>



<pre class="wp-block-code"><code>:$ brew tap mongodb/homebrew-brew
</code></pre>



<p>On GitHub, a Homebrew repository must be named <strong>homebrew-<something></strong> in order to use the form of the <code>brew tap</code> with only one argument. When you use <code>brew tap</code> you can leave out the homebrew- prefix. </p>



<pre class="wp-block-code"><code>:$ brew tap mongodb/brew
</code></pre>



<p>This <code>brew tap &lt;username&gt;/brew</code> be used as a shortcut for the long version <code>brew tap &lt;username&gt;/homebrew-brew</code>. Homebrew will automatically add back the homebrew<em>&#8211;</em> prefix whenever it’s necessary.</p>



<p>The command <code>brew tap</code> without any arguments lists the GitHub repositories that are currently tapped on your local machine and available to install software from these sources.</p>



<pre class="wp-block-code"><code>Patricks-MBP:~ patrick$ brew tap
homebrew/cask
homebrew/core
homebrew/services
mongodb/brew
</code></pre>



<h2 class="wp-block-heading">Where are Packages on your System</h2>



<p>Homebrew create symlinks for each installed package in <code>/usr/local/bin</code> and usually point to the binary in <code>/usr/local/Cellar/&lt;package_name&gt;/&lt;version&gt;/bin</code>. This is the standard. Depending on the definitions in the formula of a certain package the binaries can be also linked somewhere else on your system.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ ls -l /usr/local/bin
total 0
lrwxr-xr-x  1 user  admin  28 11 Nov  2016 brew -&gt; /usr/local/Homebrew/bin/brew
lrwxr-xr-x  1 user  admin  34  1 Nov  2017 ccmake -&gt; ../Cellar/cmake/3.9.4_1/bin/ccmake
lrwxr-xr-x  1 user  admin  33  1 Nov  2017 cmake -&gt; ../Cellar/cmake/3.9.4_1/bin/cmake
lrwxr-xr-x  1 user  admin  39  1 Nov  2017 cmakexbuild -&gt; ../Cellar/cmake/3.9.4_1/bin/cmakexbuild
lrwxr-xr-x  1 user  admin  33  1 Nov  2017 cpack -&gt; ../Cellar/cmake/3.9.4_1/bin/cpack
lrwxr-xr-x  1 user  admin  41 16 Dez  2016 cryptest.exe -&gt; ../Cellar/cryptopp/5.6.5/bin/cryptest.exe
lrwxr-xr-x  1 user  admin  33  1 Nov  2017 ctest -&gt; ../Cellar/cmake/3.9.4_1/bin/ctest
lrwxr-xr-x  1 user  admin  32  1 Nov  2017 evm -&gt; ../Cellar/ethereum/1.7.2/bin/evm

.......
</code></pre>



<p>The Homebrew binary link named brew point to <code>/usr/local/Homebrew/bin/brew</code>. Any other binary link point into the Cellar in <code>/usr/local/Cellar/&lt;package_name&gt;/&lt;version&gt;/bin</code>. The Cellar is the place on your system where you usually find Homebrew installed software packages. As you see on my system I have installed a couple of software packages like boost, cmake and node.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ ls -l /usr/local/Cellar
total 0
drwxr-xr-x  4 user  admin  128  1 Nov  2017 boost
drwxr-xr-x  4 user  admin  128  1 Nov  2017 cmake
drwxr-xr-x  3 user  admin   96 16 Dez  2016 cryptopp
drwxr-xr-x  5 user  admin  160  1 Nov  2017 ethereum
drwxr-xr-x  4 user  admin  128  1 Nov  2017 gmp
drwxr-xr-x  5 user  admin  160  1 Nov  2017 go
drwxr-xr-x  4 user  staff  128  6 Okt 07:16 hugo
drwxr-xr-x  3 user  staff   96  3 Aug 06:48 icu4c
drwxr-xr-x  4 user  admin  128  1 Nov  2017 jsoncpp
drwxr-xr-x  4 user  staff  128  9 Okt 07:39 node
drwxr-xr-x  3 user  admin   96 12 Nov  2017 openssl
drwxr-xr-x  4 user  admin  128  1 Nov  2017 solidity
</code></pre>



<p>Cask software is installed in the following directory.</p>



<pre class="wp-block-code"><code>Patricks-MBP:~ patrick$ ls -l /usr/local/Caskroom
total 0
drwxr-xr-x  4 patrick  admin  128 11 Jun 09:00 opera
</code></pre>



<p>Homebrew Cask create a symlink in <code>/usr/local/Caskroom/&lt;package_name&gt;/&lt;version&gt;/&lt;symlink&gt;</code> and point it to the app in the Applications directory where the app will be copied.</p>



<pre class="wp-block-code"><code>Patricks-MBP:~ patrick$ ls -l /usr/local/Caskroom/opera/68.0.3618.165
total 0
lrwxr-xr-x  1 patrick  admin  23 11 Jun 09:00 Opera.app -&gt; /Applications/Opera.app
</code></pre>



<h2 class="wp-block-heading">Install, Uninstall and Update Software Packages</h2>



<p>To install a package using the <code>brew install</code> command.</p>



<pre class="wp-block-code"><code>:$ brew install &lt;formula&gt;
</code></pre>



<p>To uninstall a package using the <code>brew uninstall</code> command.</p>



<pre class="wp-block-code"><code>:$ brew uninstall &lt;formula&gt;
</code></pre>



<p>To update and upgrade all packages with Homebrew use the following commands.</p>



<pre class="wp-block-code"><code>:$ brew update
:$ brew upgrade
</code></pre>



<p>You can also update and upgrade only a certain package.</p>



<pre class="wp-block-code"><code>:$ brew update &lt;formula&gt;
:$ brew upgrade &lt;formula&gt;
</code></pre>



<p>The update command load the new formulae and the upgrade command installs the newer software versions in the Cellar. Depending on the amount of packages you have installed this might take some time.</p>



<p>When you install Cask Software the app must be copied into your Applications Directory. Here you need to provide your user password.</p>



<p>You can list the Casks installed on your Mac.</p>



<pre class="wp-block-code"><code>patrick@PatrickMBNeu ~ % brew list --casks
opera
patrick@PatrickMBNeu ~ % 
</code></pre>



<p>You can search for packages<br></p>



<pre class="wp-block-code"><code>patrick@PatrickMBNeu ~ % brew search opera
==&gt; Formulae
operator-sdk
==&gt; Casks
opera &#x2714;                                                    opera-mobile-emulator                                      operator
opera-gx                                                   opera-neon                                                 homebrew/cask-versions/opera-beta
opera-mail                                                 operadriver                                                homebrew/cask-versions/opera-developer
patrick@PatrickMBNeu ~ %
</code></pre>



<p>You install a cask package using the <code>brew install</code> command.</p>



<pre class="wp-block-code"><code>:$ brew install &lt;cask-package&gt;
</code></pre>



<p>You uninstall a cask package using the <code>brew uninstall</code> command.</p>



<pre class="wp-block-code"><code>patrick@PatrickMBNeu ~ % brew uninstall opera     
==&gt; Uninstalling Cask opera
==&gt; Purging files for version 68.0.3618.165 of Cask opera
patrick@PatrickMBNeu ~ % brew list --casks        
patrick@PatrickMBNeu ~ % 
</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Homebrew Package Manager on Mac OS</title>
		<link>https://digitaldocblog.com/mac/homebrew-package-manager-on-mac-os/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 22 Oct 2018 16:06:00 +0000</pubDate>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Homebrew]]></category>
		<guid isPermaLink="false">https://digitaldocblog.com/?p=57</guid>

					<description><![CDATA[Most of the Mac OS users install software via the Apple App store or download a .dmg file from the Internet and run an installation script to install the software&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Most of the Mac OS users install software via the Apple App store or download a .dmg file from the Internet and run an installation script to install the software on the Mac. Applications that will be installed this way are installed into the Application folder of your Mac.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ ls -l /Applications
total 0
drwxr-xr-x@  3 root     wheel   96 11 Jul 19:10 App Store.app
drwxr-xr-x@  3 root     wheel   96 21 Jun 18:48 Automator.app
drwxr-xr-x@  3 user     admin   96 14 Jun 09:32 Brackets.app
drwxr-xr-x@  3 root     wheel   96 21 Jun 18:48 Calculator.app
drwxr-xr-x@  3 root     wheel   96 21 Jun 18:48 Calendar.app
drwxr-xr-x@  3 root     wheel   96 11 Jul 19:10 Chess.app
drwxr-xr-x   3 user     admin   96  2 Okt 07:18 CleanMyMac 3.app
drwxr-xr-x   3 user     admin   96 19 Feb  2018 ClipGrab.app
drwxr-xr-x@  3 root     wheel   96 11 Jul 19:10 Contacts.app
drwxr-xr-x@  3 root     wheel   96 21 Jun 18:48 DVD Player.app

........

</code></pre>



<p>An alternative way to install software in your Mac is using a package manager like <a href="https://brew.sh">Homebrew</a>. With Homebrew you have access to a large number of free software packages developed by developers for the installation via Homebrew.</p>



<h3 class="wp-block-heading">Homebrew installation</h3>



<p>Check if xcode command line tools are installed.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ xcode-select -p
/Library/Developer/CommandLineTools
Macbook Pro:~ patrick$

</code></pre>



<p>The above command return that xcode command line tools for xcode (CLT) are installed on your Mac and show the directory path where xcode command line tools are installed.</p>



<p>In case xcode command line tools are not installed run the following command in shell:</p>



<pre class="wp-block-code"><code>xcode-select --install

</code></pre>



<p>Check if Homebrew is (already) installed.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ brew --version
Homebrew 1.7.7
Homebrew/homebrew-core (git revision 45d56; last commit 2018-10-08)
Homebrew/homebrew-cask (git revision 33e4d; last commit 2018-10-09)
Macbook Pro:~ user$

</code></pre>



<p>The above output show Homebrew 1.7.7.</p>



<p>In case Homebrew is not istalled run the follwoing command from shell to install Homebrew:</p>



<pre class="wp-block-code"><code>ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

</code></pre>



<p>If you run the above shown ruby script you will be asked to run the following command.</p>



<pre class="wp-block-code"><code>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

</code></pre>



<p>Check the Homebrew installation.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ brew --version
Homebrew 1.7.7
Homebrew/homebrew-core (git revision 02721; last commit 2018-10-21)
Homebrew/homebrew-cask (git revision 4bcf; last commit 2018-10-22)

Macbook Pro:~ user$ brew doctor
Your system is ready to brew.
Macbook Pro:~ user$

</code></pre>



<p>The shell output show that Homebrew version 1.7.7 is installed on the system and that you are ready to brew which means that you are ready to install software.</p>



<h3 class="wp-block-heading">Homebrew Software Repositories and Tap(s)</h3>



<p>With Homebrew package manager you have access to a wide range of software that can be installed on your system. After Homebrew has been installed on your system you find Homebrew under <code>/usr/local/Homebrew</code> on your system. </p>



<p>In principle, Homebrew differentiates between Core Software Packages, Non-Core Software Packages and so-called Cask(s). These Software Packages are available in GitHub Repositories or so called Tap(s).<br></p>



<p>Core Software Packages are free software developed from developers around the world to be installed on Mac OS platforms using Homebrew. Core software will be installed based on so called formulae. A formula contain the basic package definition and tell Homebrew i.e. how a package should be installed. This mean a formula of a certain software package contain the required information for the installation such as i.e. from where the installation files should be loaded, which dependencies exist and how the installation should be performed on the different Mac platforms. All formulae for Core Software Packages have been loaded from Homebrew&#8217;s GitHub Core-Repository-Tap <a href="https://github.com/Homebrew/homebrew-core">Homebrew/homebrew-core</a> into <code>/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula</code>on your machine. </p>



<p>It is also possible that Software can be installed with Homebrew but the formula is not available on Homebrew&#8217;s GitHub Core-Repository-Tap. Then we speak of Non-Core Software Packages because these Software Packages are not <code>tap(ed)</code> into the Homebrew Core-Repository-Tap. In this case you must first <code>tap</code> the Non-Core-Repository-Tap to let Homebrew know from where it should load the formula to install the software package. </p>



<p>Cask software or <code>Casks</code> are native Mac OS Apps like Google Chrome, Firefox or other native Mac OS Apps that can be also installed using the Homebrew Package Manager. All available Casks to install Mac OS native Apps have been loaded from Homebrew&#8217;s GitHub Profile <a href="https://github.com/Homebrew/homebrew-cask">Homebrew/homebrew-cask</a> into <code>/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks</code>.</p>



<p>To get an overview which tap(s) are currently linked to your Homebrew Installation use th efollowing command. </p>



<pre class="wp-block-code"><code>Patricks-MBP:~ patrick$ brew tap
homebrew/cask
homebrew/core
homebrew/services
mongodb/brew

</code></pre>



<h3 class="wp-block-heading">Where is Homebrew on your System</h3>



<p>Homebrew create symlinks for each installed package in <code>/usr/local/bin</code> and symlink the relevant binary. Usually this symlink will point to <code>/usr/local/Cellar/&lt;package_name&gt;/&lt;version&gt;/bin</code> but it can also be anywhere else on your system.</p>



<p>So lets <code>ls -l /usr/local/bin</code>:</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ ls -l /usr/local/bin
total 0
lrwxr-xr-x  1 user  admin  28 11 Nov  2016 brew -&gt; /usr/local/Homebrew/bin/brew
lrwxr-xr-x  1 user  admin  34  1 Nov  2017 ccmake -&gt; ../Cellar/cmake/3.9.4_1/bin/ccmake
lrwxr-xr-x  1 user  admin  33  1 Nov  2017 cmake -&gt; ../Cellar/cmake/3.9.4_1/bin/cmake
lrwxr-xr-x  1 user  admin  39  1 Nov  2017 cmakexbuild -&gt; ../Cellar/cmake/3.9.4_1/bin/cmakexbuild
lrwxr-xr-x  1 user  admin  33  1 Nov  2017 cpack -&gt; ../Cellar/cmake/3.9.4_1/bin/cpack
lrwxr-xr-x  1 user  admin  41 16 Dez  2016 cryptest.exe -&gt; ../Cellar/cryptopp/5.6.5/bin/cryptest.exe
lrwxr-xr-x  1 user  admin  33  1 Nov  2017 ctest -&gt; ../Cellar/cmake/3.9.4_1/bin/ctest
lrwxr-xr-x  1 user  admin  32  1 Nov  2017 evm -&gt; ../Cellar/ethereum/1.7.2/bin/evm

.......

</code></pre>



<p>Homebrew package manager binary is named <strong>brew</strong> and symlinked to <code>/usr/local/Homebrew/bin/brew</code>. The Homebrew package is installed in <code>/usr/local/Homebrew</code> This is the place on your system where Homebrew is installed.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ ls -l /usr/local/Homebrew
total 64
-rw-r--r--   1 user  admin    98 16 Dez  2016 CHANGELOG.md
-rw-r--r--   1 user  admin  3161  1 Nov  2017 CODE_OF_CONDUCT.md
-rw-r--r--   1 user  admin   827  9 Okt 07:38 CONTRIBUTING.md
-rw-r--r--   1 user  admin  1334  1 Nov  2017 LICENSE.txt
drwxr-xr-x   7 user  admin   224  9 Okt 07:38 Library
-rw-r--r--   1 user  admin  8471  9 Okt 07:38 README.md
-rw-r--r--   1 user  admin   899  9 Okt 07:38 azure-pipelines.yml
drwxr-xr-x   3 user  admin    96  9 Okt 07:38 bin
drwxr-xr-x   5 user  admin   160  1 Nov  2017 completions
drwxr-xr-x  49 user  admin  1568  9 Okt 07:38 docs
drwxr-xr-x   5 user  admin   160  9 Okt 07:38 manpages

</code></pre>



<h3 class="wp-block-heading">Where are Core Software Packages on your System</h3>



<p>Also the symlinks from other packages that you install with Homebrew have been created in <code>/usr/local/bin</code> directory and symlinked into <code>/usr/local/Cellar/...</code>. The Cellar is the place on your system where you usually find Homebrew installed software packages.</p>



<p>As you see on my system I have installed a couple of software packages like boost, cmake, node but also hugo which is my static website genrator.</p>



<pre class="wp-block-code"><code>Macbook Pro:~ user$ ls -l /usr/local/Cellar
total 0
drwxr-xr-x  4 user  admin  128  1 Nov  2017 boost
drwxr-xr-x  4 user  admin  128  1 Nov  2017 cmake
drwxr-xr-x  3 user  admin   96 16 Dez  2016 cryptopp
drwxr-xr-x  5 user  admin  160  1 Nov  2017 ethereum
drwxr-xr-x  4 user  admin  128  1 Nov  2017 gmp
drwxr-xr-x  5 user  admin  160  1 Nov  2017 go
drwxr-xr-x  4 user  staff  128  6 Okt 07:16 hugo
drwxr-xr-x  3 user  staff   96  3 Aug 06:48 icu4c
drwxr-xr-x  4 user  admin  128  1 Nov  2017 jsoncpp
drwxr-xr-x  4 user  staff  128  9 Okt 07:39 node
drwxr-xr-x  3 user  admin   96 12 Nov  2017 openssl
drwxr-xr-x  4 user  admin  128  1 Nov  2017 solidity

</code></pre>



<h3 class="wp-block-heading">Install and Uninstall Core Software</h3>



<p>To install formula with Homebrew to your system use the command.</p>



<p><code>brew install &lt;formula&gt;</code> </p>



<p>To uninstall a formula from your system simply use the command. </p>



<p><code>brew uninstall &lt;formula&gt;</code></p>



<p>After installation the software package exist in the Cellar. </p>



<p><code>/usr/local/Cellar/&lt;formula&gt;/&lt;version&gt;</code></p>



<h3 class="wp-block-heading">Update and Upgrade Core Software packages</h3>



<p>First you update all formulae and Casks using the following command.</p>



<p><code>brew update</code></p>



<p>or if you want to update only a specific formula</p>



<p><code>brew update &lt;formula&gt;</code></p>



<p>Then you upgrade all your software packages using the following command.</p>



<p><code>brew upgrade</code> </p>



<p>or if you want to upgrade only a specific formula</p>



<p><code>brew upgrade &lt;formula&gt;</code></p>



<p>The upgrade command installs newer software versions of all packages in the Cellar. Depending on the amount of packages you have installed this might take some time.</p>



<h3 class="wp-block-heading">Where are Cask Software Packages on your System</h3>



<p>Cask software is installed in the following directory.</p>



<pre class="wp-block-code"><code>Patricks-MBP:~ patrick$ ls -l /usr/local/Caskroom
total 0
drwxr-xr-x  4 patrick  admin  128 11 Jun 09:00 opera

</code></pre>



<p>From the output above you can see that I installed a GUI software package with the help of Homebrew. It is the Opera browser. </p>



<p>The installation takes place in the following path <code>/usr/local/Caskroom/&lt;package_name&gt;/&lt;version&gt;/&lt;symlink&gt;</code>. The symlink point to the /Applications directory where Homebrew copy the app.</p>



<pre class="wp-block-code"><code>Patricks-MBP:~ patrick$ ls -l /usr/local/Caskroom/opera
total 0
drwxr-xr-x@ 3 patrick  admin  96 11 Jun 09:00 68.0.3618.165
Patricks-MBP:~ patrick$ ls -l /usr/local/Caskroom/opera/68.0.3618.165
total 0
lrwxr-xr-x  1 patrick  admin  23 11 Jun 09:00 Opera.app -&gt; /Applications/Opera.app
</code></pre>



<h3 class="wp-block-heading">Install and uninstall Cask GUI Software Packages</h3>



<p>When you install GUI Software the app must be copied into your Applications Directory. Here you need to provide your user password.</p>



<pre class="wp-block-code"><code>drwxr-xr-x  4 patrick  admin  128  9 Aug  2018 java
Patricks-MBP:~ patrick$ brew cask install opera
==&gt; Downloading https://get.geo.opera.com/pub/opera/desktop/68.0.3618.165/mac/Opera_68.0.3618.165_Setup.dmg
######################################################################## 100.0%
==&gt; Verifying SHA-256 checksum for Cask 'opera'.
==&gt; Installing Cask opera
==&gt; Moving App 'Opera.app' to '/Applications/Opera.app'.
Password:
&#x1f37a;  opera was successfully installed!
</code></pre>



<p>To uninstall GUI Software Packeges you simply provide the uninstall command like this. </p>



<pre class="wp-block-code"><code>Patricks-MBP:~ patrick$ brew cask uninstall java
==&gt; Uninstalling Cask java
==&gt; Removing launchctl service com.oracle.java.Helper-Tool
==&gt; Removing launchctl service com.oracle.java.Java-Updater
==&gt; Uninstalling packages:
com.oracle.jdk-10.0.2
com.oracle.jre
==&gt; Removing files:
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin
/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents
/Library/PreferencePanes/JavaControlPanel.prefPane
/Library/Java/Home
/Library/Java/MacOS
==&gt; Removing directories if empty:
/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk
==&gt; Purging files for version 10.0.2,13:19aef61b38124481863b1413dce1855f of Cask java
</code></pre>



<h3 class="wp-block-heading">Update Cask GUI Software Packages</h3>



<p>To update Casks you can check if some Casks are outdated using the following command <code>brew cask outdated</code>. Outdated Casks can be updated using the <code>brew cask upgrade</code> command.</p>



<p>More detailed information regarding the brew cask usage can be found on <a href="https://github.com/Homebrew/homebrew-cask/blob/master/USAGE.md">Homebrew-Cask</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
