|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Crowdstrike-Deploy Banner |
| 4 | +echo "" |
| 5 | +echo " ██████╗██████╗ ██████╗ ██╗ ██╗██████╗ ███████╗████████╗██████╗ ██╗██╗ ██╗███████╗" |
| 6 | +echo " ██╔════╝██╔══██╗██╔═══██╗██║ ██║██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║██║ ██╔╝██╔════╝" |
| 7 | +echo " ██║ ██████╔╝██║ ██║██║ █╗ ██║██║ ██║███████╗ ██║ ██████╔╝██║█████╔╝ █████╗" |
| 8 | +echo " ██║ ██╔══██╗██║ ██║██║███╗██║██║ ██║╚════██║ ██║ ██╔══██╗██║██╔═██╗ ██╔══╝" |
| 9 | +echo " ╚██████╗██║ ██║╚██████╔╝╚███╔███╔╝██████╔╝███████║ ██║ ██║ ██║██║██║ ██╗███████╗" |
| 10 | +echo " ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚══════╝" |
| 11 | +echo "" |
| 12 | +echo " ██████╗ ███████╗██████╗ ██╗ ██████╗ ██╗ ██╗" |
| 13 | +echo " ██╔══██╗██╔════╝██╔══██╗██║ ██╔═══██╗╚██╗ ██╔╝" |
| 14 | +echo " ██║ ██║█████╗ ██████╔╝██║ ██║ ██║ ╚████╔╝" |
| 15 | +echo " ██║ ██║██╔══╝ ██╔═══╝ ██║ ██║ ██║ ╚██╔╝" |
| 16 | +echo " ██████╔╝███████╗██║ ███████╗╚██████╔╝ ██║" |
| 17 | +echo " ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝" |
| 18 | +echo "" |
| 19 | +echo " Created & Maintained by: Eilay Yosfan" |
| 20 | +echo " GitHub.com/YosfanEilay" |
| 21 | +echo " Version: 1.0" |
| 22 | +echo "" |
| 23 | + |
| 24 | +###### Please Paste Your Information in Here ###### |
| 25 | +SensorLink='' # Crowdstrike Sensor Download Link |
| 26 | +SensorSig1="" # Crowdstrike Sensor Hash (SHA256) |
| 27 | +TenantCID="" # Crowdstrike Tenant CID |
| 28 | +TenantName="" # Crowdstrike Tenant Name |
| 29 | +################################################### |
| 30 | + |
| 31 | +# Prerequisite Variable Load |
| 32 | +Hostname=$(hostname) |
| 33 | +RunPath=$(pwd) |
| 34 | +DstPath="$RunPath/CrowdstrikeSensor.deb" |
| 35 | + |
| 36 | +# Check if the script is run as root (or with sudo) |
| 37 | +if [ "$EUID" -ne 0 ]; then |
| 38 | + echo "[!] This script must be run as root. Please use 'sudo ./Crowdstrike-Deploy.sh'." |
| 39 | + exit 1 |
| 40 | +fi |
| 41 | + |
| 42 | +# Test if Host is Connected to the internet |
| 43 | +if ping -c 2 8.8.8.8 &> /dev/null; then |
| 44 | + echo "[+] Host is connected to the internet." |
| 45 | +else |
| 46 | + echo "[!] Host is not connected to the internet." |
| 47 | + exit 1 |
| 48 | +fi |
| 49 | + |
| 50 | +# Test Connection to OneDrive |
| 51 | +if ping -c 2 "onedrive.live.com" &> /dev/null; then |
| 52 | + echo "[+] OneDrive is reachable." |
| 53 | +else |
| 54 | + echo "[!] OneDrive is not reachable, might be related to host network or organization policy. Deploy might fail." |
| 55 | +fi |
| 56 | + |
| 57 | +# Download Crowdstrike Sensor |
| 58 | +echo "[+] Download has started. The time required will depend on the host's bandwidth." |
| 59 | +echo # Blank Line |
| 60 | +curl -L -o CrowdstrikeSensor.deb -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36" "$SensorLink" |
| 61 | + |
| 62 | +# Check if the Downloaded Sensor File is Corrupted |
| 63 | +SensorSig2=$(openssl sha256 "$DstPath" | awk '{print $2}') |
| 64 | +if [ "$SensorSig1" == "$SensorSig2" ]; then |
| 65 | + echo "[+] Crowdstrike sensor was successfully downloaded. Sensor installation started." |
| 66 | +else |
| 67 | + echo "[!] The sensor file is corrupted, likely due to an interrupted download. You can try again." |
| 68 | + rm -f "$DstPath" |
| 69 | + exit 1 |
| 70 | +fi |
| 71 | + |
| 72 | +# Start Crowdstrike Installation Process |
| 73 | +echo # Blank Line |
| 74 | +echo "[+] Showing installation process.. [60 seconds]" |
| 75 | +dpkg -i "CrowdstrikeSensor.deb" |
| 76 | +sleep 60 |
| 77 | +/opt/CrowdStrike/falconctl -s --cid="$TenantCID" |
| 78 | +systemctl start falcon-sensor |
| 79 | + |
| 80 | +# show that falcon crowdstrike sensor process is running using ps aux |
| 81 | +echo # Blank Line |
| 82 | +echo "[+] Showing that falcon is indeed running." |
| 83 | +ps aux | grep "falcon" |
| 84 | +echo # Blank Line |
| 85 | + |
| 86 | +# Print Success Message |
| 87 | +echo "[+] Done. $Hostname will be available on host management under the tenant $TenantName in 5-10 minutes." |
| 88 | +echo "" |
0 commit comments