General help page about Linux Virtual Machines in Azure: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ There are two ways to install Lucy in Azure: - Use a default Debian 9 "Stretch" image available in Azure marketplace (recommended and fastest). - Use a custom image made by Lucy and based on Debian 9 "Stretch". ===== Recommended method (using a default image) ===== ==== Step 1. Creating a new virtual machine ==== On the Home page of your Azure portal click the "Virtual Machines" icon: {{ :azure:1.png?600 |}} Press the "Add" button: {{ :azure:2.png?600 |}} Configure new virtual machine. Key parameters is as follow: * Image: Debian 9 "Stretch" * Size: at least 2 vcpus and 4 GiB memory * Public Inbound Ports: Allow SSH, HTTP and HTTPS {{ :azure:3.png?600 |}} {{ ::azure_os_image.png?500 |}} :!: Attention. Do not use an image with backports kernel. Fill other required fields and press "Review + Create" button. \\ Wait until the virtual machine is completed (this may take several minutes). ====Step 2. Installing Lucy==== Please refer to this guide for more information: https://wiki.thrivedx.com/doku.php?id=installing_lucy_on_linux Connect to the server using SSH client (eg. Putty) and login as sudo: {{ :azure:4.png?500 |}} Install system updates: **apt-get update && apt-get upgrade -y** Change the current directory to /srv and download the installation script “install.sh” from our download location: Ubuntu 20.04: **cd /srv \\ wget https://download.phishing-server.com/dl/lucy-latest/install-20.04.sh**\\ Ubuntu 22.04: **cd /srv \\ wget https://download.phishing-server.com/dl/lucy-latest/install-22.04.sh**\\ Create a directory to avoid the error during the installation:\\ **mkdir -p /usr/lib/php/20160303** Execute installation script: **bash install.sh legacy** You will be asked if you want to install LUCY (Install LUCY (y/n)?). Please type “y” and press enter. When the installation will be finished, the system will ask you to configure Lucy automatically (Use automatic configuration? Y or N (Y)). Please type “y” and press enter. You will be provided with access to the Admin Web Console: {{ ::azure:5.png?500 |}} ===== Alternative method (using a custom image) ===== This method requires to upload a ready-made Debian 9 operating system image to Azure. It can be done different ways: through Azure PowerSheel and AzCopy tool or GUI using Azure Storage Explorer. We'd prefer using a GUI. ==== Step 1. Prerequisites ==== * Download VHD file (30 Gb): [[https://download.phishing-server.com/dl/images/lucy.vhd]] * Install the latest version of [[https://azure.microsoft.com/features/storage-explorer|Azure Storage Explorer]] ==== Step 2. Upload VHD file to Azure ==== - In the **Azure Portal**, select **Storage Accounts**. - Select the storage account where the VHD file will be uploaded to (if you do not have a storage account, click **Add** to create one). Note that the selected location will dictate where the image can be created and subsequently deployed to - Under **Blob service**, select **Containers**. - Click **Add Container** to create a new container. - Launch **Azure Storage Explorer** and click the **plug-in** icon on the left. - Select **Add an Azure Account**, and then click **Next**. - In the **Azure Sign** in dialog box, enter your Azure credentials. - Select your subscription from the list and then click **Apply**. - On the left pane, expand **Storage Accounts** and select the resource group that you want to upload the VHD file to. - Under **Blob Container**, select the container you created in one of the previous step. - Select **Upload**. - In Upload VHD specify your source VHD, Blob type - select **Page Blob**. - The status of the upload will now display in **Activities**. - If the upload has finished and you don't see the VHD file in the right pane, select **Refresh**. Please find more details on [[https://docs.microsoft.com/en-us/azure/virtual-machines/disks-use-storage-explorer-managed-disks|this]] page. ==== Step 3. Create an image ==== - Go to the [[https://portal.azure.com|Azure portal]], on the left menu, select **All services**. - In the **All services** search box, enter **images** and then select **Images** to display the list of available images. - For **Name**, enter a name that you would like to use for the image (e.g. Lucy). - For **Resource group**, select a resource group to use from the drop-down list (use the same resource group where your Storage Account created). - For **OS type**, select **Linux**. - For **VM generation**, select **Gen 1**. - For **Storage blob**, select the VHD file. - For **Storage type**, select what you decide to use (in most cases Standard HDD would be enough). \\ Find more [[http://go.microsoft.com/fwlink/?LinkId=2077396|here]]. - For **Data disk**, add at least 100 Gb disk since the OS disk has only 30 Gb space without ability to expand it. The Data Disk will be used later to install Lucy on it. - Select **Create** to create the image. ==== Step 4. Create a VM ==== - Go to the [[https://portal.azure.com|Azure portal]] - Type **virtual machines** in the search, under **Services**, select **Virtual machines**. - In the **Virtual machines** page, select **Add**. - In the **Basics** tab, under **Project details**, make sure the correct subscription is selected and then choose a resource group. - Under **Instance details**, type **Lucy** for the **Virtual machine name** (or any name you want) and choose a **Region**. - For **Image**, select **Browse all public and private images**, under **My Items** tab, choose **Lucy**. - For **Size**, select at least **Standard_B2s** (2 CPUs, 4 GB memory). - Under **Authentication type**, select **SSH public key**, use a default azureuser or enter your own name and SSH public key. - Under **Inbound port rules**, choose **Allow selected ports** and then select SSH (22), HTTP (80) and HTTPS (443) from the drop-down. - Leave the remaining defaults and then select the **Review + create** button at the bottom of the page. ==== Step 5. Mount Data Disk ==== - Connect to virtual machine via SSH using [[http://go.microsoft.com/fwlink/?LinkId=2116707|PuTTY]] or [[http://go.microsoft.com/fwlink/?LinkId=2116708|any client]]. - Once connected to your VM, you need to find the disk. In this example, we are using lsblk to list the disks. \\ lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd" Here, **sdc** is the disk that we want. If you aren't sure which disk it is based on size alone, you can go to the VM page in the portal, select **Disks**, and check the LUN number for the disk under **Data disks**. - Format the disk with parted, if the disk size is 2 tebibytes (TiB) or larger then you must use GPT partitioning, if it is under 2TiB, then you can use either MBR or GPT partitioning. \\ sudo apt-get install -y parted xfsprogs sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100% sudo mkfs.xfs /dev/sdc1 sudo partprobe /dev/sdc1 - Mount the disk \\ sudo mount /dev/sdc1 /opt - Persist the mount \\ sudo blkid - Next, open the **/etc/fstab** file in a text editor as follows: \\ sudo nano /etc/fstab - In this example, use the UUID value for the /dev/sdc1 device that was created in the previous steps, and the mountpoint of /opt. Add the following line to the end of the /etc/fstab file: \\ UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /opt ext4 defaults,nofail 1 2 - In this example, we are using the nano editor, so when you are done editing the file, use Ctrl+O to write the file and Ctrl+X to exit the editor. Please find more details on how to add disk to Linux on [[https://docs.microsoft.com/en-us/azure/virtual-machines/linux/add-disk|this]] page. ==== Step 6. Install Lucy ==== Please refer to [[installing_lucy_on_linux|this]] guide for more information. 1. Download installation script \\ cd /srv wget wget https://download.phishing-server.com/dl/lucy-latest/install-20.04.sh OR wget wget https://download.phishing-server.com/dl/lucy-latest/install-22.04.sh 2. Run the script \\ bash install.sh legacy 3. Follow the instructions on the screen. ==== Installation problem? Contact our support ==== In case you are planning to purchase LUCY or you are already a commercial client you can contact support@lucysecurity.com to open a ticket. We will get in touch with you within 24 hours.