Use the following guide to deploy DShield honeypot using the free compute tier.
This guide uses the Ubuntu 22.04 LTS Server AMI (Amazon Machine Image).
This guide assumes you already have an AWS account and some basic knowledge of the platform. If you need help getting started, see this link.
- On the top right corner of the AWS console, select the region button. Using this dropdown, you can change the region that your honeypot will deploy into.
-
Under "Names and tags", enter a name for the instance.
-
Under "Application and OS Images", there are a number of "Quick Start" images, including Ubuntu. Select "Ubuntu" from this menu. In the dropdown below that, select "Ubuntu Server 22.04 LTS (HVM), SSD Volume Type". This is the current, tested version for dshield.
-
Under "Instance type", the default "t2.micro" will suffice for dshield, and is free-tier eligible. For certain use cases, feel free to adjust this setting, at the risk of incurring increased costs.
-
Under "Key pair (login)", it is recommended to use a key pair for secure access to your EC2 instance.
-
Under "Network settings", the default settings for "Network" and "Subnet" will suffice. These default settings deploy the instance in your default VPC; read more here. In this section, you will also see an option to "Create security group". Select this, then select the box beside "Allow SSH traffic from", and choose either "Anywhere" or your own public IP. Please note, however, that your public IP may change, requiring you to reconfigure this security group. For the time being, it will suffice to allow you to access the instance and install dshield. Once installed, dshield sets up security on Ubuntu itself, and you will need to adjust the security group to allow internet traffic to hit the instance.
-
Under "Configure storage", the default setting "1x 8 GiB gp2 Root volume" suffices for this use case and is free-tier eligible. Per AWS, "Free tier eligible customers can get up to 30 GB of EBS General Purpose (SSD) or Magnetic storage".
-
At the bottom of the summary window on the right side, select "Launch instance".
-
Your EC2 instance will be launched. View completion progress by navigating to the EC2 dashboard, select "Instances", and select the Instance ID of the created instance.
-
Check your instance's public IP by navigating to the instance summary (see step 9 above).
-
Open a terminal on a machine with SSH installed, or using a program such as PuTTY, connect to your instance's public IP address using the key pair created previously. Note that the default user created for the Ubuntu 22.04 Server is "ubuntu".
ssh -i dshield.pem ubuntu@1.2.3.4
- When I tried doing this on Windows 11 Pro, I got an error: Load key "dshield.pem": bad permissions
- Use this guide if you run into the issue on Windows 10/11.
- On a *nix system, doing "chmod 700" to the file should fix this error.
- Optional: If you're going to directly ingest logs for analysis set hostname for your honeypot using:
sudo hostnamectl set-hostname "hostname"
- Make sure the OS is updated
sudo apt update && sudo apt full-upgrade -y
- You will have to install Python2, Python-pip, git [may be installed by default] manually. You may refer: https://linuxize.com/post/how-to-install-pip-on-ubuntu-22.04/ or use the following commands:
It is advisable to be in the home directory when carrying out the following commands. (cd ~)
cd ~ && sudo apt update && sudo apt full-upgrade -y && sudo apt install python-pip -y && sudo apt install python3-pip -y && sudo apt update && sudo apt install python2.7 -y && sudo apt install git -y && curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py && sudo python2 get-pip.py && sudo python3 get-pip.py
- Follow installation steps from Readme.md
mkdir install
cd install
git clone https://github.com/DShield-ISC/dshield.git
cd dshield/bin
sudo ./install.sh
Once dshield is installed, adjust security group settings to allow internet traffic to hit it.
- Navigate to the instance's summary page
- Select the "Security" tab
- Select the security group name
- On the security group page, with "Inbound rules" tab selected, select "Edit inbound rules"
- For enhanced security, change the existing inbound SSH rule to "Type" -> "Custom TCP", "Port range" -> 12222, "Source" -> "My IP"
- Recall that dshield adjusts the true SSH service to port 12222; restrict this port to only your management IP
- To allow all internet traffic to hit the honeypot, select "Add rule", with the settings "Type" -> "All traffic", "Source" -> "Anywhere"