User Tools

Site Tools


installing_lucy_in_azure

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
installing_lucy_in_azure [2019/06/04 14:29]
lucy
installing_lucy_in_azure [2020/08/27 11:24] (current)
lucy
Line 3: Line 3:
 https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ https://docs.microsoft.com/en-us/azure/virtual-machines/linux/
  
-====Step 1. Creating a new virtual machine====+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: On the Home page of your Azure portal click the "Virtual Machines" icon:
  
-{{:azure:1.png?400|}}+{{ :azure:1.png?600 |}}
  
 Press the "Add" button: Press the "Add" button:
  
-{{:azure:2.png?400|}}+{{ :azure:2.png?600 |}}
  
 Configure new virtual machine. Configure new virtual machine.
Line 20: Line 26:
   * Public Inbound Ports: Allow SSH, HTTP and HTTPS   * Public Inbound Ports: Allow SSH, HTTP and HTTPS
  
-{{:azure:3.png?400|}}+{{ :azure:3.png?600 |}}
  
-Fill other required fields and press "Review + Create" button.+{{ ::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). Wait until the virtual machine is completed (this may take several minutes).
  
Line 33: Line 43:
 Connect to the server using SSH client (eg. Putty) and login as sudo: Connect to the server using SSH client (eg. Putty) and login as sudo:
  
-{{:azure:4.png?400|}}+{{ :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: Change the current directory to /srv and download the installation script “install.sh” from our download location:
  
-**cd /srv+**cd /srv \\
 wget http://download.phishing-server.com/dl/lucy-latest/install.sh** wget http://download.phishing-server.com/dl/lucy-latest/install.sh**
  
 Execute installation script: Execute installation script:
  
-**bash ./install.sh legacy**+**bash install.sh legacy**
  
 You will be asked if you want to install LUCY (Install LUCY (y/n)?). You will be asked if you want to install LUCY (Install LUCY (y/n)?).
Line 50: Line 64:
 Please type “y” and press enter. You will be provided with access to the Admin Web Console: Please type “y” and press enter. You will be provided with access to the Admin Web Console:
  
-{{::azure:5.png?400|}}+{{ ::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. \\ <code>lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"</code> 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. \\ <code>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</code> 
 +  - Mount the disk \\ <code>sudo mount /dev/sdc1 /opt</code> 
 +  - Persist the mount \\ <code>sudo blkid</code> 
 +  - Next, open the **/etc/fstab** file in a text editor as follows: \\ <code>sudo nano /etc/fstab</code> 
 +  - 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: \\ <code>UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e   /opt   ext4   defaults,nofail     2</code> 
 +  - 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. 
 + 
 +  - Download installation script \\ <code>cd /srv 
 +wget https://download.phishing-server.com/dl/lucy-latest/install.sh</code> 
 +  - Run the script \\ <code>bash install.sh legacy</code> 
 +  - 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.1559651342.txt.gz · Last modified: 2019/07/25 12:51 (external edit)