User Tools

Site Tools


installing_lucy_in_azure

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:

  1. Use a default Debian 9 "Stretch" image available in Azure marketplace (recommended and fastest).
  2. Use a custom image made by Lucy and based on Debian 9 "Stretch".

Step 1. Creating a new virtual machine

On the Home page of your Azure portal click the "Virtual Machines" icon:

Press the "Add" button:

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

:!: 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:

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:

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

Step 2. Upload VHD file to Azure

  1. In the Azure Portal, select Storage Accounts.
  2. 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
  3. Under Blob service, select Containers.
  4. Click Add Container to create a new container.
  5. Launch Azure Storage Explorer and click the plug-in icon on the left.
  6. Select Add an Azure Account, and then click Next.
  7. In the Azure Sign in dialog box, enter your Azure credentials.
  8. Select your subscription from the list and then click Apply.
  9. On the left pane, expand Storage Accounts and select the resource group that you want to upload the VHD file to.
  10. Under Blob Container, select the container you created in one of the previous step.
  11. Select Upload.
  12. In Upload VHD specify your source VHD, Blob type - select Page Blob.
  13. The status of the upload will now display in Activities.
  14. If the upload has finished and you don't see the VHD file in the right pane, select Refresh.

Please find more details on this page.

Step 3. Create an image

  1. Go to the Azure portal, on the left menu, select All services.
  2. In the All services search box, enter images and then select Images to display the list of available images.
  3. For Name, enter a name that you would like to use for the image (e.g. Lucy).
  4. For Resource group, select a resource group to use from the drop-down list (use the same resource group where your Storage Account created).
  5. For OS type, select Linux.
  6. For VM generation, select Gen 1.
  7. For Storage blob, select the VHD file.
  8. For Storage type, select what you decide to use (in most cases Standard HDD would be enough).
    Find more here.
  9. 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.
  10. Select Create to create the image.

Step 4. Create a VM

  1. Go to the Azure portal
  2. Type virtual machines in the search, under Services, select Virtual machines.
  3. In the Virtual machines page, select Add.
  4. In the Basics tab, under Project details, make sure the correct subscription is selected and then choose a resource group.
  5. Under Instance details, type Lucy for the Virtual machine name (or any name you want) and choose a Region.
  6. For Image, select Browse all public and private images, under My Items tab, choose Lucy.
  7. For Size, select at least Standard_B2s (2 CPUs, 4 GB memory).
  8. Under Authentication type, select SSH public key, use a default azureuser or enter your own name and SSH public key.
  9. Under Inbound port rules, choose Allow selected ports and then select SSH (22), HTTP (80) and HTTPS (443) from the drop-down.
  10. Leave the remaining defaults and then select the Review + create button at the bottom of the page.

Step 5. Mount Data Disk

  1. Connect to virtual machine via SSH using PuTTY or any client.
  2. 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.

  3. 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
  4. Mount the disk
    sudo mount /dev/sdc1 /opt
  5. Persist the mount
    sudo blkid
  6. Next, open the /etc/fstab file in a text editor as follows:
    sudo nano /etc/fstab
  7. 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
  8. 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 this page.

Step 6. Install Lucy

Please refer to 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.

installing_lucy_in_azure.txt · Last modified: 2024/10/08 12:20 by editor6